Пример #1
0
        public static void ProcessPacket(WorldClient Client, string Packet)
        {
            switch (Packet)
            {
            case "DB":
                BasicHandler.ProcessBasicDateRequest(Client);
                break;

            case "GC1":
                GameCreateHandler.ProcessGameCreateRequest(Client);
                break;
            }
            if (Packet.StartsWith("FRGE"))
            {
                Client.hasFightMessage = true;
            }
        }
Пример #2
0
        public static void ProcessPacket(WorldClient Client, string Packet)
        {
            try
            {
                switch (Client.GetState())
                {
                case WorldState.STATE_NON_AUTHENTIFIED:
                    AuthHandler.ProcessAuth(Client, Packet);
                    break;

                case WorldState.STATE_AUTHENTIFIED:
                    CharacterScreenHandler.ProcessPacket(Client, Packet);
                    break;

                case WorldState.STATE_CHARACTER_SELECTION:
                    CharacterSelectionHandler.ProcessPacket(Client, Packet);
                    break;

                case WorldState.STATE_GAME_CREATE:
                    GameCreateHandler.ProcessPacket(Client, Packet);
                    break;

                case WorldState.STATE_GAME_INFORMATION:
                    GameInformationHandler.ProcessPacket(Client, Packet);
                    break;

                case WorldState.STATE_IN_GAME:
                    GameHandler.ProcessPacket(Client, Packet);
                    break;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("PacketProcessor::ProcessPacket() unknow error " + ex.ToString());
            }
        }