Ejemplo n.º 1
0
        /// <summary>
        /// Handles incoming packets from connected clients.
        /// </summary>
        private void m_Listener_OnReceiveEvent(PacketStream P, LoginClient Client)
        {
            byte ID = (byte)P.ReadByte();

            switch (ID)
            {
            case 0x00:
                PacketHandlers.HandleLoginRequest(P, ref Client);
                break;

            case 0x05:
                PacketHandlers.HandleCharacterInfoRequest(P, Client);
                break;

            case 0x06:
                PacketHandlers.HandleCityInfoRequest(P, Client);
                break;

            case 0x07:
                PacketHandlers.HandleCharacterCreate(P, ref Client, ref NetworkFacade.CServerListener);
                break;

            default:
                Logger.LogInfo("Received unhandled packet - ID: " + P.PacketID);
                break;
            }
        }