BecomeNewHost() public method

This causes a client that has been disconnected from the host to become the new host of the game.

public BecomeNewHost ( int port ) : bool
port int The network port to listen on.
return bool
コード例 #1
0
        void OnClientDisconnectedFromHost(NetworkConnection conn, out NetworkMigrationManager.SceneChangeOption sceneChange)
        {
            Debug.Log("Migration >> On Client Disconnected From Host");
            //OnClientDisconnectedFromHost
            OnClientDisconnectedFromHost(conn, out sceneChange);


            //netwr.PeerInfoMessage _info;
            //bool _newHost = false;


            //netwr.FindNewHost(out _info, out _youAreNewHost);

            if (_newHost == true)
            {
                netwr.BecomeNewHost(7777);
            }
            else
            {
            }
        }