HandleJoinGame : opCode Join or JoinGame ?

edited September 2011 in Photon Server

In the LoadBalancing sample you use to join a game in Program.cs the operation code: Lite.Operations.OperationCode.Join (= 255) which will be catched in the switch in Game.ExecuteOperation to execute the desired Game.HandleJoinOperation().

However you also define an OperationCode.JoinGame (= 7)
And here I am confused what is the purpose of this operation?

AppLobby and MasterClientPeer do catch this operation and execute HandleJoinGame
but your sample never sends such an operation and AppLobby::HandleJoinGame is never called as far as i see it?

Isn't there a discrepancy here?


PS: Frankly am I alone in finding the LoadBalancing code a bit... confusing?


  • JoinGame (=7) is used with the Lobby where a player can choose from a list of games.

    The way it works in a nut shell is:
    -(Master) join the lobby with JoinLobby (= 4)
    -(Master) receive an event GameList (= 10)
    -(Master) while connected to the Lobby receive GameListUpdate (= 11)
    -(Master) call JoinGame (=7)
    -(GameServer) Join(=255) the room on the GS

    This is the framework Photon Unity Networking is built on. You can download it and look at the code in NetworkingPeer.cs.
Sign In or Register to comment.