Photon with Cocos Creator

Photon with Cocos Creator

Doest anyone has any idea on how to use Photon Javascript version in a project on Cocos Creator? I cant find any useful resources on this and it seems to lack a Photon API documentation to see how can the functions can be called…

1 Like

I have integrated Photon JS successfully for testing. Then I gave up, because it’s API docs is not full enough. If you want you can convert the demo from HTML5 to Cocos Creator, most of the code will be the same.

Where can I find the html5 demo? If you could send me your implementation on cocos creator it would help me a lot, thank you

When you download Photon Javascript SDK, there are some demo projects in src folder. In my case, I have cloned demo-pairs-mc example. The code was messy to me, and there some events/listeners not well documented so I don’t know why and when they are triggered :slight_smile: I don’t have my Cocos Creator version any more, but I’m ready to answer any question related to initial work with Photon (joinRoom, createActor, etc…)

I see, so I cloned the LoadBalancing demo, I found it to be the simplest of them all, so when trying to connect I get errors like “Error in connection establishment: net::ERR_CONNECTION_REFUSED” and " Error: 1001 Master peer error", do you have any idea of what that is? I’m using WS connection protocol and localhost:9090 as my master server

Have you run html version successfully? Or the first time you can disable the line "MasterServer: “localhost:9090"” in cloud-app-info

yes on html version it was cool, now im connecting directly to a region instead of using localhost and everything is working

Is it working on Cocos?

Yes, I had some trouble on the way like it doesnt fire any event when it doesnt match a random room for example, but I faked an event to simulate that, still working around it