private void ParseConnectionRequestPacket(Packet packet, NetworkConnection clientConnection) { if (Array.IndexOf(clientConnections, clientConnection) > -1 || pendingConnections.Contains(clientConnection)) { return; } pendingConnections.Add(clientConnection); PacketChallengeRequest packetChallengeRequest = new PacketChallengeRequest(); SendPacket(packetChallengeRequest, clientConnection); }
private void ParseChallengeRequestPacket(Packet packet) { PacketChallengeRequest parsePacket = (PacketChallengeRequest)packet; PacketChallengeResponse response = new PacketChallengeResponse(); response.clientId = clientId; response.username = ClientData.Username; response.playerName = ClientData.PlayerName; response.playerAccountBalance = ClientData.AccountBalance; state = (int)States.ChallengeResponse; SendPacket(response); }