Leaving Room without Disconnecting

Options
amiractivate
edited June 2012 in Photon Server
Currently what I am trying to do is to enable room switching. Im looking at the code and the OperationCode.Leave (the only leave operation other than OpLeaveLobby) is calling DisconnectFromGameServer().

Is there a way to leave a joined room without disconnecting (apart from changing the photon codes)?

Comments

  • Kaiserludi
    Options
    This depends on the question, if you need multi server support or not.
    If you have a look at Lite, then you will see, that it does not disconnect from the server, when its leaving a room. However in LoadBalancing there normally will be a lot of different gameservers online and the new game room most probably will be on another gameserver.
  • Thank You Kaiserludi,

    That does make sense, Im currently using the PhotonUnityNetworking and its using the loadbalancing peer and will probably need multiserver functionality in the future. So if im using loadbalancing what Im suppose to do in order to switch room is to
    1) disconnect from gameserver
    2) find the room that im targetting to join
    3) join the gameserver that hosts that room
    4) join the target room

    Did I get that right?
  • Tobias
    Options
    If you use our "standard" loadbalancing, the server switching is taken care of for you. Instead of just joining a room, the Loadbalancing API will connect to the designated game-server and join the room there. The same happens when you leave a room: Our framework will do what you described: disconnect, re-connect to the master and join the other room by connecting it's game server.

    There are two frameworks that do this for you:
    Photon Unity Networking - A framework built to replace Unity's networking
    Loadbalancing API - A collection of C# classes which make it easy to connect to Photon loadbalanced servers
  • Thanks guys,

    Got it working however I bumped into another problem, im not really sure but maybe its related. Ive posted it on : viewtopic.php?f=5&t=1795