예제 #1
0
        private void LobbyServer_OnDisconnect(object sender, ClientEventArgs e)
        {
            CharClient client = ((CharClient)e.Client.User);

            SysCons.LogInfo("Client disconnected: {0}", e.Client.ToString());
        }
예제 #2
0
        public void CheckPacket(byte[] data, CharClient 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.UC_LOGIN_REQ: client.SendLoginResponse(data); break;
                case PacketOpcodes.UC_CHARACTER_SERVERLIST_REQ: client.SendServerList(false); break;
                case PacketOpcodes.UC_CHARACTER_SERVERLIST_ONE_REQ: client.SendServerList(true); break;
                case PacketOpcodes.UC_CHARACTER_LOAD_REQ: client.SendCharacterLoad(data); 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;
            }
        }