[Trick] If randomly no game in loadbalancing lobby

edited October 2011 in Photon Server

Small advice for those tackling the loadbalancing code.

Don't forget to add this line in GameState.CheckJoinTimeOuts() :
log.Debug("Joining peer removed (timeout) "+peerState.UserId);

This will save you a lot of time to detect that your join process (connect + encryption + authentication + join game) is too long and triggers a time out.
The consequence of this timeout will be that your room is still created and you will connect to it... but the room isn't listed in the GameList !!! (see GameList.CheckJoinTimeOuts()).

Very hard to find out especially when like me the join process is nearly as long as the timeout, resulting in randomly the room being present in the game list and sometime not !!!

This "issue" can easily be fixed by.. increasing the JoinTimeOut from 5 to -in my case- 10 sec.

I hope this will avoid some lost hours.


  • Nice tip, thanks!
  • We thought 5sec are quite a long time, if a client just has to reconnect and authenticate.
    Did you modify the server somehow? Is there any new place where it could take longer?
  • On the server side I mostly added some debug log, but its on the client side that the time is critical as the client -after creating a game- must join the room before the timeout.
    Remember that currently the peer creating the room is added automatically by the server during the room creation (if you remember I posted about this behaviour that I found too complicated and error prone).

    But I agree I was surprised that this fixed the issue. My pc isn't soooo slow and I am developing locally. Perhaps it is something else but then I can't find out what and I don't see why it should be fixed by changing the timeout.
Sign In or Register to comment.