public void HandleCommand(MatchServer server, Client client, UdpPacket packet, MatchBaseRequestPacket baseRequest) { var reader = packet.GetReader(); var request = new MatchUnregisterHostingRequestPacket(reader); var playlist = server.Playlist; var sessions = from session in server.Sessions where session.HostXUID == client.XUID select session; if (sessions.Count() > 0) { var session = sessions.First(); server.Sessions.Remove(session); if (ServerParser.Servers.ContainsKey(session.ExternalIP)) { ServerParser.Servers.Remove(session.ExternalIP); } } Log.Debug(string.Format("{0} unregistered their session", client.XUID.ToString("X16"))); // send response, sadly }
public void HandleCommand(MatchServer server, Client client, UdpPacket packet, MatchBaseRequestPacket baseRequest) { var reader = packet.GetReader(); var request = new MatchUnregisterHostingRequestPacket(reader); var playlist = server.Playlist; var sessions = from session in server.Sessions where session.HostXUID == client.XUID select session; if (sessions.Count() > 0) { var session = sessions.First(); server.Sessions.Remove(session); if (ServerParser.Servers.ContainsKey(session.ExternalIP)) { ServerParser.Servers.Remove(session.ExternalIP); } } Log.Debug(string.Format("{0} unregistered their session", client.XUID.ToString("X16"))); // send response, sadly }