From 6c54eedd18c808cd197cb16301fd08887713037a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Sep 2014 17:55:47 +0300 Subject: Move processCharCreate from ea namespace into eathena and tmwa. --- src/net/tmwa/charserverhandler.cpp | 20 ++++++++++++++++++++ src/net/tmwa/charserverhandler.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 305add158..4167a3620 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -28,6 +28,8 @@ #include "being/attributes.h" +#include "gui/windows/charcreatedialog.h" + #include "net/character.h" #include "net/logindata.h" #include "net/net.h" @@ -429,4 +431,22 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg) BLOCK_END("CharServerHandler::processChangeMapServer") } +void CharServerHandler::processCharCreate(Net::MessageIn &msg) +{ + BLOCK_START("CharServerHandler::processCharCreate") + Net::Character *const character = new Net::Character; + readPlayerData(msg, character, msg.getId() == SMSG_CHAR_CREATE_SUCCEEDED2); + mCharacters.push_back(character); + + updateCharSelectDialog(); + + // Close the character create dialog + if (mCharCreateDialog) + { + mCharCreateDialog->scheduleDelete(); + mCharCreateDialog = nullptr; + } + BLOCK_END("CharServerHandler::processCharCreate") +} + } // namespace TmwAthena diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 757474c4c..02e732bc8 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -73,6 +73,8 @@ class CharServerHandler final : public MessageHandler, void readPlayerData(Net::MessageIn &msg, Net::Character *const character, const bool withColors) const override final; + + void processCharCreate(Net::MessageIn &msg); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2