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:
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

Comments

  • Also, when I get the list of available rooms I do not see that Lobby room.
    But, that room is listed in the mobile clients.
    Could this be because of a bug in the JS SDK?
  • Hi @Vasilis,

    I think it's a matchmaking issue and not a bug in the JS SDK.
    Check "Matchmaking Checklist".
    Especially Region and AppVersion must match.

    "autoJoinLobby" is not related here.
    In fact, joining a lobby is not needed at all if you use JoinRoom or JoinOrCreateRoom by name ("CustomLobby").
    Rooms names are unique across lobbies and joining a room by name works across lobbies. So no need to be joined to a lobby to be able to join a room by name.

    Lobbies are different from rooms, even if you use a room as a "lobby" which is not recommended if the maximum number of players is too high.
    Lobbies are on the master server and players can't interact with each other when joined to lobbies.
    Rooms are on game servers and players can interact with each other when joined to the same room.
  • Hi @JohnTube ,

    Thank you for your reply. If there was a region or appversion issue then I shouldn't see the other rooms, right? But, I do see, and I can join them. I can not see that custom lobby, though.
    I am not entirely sure about the region, however. On Photon's site I have set that I want all users to connect to "eu" server, but, I am not sure that the JS client respects this choice.

    Does the Js SDK has a JoinOrCreateRoom method? I can not find it

    On the mobile clients, the users do connect to that custom lobby, and they do interact. Meaning, that they can message to each others.
  • Hi @Vasilis,

    Other than the "CustomLobby" room, did a JS Client join a same rooms as the (other non JS) mobile client(s)?

    According to the API reference for the JS SDK:
    I think you could use
    loadBalancingClient.JoinRoom(roomName, { createIfNotExists: true }, createOptions);
    

    or something like that.
  • VasilisVasilis
    edited January 10
    I will try what you proposed for joining a room.

    About the regions:
    The JS clients makes the following call:
    Connecting to Master ws://app-eu.exitgamescloud.com:9090

    But, the iOS client I see the following two addresses:
    2020-01-10 15:15:53,675756 INFO PeerBase.cpp connect() 128 address: ns.exitgamescloud.com:5058
    2020-01-10 15:15:54,001406 INFO EGLoadBalancingClient.mm -[EGLoadBalancingClient onStatusChanged:] 1239 connected to nameserver
    2020-01-10 15:15:54,333364 INFO EGLoadBalancingClient.mm -[EGLoadBalancingClient onOperationResponse:] 881 OperationResponse - operationCode: 220, returnCode: 0 {210=["eu"], 230=["92.38.154.7:5055"]}
    2020-01-10 15:15:54,333490 INFO EGLoadBalancingClient.mm -[EGLoadBalancingClient pingBestRegion:] 841

    Are these the same regions?
  • JohnTubeJohnTube mod
    edited January 10
    Should be the same region, EU, yes.
  • Then, what is causing this problem?
  • The problem was that I was calling the method
    this.connect()
    

    When I used the method
    this.connectToRegionMaster("EU");
    

    I was able to connect to a room.
    Does this mean that the connect() method has a bug? It should pick the EU region
  • vadimvadim ✭✭✭
    Hi,
    connect() connects directly to a master server, so you need to set master server address first.
    Normally, connectToRegionMaster() should be used to connects to nameserver first. Then master server will be automatically assigned by nameserver depending on specified region.
  • Hi,

    which connect method should I use to connect to the region(s) that I have set on my app page?

    Right now, I am OK with connectToRegionMaster("EU") method. But, if I change the region in the future, I do not want to modify the code
  • vadimvadim ✭✭✭
    Hi,
    You can connect to nameserver and get list of available regions before calling client.connectToRegionMaster():
    Call client.connectToNameServer() and when client state changes to LoadBalancingClient.State.ConnectedToNameServer, call getRegions().

    Implement client.onGetRegionsResult(errorCode: number, errorMsg: string, regions: {})
    This method will be called when region list received. Choose region from the list and call client.connectToRegionMaster(region)
Sign In or Register to comment.