private static void OnHandshakeRequest(PortalClient client, PortalPacketReader p) { if (client.IsAuthed) { client.Send(PortalPackets.HandshakeResponse.Accepted); return; } var key = p.ReadBytes(20); client.IsAuthed = PortalAuthentication.Key.SequenceEqual(key); var r = client.IsAuthed ? PortalPackets.HandshakeResponse.Accepted : PortalPackets.HandshakeResponse.Rejected; client.Send(r); }
private static void OnHandshakeRequest(PortalClient client, PortalPacketReader p) { if (client.IsAuthed) { client.Send(PortalPackets.HandshakeResponse.Accepted); return; } var key = p.ReadBytes(20); client.IsAuthed = PortalAuthentication.Verify(key); if (client.IsAuthed && Portal.UniqueIDs && Portal.Transport is PortalServer && ((PortalServer)Portal.Transport).Clients.Any(c => c != client && c.IsIdentified && c.ServerID == p.ServerID)) { client.IsAuthed = false; } var r = client.IsAuthed // ? PortalPackets.HandshakeResponse.Accepted : PortalPackets.HandshakeResponse.Rejected; client.Send(r); }