Player cant connect to local server room

we are working on a VR room scale multiplayer game. we using pun2 for connection and every thing works perfectly in cloud server. after we try to use local server as our game server, player from other devices (except the device that running server) can connect to server and see existing rooms (by joining lobby) but cannot join are create any room and they will be remove from server by photon server after sending create or join room request to server.
here is my client code
using System.Collections;
using System.Collections.Generic;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Connect : MonoBehaviourPunCallbacks
{
    TypedLobby lobby = new TypedLobby("looby", LobbyType.Default);

    private void Awake()
    {
        PhotonNetwork.OfflineMode = false;
        PhotonNetwork.AutomaticallySyncScene = true;
        DontDestroyOnLoad(gameObject);
    }


    private void Start()
    {
        Connecting();
    }

    public void Connecting()
    {
        if (!PhotonNetwork.IsConnected)
        {
            PhotonNetwork.ConnectUsingSettings();
        }
    }

    public override void OnConnected()
    {
        Debug.Log("on connected");
        Debug.Log(PhotonNetwork.CountOfRooms);

    }

    public override void OnDisconnected(DisconnectCause cause)
    {
        Debug.Log("on disconnected "+cause);
    }

    public void CreateRoom()
    {
        RoomOptions roomOptions = new RoomOptions {MaxPlayers = 8};
        PhotonNetwork.CreateRoom("name", roomOptions);
    }

    public void Join()
    {
        PhotonNetwork.JoinRandomRoom();
    }
    public override void OnRoomListUpdate(List<RoomInfo> roomList)
    {
        Debug.Log("on rooms updated");
        foreach (RoomInfo ri in roomList)
        {
            Debug.Log(ri.Name + ri.ToString());
        }
    }


    public override void OnCreatedRoom()
    {
        Debug.Log("room created" + PhotonNetwork.CurrentRoom.Name);
    }

    public override void OnJoinedRoom()
    {
        Debug.Log("room joined" + PhotonNetwork.CurrentRoom.Name);
    }

    public override void OnJoinRandomFailed(short returnCode, string message)
    {
        Debug.Log("random room join failed"+returnCode+"  " +message);
        
    }

    public override void OnJoinRoomFailed(short returnCode, string message)
    {
        Debug.Log("room join failed"+returnCode+message);
    }
}
here is photon MS master log
2021-08-04 12:35:45,787 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game client on leader node
2021-08-04 12:35:45,787 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Auth Timeout Checker scheduled. authTimeout:20000 p:T:MasterClientPeer,ConnId:18,ip:192.168.ip:55027,Udp,GpBinaryV18
2021-08-04 12:35:45,881 [25] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Auth Timeout Checker stopped. authTimeout:20000 p:T:MasterClientPeer,ConnId:18,ip:192.168.ip:55027,Udp,GpBinaryV18
2021-08-04 12:35:45,881 [25] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - HandleAuthenticateRequest:appId=7f07abdb-5894-4525-9819-2aea6411b3ff;version=_2.34.1;region=;type=0;userId=27079409-fe89-4e4a-ada1-9fc24444302f
2021-08-04 12:35:45,882 [25] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - OnClientConnect: peerId=18, appId={Default}
2021-08-04 12:35:45,882 [31] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=27079409-fe89-4e4a-ada1-9fc24444302f, master=True, gid=
2021-08-04 12:35:51,204 [25] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - Created game: gameId=name, appId={Default}
2021-08-04 12:35:51,204 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated: in list=2, in game oldPlayerCount=0, playerCount=1, DebugData:CheckUserOnJoin:False, PeerCount:1, GameServerPlayerCount:0, YetExpectedCount:0, InactiveCount:0,JoiningCount:1,ActivePlayers:[],Inactive:[],Expected:[], Joining:[{"UtcCreated":"2021-08-04T08:05:51.2049436Z","UserId":"27079409-fe89-4e4a-ada1-9fc24444302f"}], lastUpdateEvent:''
2021-08-04 12:35:51,205 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - Added peer: gameId=name, userId=27079409-fe89-4e4a-ada1-9fc24444302f, joiningPeers=1
2021-08-04 12:35:51,205 [25] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Token Validation: Creating token for GS:localhost and game:name
2021-08-04 12:35:51,205 [12] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=27079409-fe89-4e4a-ada1-9fc24444302f, master=True, gid=name
2021-08-04 12:35:51,251 [32] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: peer=T:MasterClientPeer,ConnId:18,ip:192.168.ip:55027,Udp,GpBinaryV18, UserId:27079409-fe89-4e4a-ada1-9fc24444302f: reason=0, detail=
2021-08-04 12:35:51,252 [32] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - OnClientDisconnect: peerId=18, appId={Default}
2021-08-04 12:35:51,252 [32] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Auth Timeout Checker stopped. authTimeout:20000 p:T:MasterClientPeer,ConnId:18,ip:192.168.ip:55027,Udp,GpBinaryV18
2021-08-04 12:35:52,208 [12] DEBUG Photon.LoadBalancing.MasterServer.Lobby.AppLobby - Publishing game changes. AppLobby:, type:Default
2021-08-04 12:35:56,259 [12] DEBUG Photon.LoadBalancing.MasterServer.ApplicationStats - Publishing application stats. MasterPeerCount=0, PlayerCount=1, GameCount=1
2021-08-04 12:35:58,735 [20] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - Checked join timeouts: before=1, after=1
2021-08-04 12:36:06,244 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - Player removed from joining list by timeout. UserId=27079409-fe89-4e4a-ada1-9fc24444302f
2021-08-04 12:36:06,244 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated: in list=1, in game oldPlayerCount=1, playerCount=0, DebugData:CheckUserOnJoin:False, PeerCount:0, GameServerPlayerCount:0, YetExpectedCount:0, InactiveCount:0,JoiningCount:0,ActivePlayers:[],Inactive:[],Expected:[], Joining:[], lastUpdateEvent:''
2021-08-04 12:36:06,245 [25] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - Removed game: gameId=name, appId={Default}
2021-08-04 12:36:06,245 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - RemoveGameState:id=name, peers=0, max=0, open=True, visible=True, peersJoining=0, inactive=0, ispersistent=False
2021-08-04 12:36:06,245 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - Game removed on GS. GameId=name, ServerId=[key:127.0.0.1-5056-4531, serverId:1b0e0839-f3e6-413c-88ec-02e563ac35ca]
2021-08-04 12:36:06,246 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount changed after game remove. New Value=1
2021-08-04 12:36:06,246 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - Checked join timeouts: before=1, after=0
2021-08-04 12:36:06,244 [31] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player removed: pid=27079409-fe89-4e4a-ada1-9fc24444302f, master=False, gid=
i read every related doc and forum but i cant solve the problem
We appreciate your efforts and all your help.
Thank you for your time and understanding.
Note: photon server IP: local IP of server machine (we want to use server just in local network), photon server port: 5055, i dont use name server

Comments

  • chvetsov
    chvetsov mod
    edited August 4
    hi, @amm

    I think the issue is that you did not update game server public ip and host name. by default they are equal to 127.0.0.1 and localhost respectively.
    Please change it to 192.168.... and host name. in GameServer.xml.config in section Photon/GameServer/Master. keys PublicIPAddress and PublicHostName

    best,
    ilya
  • chvetsov wrote: »
    hi, @amm

    I think the issue is that you did not update game server public ip and host name. by default they are equal to 127.0.0.1 and localhost respectively.
    Please change it to 192.168.... and host name. in GameServer.xml.config in section Photon/GameServer/Master. keys PublicIPAddress and PublicHostName

    best,
    ilya

    thank you so much it works!
    but i wonder why i couldn't find this solution in docs
    maybe i don't discover them properly.
    thank you again.