Multiple Join Disable
Options
querwilly
✭✭
I want the same user logging on from different devices.
I did research for it I found this
but i think this is no longer valid
i see code commented disable
what can I do
I did research for it I found this
CheckUserOnJoin
but i think this is no longer valid
i see code commented disable
//public bool CheckUserOnJoin { get { return this.checkUserOnJoinField; } set { this.checkUserOnJoinField = value; } } //private bool checkUserOnJoinField = false;
what can I do
0
Comments
-
Hi @querwilly,
What is the behavior you want?
1.CheckUserOnJoin = false;
Allow multiple connections to all Photon servers from same UserID: same player (unique UserID) can connect to your game from multiple clients at the same time.
2.CheckUserOnJoin = true;
Same as 1 but same player can't join the same room from multiple clients at the same time.
3. Disallow multiple connections to all Photon servers from same player: you can achieve this by implementing Custom Authentication.0 -
HelloJohnTube said:Hi @querwilly,
What is the behavior you want?
1.CheckUserOnJoin = false;
Allow multiple connections to all Photon servers from same UserID: same player (unique UserID) can connect to your game from multiple clients at the same time.
2.CheckUserOnJoin = true;
Same as 1 but same player can't join the same room from multiple clients at the same time.
3. Disallow multiple connections to all Photon servers from same player: you can achieve this by implementing Custom Authentication.
My Code
RoomOptions newRoomOptions = new RoomOptions();
newRoomOptions.isOpen = true;
newRoomOptions.isVisible = true;
newRoomOptions.maxPlayers = 4;
TypedLobby newLobby = new TypedLobby("Ihale", LobbyType.SqlLobby);
PhotonNetwork.JoinOrCreateRoom("covannix", newRoomOptions, newLobby);
But class not found photon engine v.175 ?
RoomOptions.CheckUserOnJoin=true;
I m control this file "LoadbalancingPeer.cs" line 1488 CheckUserOnJoin disable
Can you help me?
0 -
any body help me0
-
It's not easy for me to understand what you are trying to say.But class not found photon engine v.175 ?
I don't think there is a missing class in 1.75.I m control this file "LoadbalancingPeer.cs" line 1488 CheckUserOnJoin disable
I don't get it.
If you know what you're doing. Feel free to uncomment or modify code.
I guess you're saying "CheckUserOnJoin" in PUN is hidden and you want to change its default value.
Go ahead.
0 -
I'm making changes.JohnTube said:It's not easy for me to understand what you are trying to say.
But class not found photon engine v.175 ?
I don't think there is a missing class in 1.75.I m control this file "LoadbalancingPeer.cs" line 1488 CheckUserOnJoin disable
I don't get it.
If you know what you're doing. Feel free to uncomment or modify code.
I guess you're saying "CheckUserOnJoin" in PUN is hidden and you want to change its default value.
Go ahead.
but it does not work how are we going to do.
multiple device control
It's the same user in the same room0 -
Hi @querwilly,I'm making changes.What changes did you make?but it does not work howWhat made you say that?
Please make sure you're using unique same UserIDs for same players.0 -
JohnTube said:
Hi @querwilly,
I'm making changes.What changes did you make?but it does not work howWhat made you say that?
Please make sure you're using unique same UserIDs for same players.
i made changes
loadbalancing.cs 1488-1489
// public bool CheckUserOnJoin { get { return this.checkUserOnJoinField; } set { this.checkUserOnJoinField = value; } }
// private bool checkUserOnJoinField = false;
changes uncomment
public bool CheckUserOnJoin { get { return this.checkUserOnJoinField; } set { this.checkUserOnJoinField = value; } }
private bool checkUserOnJoinField = false;
Sample code;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
public class MyTestPhoton : MonoBehaviour {
Text ShowUserId;
// Use this for initialization
void Start () {
ShowUserId = GameObject.Find ("UserIDShow").GetComponent ();
if (PhotonNetwork.connectionStateDetailed == ClientState.PeerCreated) {
// Connect to the photon master-server. We use the settings saved in PhotonServerSettings (a .asset file in this project)
PhotonNetwork.AuthValues = new AuthenticationValues();
PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.None;
PhotonNetwork.playerName="SameName";
PhotonNetwork.AuthValues.UserId = "333"; // alternatively set by server
// PhotonNetwork.AuthValues.AddAuthParameter("username", "n");
// PhotonNetwork.AuthValues.AddAuthParameter("token", AccessToken);
// PhotonNetwork.AuthValues.Token = AccessToken;
PhotonNetwork.ConnectUsingSettings ("1.0");
}
}
public void CreateRoom(){
RoomOptions newRoomOptions = new RoomOptions();
newRoomOptions.isOpen = true;
newRoomOptions.isVisible = true;
newRoomOptions.maxPlayers = 4;
newRoomOptions.PublishUserId = true;
newRoomOptions.CheckUserOnJoin = true;
TypedLobby newLobby = new TypedLobby("LobyTest", LobbyType.SqlLobby);
PhotonNetwork.JoinLobby (newLobby);
print ("room crated");
PhotonNetwork.CreateRoom ("RoomTest", newRoomOptions, newLobby);
}
public void OnPhotonCreateRoomFailed()
{
PhotonNetwork.JoinRoom ("RoomTest");
}
public virtual void OnConnectedToMaster()
{
Debug.Log("OnConnectedToMaster() was called by PUN. Now this client is connected and could join a room. Calling: PhotonNetwork.JoinRandomRoom();");
//PhotonNetwork.JoinRandomRoom();
Debug.Log ("UserID=>"+PhotonNetwork.player.userId.ToString());
CreateRoom();
}
public void OnJoinedRoom()
{
Debug.Log("OnJoinedRoom=>Okey");
}
}
Big problem.
Multiple device same user same uniqueId same room.
Im tested
newRoomOptions.CheckUserOnJoin = true; OR newRoomOptions.CheckUserOnJoin = false;
ineffective
0