Created
September 6, 2013 16:10
-
-
Save Noxalus/6466060 to your computer and use it in GitHub Desktop.
Lidgren cut the disconnect string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NetIncomingMessage incMsg; | |
NetConnection sender; | |
while ((incMsg = server.ReadMessage()) != null) | |
{ | |
sender = incMsg.SenderConnection; | |
Client t_client = clients.GetClientFromConnection(sender); | |
switch (incMsg.MessageType) | |
{ | |
case NetIncomingMessageType.StatusChanged: | |
if (sender.Status == NetConnectionStatus.Connected) | |
{ | |
// Some instructions | |
} | |
else if (sender.Status != NetConnectionStatus.Connected) | |
{ | |
if (t_client != null) | |
{ | |
WriteOutput("[Disconnected]Client " + t_client.ClientId + " has disconnected (" + incMsg.ReadString + ")"); | |
clients.RemoveClient(t_client); | |
OnDisconnectedClient(t_client, new EventArgs()); | |
} | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment