JoinRoom Failed

Options
Hello
I have been developing games with Photon Unity Networking (PUN).
However, I want to add Server side logic, so I'm running Photon Server by Self-Hosted and I am checking the connection.

A problem occurred here.
Only one of the PC, or Android (exists in the same LAN as PhotonServer (PC)) can participate in the Room.
When either terminal is joining Room, the other attempts to join Room, the following Error will occur.

Operation failed: OperationResponse 226: ReturnCode: -2 (Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.). Parameters: {} Server: GameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1621)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)




public class PhotonManager : Photon.MonoBehaviour { private string ROOM_NAME = "ROOM_1"; private void Start() { PhotonNetwork.autoJoinLobby = true; PhotonNetwork.ConnectUsingSettings("v1.0"); } private void OnGUI() { GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString()); } //============================Button Event============================ /// <summary> ///After entering the lobby. /// </summary> public void OnJoinOrCreateRoomButton() { RoomOptions roomOptions = new RoomOptions() { MaxPlayers = 20, IsOpen = true, IsVisible = true, }; PhotonNetwork.JoinOrCreateRoom(ROOM_NAME, roomOptions, null); } public void OnPhotonDisConnect() { Debug.Log("Discon"); PhotonNetwork.Disconnect(); } //======================================================================= void OnJoinedLobby() { Debug.Log("OnJoinedLobby"); } //ランダムでRoomに接続失敗 void OnPhotonRandomJoinFailed() { Debug.Log("OnPhotonRandomJoinFailed"); // Room作成 PhotonNetwork.CreateRoom(ROOM_NAME); } void OnPhotonJoinRoomFailed(object[] codeAndMsg) { Debug.Log("JoinRoom()の呼び出しが失敗! " + codeAndMsg[0].ToString()+" : "+codeAndMsg[1 ]); } void OnCreatedRoom() { Debug.Log("OnCreatedRoom"); } void OnJoinedRoom() { Debug.Log("OnJoinedRoom"); } }


PC, Android, both can participate in the lobby together.
How do I put all the terminals into the Room?
What is UserId of this error?
Thank you.

Best Answer

Answers