protected override void OnClose(CloseEventArgs e)
            {
                // If the reason of a client disonnect is because we are still loading the game,
                // we don't need to inform the other clients since the disconnected client never
                // joined the game in the first place.
                if (e.Code == (short)DisconnectionReason.HostStillLoading)
                {
                    return;
                }

                NebulaModel.Logger.Log.Info($"Client disconnected: {Context.UserEndPoint}, reason: {e.Reason}");
                playerManager.PlayerDisconnected(new NebulaConnection(Context.WebSocket, Context.UserEndPoint, packetProcessor));
            }
Exemple #2
0
 private void OnPeerDisconnected(NetPeer peer, DisconnectInfo disconnectInfo)
 {
     Log.Info($"Client disconnected: {peer.EndPoint}, reason: {disconnectInfo.Reason}");
     PlayerManager.PlayerDisconnected(new NebulaConnection(peer, PacketProcessor));
 }