Password
Options
friuns
✭
how to set password for game/room?
0
Comments
-
You cant.
Not in the Unity Networking Plugin. It could be added to the room logic, if really needed.
You can hide rooms and close them. If you hide a room, the name of it more or less becomes a password (no one knows). Avoid random matchmaking in that case.0 -
Is this still the case? I have been lolling for a password option in PUN (1.9.6) and can't see anything.0
-
Its still the case.
If you want a password and don't want to toy with the Photon LoadBalancing code, you would have to handle that yourself on the master client through an RPC for example0 -
There are 2 ways to do this:
a) Use the server SDK's Loadbalancing application and add this feature.
b) Encode the pw and add it as property to the room. Clients that see a room has a pw, will get user input, encode and compare with the room's property before joining the room. Of course, this is a put client side solution but simpler.0 -
It's ok, I implemented your suggestion (Tobias) of hidden rooms, works really well actually :-)
If the user sets a password, i make the room hidden and name the room the password name, then on the joining client, the user types in a password and it looks for and joins that room.
Working really well... way better than I expected :-)
I LOVE PHOTON!0 -
seonr wrote:It's ok, I implemented your suggestion (Tobias) of hidden rooms, works really well actually :-)
If the user sets a password, i make the room hidden and name the room the password name, then on the joining client, the user types in a password and it looks for and joins that room.
Working really well... way better than I expected :-)
I LOVE PHOTON!0 -
Working really well... way better than I expected :-)
I LOVE PHOTON!
0 -
Hello @Tobias admin
i have made custom room properties for password. and then how to access it? I write below code :
if(inputPass.text == PhotonNetwork.room.CustomProperties["pass"].tostring())
{
Photonnetwork.Joinroom(name);
}
but photonnetwork.room is for current room we are inside right?
if i'm in lobby, how to do that?
0