From 94366099f9019643c9e431a35af064283fab5a0c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 5 Nov 2018 23:37:03 +0300 Subject: Add interface for packets in common. For now supported only packet length fields. --- src/login/HPMlogin.c | 1 + src/login/lclif.c | 4 ++-- src/login/lclif.p.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/login') 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. }; /** -- cgit v1.2.3-70-g09d2