summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/network.cpp16
-rw-r--r--src/net/eathena/packetsin.inc2
2 files changed, 6 insertions, 12 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index ed6f6f1f7..75a737ad2 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -38,8 +38,7 @@
namespace EAthena
{
-static const unsigned int packet_lengths_size
- = static_cast<unsigned int>(sizeof(packet_lengths) / sizeof(int16_t));
+static const unsigned int packet_lengths_size = 0xFFFFU;
static const unsigned int messagesSize = 0xFFFFU;
Network *Network::mInstance = nullptr;
@@ -103,8 +102,7 @@ void Network::dispatchMessages()
const unsigned int msgId = readWord(0);
int len = -1;
if (msgId < packet_lengths_size)
- len = packet_lengths[msgId];
-
+ len = mPackets[msgId].len;
if (len == -1)
len = readWord(2);
@@ -144,14 +142,10 @@ bool Network::messageReady()
if (mInSize >= 2)
{
const int msgId = readWord(0);
- if (msgId == SMSG_SERVER_VERSION_RESPONSE)
- {
- len = 10;
- }
- else if (msgId >= 0 && static_cast<unsigned int>(msgId)
- < packet_lengths_size)
+ if (msgId >= 0 &&
+ static_cast<unsigned int>(msgId) < packet_lengths_size)
{
- len = packet_lengths[msgId];
+ len = mPackets[msgId].len;
}
if (len == -1 && mInSize > 4)
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index fc90d90e0..54f1ad2b9 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -381,7 +381,7 @@ packet(SMSG_SEARCHSTORE_OPEN, 0x083a, 5);
packet(SMSG_SEARCHSTORE_SEARCH_ACK, 0x0836, 0);
packet(SMSG_SEARCHSTORE_SEARCH_FAILED, 0x0837, 0);
packet(SMSG_SERVER_PING, 0x007f, 6);
-packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, 10);
+packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, -1);
packet(SMSG_SKILL_ARROW_CREATE_LIST, 0x01ad, -1);
packet(SMSG_SKILL_AUTO_CAST, 0x0147, 39);
packet(SMSG_SKILL_CASTING, 0x07fb, 25);