summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-13 18:06:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-13 18:06:59 +0300
commit71e2ff27012ea70955388cfb7c6c760028711eac (patch)
tree3549850970318563e1fd369ba825edadb9a0ac53 /src/net/tmwa
parent5d92f01a20948ad20868e50a28830186c9cd1546 (diff)
downloadmanaverse-71e2ff27012ea70955388cfb7c6c760028711eac.tar.gz
manaverse-71e2ff27012ea70955388cfb7c6c760028711eac.tar.bz2
manaverse-71e2ff27012ea70955388cfb7c6c760028711eac.tar.xz
manaverse-71e2ff27012ea70955388cfb7c6c760028711eac.zip
Split processCharCreate for each packet type.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp25
-rw-r--r--src/net/tmwa/charserverhandler.h2
2 files changed, 25 insertions, 2 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 4167a3620..3fed3b568 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -94,10 +94,13 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
break;
case SMSG_CHAR_CREATE_SUCCEEDED:
- case SMSG_CHAR_CREATE_SUCCEEDED2:
processCharCreate(msg);
break;
+ case SMSG_CHAR_CREATE_SUCCEEDED2:
+ processCharCreate2(msg);
+ break;
+
case SMSG_CHAR_CREATE_FAILED:
processCharCreateFailed(msg);
break;
@@ -435,7 +438,7 @@ 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);
+ readPlayerData(msg, character, false);
mCharacters.push_back(character);
updateCharSelectDialog();
@@ -449,4 +452,22 @@ void CharServerHandler::processCharCreate(Net::MessageIn &msg)
BLOCK_END("CharServerHandler::processCharCreate")
}
+void CharServerHandler::processCharCreate2(Net::MessageIn &msg)
+{
+ BLOCK_START("CharServerHandler::processCharCreate2")
+ Net::Character *const character = new Net::Character;
+ readPlayerData(msg, character, true);
+ mCharacters.push_back(character);
+
+ updateCharSelectDialog();
+
+ // Close the character create dialog
+ if (mCharCreateDialog)
+ {
+ mCharCreateDialog->scheduleDelete();
+ mCharCreateDialog = nullptr;
+ }
+ BLOCK_END("CharServerHandler::processCharCreate2")
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 02e732bc8..b8cb5182e 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -75,6 +75,8 @@ class CharServerHandler final : public MessageHandler,
const bool withColors) const override final;
void processCharCreate(Net::MessageIn &msg);
+
+ void processCharCreate2(Net::MessageIn &msg);
};
} // namespace TmwAthena