コード例 #1
0
 public override void OnPeerDisconnected(long connectionId, DisconnectInfo disconnectInfo)
 {
     base.OnPeerDisconnected(connectionId, disconnectInfo);
     if (Players.ContainsKey(connectionId))
     {
         LiteNetLibPlayer player = Players[connectionId];
         player.ClearSubscribing(false);
         player.DestroyAllObjects();
         Players.Remove(connectionId);
     }
 }
コード例 #2
0
        public virtual void SetPlayerNotReady(long connectionId, NetDataReader reader)
        {
            if (!IsServer)
            {
                return;
            }

            LiteNetLibPlayer player = Players[connectionId];

            if (!player.IsReady)
            {
                return;
            }

            player.IsReady = false;
            player.ClearSubscribing(true);
            player.DestroyAllObjects();
        }