public static void ProcessPacket(WorldClient Client, string Packet)
        {
            switch (Packet[1])
            {
            case 'A':     // Creation
                CharacterSelectionHandler.ProcessCharacterCreationRequest(Client, Packet);
                break;

            case 'D':     // Delete
                CharacterSelectionHandler.ProcessCharacterDeletionRequest(Client, Packet);
                break;

            case 'L':     // List
                CharacterSelectionHandler.ProcessCharactersListRequest(Client);
                break;

            case 'S':     // Selection
                CharacterSelectionHandler.ProcessCharacterSelectionRequest(Client, Packet);
                break;

            case 'P':
                CharacterSelectionHandler.ProcessCharactersGenerateName(Client);
                break;

            case 'R':
                //CharacterSelectionHandler.ProcessCharacterResetResquest(Client, Packet);
                break;

            case 'f':
                CharacterSelectionHandler.ProcessQueueMessage(Client);
                break;
            }
        }
Esempio n. 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());
            }
        }