summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-05 23:37:03 +0300
committerAndrei Karas <akaras@inbox.ru>2018-11-14 06:00:50 +0300
commit94366099f9019643c9e431a35af064283fab5a0c (patch)
tree809e747ca8bf89cf63ed4643ee348f7a40e74d6c /src/login
parent77841351959658c576d1087dfdcc6ea0886ade20 (diff)
downloadhercules-94366099f9019643c9e431a35af064283fab5a0c.tar.gz
hercules-94366099f9019643c9e431a35af064283fab5a0c.tar.bz2
hercules-94366099f9019643c9e431a35af064283fab5a0c.tar.xz
hercules-94366099f9019643c9e431a35af064283fab5a0c.zip
Add interface for packets in common.
For now supported only packet length fields.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/HPMlogin.c1
-rw-r--r--src/login/lclif.c4
-rw-r--r--src/login/lclif.p.h4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c
index c13bd96a3..e5dc126eb 100644
--- a/src/login/HPMlogin.c
+++ b/src/login/HPMlogin.c
@@ -41,6 +41,7 @@
#include "common/memmgr.h"
#include "common/mutex.h"
#include "common/mmo.h"
+#include "common/packets.h"
#include "common/nullpo.h"
#include "common/random.h"
#include "common/showmsg.h"
diff --git a/src/login/lclif.c b/src/login/lclif.c
index 48a9c6b94..1cb8bfdbd 100644
--- a/src/login/lclif.c
+++ b/src/login/lclif.c
@@ -479,7 +479,7 @@ static const struct login_packet_db *lclif_packet(int16 packet_id)
if (packet_id == PACKET_ID_CA_CHARSERVERCONNECT)
return &lclif->p->dbs->packet_db[0];
- if (packet_id > MAX_PACKET_DB || packet_id < MIN_PACKET_DB)
+ if (packet_id > MAX_PACKET_LOGIN_DB || packet_id < MIN_PACKET_DB)
return NULL;
return &lclif->p->dbs->packet_db[packet_id];
@@ -525,7 +525,7 @@ static void packetdb_loaddb(void)
for (i = 0; i < length; ++i) {
int16 packet_id = packet[i].packet_id;
- Assert_retb(packet_id >= MIN_PACKET_DB && packet_id <= MAX_PACKET_DB);
+ Assert_retb(packet_id >= MIN_PACKET_DB && packet_id <= MAX_PACKET_LOGIN_DB);
lclif->p->dbs->packet_db[packet_id].len = packet[i].packet_len;
lclif->p->dbs->packet_db[packet_id].pFunc = packet[i].pFunc;
}
diff --git a/src/login/lclif.p.h b/src/login/lclif.p.h
index 7fa8475f4..a80caafa2 100644
--- a/src/login/lclif.p.h
+++ b/src/login/lclif.p.h
@@ -35,7 +35,7 @@
// Packet DB
#define MIN_PACKET_DB 0x0064
-#define MAX_PACKET_DB 0x0acf
+#define MAX_PACKET_LOGIN_DB 0x0acf
/* Enums */
@@ -309,7 +309,7 @@ struct packet_AC_ACK_HASH {
* Login Client Interface additional data
*/
struct lclif_interface_dbs {
- struct login_packet_db packet_db[MAX_PACKET_DB + 1]; ///< Packet database.
+ struct login_packet_db packet_db[MAX_PACKET_LOGIN_DB + 1]; ///< Packet database.
};
/**