public void CheckPacket(byte[] data, AuthClient client) { this.pkt = new Packet(); pkt.SetData(data); this.client = client; switch((PacketOpcodes)pkt.Opcode) { case PacketOpcodes.SYS_ALIVE: /* TO SKIP LOGGING THIS PACKET */ break; case PacketOpcodes.SYS_HANDSHAKE_RES: client.SendHandShakeRes(); break; case PacketOpcodes.UA_LOGIN_REQ: client.SendLoginResponse(data); break; case PacketOpcodes.UA_LOGIN_DISCONNECT_REQ: client.SendLoginDisconnectResponse(); break; default: SysCons.WriteLine("Recv Unknow Packet Len({0}) Enc({1}) Opcode({2})", pkt.Lenght, pkt.Encrypt, pkt.Opcode); SysCons.SavePacket(pkt.Data, pkt.Opcode); break; } }
private void AuthServ_OnDisconnect(object sender, ClientEventArgs e) { AuthClient client = ((AuthClient)e.Client.User); SysCons.LogInfo("Client disconnected: {0}", e.Client.ToString()); }