Requests with no response (sometimes)!
Hello there!
I've been using Photon on as3 for 6 months now, it's great and very useful but I have an issue which turned to a nightmare to me...
The problem is when a request is sent, no response comes back. For example, when a user exits from a room a "please wait" message appears until the server says Ok now you can exit now, but some times that does not happen and they stuck there forever. Also, when the users connect to the game (home page) Photon server does not respond and they stuck at "main loading page". I have some reports about the issue based on users feedback, and most of them came back with "photon wasn't loaded"!!
HELP
Thank you very much
I've been using Photon on as3 for 6 months now, it's great and very useful but I have an issue which turned to a nightmare to me...
The problem is when a request is sent, no response comes back. For example, when a user exits from a room a "please wait" message appears until the server says Ok now you can exit now, but some times that does not happen and they stuck there forever. Also, when the users connect to the game (home page) Photon server does not respond and they stuck at "main loading page". I have some reports about the issue based on users feedback, and most of them came back with "photon wasn't loaded"!!
HELP
Thank you very much

0
Comments
https://www.exitgames.com/download
"Photon wasn't loaded" is not the most clear error message. We didn't find it in our source, so it's something from your app? How does it happen?
Can we test your app somehow?
I will download it and test it...
"Photon wasn't loaded" is a message I created, it appears when all the resources of my game are loaded and photon took forever but didn't load, and it's being sent to my email every time it happens..
About the "wasn't loaded" message: In which way did Photon take forever and didn't get loaded? Loading Photon (the swf, or any library) is not a problem we can fix with the API. What does "did not load" mean in a technical way?
Which part of Photon sdk do you use?
Core, Lite or LoadBalancing?
"wasn't loaded" I meant did not respond to my app that it was connected to server or master (cuz I have them in the same phase).
I use LoadBalancing (the same as the demo)
Instead of adding listeners to peer you should extend LoadBalancingClient and override some of its methods.
Most important are:
onError(errorCode: int, errorMsg: String) // various errors including disconnections - see loadbalancing.constants.ErrorCode
onEvent(code:int, content:Object, actorNr:int) // custom event
onStateChange(state: int) // client state changes including disconnected
onOperationResponse(errorCode: int, errorMsg: String, ... ) // to check operation (join random room for instance) result
onRoomList(rooms: Vector.<RoomInfo>)
onRoomListUpdate(rooms: Vector.<RoomInfo>, ... )
onMyRoomPropertiesChange() // someone changed properties of joined room
onJoinRoom()
onActorJoin(actor: Actor)
onActorLeave(actor: Actor)
You can find full list in documentation.
Create your Client instance with parameters "serverAddress:port", "appId", "appVersion" for base class constructor and call connect for this instance.
Please tell which features more detailed description do you need.
thank you very much
If you need return to lobby, you should call disconnect() and then call connect() again in onStateChange when state changes to Disconnected.
You can set room properties calling client.myRoom().setCustomProperty(propName, propValue) before join operations.
While joined call same method to change room properties and notify about this all other clients.
After joining any client can get these properties via client.myRoom().getCustomProperty(propName).
You can listen to properties change while joined in overriden client onMyRoomPropertiesChange method.
You can set/get player properties as well as room properties.
You can get some of room properties in lobby with rooms list.
Also you can join random room with matching rule specified in parameters.
here is an example:
[code2=as3]//creating random room
var gPro = new Dictionary();
gPro = "random";
opCreateGame("some_name", gPro);
//joining random game
var gRandom = new Dictionary();
gRandom = "random";
opJoinRandomGame(gRandom);
///****************///
//create custom room(could be "playing with friends")
var gPro = new Dictionary();
gPro = creator_id;//or something else
opCreateGame("some_name2", gPro);
//joining custom room
var gcustom= new Dictionary();
gcustom = creator_id;
opJoinRandomGame(gRandom);[/code2]
But will fix it during the day.
Use first joinRandomRoom method parameter to specify expected room properties exactly like you did with opJoinRandomGame
To specify these properties in new room, use myRoom().setCustomProperty(propName, propValue) before room creation.