Does anyone know where I could find a javascript tutorial for Photon Realtime? I want to implement it into an online game I am creating.
↧
Photon Engine Javascript Tutorial
↧
can not reveive onRoomListUpdate after connected to lobby for a long time
I development a call application using photon realtime. app and web browser join the same room to interactive with
each others. we using nodeJS server to load Photon-Javascript_SDK.min.js and join lobby to listen each rooms connection state. our application connect region is JP. Our approach is using LoadBalancingClient and connectToRegionMaster() to let our server can listen onRoomListUpdate.
Our server calculate the connection time when roomRemove event triggered by onRoomListUpdate. But I found the onRoomListUpdate no response on 5/26 10:41, 5.15 12:27.
I check the operation status in JP is ok and the web socket connection has no error. After my customer complain our service, I use my test account to join the room. The connection is success and the onRoomListUpdate send the roomRemoved event to our server again.
My question is why the onRoomListUpdate is idle over certain period? The previous connection roomRemoved event has sended until other new user join new room. How can I ensure the client connection can correct
receive roomsUpdate event in lobby? Currently I'll try to reconnect when new user want to ask which room can be connect. But I thinks this is not a good approach
↧
↧
How to rejoin a room
Hi.
I want to know how to rejoin a room where the client left the room due to a timeout.
If you have sample source please let me know.
I'm a beginner.
photon cloud+javascript sdk
↧
Request: Change appId and appVersion to be a protected variable.
I need a way to set the appId after I create a new LoadBalancingClient (I am getting the API key from my server, then setting it after user login). Seems like there is no reasons that appId and appVersion should not be protected. This way I can interact with them from inherited classes.
class LoadBalancingClient {
protected appId: string;
protected appVersion;
↧
How To Test Disconnects?
So every so often I get an error when a user tries to connect to the server. I would post the exact error, but I am currently having trouble reproducing the bug. I was wondering if there is a way for me to trigger each type of disconnect so I can test code to attempt re-connection?
↧
↧
Javascript SDK files and folder missing
https://doc-api.photonengine.com/en/javascript/current/
/src/Photon - library TypeScript source files
/src/PhotonWebsockets.sln - Visual Studio solution file for samples TypeScript projects (TypeScript minimal version 1.0.0.0 required)
Those 2 file and folder is missing in actual Javascript Realtime SDK. can anyone help me with those files and folders?
↧
Custom Authentication with PlayFab fails again
I am using Photon's JavaScript SDK.
From around September 3, custom authentication with PlayFab came to fail.
The following appears on the console.
Client: Error: 3101 NameServer authentication failed: -2 Wrong parameter type 217 (AuthenticateRequest.ClientAuthenticationType): should be Nullable`1 but received Double.
This is the same issue I posted earlier.
https://forum.photonengine.com/discussion/11338/custom-authentication-with-playfab-fails
↧
Client: Error: 1003 Master server closed connection
When repetitive connecting to room and disconnecting from the room for 4-5 times getting random error while connecting to Game Server
Client: Error: 1003 Master server closed connection
Sequence of state changes are
ConnectedToNameServer
ConnectingToMasterserver
ConnectedToMaster
JoinedLobby
ConnectingToGameserver
ConnectedToGameserver
Joined
JoinedLobby // disconnected from game server
ConnectingToGameserver
ConnectedToGameserver
Joined
JoinedLobby // disconnected from game server
ConnectingToGameserver
ConnectedToGameserver
Joined
JoinedLobby // disconnected from game server
ConnectingToGameserver
ConnectedToGameserver
Joined
JoinedLobby // disconnected from game server
ConnectingToGameserver
ConnectedToGameserver
Joined
JoinedLobby // disconnected from game server
Error // Error coming when connecting to game server again
Disconnected
↧
Photon plugin for construct works until I export it to my html website where it crashes and doesen't
I also tried running it on Xampp this did not work either
Error Message (using chrome):
c2runtime.js:315 Uncaught TypeError: Cannot read property 'ConnectionProtocol' of undefined
at m.Aa.t.aa (c2runtime.js:315)
at e.lg (c2runtime.js:121)
at XMLHttpRequest.Xf.b.onload (c2runtime.js:89)
--------------------------------------------------------------------------------------------------------------------------------------------
Website:
https://gravcore.co.uk/Gravland/
↧
↧
Photon Chat JavaScript SDK custom authentication
I have a free plan chat app registered in Photon dashboard. I want to use custom authentication service. And when I try to authenticate with an object:
const type = Photon.LoadBalancing.Constants.CustomAuthenticationType.Custom;
chatClient.setCustomAuthentication('', type, {
'(string)message': 'some_data',
'(string)signature': 'some_other_data'
});
Photon SDK gives me this error:
Client: Error: 3101 NameServer authentication failed: 32755 Authentication data type not supported
When I send regular string (or JSON object string) I don't see any errors related to data format. But this data is not being passed in request body to my server (POST request works itself). Photon chat SDK says, that I can provide raw JS object and it will get passed in `application/json` format when sending POST request to the authentication endpoint. Can you help me with this issue?
↧
Can not join custom lobby room that is created from the mobile client
Hi,
on a mobile client (both iOS and Android), I create a custom lobby room with the following command:
Then on the web client, after I have joined the Lobby ( the value autoJoinLobby is set to true on all clients), I call the method
photonEngine.joinRoom("CustomLobby");
I get the error message that "Game does not exist"
I have no problem to connect to a game room, but, how can I connect to that CustomLobby room?
Thank you
on a mobile client (both iOS and Android), I create a custom lobby room with the following command:
EGRoomOptions *options = [EGRoomOptions roomOptions:YES :YES :0 :nil :nil :@"CustomLobby" :EGLobbyType_DEFAULT :-1 :60000 :NO :nil :YES]; [mLoadBalancingClient opJoinOrCreateRoom:@"CustomLobby" :options];
Then on the web client, after I have joined the Lobby ( the value autoJoinLobby is set to true on all clients), I call the method
photonEngine.joinRoom("CustomLobby");
I get the error message that "Game does not exist"
I have no problem to connect to a game room, but, how can I connect to that CustomLobby room?
Thank you
↧
Create json object with integers of type char
Hi,
I am using this method
to convert an int to a char (1 byte in length). But, when I create the following json object
Then, on the mobile client I see that "a_key" has a value with length of 8 bytes, and not 1.
How can I fix this?
I am using this method
function toChar(number) { var int8 = new Int8Array(1); int8[0] = number; return int8[0]; }
to convert an int to a char (1 byte in length). But, when I create the following json object
var obj = {"a_key":tochar(1)};
Then, on the mobile client I see that "a_key" has a value with length of 8 bytes, and not 1.
"{length = 8, bytes = 0x0000000000804840}"
How can I fix this?
↧
Reliable Events
Hi,
I'm fairly new to photon javascript, I had previously used PUN and PUN2.
I would like to know a way by which I could make my raise on events reliable or tell me some command/function in javascript to send reliable messages, just like we use RPC in PUN.
Thanks.
Regards,
Humza Khalid
I'm fairly new to photon javascript, I had previously used PUN and PUN2.
I would like to know a way by which I could make my raise on events reliable or tell me some command/function in javascript to send reliable messages, just like we use RPC in PUN.
Thanks.
Regards,
Humza Khalid
↧
↧
Turn all logs OFF
Hi,
I have already set it to OFF:
but, I do see the following logs:
How can I turn these logs off?
I have already set it to OFF:
_this.logger = new Exitgames.Common.Logger("Demo:", Exitgames.Common.Logger.Level.OFF);
but, I do see the following logs:
[Em] PhotonPeerCreate 1 1 1 1 Photon-Javascript_Emscripten_SDK.min.js:15:485 [Em] PhotonPeerConnect 0x52aa48 wss://ns.exitgames.com:19093 6b62cd49-65db-4f4c-9d25-1db9785839e0 Photon-Javascript_Emscripten_SDK.min.js:15:485 [Em] onStatusChanged 1024
How can I turn these logs off?
↧
Implementation in Cocos Creator?
Hi, I'm using the Cocos Creator game engine. So far, I'm quite confused as to how to get started with Photon engine in Cocos Creator, especially this part I don't understand from the Photon Engine example:
![tz0u4Hb.png]()

↧
Error in network establishment (net::ERR_CERT_COMMON_NAME_INVALID)
Hi, recently I've got the Photon Server setup thanks to @vadim ! However, as i upload my games on netlify.com, i need to use wss connections. Using wss connection causes this issue and I can't connect:
Photon-Javascript_SDK.js:1 WebSocket connection to 'wss://app-eu.exitgamescloud.com:19090/af962eb6-4b15-4488-a09b-8243a448d4ba?libversion=4.1.0.0' failed: Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID
I used to use the Photon Engine plugin for Construct 2 and am still able to enable wss connections there, as well as upload on the same site netlify.com without any hitch. Now that I'm trying to use a new engine that requires my own coding, I think I did not resolve the secure certificates portion.
How can I resolve this problem with minimal setup? Photon Engine realtime plugin for Construct 2 had great coverage as the wss connection worked across almost all platforms. I read online about how to manually solve this certificate problem and mostly mentioned using OpenSSL and stuff, which I'm not sure if the Photon Engine plugin for Construct 2 did implicitly. Any pointers would be appreciated!
Photon-Javascript_SDK.js:1 WebSocket connection to 'wss://app-eu.exitgamescloud.com:19090/af962eb6-4b15-4488-a09b-8243a448d4ba?libversion=4.1.0.0' failed: Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID
I used to use the Photon Engine plugin for Construct 2 and am still able to enable wss connections there, as well as upload on the same site netlify.com without any hitch. Now that I'm trying to use a new engine that requires my own coding, I think I did not resolve the secure certificates portion.
How can I resolve this problem with minimal setup? Photon Engine realtime plugin for Construct 2 had great coverage as the wss connection worked across almost all platforms. I read online about how to manually solve this certificate problem and mostly mentioned using OpenSSL and stuff, which I'm not sure if the Photon Engine plugin for Construct 2 did implicitly. Any pointers would be appreciated!
↧
What is 'ExpectedValue' in setCustomProperty func?
Give me some best practice, please.

↧
↧
SetCustomProperty call like this
like this:
this.client.myRoom().setCustomProperty('playerNames', playerNames);
this.client.myRoom().setCustomProperty('players', players);
this.client.myRoom().setCustomProperty('ready', true);
will onMyRoomPropertiesChange callback keep the order: playerNames, players, ready??
this.client.myRoom().setCustomProperty('playerNames', playerNames);
this.client.myRoom().setCustomProperty('players', players);
this.client.myRoom().setCustomProperty('ready', true);
will onMyRoomPropertiesChange callback keep the order: playerNames, players, ready??
↧
raiseEvent WebHook Not Working
I'm trying to use the WebHook for raiseEvent but the server never receives the call. webForward is set to true:
The server receives all other hooks correctly, including OnGameProperties when webForward is true:
The app is set to Realtime, WebHooks 1.2, with IsPersistent=true, PathEvent=OnEvent, PathGameProperties=OnGameProperties.
The raiseEvent call is received correctly in OnEvent.
Any idea what else I might be missing to get this working?
raiseEvent(1, {foo:"bar"}, {webForward: true})
The server receives all other hooks correctly, including OnGameProperties when webForward is true:
myRoom().setCustomProperty("foo", "bar", true)
The app is set to Realtime, WebHooks 1.2, with IsPersistent=true, PathEvent=OnEvent, PathGameProperties=OnGameProperties.
The raiseEvent call is received correctly in OnEvent.
Any idea what else I might be missing to get this working?
↧
createRoom vs createRoomFromMy
I'm a photon newbie and I'm working on adding multiplayer to a web game. The JS SDK shows two APIs for creating rooms, createRoom and createRoomFromMy. It's not clear to me what the difference is between the two. Can someone explain when it is more appropriate to choose one over the other?
↧