summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/charserverhandler.cpp3
-rw-r--r--src/net/tmwa/charserverhandler.cpp25
-rw-r--r--src/net/tmwa/charserverhandler.h2
3 files changed, 26 insertions, 4 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 771a9128b..d7d7be582 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -101,7 +101,6 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
break;
case SMSG_CHAR_CREATE_SUCCEEDED:
- case SMSG_CHAR_CREATE_SUCCEEDED2:
processCharCreate(msg);
break;
@@ -443,7 +442,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();
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