コード例 #1
0
 public void OnClientConnectedMessage(NetworkConnection conn, ClientConnectedMessage message)
 {
     if (ServerUtils.CreatePlayer(
             conn,
             NetworkingLibrary.Instance.ClientConnectionPlayer.gameObject,
             out NetworkBehaviour client))
     {
         _connections.Add(conn.connectionId, (CommandClient)client);
     }
 }
コード例 #2
0
        public override void OnClientConnect(NetworkConnection conn)
        {
            base.OnClientConnect(conn);

            // If local connection
            if (NetworkServer.localConnection.connectionId == conn.connectionId)
            {
                if (ServerUtils.CreatePlayer(
                        NetworkServer.localConnection,
                        NetworkingLibrary.Instance.ClientConnectionPlayer.gameObject,
                        out NetworkBehaviour player))
                {
                    _connections.Add(conn.connectionId, (CommandClient)player);
                }
            }
        }