Joining a private session by password

I want to have it so that the host would make a private session with a password. Then anyone that enters that password will join the session.

Looking through the Bolt Matchmaking documentation there's a mix between examples of PhotonRoomProperties() and IProtocolTokens. I'm not sure if a specific one is needed or if both will work for the joining by password method.

I do see an example of "Join by Session Name", can the same code be modified to become "Join by Session Password"?

Comments

  • Something I should add, to be more specific the clients that want to join the session do not need to see it via something like a room list. They also should not need an invite. They would just have to type in the password, click join, and it should send them to that session made with that password.
  • Hello @chocomurr ,
    I do see an example of "Join by Session Name", can the same code be modified to become "Join by Session Password"?

    Yes, you can create an invisible session that can only be joined with the proper name.
    So you could modify the code sample to, for example, join the session by name, and this name being the "password" of your game.

    Take a look at step 4: https://doc.photonengine.com/en-us/bolt/current/in-depth/photon-cloud
    Show that you need to modify the property "IsVisible" of the "PhotonRoomProperties" to make it invisible.

    If you don't want to double-check, and just use the session name is fine, you should be good to go.

    Now, if you want to enter a specific session, and also check for a password, you may have to embed both pieces of information on your "password key".
    I mean, part of the password string is the session ID + real password.
    So you join the session if that ID and pass a token with the real password, so the server will let it in or not.

    --
    Ramon Melo
    Photon Bolt Team