summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/messagein.cpp4
-rw-r--r--src/net/tmwa/messagein.h2
-rw-r--r--src/net/tmwa/network.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index dac641414..4d8b334f3 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -38,6 +38,10 @@ namespace TmwAthena
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/tmwa/messagein.h b/src/net/tmwa/messagein.h
index a17260177..50afff011 100644
--- a/src/net/tmwa/messagein.h
+++ b/src/net/tmwa/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/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 515b66c89..8fe89ac52 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -156,6 +156,7 @@ void Network::dispatchMessages()
len = readWord(2);
MessageIn msg(mInBuffer, len);
+ msg.postInit();
SDL_mutexV(mMutexIn);
BLOCK_END("Network::dispatchMessages 2")
BLOCK_START("Network::dispatchMessages 3")