summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 16:44:28 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:20 +0300
commit008bf570587fb34382cca58e8d3fd909c9a621f8 (patch)
tree379cdc38fd158cbd661ba51425d9c22b1d24aba8 /src/net/eathena
parent41238c8f7ab88b2f3ef51a5e1ead58d3ba505c5b (diff)
downloadmv-008bf570587fb34382cca58e8d3fd909c9a621f8.tar.gz
mv-008bf570587fb34382cca58e8d3fd909c9a621f8.tar.bz2
mv-008bf570587fb34382cca58e8d3fd909c9a621f8.tar.xz
mv-008bf570587fb34382cca58e8d3fd909c9a621f8.zip
move virtual member calls from messagein constuctor into postInit.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/messagein.cpp4
-rw-r--r--src/net/eathena/messagein.h2
-rw-r--r--src/net/eathena/network.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index 221a782bb..bd24d8d04 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -38,6 +38,10 @@ namespace EAthena
MessageIn::MessageIn(const char *const data, const unsigned int length) :
Net::MessageIn(data, length)
{
+}
+
+void MessageIn::postInit()
+{
// Read the message ID
mId = readInt16();
}
diff --git a/src/net/eathena/messagein.h b/src/net/eathena/messagein.h
index a73e4c93b..377ab7b33 100644
--- a/src/net/eathena/messagein.h
+++ b/src/net/eathena/messagein.h
@@ -45,6 +45,8 @@ class MessageIn final : public Net::MessageIn
A_DELETE_COPY(MessageIn)
+ void postInit();
+
int16_t readInt16(); /**< Reads a short. */
int32_t readInt32(); /**< Reads a long. */
};
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 481a945ba..9fde34fd0 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -183,6 +183,7 @@ void Network::dispatchMessages()
len = readWord(2);
MessageIn msg(mInBuffer, len);
+ msg.postInit();
SDL_mutexV(mMutexIn);
if (len == 0)