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); } }
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(); }