summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-07 01:55:40 -0300
committershennetsind <ind@henn.et>2013-04-07 01:55:40 -0300
commit2f9f7ce4aa46514c9173a3c91f4033b25901520e (patch)
treeec5656a546bcaf6d7820c3de252b63070d32b887 /src/map
parent10b53b9fbc011a9224d118414517870af3e9e20c (diff)
downloadhercules-2f9f7ce4aa46514c9173a3c91f4033b25901520e.tar.gz
hercules-2f9f7ce4aa46514c9173a3c91f4033b25901520e.tar.bz2
hercules-2f9f7ce4aa46514c9173a3c91f4033b25901520e.tar.xz
hercules-2f9f7ce4aa46514c9173a3c91f4033b25901520e.zip
PacketDB Overhaul
Feature Design by GreenBox Special Thanks to mkbu95 for bringing this topic up! (packet db) http://hercules.ws/board/topic/353-packetdb-overhaul/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/Makefile.in2
-rw-r--r--src/map/atcommand.c10
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c1416
-rw-r--r--src/map/clif.h10
-rw-r--r--src/map/packets.h2063
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/sql/CMakeLists.txt1
10 files changed, 2423 insertions, 1086 deletions
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index d2c9d63d0..a49a6edb4 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -27,7 +27,7 @@ MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
log.h mail.h date.h unit.h homunculus.h mercenary.h quest.h instance.h mapreg.h \
buyingstore.h searchstore.h duel.h pc_groups.h \
../config/core.h ../config/renewal.h ../config/secure.h ../config/const.h \
- ../config/classes/general.h elemental.h
+ ../config/classes/general.h elemental.h packets.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7fc998628..9dccef177 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -258,12 +258,12 @@ ACMD_FUNC(send)
if(len)
{// show packet length
- sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
+ sprintf(atcmd_output, msg_txt(904), type, packet_db[type].len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
return 0;
}
- len=packet_db[sd->packet_ver][type].len;
+ len=packet_db[type].len;
off=2;
if(len == 0)
{// unknown packet - ERROR
@@ -414,12 +414,10 @@ ACMD_FUNC(send)
SKIP_VALUE(message);
}
- if(packet_db[sd->packet_ver][type].len == -1)
- {// send dynamic packet
+ if(packet_db[type].len == -1) {// send dynamic packet
WFIFOW(fd,2)=TOW(off);
WFIFOSET(fd,off);
- } else
- {// send static packet
+ } else {// send static packet
if(off < len)
memset(WFIFOP(fd,off),0,len-off);
WFIFOSET(fd,len);
diff --git a/src/map/battle.c b/src/map/battle.c
index 1b9d5a94b..1abcaa19e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5720,7 +5720,6 @@ static const struct _battle_data {
{ "night_at_start", &battle_config.night_at_start, 0, 0, 1, },
{ "show_mob_info", &battle_config.show_mob_info, 0, 0, 1|2|4, },
{ "ban_hack_trade", &battle_config.ban_hack_trade, 0, 0, INT_MAX, },
- { "packet_ver_flag", &battle_config.packet_ver_flag, 0xFFFFFF,0x0000,INT_MAX, },
{ "min_hair_style", &battle_config.min_hair_style, 0, 0, INT_MAX, },
{ "max_hair_style", &battle_config.max_hair_style, 23, 0, INT_MAX, },
{ "min_hair_color", &battle_config.min_hair_color, 0, 0, INT_MAX, },
diff --git a/src/map/battle.h b/src/map/battle.h
index cd07e25f9..54f941de8 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -302,7 +302,6 @@ struct Battle_Config {
int day_duration; // added by [Yor]
int night_duration; // added by [Yor]
int ban_hack_trade; // added by [Yor]
- int packet_ver_flag; // added by [Yor]
int min_hair_style; // added by [MouseJstr]
int max_hair_style; // added by [MouseJstr]
diff --git a/src/map/clif.c b/src/map/clif.c
index 0ee3de1f2..63e72b3bb 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -54,11 +54,6 @@
//#define DUMP_UNKNOWN_PACKET
//#define DUMP_INVALID_PACKET
-struct Clif_Config {
- int packet_db_ver; //Preferred packet version.
- int connect_cmd[MAX_PACKET_VER + 1]; //Store the connect command for all versions. [Skotlex]
-} clif_config;
-
//Converts item type in case of pet eggs.
static inline int itemtype(int type) {
return ( type == IT_PETEGG ) ? IT_WEAPON : type;
@@ -314,10 +309,8 @@ int clif_send_sub(struct block_list *bl, va_list ap) {
return 0;
}
- if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
- memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET(fd,len);
- }
+ memcpy(WFIFOP(fd,0), buf, len);
+ WFIFOSET(fd,len);
return 0;
}
@@ -342,245 +335,221 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
switch(type) {
- case ALL_CLIENT: //All player clients.
- iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
- if( packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version
+ case ALL_CLIENT: //All player clients.
+ iter = mapit_getallusers();
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
WFIFOHEAD(tsd->fd, len);
memcpy(WFIFOP(tsd->fd,0), buf, len);
WFIFOSET(tsd->fd,len);
}
- }
- mapit_free(iter);
- break;
+ mapit_free(iter);
+ break;
- case ALL_SAMEMAP: //All players on the same map
- iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
- if( bl->m == tsd->bl.m && packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version
- WFIFOHEAD(tsd->fd, len);
- memcpy(WFIFOP(tsd->fd,0), buf, len);
- WFIFOSET(tsd->fd,len);
+ case ALL_SAMEMAP: //All players on the same map
+ iter = mapit_getallusers();
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( bl->m == tsd->bl.m ) {
+ WFIFOHEAD(tsd->fd, len);
+ memcpy(WFIFOP(tsd->fd,0), buf, len);
+ WFIFOSET(tsd->fd,len);
+ }
}
- }
- mapit_free(iter);
- break;
+ mapit_free(iter);
+ break;
- case AREA:
- case AREA_WOSC:
- if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
- clif->send (buf, len, bl, SELF);
- case AREA_WOC:
- case AREA_WOS:
- map_foreachinarea(clif->send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
- BL_PC, buf, len, bl, type);
- break;
- case AREA_CHAT_WOC:
- map_foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
- bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
- break;
+ case AREA:
+ case AREA_WOSC:
+ if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
+ clif->send (buf, len, bl, SELF);
+ case AREA_WOC:
+ case AREA_WOS:
+ map_foreachinarea(clif->send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
+ BL_PC, buf, len, bl, type);
+ break;
+ case AREA_CHAT_WOC:
+ map_foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
+ bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
+ break;
- case CHAT:
- case CHAT_WOS:
- {
- struct chat_data *cd;
- if (sd) {
- cd = (struct chat_data*)map_id2bl(sd->chatID);
- } else if (bl->type == BL_CHAT) {
- cd = (struct chat_data*)bl;
- } else break;
- if (cd == NULL)
- break;
- for(i = 0; i < cd->users; i++) {
- if (type == CHAT_WOS && cd->usersd[i] == sd)
- continue;
- if (packet_db[cd->usersd[i]->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
- if ((fd=cd->usersd[i]->fd) >0 && session[fd]) // Added check to see if session exists [PoW]
- {
+ case CHAT:
+ case CHAT_WOS:
+ {
+ struct chat_data *cd;
+ if (sd) {
+ cd = (struct chat_data*)map_id2bl(sd->chatID);
+ } else if (bl->type == BL_CHAT) {
+ cd = (struct chat_data*)bl;
+ } else break;
+ if (cd == NULL)
+ break;
+ for(i = 0; i < cd->users; i++) {
+ if (type == CHAT_WOS && cd->usersd[i] == sd)
+ continue;
+ if ((fd=cd->usersd[i]->fd) >0 && session[fd]) { // Added check to see if session exists [PoW]
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
WFIFOSET(fd,len);
}
}
}
- }
- break;
+ break;
- case PARTY_AREA:
- case PARTY_AREA_WOS:
- x0 = bl->x - AREA_SIZE;
- y0 = bl->y - AREA_SIZE;
- x1 = bl->x + AREA_SIZE;
- y1 = bl->y + AREA_SIZE;
- case PARTY:
- case PARTY_WOS:
- case PARTY_SAMEMAP:
- case PARTY_SAMEMAP_WOS:
- if (sd && sd->status.party_id)
- p = party_search(sd->status.party_id);
-
- if (p) {
- for(i=0;i<MAX_PARTY;i++){
- if( (sd = p->data[i].sd) == NULL )
- continue;
+ case PARTY_AREA:
+ case PARTY_AREA_WOS:
+ x0 = bl->x - AREA_SIZE;
+ y0 = bl->y - AREA_SIZE;
+ x1 = bl->x + AREA_SIZE;
+ y1 = bl->y + AREA_SIZE;
+ case PARTY:
+ case PARTY_WOS:
+ case PARTY_SAMEMAP:
+ case PARTY_SAMEMAP_WOS:
+ if (sd && sd->status.party_id)
+ p = party_search(sd->status.party_id);
+
+ if (p) {
+ for(i=0;i<MAX_PARTY;i++){
+ if( (sd = p->data[i].sd) == NULL )
+ continue;
- if( !(fd=sd->fd) )
- continue;
+ if( !(fd=sd->fd) )
+ continue;
- if( sd->bl.id == bl->id && (type == PARTY_WOS || type == PARTY_SAMEMAP_WOS || type == PARTY_AREA_WOS) )
- continue;
+ if( sd->bl.id == bl->id && (type == PARTY_WOS || type == PARTY_SAMEMAP_WOS || type == PARTY_AREA_WOS) )
+ continue;
- if( type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
- continue;
+ if( type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
+ continue;
- if( (type == PARTY_AREA || type == PARTY_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
- continue;
+ if( (type == PARTY_AREA || type == PARTY_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
+ continue;
- if( packet_db[sd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
WFIFOSET(fd,len);
}
+ if (!enable_spy) //Skip unnecessary parsing. [Skotlex]
+ break;
+
+ iter = mapit_getallusers();
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( tsd->partyspy == p->party.party_id ) {
+ WFIFOHEAD(tsd->fd, len);
+ memcpy(WFIFOP(tsd->fd,0), buf, len);
+ WFIFOSET(tsd->fd,len);
+ }
+ }
+ mapit_free(iter);
}
- if (!enable_spy) //Skip unnecessary parsing. [Skotlex]
- break;
+ break;
+
+ case DUEL:
+ case DUEL_WOS:
+ if (!sd || !sd->duel_group) break; //Invalid usage.
iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL )
- {
- if( tsd->partyspy == p->party.party_id && packet_db[tsd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( type == DUEL_WOS && bl->id == tsd->bl.id )
+ continue;
+ if( sd->duel_group == tsd->duel_group ) {
WFIFOHEAD(tsd->fd, len);
memcpy(WFIFOP(tsd->fd,0), buf, len);
WFIFOSET(tsd->fd,len);
}
}
mapit_free(iter);
- }
- break;
-
- case DUEL:
- case DUEL_WOS:
- if (!sd || !sd->duel_group) break; //Invalid usage.
+ break;
- iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL )
- {
- if( type == DUEL_WOS && bl->id == tsd->bl.id )
- continue;
- if( sd->duel_group == tsd->duel_group && packet_db[tsd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
- WFIFOHEAD(tsd->fd, len);
- memcpy(WFIFOP(tsd->fd,0), buf, len);
- WFIFOSET(tsd->fd,len);
+ case SELF:
+ if (sd && (fd=sd->fd) ) {
+ WFIFOHEAD(fd,len);
+ memcpy(WFIFOP(fd,0), buf, len);
+ WFIFOSET(fd,len);
}
- }
- mapit_free(iter);
- break;
-
- case SELF:
- if (sd && (fd=sd->fd) && packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
- WFIFOHEAD(fd,len);
- memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET(fd,len);
- }
- break;
-
- // New definitions for guilds [Valaris] - Cleaned up and reorganized by [Skotlex]
- case GUILD_AREA:
- case GUILD_AREA_WOS:
- x0 = bl->x - AREA_SIZE;
- y0 = bl->y - AREA_SIZE;
- x1 = bl->x + AREA_SIZE;
- y1 = bl->y + AREA_SIZE;
- case GUILD_SAMEMAP:
- case GUILD_SAMEMAP_WOS:
- case GUILD:
- case GUILD_WOS:
- case GUILD_NOBG:
- if (sd && sd->status.guild_id)
- g = sd->guild;
-
- if (g) {
- for(i = 0; i < g->max_member; i++) {
- if( (sd = g->member[i].sd) != NULL )
- {
- if( !(fd=sd->fd) )
- continue;
-
- if( type == GUILD_NOBG && sd->bg_id )
- continue;
-
- if( sd->bl.id == bl->id && (type == GUILD_WOS || type == GUILD_SAMEMAP_WOS || type == GUILD_AREA_WOS) )
- continue;
-
- if( type != GUILD && type != GUILD_NOBG && type != GUILD_WOS && sd->bl.m != bl->m )
- continue;
-
- if( (type == GUILD_AREA || type == GUILD_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
- continue;
+ break;
- if( packet_db[sd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
+ // New definitions for guilds [Valaris] - Cleaned up and reorganized by [Skotlex]
+ case GUILD_AREA:
+ case GUILD_AREA_WOS:
+ x0 = bl->x - AREA_SIZE;
+ y0 = bl->y - AREA_SIZE;
+ x1 = bl->x + AREA_SIZE;
+ y1 = bl->y + AREA_SIZE;
+ case GUILD_SAMEMAP:
+ case GUILD_SAMEMAP_WOS:
+ case GUILD:
+ case GUILD_WOS:
+ case GUILD_NOBG:
+ if (sd && sd->status.guild_id)
+ g = sd->guild;
+
+ if (g) {
+ for(i = 0; i < g->max_member; i++) {
+ if( (sd = g->member[i].sd) != NULL ) {
+ if( !(fd=sd->fd) )
+ continue;
+
+ if( type == GUILD_NOBG && sd->bg_id )
+ continue;
+
+ if( sd->bl.id == bl->id && (type == GUILD_WOS || type == GUILD_SAMEMAP_WOS || type == GUILD_AREA_WOS) )
+ continue;
+
+ if( type != GUILD && type != GUILD_NOBG && type != GUILD_WOS && sd->bl.m != bl->m )
+ continue;
+
+ if( (type == GUILD_AREA || type == GUILD_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
+ continue;
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
WFIFOSET(fd,len);
}
}
- }
- if (!enable_spy) //Skip unnecessary parsing. [Skotlex]
- break;
+ if (!enable_spy) //Skip unnecessary parsing. [Skotlex]
+ break;
- iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL )
- {
- if( tsd->guildspy == g->guild_id && packet_db[tsd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
- WFIFOHEAD(tsd->fd, len);
- memcpy(WFIFOP(tsd->fd,0), buf, len);
- WFIFOSET(tsd->fd,len);
+ iter = mapit_getallusers();
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( tsd->guildspy == g->guild_id ) {
+ WFIFOHEAD(tsd->fd, len);
+ memcpy(WFIFOP(tsd->fd,0), buf, len);
+ WFIFOSET(tsd->fd,len);
+ }
}
+ mapit_free(iter);
}
- mapit_free(iter);
- }
- break;
+ break;
- case BG_AREA:
- case BG_AREA_WOS:
- x0 = bl->x - AREA_SIZE;
- y0 = bl->y - AREA_SIZE;
- x1 = bl->x + AREA_SIZE;
- y1 = bl->y + AREA_SIZE;
- case BG_SAMEMAP:
- case BG_SAMEMAP_WOS:
- case BG:
- case BG_WOS:
- if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL )
- {
- for( i = 0; i < MAX_BG_MEMBERS; i++ )
- {
- if( (sd = bg->members[i].sd) == NULL || !(fd = sd->fd) )
- continue;
- if( sd->bl.id == bl->id && (type == BG_WOS || type == BG_SAMEMAP_WOS || type == BG_AREA_WOS) )
- continue;
- if( type != BG && type != BG_WOS && sd->bl.m != bl->m )
- continue;
- if( (type == BG_AREA || type == BG_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
- continue;
- if( packet_db[sd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
+ case BG_AREA:
+ case BG_AREA_WOS:
+ x0 = bl->x - AREA_SIZE;
+ y0 = bl->y - AREA_SIZE;
+ x1 = bl->x + AREA_SIZE;
+ y1 = bl->y + AREA_SIZE;
+ case BG_SAMEMAP:
+ case BG_SAMEMAP_WOS:
+ case BG:
+ case BG_WOS:
+ if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL ) {
+ for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
+ if( (sd = bg->members[i].sd) == NULL || !(fd = sd->fd) )
+ continue;
+ if( sd->bl.id == bl->id && (type == BG_WOS || type == BG_SAMEMAP_WOS || type == BG_AREA_WOS) )
+ continue;
+ if( type != BG && type != BG_WOS && sd->bl.m != bl->m )
+ continue;
+ if( (type == BG_AREA || type == BG_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
+ continue;
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
WFIFOSET(fd,len);
}
}
- }
- break;
+ break;
- default:
- ShowError("clif->send: Unrecognized type %d\n",type);
- return -1;
+ default:
+ ShowError("clif->send: Unrecognized type %d\n",type);
+ return -1;
}
return 0;
@@ -8960,79 +8929,6 @@ bool clif_process_message(struct map_session_data* sd, int format, char** name_,
return true;
}
-// ---------------------
-// clif_guess_PacketVer
-// ---------------------
-// Parses a WantToConnection packet to try to identify which is the packet version used. [Skotlex]
-// error codes:
-// 0 - Success
-// 1 - Unknown packet_ver
-// 2 - Invalid account_id
-// 3 - Invalid char_id
-// 4 - Invalid login_id1 (reserved)
-// 5 - Invalid client_tick (reserved)
-// 6 - Invalid sex
-// Only the first 'invalid' error that appears is used.
-int clif_guess_PacketVer(int fd, int get_previous, int *error) {
- static int err = 1;
- static int packet_ver = -1;
- int cmd, packet_len, value; //Value is used to temporarily store account/char_id/sex
-
- if (get_previous)
- {//For quick reruns, since the normal code flow is to fetch this once to identify the packet version, then again in the wanttoconnect function. [Skotlex]
- if( error )
- *error = err;
- return packet_ver;
- }
-
- //By default, start searching on the default one.
- err = 1;
- packet_ver = clif_config.packet_db_ver;
- cmd = RFIFOW(fd,0);
- packet_len = RFIFOREST(fd);
-
-#define SET_ERROR(n) \
- if( err == 1 )\
- err = n;\
-//define SET_ERROR
-
- // FIXME: If the packet is not received at once, this will FAIL.
- // Figure out, when it happens, that only part of the packet is
- // received, or fix the function to be able to deal with that
- // case.
-#define CHECK_PACKET_VER() \
- if( cmd != clif_config.connect_cmd[packet_ver] || packet_len != packet_db[packet_ver][cmd].len )\
- ;/* not wanttoconnection or wrong length */\
- else if( (value=(int)RFIFOL(fd, packet_db[packet_ver][cmd].pos[0])) < START_ACCOUNT_NUM || value > END_ACCOUNT_NUM )\
- { SET_ERROR(2); }/* invalid account_id */\
- else if( (value=(int)RFIFOL(fd, packet_db[packet_ver][cmd].pos[1])) <= 0 )\
- { SET_ERROR(3); }/* invalid char_id */\
- /* RFIFOL(fd, packet_db[packet_ver][cmd].pos[2]) - don't care about login_id1 */\
- /* RFIFOL(fd, packet_db[packet_ver][cmd].pos[3]) - don't care about client_tick */\
- else if( (value=(int)RFIFOB(fd, packet_db[packet_ver][cmd].pos[4])) != 0 && value != 1 )\
- { SET_ERROR(6); }/* invalid sex */\
- else\
- {\
- err = 0;\
- if( error )\
- *error = 0;\
- return packet_ver;\
- }\
-//define CHECK_PACKET_VER
-
- CHECK_PACKET_VER();//Default packet version found.
-
- for (packet_ver = MAX_PACKET_VER; packet_ver > 0; packet_ver--) { //Start guessing the version, giving priority to the newer ones. [Skotlex]
- CHECK_PACKET_VER();
- }
- if( error )
- *error = err;
- packet_ver = -1;
- return -1;
-#undef SET_ERROR
-#undef CHECK_PACKET_VER
-}
-
void clif_hercules_chsys_msg(struct hChSysCh *channel, struct map_session_data *sd, char *msg) {
DBIterator *iter = db_iterator(channel->users);
struct map_session_data *user;
@@ -9068,13 +8964,11 @@ void clif_hercules_chsys_msg(struct hChSysCh *channel, struct map_session_data *
/// 0072 <account id>.L <char id>.L <auth code>.L <client time>.L <gender>.B (CZ_ENTER)
/// 0436 <account id>.L <char id>.L <auth code>.L <client time>.L <gender>.B (CZ_ENTER2)
/// There are various variants of this packet, some of them have padding between fields.
-void clif_parse_WantToConnection(int fd, struct map_session_data* sd)
-{
+void clif_parse_WantToConnection(int fd, struct map_session_data* sd) {
struct block_list* bl;
struct auth_node* node;
int cmd, account_id, char_id, login_id1, sex;
unsigned int client_tick; //The client tick is a tick, therefore it needs be unsigned. [Skotlex]
- int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 (by [Yor])
if (sd) {
ShowError("clif_parse_WantToConnection : invalid request (character already logged in)\n");
@@ -9082,27 +8976,13 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd)
}
// Only valid packet version get here
- packet_ver = clif->guess_PacketVer(fd, 1, NULL);
cmd = RFIFOW(fd,0);
- account_id = RFIFOL(fd, packet_db[packet_ver][cmd].pos[0]);
- char_id = RFIFOL(fd, packet_db[packet_ver][cmd].pos[1]);
- login_id1 = RFIFOL(fd, packet_db[packet_ver][cmd].pos[2]);
- client_tick = RFIFOL(fd, packet_db[packet_ver][cmd].pos[3]);
- sex = RFIFOB(fd, packet_db[packet_ver][cmd].pos[4]);
-
- if( packet_ver < 5 || // reject really old client versions
- (packet_ver <= 9 && (battle_config.packet_ver_flag & 1) == 0) || // older than 6sept04
- (packet_ver > 9 && (battle_config.packet_ver_flag & 1<<(packet_ver-9)) == 0)) // version not allowed
- {// packet version rejected
- ShowInfo("Rejected connection attempt, forbidden packet version (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"', Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%s"CL_RESET"').\n", account_id, char_id, packet_ver, ip2str(session[fd]->client_addr, NULL));
- WFIFOHEAD(fd,packet_len(0x6a));
- WFIFOW(fd,0) = 0x6a;
- WFIFOB(fd,2) = 5; // Your Game's EXE file is not the latest version
- WFIFOSET(fd,packet_len(0x6a));
- set_eof(fd);
- return;
- }
+ account_id = RFIFOL(fd, packet_db[cmd].pos[0]);
+ char_id = RFIFOL(fd, packet_db[cmd].pos[1]);
+ login_id1 = RFIFOL(fd, packet_db[cmd].pos[2]);
+ client_tick = RFIFOL(fd, packet_db[cmd].pos[3]);
+ sex = RFIFOB(fd, packet_db[cmd].pos[4]);
if( runflag != MAPSERVER_ST_RUNNING ) { // not allowed
clif->authfail_fd(fd,1);// server closed
@@ -9131,7 +9011,6 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd)
CREATE(sd, TBL_PC, 1);
sd->fd = fd;
- sd->packet_ver = packet_ver;
session[fd]->session_data = sd;
pc_setnewpc(sd, account_id, char_id, login_id1, client_tick, sex, fd);
@@ -9492,7 +9371,7 @@ void clif_notify_time(struct map_session_data* sd, unsigned long time) {
/// There are various variants of this packet, some of them have padding between fields.
void clif_parse_TickSend(int fd, struct map_session_data *sd)
{
- sd->client_tick = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ sd->client_tick = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
clif->notify_time(sd, gettick());
}
@@ -9532,12 +9411,12 @@ void clif_parse_Hotkey(int fd, struct map_session_data *sd) {
int cmd;
cmd = RFIFOW(fd, 0);
- idx = RFIFOW(fd, packet_db[sd->packet_ver][cmd].pos[0]);
+ idx = RFIFOW(fd, packet_db[cmd].pos[0]);
if (idx >= MAX_HOTKEYS) return;
- sd->status.hotkeys[idx].type = RFIFOB(fd, packet_db[sd->packet_ver][cmd].pos[1]);
- sd->status.hotkeys[idx].id = RFIFOL(fd, packet_db[sd->packet_ver][cmd].pos[2]);
- sd->status.hotkeys[idx].lv = RFIFOW(fd, packet_db[sd->packet_ver][cmd].pos[3]);
+ sd->status.hotkeys[idx].type = RFIFOB(fd, packet_db[cmd].pos[1]);
+ sd->status.hotkeys[idx].id = RFIFOL(fd, packet_db[cmd].pos[2]);
+ sd->status.hotkeys[idx].lv = RFIFOW(fd, packet_db[cmd].pos[3]);
#endif
}
@@ -9607,7 +9486,7 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
pc_delinvincibletimer(sd);
- RFIFOPOS(fd, packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0], &x, &y, NULL);
+ RFIFOPOS(fd, packet_db[RFIFOW(fd,0)].pos[0], &x, &y, NULL);
//Set last idle time... [Skotlex]
sd->idletime = last_tick;
@@ -9657,7 +9536,7 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd)
/// There are various variants of this packet, some of them have padding between fields.
void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd)
{
- int id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ int id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
struct block_list* bl;
//struct status_change *sc;
@@ -9838,8 +9717,8 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd)
{
unsigned char headdir, dir;
- headdir = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
- dir = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
+ headdir = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[0]);
+ dir = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[1]);
pc_setdir(sd, dir, headdir);
clif->changed_dir(&sd->bl, AREA_WOS);
@@ -9852,7 +9731,7 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd)
/// @see enum emotion_type
void clif_parse_Emotion(int fd, struct map_session_data *sd)
{
- int emoticon = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ int emoticon = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[0]);
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, NV_BASIC) >= 2) {
if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris]
@@ -10036,8 +9915,8 @@ void clif_hercules_chsys_left(struct hChSysCh *channel, struct map_session_data
void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
{
clif->pActionRequest_sub(sd,
- RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]),
- RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]),
+ RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[1]),
+ RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]),
gettick()
);
}
@@ -10239,7 +10118,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
struct flooritem_data *fitem;
int map_object_id;
- map_object_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ map_object_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
fitem = (struct flooritem_data*)map_id2bl(map_object_id);
@@ -10281,8 +10160,8 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
/// There are various variants of this packet, some of them have padding between fields.
void clif_parse_DropItem(int fd, struct map_session_data *sd)
{
- int item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
- int item_amount = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
+ int item_index = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-2;
+ int item_amount = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[1]);
for(;;) {
if (pc_isdead(sd))
@@ -10327,7 +10206,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;
- n = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
+ n = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-2;
if(n <0 || n >= MAX_INVENTORY)
return;
@@ -10949,9 +10828,9 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
int tmp, target_id;
unsigned int tick = gettick();
- skill_lv = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
- skill_id = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
- target_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[2]);
+ skill_lv = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]);
+ skill_id = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[1]);
+ target_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[2]);
if( skill_lv < 1 ) skill_lv = 1; //No clue, I have seen the client do this with guild skills :/ [Skotlex]
@@ -11129,10 +11008,10 @@ void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
return;
clif->pUseSkillToPosSub(fd, sd,
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]), //skill lv
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]), //skill num
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[2]), //pos x
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[3]), //pos y
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]), //skill lv
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[1]), //skill num
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[2]), //pos x
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[3]), //pos y
-1 //Skill more info.
);
}
@@ -11150,11 +11029,11 @@ void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd)
return;
clif->pUseSkillToPosSub(fd, sd,
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]), //Skill lv
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]), //Skill num
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[2]), //pos x
- RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[3]), //pos y
- packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[4] //skill more info
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]), //Skill lv
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[1]), //Skill num
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[2]), //pos x
+ RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[3]), //pos y
+ packet_db[RFIFOW(fd,0)].pos[4] //skill more info
);
}
@@ -11273,7 +11152,7 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
clif_menuskill_clear(sd);
return;
}
- idx = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ idx = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
skill->weaponrefine(sd, idx-2);
clif_menuskill_clear(sd);
}
@@ -11445,7 +11324,7 @@ void clif_parse_SolveCharName(int fd, struct map_session_data *sd)
{
int charid;
- charid = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ charid = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
map_reqnickdb(sd, charid);
}
@@ -11496,8 +11375,8 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd)
if (pc_istrading(sd))
return;
- item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
- item_amount = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
+ item_index = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-2;
+ item_amount = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[1]);
if (item_index < 0 || item_index >= MAX_INVENTORY || item_amount < 1)
return;
@@ -11517,8 +11396,8 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd)
{
int item_index, item_amount;
- item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-1;
- item_amount = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
+ item_index = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-1;
+ item_amount = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[1]);
if (sd->state.storage_flag == 1)
storage_storageget(sd, item_index, item_amount);
@@ -12602,7 +12481,7 @@ void clif_parse_GMRemove2(int fd, struct map_session_data* sd)
int account_id;
struct map_session_data* pl_sd;
- account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
if( (pl_sd = map_id2sd(account_id)) != NULL ) {
char command[NAME_LENGTH+8];
sprintf(command, "%cjumpto %s", atcommand_symbol, pl_sd->status.name);
@@ -12639,7 +12518,7 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd)
int account_id;
struct map_session_data* pl_sd;
- account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
if( (pl_sd = map_id2sd(account_id)) != NULL ) {
char command[NAME_LENGTH+8];
sprintf(command, "%crecall %s", atcommand_symbol, pl_sd->status.name);
@@ -13511,7 +13390,7 @@ void clif_parse_HomMoveTo(int fd, struct map_session_data *sd)
struct block_list *bl = NULL;
short x, y;
- RFIFOPOS(fd, packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1], &x, &y, NULL);
+ RFIFOPOS(fd, packet_db[RFIFOW(fd,0)].pos[1], &x, &y, NULL);
if( sd->md && sd->md->bl.id == id )
bl = &sd->md->bl; // Moving Mercenary
@@ -13563,7 +13442,7 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd)
if(!merc_is_hom_active(sd->hd))
return;
- merc_menu(sd,RFIFOB(fd,packet_db[sd->packet_ver][cmd].pos[1]));
+ merc_menu(sd,RFIFOB(fd,packet_db[cmd].pos[1]));
}
@@ -13638,10 +13517,9 @@ void clif_parse_Check(int fd, struct map_session_data *sd)
if(!pc_has_permission(sd, PC_PERM_USE_CHECK))
return;
- safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]), sizeof(charname));
+ safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[RFIFOW(fd,0)].pos[0]), sizeof(charname));
- if( ( pl_sd = map_nick2sd(charname) ) == NULL || pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
- {
+ if( ( pl_sd = map_nick2sd(charname) ) == NULL || pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) {
return;
}
@@ -15424,7 +15302,7 @@ void clif_showdigit(struct map_session_data* sd, unsigned char type, int value)
/// Graffiti.
void clif_parse_LessEffect(int fd, struct map_session_data* sd)
{
- int isLess = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ int isLess = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
sd->state.lesseffect = ( isLess != 0 );
}
@@ -15546,7 +15424,7 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
unsigned char result;
int zenylimit;
unsigned int count, packet_len;
- struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
+ struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
packet_len = RFIFOW(fd,info->pos[0]);
@@ -15679,7 +15557,7 @@ void clif_parse_ReqClickBuyingStore(int fd, struct map_session_data* sd)
{
int account_id;
- account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ account_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
buyingstore_open(sd, account_id);
}
@@ -15718,7 +15596,7 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
uint8* itemlist;
int account_id;
unsigned int count, packet_len, buyer_id;
- struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
+ struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
packet_len = RFIFOW(fd,info->pos[0]);
@@ -15834,7 +15712,7 @@ void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) {
const uint8* cardlist;
unsigned char type;
unsigned int min_price, max_price, packet_len, count, item_count, card_count;
- struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
+ struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
packet_len = RFIFOW(fd,info->pos[0]);
@@ -15982,7 +15860,7 @@ void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd
{
unsigned short nameid;
int account_id, store_id;
- struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
+ struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
account_id = RFIFOL(fd,info->pos[0]);
store_id = RFIFOL(fd,info->pos[1]);
@@ -16014,20 +15892,13 @@ void clif_parse_debug(int fd,struct map_session_data *sd) {
cmd = RFIFOW(fd,0);
if( sd ) {
- packet_len = packet_db[sd->packet_ver][cmd].len;
+ packet_len = packet_db[cmd].len;
- if( packet_len == 0 )
- {// unknown
- packet_len = RFIFOREST(fd);
- }
- else if( packet_len == -1 )
- {// variable length
+ if( packet_len == -1 ) {// variable length
packet_len = RFIFOW(fd,2); // clif_parse ensures, that this amount of data is already received
}
ShowDebug("Packet debug of 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
- }
- else
- {
+ } else {
packet_len = RFIFOREST(fd);
ShowDebug("Packet debug of 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
}
@@ -16413,753 +16284,167 @@ void clif_monster_hp_bar( struct mob_data* md, int fd ) {
* Main client packet processing function
*------------------------------------------*/
int clif_parse(int fd) {
- int cmd, packet_ver, packet_len, err;
+ int cmd, packet_len;
TBL_PC* sd;
int pnum;
//TODO apply delays or disconnect based on packet throughput [FlavioJS]
// Note: "click masters" can do 80+ clicks in 10 seconds
- for( pnum = 0; pnum < 3; ++pnum )// Limit max packets per cycle to 3 (delay packet spammers) [FlavioJS] -- This actually aids packet spammers, but stuff like /str+ gets slow without it [Ai4rei]
- { // begin main client packet processing loop
-
- sd = (TBL_PC *)session[fd]->session_data;
- if (session[fd]->flag.eof) {
- if (sd) {
- if (sd->state.autotrade) {
- //Disassociate character from the socket connection.
- session[fd]->session_data = NULL;
- sd->fd = 0;
- ShowInfo("Character '"CL_WHITE"%s"CL_RESET"' logged off (using @autotrade).\n", sd->status.name);
- } else
- if (sd->state.active) {
- // Player logout display [Valaris]
- ShowInfo("Character '"CL_WHITE"%s"CL_RESET"' logged off.\n", sd->status.name);
- clif->quitsave(fd, sd);
+ for( pnum = 0; pnum < 3; ++pnum ) { // Limit max packets per cycle to 3 (delay packet spammers) [FlavioJS] -- This actually aids packet spammers, but stuff like /str+ gets slow without it [Ai4rei]
+ // begin main client packet processing loop
+
+ sd = (TBL_PC *)session[fd]->session_data;
+ if (session[fd]->flag.eof) {
+ if (sd) {
+ if (sd->state.autotrade) {
+ //Disassociate character from the socket connection.
+ session[fd]->session_data = NULL;
+ sd->fd = 0;
+ ShowInfo("Character '"CL_WHITE"%s"CL_RESET"' logged off (using @autotrade).\n", sd->status.name);
+ } else
+ if (sd->state.active) {
+ // Player logout display [Valaris]
+ ShowInfo("Character '"CL_WHITE"%s"CL_RESET"' logged off.\n", sd->status.name);
+ clif->quitsave(fd, sd);
+ } else {
+ //Unusual logout (during log on/off/map-changer procedure)
+ ShowInfo("Player AID:%d/CID:%d logged off.\n", sd->status.account_id, sd->status.char_id);
+ map_quit(sd);
+ }
} else {
- //Unusual logout (during log on/off/map-changer procedure)
- ShowInfo("Player AID:%d/CID:%d logged off.\n", sd->status.account_id, sd->status.char_id);
- map_quit(sd);
+ ShowInfo("Closed connection from '"CL_WHITE"%s"CL_RESET"'.\n", ip2str(session[fd]->client_addr, NULL));
}
- } else {
- ShowInfo("Closed connection from '"CL_WHITE"%s"CL_RESET"'.\n", ip2str(session[fd]->client_addr, NULL));
+ do_close(fd);
+ return 0;
}
- do_close(fd);
- return 0;
- }
- if (RFIFOREST(fd) < 2)
- return 0;
+ if (RFIFOREST(fd) < 2)
+ return 0;
- cmd = RFIFOW(fd,0);
+ cmd = RFIFOW(fd,0);
- // identify client's packet version
- if (sd) {
- packet_ver = sd->packet_ver;
- } else {
- // check authentification packet to know packet version
- packet_ver = clif->guess_PacketVer(fd, 0, &err);
- if( err ) {// failed to identify packet version
- ShowInfo("clif_parse: Disconnecting session #%d with unknown packet version%s (p:0x%04x,l:%d).\n", fd, (
- err == 1 ? "" :
- err == 2 ? ", possibly for having an invalid account_id" :
- err == 3 ? ", possibly for having an invalid char_id." :
- /* Uncomment when checks are added in clif_guess_PacketVer. [FlavioJS]
- err == 4 ? ", possibly for having an invalid login_id1." :
- err == 5 ? ", possibly for having an invalid client_tick." :
- */
- err == 6 ? ", possibly for having an invalid sex." :
- ". ERROR invalid error code"), cmd, RFIFOREST(fd));
- WFIFOHEAD(fd,packet_len(0x6a));
- WFIFOW(fd,0) = 0x6a;
- WFIFOB(fd,2) = 3; // Rejected from Server
- WFIFOSET(fd,packet_len(0x6a));
-
-#ifdef DUMP_INVALID_PACKET
+ // filter out invalid / unsupported packets
+ if (cmd > MAX_PACKET_DB || packet_db[cmd].len == 0) {
+ ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x, %d bytes received), disconnecting session #%d.\n", cmd, RFIFOREST(fd), fd);
+ #ifdef DUMP_INVALID_PACKET
ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
-#endif
-
- RFIFOSKIP(fd, RFIFOREST(fd));
+ #endif
set_eof(fd);
return 0;
}
- }
- // filter out invalid / unsupported packets
- if (cmd > MAX_PACKET_DB || packet_db[packet_ver][cmd].len == 0) {
- ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x, %d bytes received), disconnecting session #%d.\n", cmd, RFIFOREST(fd), fd);
-#ifdef DUMP_INVALID_PACKET
- ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
-#endif
- set_eof(fd);
- return 0;
- }
-
- // determine real packet length
- packet_len = packet_db[packet_ver][cmd].len;
- if (packet_len == -1) { // variable-length packet
- if (RFIFOREST(fd) < 4)
- return 0;
+ // determine real packet length
+ packet_len = packet_db[cmd].len;
+ if (packet_len == -1) { // variable-length packet
+ if (RFIFOREST(fd) < 4)
+ return 0;
- packet_len = RFIFOW(fd,2);
- if (packet_len < 4 || packet_len > 32768) {
- ShowWarning("clif_parse: Received packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", cmd, packet_len, fd);
-#ifdef DUMP_INVALID_PACKET
- ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
-#endif
- set_eof(fd);
- return 0;
+ packet_len = RFIFOW(fd,2);
+ if (packet_len < 4 || packet_len > 32768) {
+ ShowWarning("clif_parse: Received packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", cmd, packet_len, fd);
+ #ifdef DUMP_INVALID_PACKET
+ ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
+ #endif
+ set_eof(fd);
+ return 0;
+ }
}
- }
- if ((int)RFIFOREST(fd) < packet_len)
- return 0; // not enough data received to form the packet
-
- if( packet_db[packet_ver][cmd].func == clif->pDebug )
- packet_db[packet_ver][cmd].func(fd, sd);
- else if( packet_db[packet_ver][cmd].func != NULL ) {
- if( !sd && packet_db[packet_ver][cmd].func != clif->pWantToConnection )
- ; //Only valid packet when there is no session
- else
- if( sd && sd->bl.prev == NULL && packet_db[packet_ver][cmd].func != clif->pLoadEndAck )
- ; //Only valid packet when player is not on a map
- else
- packet_db[packet_ver][cmd].func(fd, sd);
- }
-#ifdef DUMP_UNKNOWN_PACKET
- else {
- const char* packet_txt = "save/packet.txt";
- FILE* fp;
+ if ((int)RFIFOREST(fd) < packet_len)
+ return 0; // not enough data received to form the packet
+
+ if( packet_db[cmd].func == clif->pDebug )
+ packet_db[cmd].func(fd, sd);
+ else if( packet_db[cmd].func != NULL ) {
+ if( !sd && packet_db[cmd].func != clif->pWantToConnection )
+ ; //Only valid packet when there is no session
+ else
+ if( sd && sd->bl.prev == NULL && packet_db[cmd].func != clif->pLoadEndAck )
+ ; //Only valid packet when player is not on a map
+ else
+ packet_db[cmd].func(fd, sd);
+ }
+ #ifdef DUMP_UNKNOWN_PACKET
+ else {
+ const char* packet_txt = "save/packet.txt";
+ FILE* fp;
+
+ if( ( fp = fopen( packet_txt , "a" ) ) != NULL ) {
+ if( sd ) {
+ fprintf(fp, "Unknown packet 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
+ } else {
+ fprintf(fp, "Unknown packet 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
+ }
- if( ( fp = fopen( packet_txt , "a" ) ) != NULL ) {
- if( sd ) {
- fprintf(fp, "Unknown packet 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
+ WriteDump(fp, RFIFOP(fd,0), packet_len);
+ fprintf(fp, "\n");
+ fclose(fp);
} else {
- fprintf(fp, "Unknown packet 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
- }
+ ShowError("Failed to write '%s'.\n", packet_txt);
- WriteDump(fp, RFIFOP(fd,0), packet_len);
- fprintf(fp, "\n");
- fclose(fp);
- } else {
- ShowError("Failed to write '%s'.\n", packet_txt);
+ // Dump on console instead
+ if( sd ) {
+ ShowDebug("Unknown packet 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
+ } else {
+ ShowDebug("Unknown packet 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
+ }
- // Dump on console instead
- if( sd ) {
- ShowDebug("Unknown packet 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
- } else {
- ShowDebug("Unknown packet 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
+ ShowDump(RFIFOP(fd,0), packet_len);
}
-
- ShowDump(RFIFOP(fd,0), packet_len);
}
- }
-#endif
+ #endif
- RFIFOSKIP(fd, packet_len);
+ RFIFOSKIP(fd, packet_len);
}; // main loop end
return 0;
}
-/*==========================================
- * Reads packet_db.txt and setups its array reference
- *------------------------------------------*/
-static int packetdb_readdb(void)
-{
- FILE *fp;
- char line[1024];
- int ln=0;
- int cmd,i,j,packet_ver;
- int max_cmd=-1;
- int skip_ver = 0;
- int warned = 0;
- char *str[64],*p,*str2[64],*p2,w1[64],w2[64];
- int packet_len_table[MAX_PACKET_DB] = {
- 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0040
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#if PACKETVER <= 20081217
- 0, 0, 0, 0, 55, 17, 3, 37, 46, -1, 23, -1, 3,110, 3, 2,
-#else
- 0, 0, 0, 0, 55, 17, 3, 37, 46, -1, 23, -1, 3,114, 3, 2,
-#endif
-#if PACKETVER < 2
- 3, 28, 19, 11, 3, -1, 9, 5, 52, 51, 56, 58, 41, 2, 6, 6,
-#elif PACKETVER < 20071106 // 78-7b Lv99 effect for later Kameshima
- 3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6,
-#elif PACKETVER <= 20081217 // change in 0x78 and 0x7c
- 3, 28, 19, 11, 3, -1, 9, 5, 55, 53, 58, 60, 42, 2, 6, 6,
-#else
- 3, 28, 19, 11, 3, -1, 9, 5, 55, 53, 58, 60, 44, 2, 6, 6,
-#endif
- //#0x0080
- 7, 3, 2, 2, 2, 5, 16, 12, 10, 7, 29, 2, -1, -1, -1, 0, // 0x8b changed to 2 (was 23)
- 7, 22, 28, 2, 6, 30, -1, -1, 3, -1, -1, 5, 9, 17, 17, 6,
-#if PACKETVER <= 20100622
- 23, 6, 6, -1, -1, -1, -1, 8, 7, 6, 7, 4, 7, 0, -1, 6,
-#else
- 23, 6, 6, -1, -1, -1, -1, 8, 7, 6, 9, 4, 7, 0, -1, 6, // 0xaa changed to 9 (was 7)
-#endif
- 8, 8, 3, 3, -1, 6, 6, -1, 7, 6, 2, 5, 6, 44, 5, 3,
- //#0x00C0
- 7, 2, 6, 8, 6, 7, -1, -1, -1, -1, 3, 3, 6, 3, 2, 27, // 0xcd change to 3 (was 6)
- 3, 4, 4, 2, -1, -1, 3, -1, 6, 14, 3, -1, 28, 29, -1, -1,
- 30, 30, 26, 2, 6, 26, 3, 3, 8, 19, 5, 2, 3, 2, 2, 2,
- 3, 2, 6, 8, 21, 8, 8, 2, 2, 26, 3, -1, 6, 27, 30, 10,
- //#0x0100
- 2, 6, 6, 30, 79, 31, 10, 10, -1, -1, 4, 6, 6, 2, 11, -1,
- 10, 39, 4, 10, 31, 35, 10, 18, 2, 13, 15, 20, 68, 2, 3, 16,
- 6, 14, -1, -1, 21, 8, 8, 8, 8, 8, 2, 2, 3, 4, 2, -1,
- 6, 86, 6, -1, -1, 7, -1, 6, 3, 16, 4, 4, 4, 6, 24, 26,
- //#0x0140
- 22, 14, 6, 10, 23, 19, 6, 39, 8, 9, 6, 27, -1, 2, 6, 6,
- 110, 6, -1, -1, -1, -1, -1, 6, -1, 54, 66, 54, 90, 42, 6, 42,
- -1, -1, -1, -1, -1, 30, -1, 3, 14, 3, 30, 10, 43, 14,186,182,
- 14, 30, 10, 3, -1, 6,106, -1, 4, 5, 4, -1, 6, 7, -1, -1,
- //#0x0180
- 6, 3,106, 10, 10, 34, 0, 6, 8, 4, 4, 4, 29, -1, 10, 6,
-#if PACKETVER < 1
- 90, 86, 24, 6, 30,102, 8, 4, 8, 4, 14, 10, -1, 6, 2, 6,
-#else // 196 comodo icon status display for later
- 90, 86, 24, 6, 30,102, 9, 4, 8, 4, 14, 10, -1, 6, 2, 6,
-#endif
-#if PACKETVER < 20081126
- 3, 3, 35, 5, 11, 26, -1, 4, 4, 6, 10, 12, 6, -1, 4, 4,
-#else // 0x1a2 changed (35->37)
- 3, 3, 37, 5, 11, 26, -1, 4, 4, 6, 10, 12, 6, -1, 4, 4,
-#endif
- 11, 7, -1, 67, 12, 18,114, 6, 3, 6, 26, 26, 26, 26, 2, 3,
- //#0x01C0, Set 0x1d5=-1
- 2, 14, 10, -1, 22, 22, 4, 2, 13, 97, 3, 9, 9, 30, 6, 28,
- 8, 14, 10, 35, 6, -1, 4, 11, 54, 53, 60, 2, -1, 47, 33, 6,
- 30, 8, 34, 14, 2, 6, 26, 2, 28, 81, 6, 10, 26, 2, -1, -1,
- -1, -1, 20, 10, 32, 9, 34, 14, 2, 6, 48, 56, -1, 4, 5, 10,
- //#0x0200
- 26, -1, 26, 10, 18, 26, 11, 34, 14, 36, 10, 0, 0, -1, 32, 10, // 0x20c change to 0 (was 19)
- 22, 0, 26, 26, 42, 6, 6, 2, 2,282,282, 10, 10, -1, -1, 66,
-#if PACKETVER < 20071106
- 10, -1, -1, 8, 10, 2,282, 18, 18, 15, 58, 57, 64, 5, 71, 5,
-#else // 0x22c changed
- 10, -1, -1, 8, 10, 2,282, 18, 18, 15, 58, 57, 65, 5, 71, 5,
-#endif
- 12, 26, 9, 11, -1, -1, 10, 2,282, 11, 4, 36, 6, -1, 4, 2,
- //#0x0240
- -1, -1, -1, -1, -1, 3, 4, 8, -1, 3, 70, 4, 8, 12, 4, 10,
- 3, 32, -1, 3, 3, 5, 5, 8, 2, 3, -1, 6, 4, 6, 4, 6,
- 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0280
-#if PACKETVER < 20070711
- 0, 0, 0, 6, 14, 0, 0, -1, 6, 8, 18, 0, 0, 0, 0, 0,
-#else
- 0, 0, 0, 6, 14, 0, 0, -1, 10, 12, 18, 0, 0, 0, 0, 0, // 0x288, 0x289 increase by 4 (kafra points)
-#endif
- 0, 4, 0, 70, 10, 0, 0, 0, 8, 6, 27, 80, 0, -1, 0, 0,
- 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 85, -1, -1,107, 6, -1, 7, 7, 22,191, 0, 8, 0, 0, 0, 0,
- //#0x02C0
- 0, -1, 0, 0, 0, 30, 30, 0, 0, 3, 0, 65, 4, 71, 10, 0,
- -1, -1, -1, 0, 29, 0, 6, -1, 10, 10, 3, 0, -1, 32, 6, 36,
- 34, 33, 0, 0, 0, 0, 0, 0, -1, -1, -1, 13, 67, 59, 60, 8,
- 10, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0300
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0340
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0380
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x03C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0400
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 25,
- //#0x0440
- 10, 4, -1, 0, 0, 0, 14, 0, 0, 0, 6, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0480
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x04C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0500
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,
- //#0x0540
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0580
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x05C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0600
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,
- //#0x0640
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0680
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x06C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0700
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,
- //#0x0740
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0780
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x07C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#if PACKETVER < 20090617
- 6, 2, -1, 4, 4, 4, 4, 8, 8,254, 6, 8, 6, 54, 30, 54,
-#else // 0x7d9 changed
- 6, 2, -1, 4, 4, 4, 4, 8, 8,268, 6, 8, 6, 54, 30, 54,
-#endif
- 0, 15, 8, 6, -1, 8, 8, 32, -1, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 14, -1, -1, -1, 8, 25, 0, 0, 26, 0,
- //#0x0800
-#if PACKETVER < 20091229
- -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20,
-#else // for Party booking ( PACKETVER >= 20091229 )
- -1, -1, 18, 4, 8, 6, 2, 4, 14, 50, 18, 6, 2, 3, 14, 20,
-#endif
- 3, -1, 8, -1, 86, 2, 6, 6, -1, -1, 4, 10, 10, 0, 0, 0,
- 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, -1, -1, 3, 2, 66, 5, 2, 12, 6, 0, 0,
- //#0x0840
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0880
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x08C0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0900
- 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0940
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
- //#0x0980
- 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
-
- };
- struct {
- void (*func)(int, struct map_session_data *);
- char *name;
- } clif_parse_func[]={
- {clif->pWantToConnection,"wanttoconnection"},
- {clif->pLoadEndAck,"loadendack"},
- {clif->pTickSend,"ticksend"},
- {clif->pWalkToXY,"walktoxy"},
- {clif->pQuitGame,"quitgame"},
- {clif->pGetCharNameRequest,"getcharnamerequest"},
- {clif->pGlobalMessage,"globalmessage"},
- {clif->pMapMove,"mapmove"},
- {clif->pChangeDir,"changedir"},
- {clif->pEmotion,"emotion"},
- {clif->pHowManyConnections,"howmanyconnections"},
- {clif->pActionRequest,"actionrequest"},
- {clif->pRestart,"restart"},
- {clif->pWisMessage,"wis"},
- {clif->pBroadcast,"broadcast"},
- {clif->pTakeItem,"takeitem"},
- {clif->pDropItem,"dropitem"},
- {clif->pUseItem,"useitem"},
- {clif->pEquipItem,"equipitem"},
- {clif->pUnequipItem,"unequipitem"},
- {clif->pNpcClicked,"npcclicked"},
- {clif->pNpcBuySellSelected,"npcbuysellselected"},
- {clif->pNpcBuyListSend,"npcbuylistsend"},
- {clif->pNpcSellListSend,"npcselllistsend"},
- {clif->pCreateChatRoom,"createchatroom"},
- {clif->pChatAddMember,"chataddmember"},
- {clif->pChatRoomStatusChange,"chatroomstatuschange"},
- {clif->pChangeChatOwner,"changechatowner"},
- {clif->pKickFromChat,"kickfromchat"},
- {clif->pChatLeave,"chatleave"},
- {clif->pTradeRequest,"traderequest"},
- {clif->pTradeAck,"tradeack"},
- {clif->pTradeAddItem,"tradeadditem"},
- {clif->pTradeOk,"tradeok"},
- {clif->pTradeCancel,"tradecancel"},
- {clif->pTradeCommit,"tradecommit"},
- {clif->pStopAttack,"stopattack"},
- {clif->pPutItemToCart,"putitemtocart"},
- {clif->pGetItemFromCart,"getitemfromcart"},
- {clif->pRemoveOption,"removeoption"},
- {clif->pChangeCart,"changecart"},
- {clif->pStatusUp,"statusup"},
- {clif->pSkillUp,"skillup"},
- {clif->pUseSkillToId,"useskilltoid"},
- {clif->pUseSkillToPos,"useskilltopos"},
- {clif->pUseSkillToPosMoreInfo,"useskilltoposinfo"},
- {clif->pUseSkillMap,"useskillmap"},
- {clif->pRequestMemo,"requestmemo"},
- {clif->pProduceMix,"producemix"},
- {clif->pCooking,"cooking"},
- {clif->pNpcSelectMenu,"npcselectmenu"},
- {clif->pNpcNextClicked,"npcnextclicked"},
- {clif->pNpcAmountInput,"npcamountinput"},
- {clif->pNpcStringInput,"npcstringinput"},
- {clif->pNpcCloseClicked,"npccloseclicked"},
- {clif->pItemIdentify,"itemidentify"},
- {clif->pSelectArrow,"selectarrow"},
- {clif->pAutoSpell,"autospell"},
- {clif->pUseCard,"usecard"},
- {clif->pInsertCard,"insertcard"},
- {clif->pRepairItem,"repairitem"},
- {clif->pWeaponRefine,"weaponrefine"},
- {clif->pSolveCharName,"solvecharname"},
- {clif->pResetChar,"resetchar"},
- {clif->pLocalBroadcast,"localbroadcast"},
- {clif->pMoveToKafra,"movetokafra"},
- {clif->pMoveFromKafra,"movefromkafra"},
- {clif->pMoveToKafraFromCart,"movetokafrafromcart"},
- {clif->pMoveFromKafraToCart,"movefromkafratocart"},
- {clif->pCloseKafra,"closekafra"},
- {clif->pCreateParty,"createparty"},
- {clif->pCreateParty2,"createparty2"},
- {clif->pPartyInvite,"partyinvite"},
- {clif->pPartyInvite2,"partyinvite2"},
- {clif->pReplyPartyInvite,"replypartyinvite"},
- {clif->pReplyPartyInvite2,"replypartyinvite2"},
- {clif->pLeaveParty,"leaveparty"},
- {clif->pRemovePartyMember,"removepartymember"},
- {clif->pPartyChangeOption,"partychangeoption"},
- {clif->pPartyMessage,"partymessage"},
- {clif->pPartyChangeLeader,"partychangeleader"},
- {clif->pCloseVending,"closevending"},
- {clif->pVendingListReq,"vendinglistreq"},
- {clif->pPurchaseReq,"purchasereq"},
- {clif->pPurchaseReq2,"purchasereq2"},
- {clif->pOpenVending,"openvending"},
- {clif->pCreateGuild,"createguild"},
- {clif->pGuildCheckMaster,"guildcheckmaster"},
- {clif->pGuildRequestInfo,"guildrequestinfo"},
- {clif->pGuildChangePositionInfo,"guildchangepositioninfo"},
- {clif->pGuildChangeMemberPosition,"guildchangememberposition"},
- {clif->pGuildRequestEmblem,"guildrequestemblem"},
- {clif->pGuildChangeEmblem,"guildchangeemblem"},
- {clif->pGuildChangeNotice,"guildchangenotice"},
- {clif->pGuildInvite,"guildinvite"},
- {clif->pGuildReplyInvite,"guildreplyinvite"},
- {clif->pGuildLeave,"guildleave"},
- {clif->pGuildExpulsion,"guildexpulsion"},
- {clif->pGuildMessage,"guildmessage"},
- {clif->pGuildRequestAlliance,"guildrequestalliance"},
- {clif->pGuildReplyAlliance,"guildreplyalliance"},
- {clif->pGuildDelAlliance,"guilddelalliance"},
- {clif->pGuildOpposition,"guildopposition"},
- {clif->pGuildBreak,"guildbreak"},
- {clif->pPetMenu,"petmenu"},
- {clif->pCatchPet,"catchpet"},
- {clif->pSelectEgg,"selectegg"},
- {clif->pSendEmotion,"sendemotion"},
- {clif->pChangePetName,"changepetname"},
- {clif->pGMKick,"gmkick"},
- {clif->pGMHide,"gmhide"},
- {clif->pGMReqNoChat,"gmreqnochat"},
- {clif->pGMReqAccountName,"gmreqaccname"},
- {clif->pGMKickAll,"killall"},
- {clif->pGMRecall,"recall"},
- {clif->pGMRecall,"summon"},
- {clif->pGM_Monster_Item,"itemmonster"},
- {clif->pGMShift,"remove"},
- {clif->pGMShift,"shift"},
- {clif->pGMChangeMapType,"changemaptype"},
- {clif->pGMRc,"rc"},
- {clif->pGMRecall2,"recall2"},
- {clif->pGMRemove2,"remove2"},
-
- {clif->pNoviceDoriDori,"sndoridori"},
- {clif->pNoviceExplosionSpirits,"snexplosionspirits"},
- {clif->pPMIgnore,"wisexin"},
- {clif->pPMIgnoreList,"wisexlist"},
- {clif->pPMIgnoreAll,"wisall"},
- {clif->pFriendsListAdd,"friendslistadd"},
- {clif->pFriendsListRemove,"friendslistremove"},
- {clif->pFriendsListReply,"friendslistreply"},
- {clif->pBlacksmith,"blacksmith"},
- {clif->pAlchemist,"alchemist"},
- {clif->pTaekwon,"taekwon"},
- {clif->pRankingPk,"rankingpk"},
- {clif->pFeelSaveOk,"feelsaveok"},
- {clif->pDebug,"debug"},
- {clif->pChangeHomunculusName,"changehomunculusname"},
- {clif->pHomMoveToMaster,"hommovetomaster"},
- {clif->pHomMoveTo,"hommoveto"},
- {clif->pHomAttack,"homattack"},
- {clif->pHomMenu,"hommenu"},
- {clif->pStoragePassword,"storagepassword"},
- {clif->pHotkey,"hotkey"},
- {clif->pAutoRevive,"autorevive"},
- {clif->pCheck,"check"},
- {clif->pAdopt_request,"adoptrequest"},
- {clif->pAdopt_reply,"adoptreply"},
- // MAIL SYSTEM
- {clif->pMail_refreshinbox,"mailrefresh"},
- {clif->pMail_read,"mailread"},
- {clif->pMail_getattach,"mailgetattach"},
- {clif->pMail_delete,"maildelete"},
- {clif->pMail_return,"mailreturn"},
- {clif->pMail_setattach,"mailsetattach"},
- {clif->pMail_winopen,"mailwinopen"},
- {clif->pMail_send,"mailsend"},
- // AUCTION SYSTEM
- {clif->pAuction_search,"auctionsearch"},
- {clif->pAuction_buysell,"auctionbuysell"},
- {clif->pAuction_setitem,"auctionsetitem"},
- {clif->pAuction_cancelreg,"auctioncancelreg"},
- {clif->pAuction_register,"auctionregister"},
- {clif->pAuction_cancel,"auctioncancel"},
- {clif->pAuction_close,"auctionclose"},
- {clif->pAuction_bid,"auctionbid"},
- // Quest Log System
- {clif->pquestStateAck,"queststate"},
- {clif->pcashshop_buy,"cashshopbuy"},
- {clif->pViewPlayerEquip,"viewplayerequip"},
- {clif->pEquipTick,"equiptickbox"},
- {clif->pBattleChat,"battlechat"},
- {clif->pmercenary_action,"mermenu"},
- {clif->pProgressbar,"progressbar"},
- {clif->pSkillSelectMenu,"skillselectmenu"},
- {clif->pItemListWindowSelected,"itemlistwindowselected"},
-#if PACKETVER >= 20091229
- {clif->pPartyBookingRegisterReq,"bookingregreq"},
- {clif->pPartyBookingSearchReq,"bookingsearchreq"},
- {clif->pPartyBookingUpdateReq,"bookingupdatereq"},
- {clif->pPartyBookingDeleteReq,"bookingdelreq"},
-#endif
- {clif->pPVPInfo,"pvpinfo"},
- {clif->pLessEffect,"lesseffect"},
- // Buying Store
- {clif->pReqOpenBuyingStore,"reqopenbuyingstore"},
- {clif->pReqCloseBuyingStore,"reqclosebuyingstore"},
- {clif->pReqClickBuyingStore,"reqclickbuyingstore"},
- {clif->pReqTradeBuyingStore,"reqtradebuyingstore"},
- // Store Search
- {clif->pSearchStoreInfo,"searchstoreinfo"},
- {clif->pSearchStoreInfoNextPage,"searchstoreinfonextpage"},
- {clif->pCloseSearchStoreInfo,"closesearchstoreinfo"},
- {clif->pSearchStoreInfoListItemClick,"searchstoreinfolistitemclick"},
- /* */
- { clif->pMoveItem , "moveitem" },
- {NULL,NULL}
- };
-
- // initialize packet_db[SERVER] from hardcoded packet_len_table[] values
- memset(packet_db,0,sizeof(packet_db));
- for( i = 0; i < ARRAYLENGTH(packet_len_table); ++i )
- packet_len(i) = packet_len_table[i];
-
- sprintf(line, "%s/packet_db.txt", db_path);
- if( (fp=fopen(line,"r"))==NULL ){
- ShowFatalError("can't read %s\n", line);
- exit(EXIT_FAILURE);
- }
-
- clif_config.packet_db_ver = MAX_PACKET_VER;
- packet_ver = MAX_PACKET_VER; // read into packet_db's version by default
- while( fgets(line, sizeof(line), fp) )
- {
- ln++;
- if(line[0]=='/' && line[1]=='/')
- continue;
- if (sscanf(line,"%256[^:]: %256[^\r\n]",w1,w2) == 2)
- {
- if(strcmpi(w1,"packet_ver")==0) {
- int prev_ver = packet_ver;
- skip_ver = 0;
- packet_ver = atoi(w2);
- if ( packet_ver > MAX_PACKET_VER )
- { //Check to avoid overflowing. [Skotlex]
- if( (warned&1) == 0 )
- ShowWarning("The packet_db table only has support up to version %d.\n", MAX_PACKET_VER);
- warned &= 1;
- skip_ver = 1;
- }
- else if( packet_ver < 0 )
- {
- if( (warned&2) == 0 )
- ShowWarning("Negative packet versions are not supported.\n");
- warned &= 2;
- skip_ver = 1;
- }
- else if( packet_ver == SERVER )
- {
- if( (warned&4) == 0 )
- ShowWarning("Packet version %d is reserved for server use only.\n", SERVER);
- warned &= 4;
- skip_ver = 1;
- }
-
- if( skip_ver )
- {
- ShowWarning("Skipping packet version %d.\n", packet_ver);
- packet_ver = prev_ver;
- continue;
- }
- // copy from previous version into new version and continue
- // - indicating all following packets should be read into the newer version
- memcpy(&packet_db[packet_ver], &packet_db[prev_ver], sizeof(packet_db[0]));
- continue;
- } else if(strcmpi(w1,"packet_db_ver")==0) {
- if(strcmpi(w2,"default")==0) //This is the preferred version.
- clif_config.packet_db_ver = MAX_PACKET_VER;
- else // to manually set the packet DB version
- clif_config.packet_db_ver = cap_value(atoi(w2), 0, MAX_PACKET_VER);
-
- continue;
- }
- }
-
- if( skip_ver != 0 )
- continue; // Skipping current packet version
-
- memset(str,0,sizeof(str));
- for(j=0,p=line;j<4 && p; ++j)
- {
- str[j]=p;
- p=strchr(p,',');
- if(p) *p++=0;
- }
- if(str[0]==NULL)
- continue;
- cmd=strtol(str[0],(char **)NULL,0);
-
- if(max_cmd < cmd)
- max_cmd = cmd;
- if(cmd <= 0 || cmd > MAX_PACKET_DB)
- continue;
- if(str[1]==NULL){
- ShowError("packet_db: packet len error\n");
- continue;
- }
-
- packet_db[packet_ver][cmd].len = (short)atoi(str[1]);
-
- if(str[2]==NULL){
- packet_db[packet_ver][cmd].func = NULL;
- ln++;
- continue;
- }
-
- // look up processing function by name
- ARR_FIND( 0, ARRAYLENGTH(clif_parse_func), j, clif_parse_func[j].name != NULL && strcmp(str[2],clif_parse_func[j].name)==0 );
- if( j < ARRAYLENGTH(clif_parse_func) )
- packet_db[packet_ver][cmd].func = clif_parse_func[j].func;
-
- // set the identifying cmd for the packet_db version
- if (strcmp(str[2],"wanttoconnection")==0)
- clif_config.connect_cmd[packet_ver] = cmd;
-
- if(str[3]==NULL){
- ShowError("packet_db: packet error\n");
- exit(EXIT_FAILURE);
- }
- for(j=0,p2=str[3];p2;j++){
- short k;
- str2[j]=p2;
- p2=strchr(p2,':');
- if(p2) *p2++=0;
- k = atoi(str2[j]);
- // if (packet_db[packet_ver][cmd].pos[j] != k && clif_config.prefer_packet_db) // not used for now
-
- if( j >= MAX_PACKET_POS )
- {
- ShowError("Too many positions found for packet 0x%04x (max=%d).\n", cmd, MAX_PACKET_POS);
- break;
- }
-
- packet_db[packet_ver][cmd].pos[j] = k;
- }
- }
- fclose(fp);
- if(max_cmd > MAX_PACKET_DB)
- {
- ShowWarning("Found packets up to 0x%X, ignored 0x%X and above.\n", max_cmd, MAX_PACKET_DB);
- ShowWarning("Please increase MAX_PACKET_DB and recompile.\n");
+static void __attribute__ ((unused)) packetdb_addpacket(short cmd, int len, ...) {
+ va_list va;
+ int i;
+ int pos;
+ pFunc func;
+
+ if (cmd > MAX_PACKET_DB) {
+ ShowError("Packet Error: packet 0x%x is greater than the maximum allowed (0x%x), skipping...\n", cmd, MAX_PACKET_DB);
+ return;
}
- if (!clif_config.connect_cmd[clif_config.packet_db_ver])
- { //Locate the nearest version that we still support. [Skotlex]
- for(j = clif_config.packet_db_ver; j >= 0 && !clif_config.connect_cmd[j]; j--);
-
- clif_config.packet_db_ver = j?j:MAX_PACKET_VER;
+
+ packet_db[cmd].len = len;
+
+ va_start(va,len);
+
+ pos = va_arg(va, int);
+
+ if( pos == 0xFFFF ) /* nothing more to do */
+ return;
+
+ va_end(va);
+ va_start(va,len);
+
+ func = va_arg(va,pFunc);
+
+ packet_db[cmd].func = func;
+
+ for (i = 0; i < MAX_PACKET_POS; i++) {
+ pos = va_arg(va, int);
+
+ if (pos == 0xFFFF)
+ break;
+
+ packet_db[cmd].pos[i] = pos;
}
- ShowStatus("Done reading packet database from '"CL_WHITE"%s"CL_RESET"'.\n","packet_db.txt");
- ShowStatus("Using default packet version: "CL_WHITE"%d"CL_RESET".\n", clif_config.packet_db_ver);
- return 0;
}
-
+void packetdb_loaddb(void) {
+
+ memset(packet_db,0,sizeof(packet_db));
+
+ #define packet(id, size, ...) packetdb_addpacket(id, size, ##__VA_ARGS__, 0xFFFF)
+ #include "packets.h" /* load structure data */
+ #undef packet
+}
/*==========================================
*
*------------------------------------------*/
@@ -17174,11 +16459,7 @@ int do_init_clif(void) {
color_table[i] = (color_table[i] & 0x0000FF) << 16 | (color_table[i] & 0x00FF00) | (color_table[i] & 0xFF0000) >> 16;//RGB to BGR
}
- clif_config.packet_db_ver = -1; // the main packet version of the DB
- memset(clif_config.connect_cmd, 0, sizeof(clif_config.connect_cmd)); //The default connect command will be determined after reading the packet_db [Skotlex]
-
- //Using the packet_db file is the only way to set up packets now [Skotlex]
- packetdb_readdb();
+ packetdb_loaddb();
set_defaultparse(clif->parse);
if( make_listen_bind(clif->bind_ip,clif->map_port) == -1 ) {
@@ -17650,7 +16931,6 @@ void clif_defaults(void) {
clif->adopt_reply = clif_Adopt_reply;
clif->adopt_request = clif_Adopt_request;
clif->readbook = clif_readbook;
- clif->guess_PacketVer = clif_guess_PacketVer;
clif->notify_time = clif_notify_time;
clif->user_count = clif_user_count;
clif->noask_sub = clif_noask_sub;
diff --git a/src/map/clif.h b/src/map/clif.h
index 1892a2f25..63d597b17 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -40,8 +40,7 @@ struct eri;
/**
* Defines
**/
-#define SERVER 0 /* reserved for server use */
-#define packet_len(cmd) packet_db[SERVER][cmd].len
+#define packet_len(cmd) packet_db[cmd].len
#define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
#define HCHSYS_NAME_LENGTH 20
@@ -50,7 +49,6 @@ struct eri;
**/
enum {// packet DB
MAX_PACKET_DB = 0xF00,
- MAX_PACKET_VER = 34,
MAX_PACKET_POS = 20,
};
@@ -344,9 +342,10 @@ enum hChSysChType {
/**
* Structures
**/
+typedef void (*pFunc)(int, struct map_session_data *); //cant help but put it first
struct s_packet_db {
short len;
- void (*func)(int, struct map_session_data *);
+ pFunc func;
short pos[MAX_PACKET_POS];
};
@@ -376,7 +375,7 @@ struct hChSysCh {
/**
* Vars
**/
-struct s_packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
+struct s_packet_db packet_db[MAX_PACKET_DB + 1];
unsigned long color_table[COLOR_MAX];
/**
@@ -816,7 +815,6 @@ struct clif_interface {
void (*adopt_reply) (struct map_session_data *sd, int type);
void (*adopt_request) (struct map_session_data *sd, struct map_session_data *src, int p_id);
void (*readbook) (int fd, int book_id, int page);
- int (*guess_PacketVer) (int fd, int get_previous, int *error);
void (*notify_time) (struct map_session_data* sd, unsigned long time);
void (*user_count) (struct map_session_data* sd, int count);
void (*noask_sub) (struct map_session_data *src, struct map_session_data *target, int type);
diff --git a/src/map/packets.h b/src/map/packets.h
new file mode 100644
index 000000000..05ccc08ca
--- /dev/null
+++ b/src/map/packets.h
@@ -0,0 +1,2063 @@
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+
+//Included directly by clif.h in packet_loaddb()
+
+#ifndef _PACKETS_H_
+#define _PACKETS_H_
+
+#ifndef packet
+ #define packet(a,b,...)
+#endif
+
+/*
+ * packet syntax
+ * - packet(packet_id,length)
+ * OR
+ * - packet(packet_id,length,function,offset ( specifies the offset of a packet field in bytes from the begin of the packet ),...)
+ * - Example: packet(0x0072,19,clif->pWantToConnection,2,6,10,14,18);
+ */
+
+packet(0x0064,55);
+packet(0x0065,17);
+packet(0x0066,6);
+packet(0x0067,37);
+packet(0x0068,46);
+packet(0x0069,-1);
+packet(0x006a,23);
+packet(0x006b,-1);
+packet(0x006c,3);
+packet(0x006d,108);
+packet(0x006e,3);
+packet(0x006f,2);
+packet(0x0070,6);
+packet(0x0071,28);
+packet(0x0072,19,clif->pWantToConnection,2,6,10,14,18);
+packet(0x0073,11);
+packet(0x0074,3);
+packet(0x0075,-1);
+packet(0x0076,9);
+packet(0x0077,5);
+packet(0x0078,54);
+packet(0x0079,53);
+packet(0x007a,58);
+packet(0x007b,60);
+packet(0x007c,41);
+packet(0x007d,2,clif->pLoadEndAck,0);
+packet(0x007e,6,clif->pTickSend,2);
+packet(0x007f,6);
+packet(0x0080,7);
+packet(0x0081,3);
+packet(0x0082,2);
+packet(0x0083,2);
+packet(0x0084,2);
+packet(0x0085,5,clif->pWalkToXY,2);
+packet(0x0086,16);
+packet(0x0087,12);
+packet(0x0088,10);
+packet(0x0089,7,clif->pActionRequest,2,6);
+packet(0x008a,29);
+packet(0x008b,2);
+packet(0x008c,-1,clif->pGlobalMessage,2,4);
+packet(0x008d,-1);
+packet(0x008e,-1);
+//packet(0x008f,-1);
+packet(0x0090,7,clif->pNpcClicked,2);
+packet(0x0091,22);
+packet(0x0092,28);
+packet(0x0093,2);
+packet(0x0094,6,clif->pGetCharNameRequest,2);
+packet(0x0095,30);
+packet(0x0096,-1,clif->pWisMessage,2,4,28);
+packet(0x0097,-1);
+packet(0x0098,3);
+packet(0x0099,-1,clif->pBroadcast,2,4);
+packet(0x009a,-1);
+packet(0x009b,5,clif->pChangeDir,2,4);
+packet(0x009c,9);
+packet(0x009d,17);
+packet(0x009e,17);
+packet(0x009f,6,clif->pTakeItem,2);
+packet(0x00a0,23);
+packet(0x00a1,6);
+packet(0x00a2,6,clif->pDropItem,2,4);
+packet(0x00a3,-1);
+packet(0x00a4,-1);
+packet(0x00a5,-1);
+packet(0x00a6,-1);
+packet(0x00a7,8,clif->pUseItem,2,4);
+packet(0x00a8,7);
+packet(0x00a9,6,clif->pEquipItem,2,4);
+packet(0x00aa,7);
+packet(0x00ab,4,clif->pUnequipItem,2);
+packet(0x00ac,7);
+//packet(0x00ad,-1);
+packet(0x00ae,-1);
+packet(0x00af,6);
+packet(0x00b0,8);
+packet(0x00b1,8);
+packet(0x00b2,3,clif->pRestart,2);
+packet(0x00b3,3);
+packet(0x00b4,-1);
+packet(0x00b5,6);
+packet(0x00b6,6);
+packet(0x00b7,-1);
+packet(0x00b8,7,clif->pNpcSelectMenu,2,6);
+packet(0x00b9,6,clif->pNpcNextClicked,2);
+packet(0x00ba,2);
+packet(0x00bb,5,clif->pStatusUp,2,4);
+packet(0x00bc,6);
+packet(0x00bd,44);
+packet(0x00be,5);
+packet(0x00bf,3,clif->pEmotion,2);
+packet(0x00c0,7);
+packet(0x00c1,2,clif->pHowManyConnections,0);
+packet(0x00c2,6);
+packet(0x00c3,8);
+packet(0x00c4,6);
+packet(0x00c5,7,clif->pNpcBuySellSelected,2,6);
+packet(0x00c6,-1);
+packet(0x00c7,-1);
+packet(0x00c8,-1,clif->pNpcBuyListSend,2,4);
+packet(0x00c9,-1,clif->pNpcSellListSend,2,4);
+packet(0x00ca,3);
+packet(0x00cb,3);
+packet(0x00cc,6,clif->pGMKick,2);
+packet(0x00cd,3);
+packet(0x00ce,2,clif->pGMKickAll,0);
+packet(0x00cf,27,clif->pPMIgnore,2,26);
+packet(0x00d0,3,clif->pPMIgnoreAll,2);
+packet(0x00d1,4);
+packet(0x00d2,4);
+packet(0x00d3,2,clif->pPMIgnoreList,0);
+packet(0x00d4,-1);
+packet(0x00d5,-1,clif->pCreateChatRoom,2,4,6,7,15);
+packet(0x00d6,3);
+packet(0x00d7,-1);
+packet(0x00d8,6);
+packet(0x00d9,14,clif->pChatAddMember,2,6);
+packet(0x00da,3);
+packet(0x00db,-1);
+packet(0x00dc,28);
+packet(0x00dd,29);
+packet(0x00de,-1,clif->pChatRoomStatusChange,2,4,6,7,15);
+packet(0x00df,-1);
+packet(0x00e0,30,clif->pChangeChatOwner,2,6);
+packet(0x00e1,30);
+packet(0x00e2,26,clif->pKickFromChat,2);
+packet(0x00e3,2,clif->pChatLeave,0);
+packet(0x00e4,6,clif->pTradeRequest,2);
+packet(0x00e5,26);
+packet(0x00e6,3,clif->pTradeAck,2);
+packet(0x00e7,3);
+packet(0x00e8,8,clif->pTradeAddItem,2,4);
+packet(0x00e9,19);
+packet(0x00ea,5);
+packet(0x00eb,2,clif->pTradeOk,0);
+packet(0x00ec,3);
+packet(0x00ed,2,clif->pTradeCancel,0);
+packet(0x00ee,2);
+packet(0x00ef,2,clif->pTradeCommit,0);
+packet(0x00f0,3);
+packet(0x00f1,2);
+packet(0x00f2,6);
+packet(0x00f3,8,clif->pMoveToKafra,2,4);
+packet(0x00f4,21);
+packet(0x00f5,8,clif->pMoveFromKafra,2,4);
+packet(0x00f6,8);
+packet(0x00f7,2,clif->pCloseKafra,0);
+packet(0x00f8,2);
+packet(0x00f9,26,clif->pCreateParty,2);
+packet(0x00fa,3);
+packet(0x00fb,-1);
+packet(0x00fc,6,clif->pPartyInvite,2);
+packet(0x00fd,27);
+packet(0x00fe,30);
+packet(0x00ff,10,clif->pReplyPartyInvite,2,6);
+packet(0x0100,2,clif->pLeaveParty,0);
+packet(0x0101,6);
+packet(0x0102,6,clif->pPartyChangeOption,2);
+packet(0x0103,30,clif->pRemovePartyMember,2,6);
+packet(0x0104,79);
+packet(0x0105,31);
+packet(0x0106,10);
+packet(0x0107,10);
+packet(0x0108,-1,clif->pPartyMessage,2,4);
+packet(0x0109,-1);
+packet(0x010a,4);
+packet(0x010b,6);
+packet(0x010c,6);
+packet(0x010d,2);
+packet(0x010e,11);
+packet(0x010f,-1);
+packet(0x0110,10);
+packet(0x0111,39);
+packet(0x0112,4,clif->pSkillUp,2);
+packet(0x0113,10,clif->pUseSkillToId,2,4,6);
+packet(0x0114,31);
+packet(0x0115,35);
+packet(0x0116,10,clif->pUseSkillToPos,2,4,6,8);
+packet(0x0117,18);
+packet(0x0118,2,clif->pStopAttack,0);
+packet(0x0119,13);
+packet(0x011a,15);
+packet(0x011b,20,clif->pUseSkillMap,2,4);
+packet(0x011c,68);
+packet(0x011d,2,clif->pRequestMemo,0);
+packet(0x011e,3);
+packet(0x011f,16);
+packet(0x0120,6);
+packet(0x0121,14);
+packet(0x0122,-1);
+packet(0x0123,-1);
+packet(0x0124,21);
+packet(0x0125,8);
+packet(0x0126,8,clif->pPutItemToCart,2,4);
+packet(0x0127,8,clif->pGetItemFromCart,2,4);
+packet(0x0128,8,clif->pMoveFromKafraToCart,2,4);
+packet(0x0129,8,clif->pMoveToKafraFromCart,2,4);
+packet(0x012a,2,clif->pRemoveOption,0);
+packet(0x012b,2);
+packet(0x012c,3);
+packet(0x012d,4);
+packet(0x012e,2,clif->pCloseVending,0);
+packet(0x012f,-1);
+packet(0x0130,6,clif->pVendingListReq,2);
+packet(0x0131,86);
+packet(0x0132,6);
+packet(0x0133,-1);
+packet(0x0134,-1,clif->pPurchaseReq,2,4,8);
+packet(0x0135,7);
+packet(0x0136,-1);
+packet(0x0137,6);
+packet(0x0138,3);
+packet(0x0139,16);
+packet(0x013a,4);
+packet(0x013b,4);
+packet(0x013c,4);
+packet(0x013d,6);
+packet(0x013e,24);
+packet(0x013f,26,clif->pGM_Monster_Item,2);
+packet(0x0140,22,clif->pMapMove,2,18,20);
+packet(0x0141,14);
+packet(0x0142,6);
+packet(0x0143,10,clif->pNpcAmountInput,2,6);
+packet(0x0144,23);
+packet(0x0145,19);
+packet(0x0146,6,clif->pNpcCloseClicked,2);
+packet(0x0147,39);
+packet(0x0148,8);
+packet(0x0149,9,clif->pGMReqNoChat,2,6,7);
+packet(0x014a,6);
+packet(0x014b,27);
+packet(0x014c,-1);
+packet(0x014d,2,clif->pGuildCheckMaster,0);
+packet(0x014e,6);
+packet(0x014f,6,clif->pGuildRequestInfo,2);
+packet(0x0150,110);
+packet(0x0151,6,clif->pGuildRequestEmblem,2);
+packet(0x0152,-1);
+packet(0x0153,-1,clif->pGuildChangeEmblem,2,4);
+packet(0x0154,-1);
+packet(0x0155,-1,clif->pGuildChangeMemberPosition,2);
+packet(0x0156,-1);
+packet(0x0157,6);
+packet(0x0158,-1);
+packet(0x0159,54,clif->pGuildLeave,2,6,10,14);
+packet(0x015a,66);
+packet(0x015b,54,clif->pGuildExpulsion,2,6,10,14);
+packet(0x015c,90);
+packet(0x015d,42,clif->pGuildBreak,2);
+packet(0x015e,6);
+packet(0x015f,42);
+packet(0x0160,-1);
+packet(0x0161,-1,clif->pGuildChangePositionInfo,2);
+packet(0x0162,-1);
+packet(0x0163,-1);
+packet(0x0164,-1);
+packet(0x0165,30,clif->pCreateGuild,6);
+packet(0x0166,-1);
+packet(0x0167,3);
+packet(0x0168,14,clif->pGuildInvite,2);
+packet(0x0169,3);
+packet(0x016a,30);
+packet(0x016b,10,clif->pGuildReplyInvite,2,6);
+packet(0x016c,43);
+packet(0x016d,14);
+packet(0x016e,186,clif->pGuildChangeNotice,2,6,66);
+packet(0x016f,182);
+packet(0x0170,14,clif->pGuildRequestAlliance,2);
+packet(0x0171,30);
+packet(0x0172,10,clif->pGuildReplyAlliance,2,6);
+packet(0x0173,3);
+packet(0x0174,-1);
+packet(0x0175,6);
+packet(0x0176,106);
+packet(0x0177,-1);
+packet(0x0178,4,clif->pItemIdentify,2);
+packet(0x0179,5);
+packet(0x017a,4,clif->pUseCard,2);
+packet(0x017b,-1);
+packet(0x017c,6,clif->pInsertCard,2,4);
+packet(0x017d,7);
+packet(0x017e,-1,clif->pGuildMessage,2,4);
+packet(0x017f,-1);
+packet(0x0180,6,clif->pGuildOpposition,2);
+packet(0x0181,3);
+packet(0x0182,106);
+packet(0x0183,10,clif->pGuildDelAlliance,2,6);
+packet(0x0184,10);
+packet(0x0185,34);
+//packet(0x0186,-1);
+packet(0x0187,6);
+packet(0x0188,8);
+packet(0x0189,4);
+packet(0x018a,4,clif->pQuitGame,0);
+packet(0x018b,4);
+packet(0x018c,29);
+packet(0x018d,-1);
+packet(0x018e,10,clif->pProduceMix,2,4,6,8);
+packet(0x018f,6);
+packet(0x0190,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+packet(0x0191,86);
+packet(0x0192,24);
+packet(0x0193,6,clif->pSolveCharName,2);
+packet(0x0194,30);
+packet(0x0195,102);
+packet(0x0196,9);
+packet(0x0197,4,clif->pResetChar,2);
+packet(0x0198,8,clif->pGMChangeMapType,2,4,6);
+packet(0x0199,4);
+packet(0x019a,14);
+packet(0x019b,10);
+packet(0x019c,-1,clif->pLocalBroadcast,2,4);
+packet(0x019d,6,clif->pGMHide,0);
+packet(0x019e,2);
+packet(0x019f,6,clif->pCatchPet,2);
+packet(0x01a0,3);
+packet(0x01a1,3,clif->pPetMenu,2);
+packet(0x01a2,35);
+packet(0x01a3,5);
+packet(0x01a4,11);
+packet(0x01a5,26,clif->pChangePetName,2);
+packet(0x01a6,-1);
+packet(0x01a7,4,clif->pSelectEgg,2);
+packet(0x01a8,4);
+packet(0x01a9,6,clif->pSendEmotion,2);
+packet(0x01aa,10);
+packet(0x01ab,12);
+packet(0x01ac,6);
+packet(0x01ad,-1);
+packet(0x01ae,4,clif->pSelectArrow,2);
+packet(0x01af,4,clif->pChangeCart,2);
+packet(0x01b0,11);
+packet(0x01b1,7);
+packet(0x01b2,-1,clif->pOpenVending,2,4,84,85);
+packet(0x01b3,67);
+packet(0x01b4,12);
+packet(0x01b5,18);
+packet(0x01b6,114);
+packet(0x01b7,6);
+packet(0x01b8,3);
+packet(0x01b9,6);
+packet(0x01ba,26,clif->pGMShift,2);
+packet(0x01bb,26,clif->pGMShift,2);
+packet(0x01bc,26,clif->pGMRecall,2);
+packet(0x01bd,26,clif->pGMRecall,2);
+packet(0x01be,2);
+packet(0x01bf,3);
+packet(0x01c0,2);
+packet(0x01c1,14);
+packet(0x01c2,10);
+packet(0x01c3,-1);
+packet(0x01c4,22);
+packet(0x01c5,22);
+packet(0x01c6,4);
+packet(0x01c7,2);
+packet(0x01c8,13);
+packet(0x01c9,97);
+//packet(0x01ca,-1);
+packet(0x01cb,9);
+packet(0x01cc,9);
+packet(0x01cd,30);
+packet(0x01ce,6,clif->pAutoSpell,2);
+packet(0x01cf,28);
+packet(0x01d0,8);
+packet(0x01d1,14);
+packet(0x01d2,10);
+packet(0x01d3,35);
+packet(0x01d4,6);
+packet(0x01d5,-1,clif->pNpcStringInput,2,4,8);
+packet(0x01d6,4);
+packet(0x01d7,11);
+packet(0x01d8,54);
+packet(0x01d9,53);
+packet(0x01da,60);
+packet(0x01db,2);
+packet(0x01dc,-1);
+packet(0x01dd,47);
+packet(0x01de,33);
+packet(0x01df,6,clif->pGMReqAccountName,2);
+packet(0x01e0,30);
+packet(0x01e1,8);
+packet(0x01e2,34);
+packet(0x01e3,14);
+packet(0x01e4,2);
+packet(0x01e5,6);
+packet(0x01e6,26);
+packet(0x01e7,2,clif->pNoviceDoriDori,0);
+packet(0x01e8,28,clif->pCreateParty2,2);
+packet(0x01e9,81);
+packet(0x01ea,6);
+packet(0x01eb,10);
+packet(0x01ec,26);
+packet(0x01ed,2,clif->pNoviceExplosionSpirits,0);
+packet(0x01ee,-1);
+packet(0x01ef,-1);
+packet(0x01f0,-1);
+packet(0x01f1,-1);
+packet(0x01f2,20);
+packet(0x01f3,10);
+packet(0x01f4,32);
+packet(0x01f5,9);
+packet(0x01f6,34);
+packet(0x01f7,14,clif->pAdopt_reply,0);
+packet(0x01f8,2);
+packet(0x01f9,6,clif->pAdopt_request,0);
+packet(0x01fa,48);
+packet(0x01fb,56);
+packet(0x01fc,-1);
+packet(0x01fd,4,clif->pRepairItem,2);
+packet(0x01fe,5);
+packet(0x01ff,10);
+packet(0x0200,26);
+packet(0x0201,-1);
+packet(0x0202,26,clif->pFriendsListAdd,2);
+packet(0x0203,10,clif->pFriendsListRemove,2,6);
+packet(0x0204,18);
+packet(0x0205,26);
+packet(0x0206,11);
+packet(0x0207,34);
+packet(0x0208,11,clif->pFriendsListReply,2,6,10);
+packet(0x0209,36);
+packet(0x020a,10);
+//packet(0x020b,-1);
+//packet(0x020c,-1);
+packet(0x020d,-1);
+
+//2004-07-05aSakexe
+#if PACKETVER >= 20040705
+ packet(0x0072,22,clif->pWantToConnection,5,9,13,17,21);
+ packet(0x0085,8,clif->pWalkToXY,5);
+ packet(0x00a7,13,clif->pUseItem,5,9);
+ packet(0x0113,15,clif->pUseSkillToId,4,9,11);
+ packet(0x0116,15,clif->pUseSkillToPos,4,9,11,13);
+ packet(0x0190,95,clif->pUseSkillToPosMoreInfo,4,9,11,13,15);
+ packet(0x0208,14,clif->pFriendsListReply,2,6,10);
+ packet(0x020e,24);
+#endif
+
+//2004-07-13aSakexe
+#if PACKETVER >= 20040713
+ packet(0x0072,39,clif->pWantToConnection,12,22,30,34,38);
+ packet(0x0085,9,clif->pWalkToXY,6);
+ packet(0x009b,13,clif->pChangeDir,5,12);
+ packet(0x009f,10,clif->pTakeItem,6);
+ packet(0x00a7,17,clif->pUseItem,6,13);
+ packet(0x0113,19,clif->pUseSkillToId,7,9,15);
+ packet(0x0116,19,clif->pUseSkillToPos,7,9,15,17);
+ packet(0x0190,99,clif->pUseSkillToPosMoreInfo,7,9,15,17,19);
+#endif
+
+//2004-07-26aSakexe
+#if PACKETVER >= 20040726
+ packet(0x0072,14,clif->pDropItem,5,12);
+ packet(0x007e,33,clif->pWantToConnection,12,18,24,28,32);
+ packet(0x0085,20,clif->pUseSkillToId,7,12,16);
+ packet(0x0089,15,clif->pGetCharNameRequest,11);
+ packet(0x008c,23,clif->pUseSkillToPos,3,6,17,21);
+ packet(0x0094,10,clif->pTakeItem,6);
+ packet(0x009b,6,clif->pWalkToXY,3);
+ packet(0x009f,13,clif->pChangeDir,5,12);
+ packet(0x00a2,103,clif->pUseSkillToPosMoreInfo,3,6,17,21,23);
+ packet(0x00a7,12,clif->pSolveCharName,8);
+ packet(0x00f3,-1,clif->pGlobalMessage,2,4);
+ packet(0x00f5,17,clif->pUseItem,6,12);
+ packet(0x00f7,10,clif->pTickSend,6);
+ packet(0x0113,16,clif->pMoveToKafra,5,12);
+ packet(0x0116,2,clif->pCloseKafra,0);
+ packet(0x0190,26,clif->pMoveFromKafra,10,22);
+ packet(0x0193,9,clif->pActionRequest,3,8);
+#endif
+
+//2004-08-09aSakexe
+#if PACKETVER >= 20040809
+ packet(0x0072,17,clif->pDropItem,8,15);
+ packet(0x007e,37,clif->pWantToConnection,9,21,28,32,36);
+ packet(0x0085,26,clif->pUseSkillToId,11,18,22);
+ packet(0x0089,12,clif->pGetCharNameRequest,8);
+ packet(0x008c,40,clif->pUseSkillToPos,5,15,29,38);
+ packet(0x0094,13,clif->pTakeItem,9);
+ packet(0x009b,15,clif->pWalkToXY,12);
+ packet(0x009f,12,clif->pChangeDir,7,11);
+ packet(0x00a2,120,clif->pUseSkillToPosMoreInfo,5,15,29,38,40);
+ packet(0x00a7,11,clif->pSolveCharName,7);
+ packet(0x00f5,24,clif->pUseItem,9,20);
+ packet(0x00f7,13,clif->pTickSend,9);
+ packet(0x0113,23,clif->pMoveToKafra,5,19);
+ packet(0x0190,26,clif->pMoveFromKafra,11,22);
+ packet(0x0193,18,clif->pActionRequest,7,17);
+#endif
+
+//2004-08-16aSakexe
+#if PACKETVER >= 20040816
+ packet(0x0212,26,clif->pGMRc,2);
+ packet(0x0213,26,clif->pCheck,2);
+ packet(0x0214,42);
+#endif
+
+//2004-08-17aSakexe
+#if PACKETVER >= 20040817
+ packet(0x020f,10,clif->pPVPInfo,2,6);
+ packet(0x0210,22);
+#endif
+
+//2004-09-06aSakexe
+#if PACKETVER >= 20040906
+ packet(0x0072,20,clif->pUseItem,9,20);
+ packet(0x007e,19,clif->pMoveToKafra,3,15);
+ packet(0x0085,23,clif->pActionRequest,9,22);
+ packet(0x0089,9,clif->pWalkToXY,6);
+ packet(0x008c,105,clif->pUseSkillToPosMoreInfo,10,14,18,23,25);
+ packet(0x0094,17,clif->pDropItem,6,15);
+ packet(0x009b,14,clif->pGetCharNameRequest,10);
+ packet(0x009f,-1,clif->pGlobalMessage,2,4);
+ packet(0x00a2,14,clif->pSolveCharName,10);
+ packet(0x00a7,25,clif->pUseSkillToPos,10,14,18,23);
+ packet(0x00f3,10,clif->pChangeDir,4,9);
+ packet(0x00f5,34,clif->pWantToConnection,7,15,25,29,33);
+ packet(0x00f7,2,clif->pCloseKafra,0);
+ packet(0x0113,11,clif->pTakeItem,7);
+ packet(0x0116,11,clif->pTickSend,7);
+ packet(0x0190,22,clif->pUseSkillToId,9,15,18);
+ packet(0x0193,17,clif->pMoveFromKafra,3,13);
+#endif
+
+//2004-09-20aSakexe
+#if PACKETVER >= 20040920
+ packet(0x0072,18,clif->pUseItem,10,14);
+ packet(0x007e,25,clif->pMoveToKafra,6,21);
+ packet(0x0085,9,clif->pActionRequest,3,8);
+ packet(0x0089,14,clif->pWalkToXY,11);
+ packet(0x008c,109,clif->pUseSkillToPosMoreInfo,16,20,23,27,29);
+ packet(0x0094,19,clif->pDropItem,12,17);
+ packet(0x009b,10,clif->pGetCharNameRequest,6);
+ packet(0x00a2,10,clif->pSolveCharName,6);
+ packet(0x00a7,29,clif->pUseSkillToPos,6,20,23,27);
+ packet(0x00f3,18,clif->pChangeDir,8,17);
+ packet(0x00f5,32,clif->pWantToConnection,10,17,23,27,31);
+ packet(0x0113,14,clif->pTakeItem,10);
+ packet(0x0116,14,clif->pTickSend,10);
+ packet(0x0190,14,clif->pUseSkillToId,4,7,10);
+ packet(0x0193,12,clif->pMoveFromKafra,4,8);
+#endif
+
+//2004-10-05aSakexe
+#if PACKETVER >= 20041005
+ packet(0x0072,17,clif->pUseItem,6,13);
+ packet(0x007e,16,clif->pMoveToKafra,5,12);
+ packet(0x0089,6,clif->pWalkToXY,3);
+ packet(0x008c,103,clif->pUseSkillToPosMoreInfo,2,6,17,21,23);
+ packet(0x0094,14,clif->pDropItem,5,12);
+ packet(0x009b,15,clif->pGetCharNameRequest,11);
+ packet(0x00a2,12,clif->pSolveCharName,8);
+ packet(0x00a7,23,clif->pUseSkillToPos,3,6,17,21);
+ packet(0x00f3,13,clif->pChangeDir,5,12);
+ packet(0x00f5,33,clif->pWantToConnection,12,18,24,28,32);
+ packet(0x0113,10,clif->pTakeItem,6);
+ packet(0x0116,10,clif->pTickSend,6);
+ packet(0x0190,20,clif->pUseSkillToId,7,12,16);
+ packet(0x0193,26,clif->pMoveFromKafra,10,22);
+#endif
+
+//2004-10-25aSakexe
+#if PACKETVER >= 20041025
+ packet(0x0072,13,clif->pUseItem,5,9);
+ packet(0x007e,13,clif->pMoveToKafra,6,9);
+ packet(0x0085,15,clif->pActionRequest,4,14);
+ packet(0x008c,108,clif->pUseSkillToPosMoreInfo,6,9,23,26,28);
+ packet(0x0094,12,clif->pDropItem,6,10);
+ packet(0x009b,10,clif->pGetCharNameRequest,6);
+ packet(0x00a2,16,clif->pSolveCharName,12);
+ packet(0x00a7,28,clif->pUseSkillToPos,6,9,23,26);
+ packet(0x00f3,15,clif->pChangeDir,6,14);
+ packet(0x00f5,29,clif->pWantToConnection,5,14,20,24,28);
+ packet(0x0113,9,clif->pTakeItem,5);
+ packet(0x0116,9,clif->pTickSend,5);
+ packet(0x0190,26,clif->pUseSkillToId,4,10,22);
+ packet(0x0193,22,clif->pMoveFromKafra,12,18);
+#endif
+
+//2004-11-01aSakexe
+#if PACKETVER >= 20041101
+ packet(0x0084,-1);
+ packet(0x0215,6);
+#endif
+
+//2004-11-08aSakexe
+#if PACKETVER >= 20041108
+ packet(0x0084,2);
+ packet(0x0216,6);
+ packet(0x0217,2,clif->pBlacksmith,0);
+ packet(0x0218,2,clif->pAlchemist,0);
+ packet(0x0219,282);
+ packet(0x021a,282);
+ packet(0x021b,10);
+ packet(0x021c,10);
+#endif
+
+//2004-11-15aSakexe
+#if PACKETVER >= 20041115
+ packet(0x021d,6,clif->pLessEffect,2);
+#endif
+
+//2004-11-29aSakexe
+#if PACKETVER >= 20041129
+ packet(0x0072,22,clif->pUseSkillToId,8,12,18);
+ packet(0x007e,30,clif->pUseSkillToPos,4,9,22,28);
+ packet(0x0085,-1,clif->pGlobalMessage,2,4);
+ packet(0x0089,7,clif->pTickSend,3);
+ packet(0x008c,13,clif->pGetCharNameRequest,9);
+ packet(0x0094,14,clif->pMoveToKafra,4,10);
+ packet(0x009b,2,clif->pCloseKafra,0);
+ packet(0x009f,18,clif->pActionRequest,6,17);
+ packet(0x00a2,7,clif->pTakeItem,3);
+ packet(0x00a7,7,clif->pWalkToXY,4);
+ packet(0x00f3,8,clif->pChangeDir,3,7);
+ packet(0x00f5,29,clif->pWantToConnection,3,10,20,24,28);
+ packet(0x00f7,14,clif->pSolveCharName,10);
+ packet(0x0113,110,clif->pUseSkillToPosMoreInfo,4,9,22,28,30);
+ packet(0x0116,12,clif->pDropItem,4,10);
+ packet(0x0190,15,clif->pUseItem,3,11);
+ packet(0x0193,21,clif->pMoveFromKafra,4,17);
+ packet(0x0221,-1);
+ packet(0x0222,6,clif->pWeaponRefine,2);
+ packet(0x0223,8);
+#endif
+
+//2004-12-13aSakexe
+#if PACKETVER >= 20041213
+//skipped: many packets being set to -1
+ packet(0x0066,3);
+ packet(0x0070,3);
+ packet(0x01ca,3);
+ packet(0x021e,6);
+ packet(0x021f,66);
+ packet(0x0220,10);
+#endif
+
+//2005-01-10bSakexe
+#if PACKETVER >= 20050110
+ packet(0x0072,26,clif->pUseSkillToId,8,16,22);
+ packet(0x007e,114,clif->pUseSkillToPosMoreInfo,10,18,22,32,34);
+ packet(0x0085,23,clif->pChangeDir,12,22);
+ packet(0x0089,9,clif->pTickSend,5);
+ packet(0x008c,8,clif->pGetCharNameRequest,4);
+ packet(0x0094,20,clif->pMoveToKafra,10,16);
+ packet(0x009b,32,clif->pWantToConnection,3,12,23,27,31);
+ packet(0x009f,17,clif->pUseItem,5,13);
+ packet(0x00a2,11,clif->pSolveCharName,7);
+ packet(0x00a7,13,clif->pWalkToXY,10);
+ packet(0x00f3,-1,clif->pGlobalMessage,2,4);
+ packet(0x00f5,9,clif->pTakeItem,5);
+ packet(0x00f7,21,clif->pMoveFromKafra,11,17);
+ packet(0x0113,34,clif->pUseSkillToPos,10,18,22,32);
+ packet(0x0116,20,clif->pDropItem,15,18);
+ packet(0x0190,20,clif->pActionRequest,9,19);
+ packet(0x0193,2,clif->pCloseKafra,0);
+#endif
+
+//2005-03-28aSakexe
+#if PACKETVER >= 20050328
+ packet(0x0224,10);
+ packet(0x0225,2,clif->pTaekwon,0);
+ packet(0x0226,282);
+#endif
+
+//2005-04-04aSakexe
+#if PACKETVER >= 20050404
+ packet(0x0227,18);
+ packet(0x0228,18);
+#endif
+
+//2005-04-11aSakexe
+#if PACKETVER >= 20050411
+ packet(0x0229,15);
+ packet(0x022a,58);
+ packet(0x022b,57);
+ packet(0x022c,64);
+#endif
+
+//2005-04-25aSakexe
+#if PACKETVER >= 20050425
+ packet(0x022d,5,clif->pHomMenu,2,4);
+ packet(0x0232,9,clif->pHomMoveTo,2,6);
+ packet(0x0233,11,clif->pHomAttack,2,6,10);
+ packet(0x0234,6,clif->pHomMoveToMaster,2);
+#endif
+
+//2005-05-09aSakexe
+#if PACKETVER >= 20050509
+ packet(0x0072,25,clif->pUseSkillToId,6,10,21);
+ packet(0x007e,102,clif->pUseSkillToPosMoreInfo,5,9,12,20,22);
+ packet(0x0085,11,clif->pChangeDir,7,10);
+ packet(0x0089,8,clif->pTickSend,4);
+ packet(0x008c,11,clif->pGetCharNameRequest,7);
+ packet(0x0094,14,clif->pMoveToKafra,7,10);
+ packet(0x009b,26,clif->pWantToConnection,4,9,17,21,25);
+ packet(0x009f,14,clif->pUseItem,4,10);
+ packet(0x00a2,15,clif->pSolveCharName,11);
+ packet(0x00a7,8,clif->pWalkToXY,5);
+ packet(0x00f5,8,clif->pTakeItem,4);
+ packet(0x00f7,22,clif->pMoveFromKafra,14,18);
+ packet(0x0113,22,clif->pUseSkillToPos,5,9,12,20);
+ packet(0x0116,10,clif->pDropItem,5,8);
+ packet(0x0190,19,clif->pActionRequest,5,18);
+#endif
+
+//2005-05-23aSakexe
+#if PACKETVER >= 20050523
+ packet(0x022e,69);
+ packet(0x0230,12);
+#endif
+
+//2005-05-30aSakexe
+#if PACKETVER >= 20050530
+ packet(0x022e,71);
+ packet(0x0235,-1);
+ packet(0x0236,10);
+ packet(0x0237,2,clif->pRankingPk,0);
+ packet(0x0238,282);
+#endif
+
+//2005-05-31aSakexe
+#if PACKETVER >= 20050531
+ packet(0x0216,2);
+ packet(0x0239,11);
+#endif
+
+//2005-06-08aSakexe
+#if PACKETVER >= 20050608
+ packet(0x0216,6);
+ packet(0x0217,2,clif->pBlacksmith,0);
+ packet(0x022f,5);
+ packet(0x0231,26,clif->pChangeHomunculusName,0);
+ packet(0x023a,4);
+ packet(0x023b,36,clif->pStoragePassword,2,4,20);
+ packet(0x023c,6);
+#endif
+
+//2005-06-22aSakexe
+#if PACKETVER >= 20050622
+ packet(0x022e,71);
+
+#endif
+
+//2005-06-28aSakexe
+#if PACKETVER >= 20050628
+ packet(0x0072,34,clif->pUseSkillToId,6,17,30);
+ packet(0x007e,113,clif->pUseSkillToPosMoreInfo,12,15,18,31,33);
+ packet(0x0085,17,clif->pChangeDir,8,16);
+ packet(0x0089,13,clif->pTickSend,9);
+ packet(0x008c,8,clif->pGetCharNameRequest,4);
+ packet(0x0094,31,clif->pMoveToKafra,16,27);
+ packet(0x009b,32,clif->pWantToConnection,9,15,23,27,31);
+ packet(0x009f,19,clif->pUseItem,9,15);
+ packet(0x00a2,9,clif->pSolveCharName,5);
+ packet(0x00a7,11,clif->pWalkToXY,8);
+ packet(0x00f5,13,clif->pTakeItem,9);
+ packet(0x00f7,18,clif->pMoveFromKafra,11,14);
+ packet(0x0113,33,clif->pUseSkillToPos,12,15,18,31);
+ packet(0x0116,12,clif->pDropItem,3,10);
+ packet(0x0190,24,clif->pActionRequest,11,23);
+ packet(0x0216,-1);
+ packet(0x023d,-1);
+ packet(0x023e,4);
+#endif
+
+//2005-07-18aSakexe
+#if PACKETVER >= 20050718
+ packet(0x0072,19,clif->pUseSkillToId,5,11,15);
+ packet(0x007e,110,clif->pUseSkillToPosMoreInfo,9,15,23,28,30);
+ packet(0x0085,11,clif->pChangeDir,6,10);
+ packet(0x0089,7,clif->pTickSend,3);
+ packet(0x008c,11,clif->pGetCharNameRequest,7);
+ packet(0x0094,21,clif->pMoveToKafra,12,17);
+ packet(0x009b,31,clif->pWantToConnection,3,13,22,26,30);
+ packet(0x009f,12,clif->pUseItem,3,8);
+ packet(0x00a2,18,clif->pSolveCharName,14);
+ packet(0x00a7,15,clif->pWalkToXY,12);
+ packet(0x00f5,7,clif->pTakeItem,3);
+ packet(0x00f7,13,clif->pMoveFromKafra,5,9);
+ packet(0x0113,30,clif->pUseSkillToPos,9,15,23,28);
+ packet(0x0116,12,clif->pDropItem,6,10);
+ packet(0x0190,21,clif->pActionRequest,5,20);
+ packet(0x0216,6);
+ packet(0x023f,2,clif->pMail_refreshinbox,0);
+ packet(0x0240,8);
+ packet(0x0241,6,clif->pMail_read,2);
+ packet(0x0242,-1);
+ packet(0x0243,6,clif->pMail_delete,2);
+ packet(0x0244,6,clif->pMail_getattach,2);
+ packet(0x0245,7);
+ packet(0x0246,4,clif->pMail_winopen,2);
+ packet(0x0247,8,clif->pMail_setattach,2,4);
+ packet(0x0248,68);
+ packet(0x0249,3);
+ packet(0x024a,70);
+ packet(0x024b,4,clif->pAuction_cancelreg,0);
+ packet(0x024c,8,clif->pAuction_setitem,0);
+ packet(0x024d,14);
+ packet(0x024e,6,clif->pAuction_cancel,0);
+ packet(0x024f,10,clif->pAuction_bid,0);
+ packet(0x0250,3);
+ packet(0x0251,2);
+ packet(0x0252,-1);
+#endif
+
+//2005-07-19bSakexe
+#if PACKETVER >= 20050719
+ packet(0x0072,34,clif->pUseSkillToId,6,17,30);
+ packet(0x007e,113,clif->pUseSkillToPosMoreInfo,12,15,18,31,33);
+ packet(0x0085,17,clif->pChangeDir,8,16);
+ packet(0x0089,13,clif->pTickSend,9);
+ packet(0x008c,8,clif->pGetCharNameRequest,4);
+ packet(0x0094,31,clif->pMoveToKafra,16,27);
+ packet(0x009b,32,clif->pWantToConnection,9,15,23,27,31);
+ packet(0x009f,19,clif->pUseItem,9,15);
+ packet(0x00a2,9,clif->pSolveCharName,5);
+ packet(0x00a7,11,clif->pWalkToXY,8);
+ packet(0x00f5,13,clif->pTakeItem,9);
+ packet(0x00f7,18,clif->pMoveFromKafra,11,14);
+ packet(0x0113,33,clif->pUseSkillToPos,12,15,18,31);
+ packet(0x0116,12,clif->pDropItem,3,10);
+ packet(0x0190,24,clif->pActionRequest,11,23);
+#endif
+
+//2005-08-01aSakexe
+#if PACKETVER >= 20050801
+ packet(0x0245,3);
+ packet(0x0251,4);
+#endif
+
+//2005-08-08aSakexe
+#if PACKETVER >= 20050808
+ packet(0x024d,12,clif->pAuction_register,0);
+ packet(0x024e,4);
+#endif
+
+//2005-08-17aSakexe
+#if PACKETVER >= 20050817
+ packet(0x0253,3);
+ packet(0x0254,3,clif->pFeelSaveOk,0);
+#endif
+
+//2005-08-29aSakexe
+#if PACKETVER >= 20050829
+ packet(0x0240,-1);
+ packet(0x0248,-1,clif->pMail_send,2,4,28,68);
+ packet(0x0255,5);
+ packet(0x0256,-1);
+ packet(0x0257,8);
+#endif
+
+//2005-09-12bSakexe
+#if PACKETVER >= 20050912
+ packet(0x0256,5);
+ packet(0x0258,2);
+ packet(0x0259,3);
+#endif
+
+//2005-10-10aSakexe
+#if PACKETVER >= 20051010
+ packet(0x020e,32);
+ packet(0x025a,-1);
+ packet(0x025b,6,clif->pCooking,0);
+#endif
+
+//2005-10-13aSakexe
+#if PACKETVER >= 20051013
+ packet(0x007a,6);
+ packet(0x0251,32);
+ packet(0x025c,4,clif->pAuction_buysell,0);
+#endif
+
+//2005-10-17aSakexe
+#if PACKETVER >= 20051017
+ packet(0x007a,58);
+ packet(0x025d,6,clif->pAuction_close,0);
+ packet(0x025e,4);
+#endif
+
+//2005-10-24aSakexe
+#if PACKETVER >= 20051024
+ packet(0x025f,6);
+ packet(0x0260,6);
+#endif
+
+//2005-11-07aSakexe
+#if PACKETVER >= 20051107
+ packet(0x024e,6,clif->pAuction_cancel,0);
+ packet(0x0251,34,clif->pAuction_search,0);
+#endif
+
+//2006-01-09aSakexe
+#if PACKETVER >= 20060109
+ packet(0x0261,11);
+ packet(0x0262,11);
+ packet(0x0263,11);
+ packet(0x0264,20);
+ packet(0x0265,20);
+ packet(0x0266,30);
+ packet(0x0267,4);
+ packet(0x0268,4);
+ packet(0x0269,4);
+ packet(0x026a,4);
+ packet(0x026b,4);
+ packet(0x026c,4);
+ packet(0x026d,4);
+ packet(0x026f,2);
+ packet(0x0270,2);
+ packet(0x0271,38);
+ packet(0x0272,44);
+#endif
+
+//2006-01-26aSakexe
+#if PACKETVER >= 20060126
+ packet(0x0271,40);
+
+#endif
+
+//2006-03-06aSakexe
+#if PACKETVER >= 20060306
+ packet(0x0273,6);
+ packet(0x0274,8);
+#endif
+
+//2006-03-13aSakexe
+#if PACKETVER >= 20060313
+ packet(0x0273,30,clif->pMail_return,2,6);
+#endif
+
+//2006-03-27aSakexe
+#if PACKETVER >= 20060327
+ packet(0x0072,26,clif->pUseSkillToId,11,18,22);
+ packet(0x007e,120,clif->pUseSkillToPosMoreInfo,5,15,29,38,40);
+ packet(0x0085,12,clif->pChangeDir,7,11);
+ //packet(0x0089,13,clif->pTickSend,9);
+ packet(0x008c,12,clif->pGetCharNameRequest,8);
+ packet(0x0094,23,clif->pMoveToKafra,5,19);
+ packet(0x009b,37,clif->pWantToConnection,9,21,28,32,36);
+ packet(0x009f,24,clif->pUseItem,9,20);
+ packet(0x00a2,11,clif->pSolveCharName,7);
+ packet(0x00a7,15,clif->pWalkToXY,12);
+ packet(0x00f5,13,clif->pTakeItem,9);
+ packet(0x00f7,26,clif->pMoveFromKafra,11,22);
+ packet(0x0113,40,clif->pUseSkillToPos,5,15,29,38);
+ packet(0x0116,17,clif->pDropItem,8,15);
+ packet(0x0190,18,clif->pActionRequest,7,17);
+#endif
+
+//2006-10-23aSakexe
+#if PACKETVER >= 20061023
+ packet(0x006d,110);
+#endif
+
+//2006-04-24aSakexe to 2007-01-02aSakexe
+#if PACKETVER >= 20060424
+ packet(0x023e,8);
+ packet(0x0277,84);
+ packet(0x0278,2);
+ packet(0x0279,2);
+ packet(0x027a,-1);
+ packet(0x027b,14);
+ packet(0x027c,60);
+ packet(0x027d,62);
+ packet(0x027e,-1);
+ packet(0x027f,8);
+ packet(0x0280,12);
+ packet(0x0281,4);
+ packet(0x0282,284);
+ packet(0x0283,6);
+ packet(0x0284,14);
+ packet(0x0285,6);
+ packet(0x0286,4);
+ packet(0x0287,-1);
+ packet(0x0288,6);
+ packet(0x0289,8);
+ packet(0x028a,18);
+ packet(0x028b,-1);
+ packet(0x028c,46);
+ packet(0x028d,34);
+ packet(0x028e,4);
+ packet(0x028f,6);
+ packet(0x0290,4);
+ packet(0x0291,4);
+ packet(0x0292,2,clif->pAutoRevive,0);
+ packet(0x0293,70);
+ packet(0x0294,10);
+ packet(0x0295,-1);
+ packet(0x0296,-1);
+ packet(0x0297,-1);
+ packet(0x0298,8);
+ packet(0x0299,6);
+ packet(0x029a,27);
+ packet(0x029c,66);
+ packet(0x029d,-1);
+ packet(0x029e,11);
+ packet(0x029f,3,clif->pmercenary_action,0);
+ packet(0x02a0,-1);
+ packet(0x02a1,-1);
+ packet(0x02a2,8);
+#endif
+
+//2007-01-08aSakexe
+#if PACKETVER >= 20070108
+ packet(0x0072,30,clif->pUseSkillToId,10,14,26);
+ packet(0x007e,120,clif->pUseSkillToPosMoreInfo,10,19,23,38,40);
+ packet(0x0085,14,clif->pChangeDir,10,13);
+ packet(0x0089,11,clif->pTickSend,7);
+ packet(0x008c,17,clif->pGetCharNameRequest,13);
+ packet(0x0094,17,clif->pMoveToKafra,4,13);
+ packet(0x009b,35,clif->pWantToConnection,7,21,26,30,34);
+ packet(0x009f,21,clif->pUseItem,7,17);
+ packet(0x00a2,10,clif->pSolveCharName,6);
+ packet(0x00a7,8,clif->pWalkToXY,5);
+ packet(0x00f5,11,clif->pTakeItem,7);
+ packet(0x00f7,15,clif->pMoveFromKafra,3,11);
+ packet(0x0113,40,clif->pUseSkillToPos,10,19,23,38);
+ packet(0x0116,19,clif->pDropItem,11,17);
+ packet(0x0190,10,clif->pActionRequest,4,9);
+#endif
+
+//2007-01-22aSakexe
+#if PACKETVER >= 20070122
+ packet(0x02a3,18);
+ packet(0x02a4,2);
+#endif
+
+//2007-01-29aSakexe
+#if PACKETVER >= 20070129
+ packet(0x029b,72);
+ packet(0x02a3,-1);
+ packet(0x02a4,-1);
+ packet(0x02a5,8);
+
+#endif
+
+//2007-02-05aSakexe
+#if PACKETVER >= 20070205
+ packet(0x02aa,4);
+ packet(0x02ab,36);
+ packet(0x02ac,6);
+#endif
+
+//2007-02-12aSakexe
+#if PACKETVER >= 20070212
+ packet(0x0072,25,clif->pUseSkillToId,6,10,21);
+ packet(0x007e,102,clif->pUseSkillToPosMoreInfo,5,9,12,20,22);
+ packet(0x0085,11,clif->pChangeDir,7,10);
+ packet(0x0089,8,clif->pTickSend,4);
+ packet(0x008c,11,clif->pGetCharNameRequest,7);
+ packet(0x0094,14,clif->pMoveToKafra,7,10);
+ packet(0x009b,26,clif->pWantToConnection,4,9,17,21,25);
+ packet(0x009f,14,clif->pUseItem,4,10);
+ packet(0x00a2,15,clif->pSolveCharName,11);
+ //packet(0x00a7,8,clif->pWalkToXY,5);
+ packet(0x00f5,8,clif->pTakeItem,4);
+ packet(0x00f7,22,clif->pMoveFromKafra,14,18);
+ packet(0x0113,22,clif->pUseSkillToPos,5,9,12,20);
+ packet(0x0116,10,clif->pDropItem,5,8);
+ packet(0x0190,19,clif->pActionRequest,5,18);
+#endif
+
+//2007-05-07aSakexe
+#if PACKETVER >= 20070507
+ packet(0x01fd,15,clif->pRepairItem,2);
+#endif
+
+//2007-02-27aSakexe to 2007-10-02aSakexe
+#if PACKETVER >= 20070227
+ packet(0x0288,10,clif->pcashshop_buy,2,4,6);
+ packet(0x0289,12);
+ packet(0x02a6,22);
+ packet(0x02a7,22);
+ packet(0x02a8,162);
+ packet(0x02a9,58);
+ packet(0x02ad,8);
+ packet(0x02b0,85);
+ packet(0x02b1,-1);
+ packet(0x02b2,-1);
+ packet(0x02b3,107);
+ packet(0x02b4,6);
+ packet(0x02b5,-1);
+ packet(0x02b6,7,clif->pquestStateAck,2,6);
+ packet(0x02b7,7);
+ packet(0x02b8,22);
+ packet(0x02b9,191);
+ packet(0x02ba,11,clif->pHotkey,2,4,5,9);
+ packet(0x02bb,8);
+ packet(0x02bc,6);
+ packet(0x02bf,10);
+ packet(0x02c0,2);
+ packet(0x02c1,-1);
+ packet(0x02c2,-1);
+ packet(0x02c4,26,clif->pPartyInvite2,2);
+ packet(0x02c5,30);
+ packet(0x02c6,30);
+ packet(0x02c7,7,clif->pReplyPartyInvite2,2,6);
+ packet(0x02c8,3);
+ packet(0x02c9,3);
+ packet(0x02ca,3);
+ packet(0x02cb,20);
+ packet(0x02cc,4);
+ packet(0x02cd,26);
+ packet(0x02ce,10);
+ packet(0x02cf,6);
+ packet(0x02d0,-1);
+ packet(0x02d1,-1);
+ packet(0x02d2,-1);
+ packet(0x02d3,4);
+ packet(0x02d4,29);
+ packet(0x02d5,2);
+ packet(0x02d6,6,clif->pViewPlayerEquip,2);
+ packet(0x02d7,-1);
+ packet(0x02d8,10,clif->pEquipTick,6);
+ packet(0x02d9,10);
+ packet(0x02da,3);
+ packet(0x02db,-1,clif->pBattleChat,2,4);
+ packet(0x02dc,-1);
+ packet(0x02dd,32);
+ packet(0x02de,6);
+ packet(0x02df,36);
+ packet(0x02e0,34);
+#endif
+
+//2007-10-23aSakexe
+#if PACKETVER >= 20071023
+ packet(0x02cb,65);
+ packet(0x02cd,71);
+#endif
+
+//2007-11-06aSakexe
+#if PACKETVER >= 20071106
+ packet(0x0078,55);
+ packet(0x007c,42);
+ packet(0x022c,65);
+ packet(0x029b,80);
+#endif
+
+//2007-11-13aSakexe
+#if PACKETVER >= 20071113
+ packet(0x02e1,33);
+#endif
+
+//2007-11-20aSakexe
+#if PACKETVER >= 20071120
+ //packet(0x01df,10 <- ???);
+ packet(0x02e2,14);
+ packet(0x02e3,25);
+ packet(0x02e4,8);
+ packet(0x02e5,8);
+ packet(0x02e6,6);
+#endif
+
+//2007-11-27aSakexe
+#if PACKETVER >= 20071127
+ packet(0x02e7,-1);
+#endif
+
+//2008-01-02aSakexe
+#if PACKETVER >= 20080102
+ packet(0x01df,6,clif->pGMReqAccountName,2);
+ packet(0x02e8,-1);
+ packet(0x02e9,-1);
+ packet(0x02ea,-1);
+ packet(0x02eb,13);
+ packet(0x02ec,67);
+ packet(0x02ed,59);
+ packet(0x02ee,60);
+ packet(0x02ef,8);
+#endif
+
+//2008-03-18aSakexe
+#if PACKETVER >= 20080318
+ packet(0x02bf,-1);
+ packet(0x02c0,-1);
+ packet(0x02f0,10);
+ packet(0x02f1,2,clif->pProgressbar,0);
+ packet(0x02f2,2);
+#endif
+
+//2008-03-25bSakexe
+#if PACKETVER >= 20080325
+ packet(0x02f3,-1);
+ packet(0x02f4,-1);
+ packet(0x02f5,-1);
+ packet(0x02f6,-1);
+ packet(0x02f7,-1);
+ packet(0x02f8,-1);
+ packet(0x02f9,-1);
+ packet(0x02fa,-1);
+ packet(0x02fb,-1);
+ packet(0x02fc,-1);
+ packet(0x02fd,-1);
+ packet(0x02fe,-1);
+ packet(0x02ff,-1);
+ packet(0x0300,-1);
+#endif
+
+//2008-04-01aSakexe
+#if PACKETVER >= 20080401
+ packet(0x0301,-1);
+ packet(0x0302,-1);
+ packet(0x0303,-1);
+ packet(0x0304,-1);
+ packet(0x0305,-1);
+ packet(0x0306,-1);
+ packet(0x0307,-1);
+ packet(0x0308,-1);
+ packet(0x0309,-1);
+ packet(0x030a,-1);
+ packet(0x030b,-1);
+ packet(0x030c,-1);
+ packet(0x030d,-1);
+ packet(0x030e,-1);
+ packet(0x030f,-1);
+ packet(0x0310,-1);
+ packet(0x0311,-1);
+ packet(0x0312,-1);
+ packet(0x0313,-1);
+ packet(0x0314,-1);
+ packet(0x0315,-1);
+ packet(0x0316,-1);
+ packet(0x0317,-1);
+ packet(0x0318,-1);
+ packet(0x0319,-1);
+ packet(0x031a,-1);
+ packet(0x031b,-1);
+ packet(0x031c,-1);
+ packet(0x031d,-1);
+ packet(0x031e,-1);
+ packet(0x031f,-1);
+ packet(0x0320,-1);
+ packet(0x0321,-1);
+ packet(0x0322,-1);
+ packet(0x0323,-1);
+ packet(0x0324,-1);
+ packet(0x0325,-1);
+ packet(0x0326,-1);
+ packet(0x0327,-1);
+ packet(0x0328,-1);
+ packet(0x0329,-1);
+ packet(0x032a,-1);
+ packet(0x032b,-1);
+ packet(0x032c,-1);
+ packet(0x032d,-1);
+ packet(0x032e,-1);
+ packet(0x032f,-1);
+ packet(0x0330,-1);
+ packet(0x0331,-1);
+ packet(0x0332,-1);
+ packet(0x0333,-1);
+ packet(0x0334,-1);
+ packet(0x0335,-1);
+ packet(0x0336,-1);
+ packet(0x0337,-1);
+ packet(0x0338,-1);
+ packet(0x0339,-1);
+ packet(0x033a,-1);
+ packet(0x033b,-1);
+ packet(0x033c,-1);
+ packet(0x033d,-1);
+ packet(0x033e,-1);
+ packet(0x033f,-1);
+ packet(0x0340,-1);
+ packet(0x0341,-1);
+ packet(0x0342,-1);
+ packet(0x0343,-1);
+ packet(0x0344,-1);
+ packet(0x0345,-1);
+ packet(0x0346,-1);
+ packet(0x0347,-1);
+ packet(0x0348,-1);
+ packet(0x0349,-1);
+ packet(0x034a,-1);
+ packet(0x034b,-1);
+ packet(0x034c,-1);
+ packet(0x034d,-1);
+ packet(0x034e,-1);
+ packet(0x034f,-1);
+ packet(0x0350,-1);
+ packet(0x0351,-1);
+ packet(0x0352,-1);
+ packet(0x0353,-1);
+ packet(0x0354,-1);
+ packet(0x0355,-1);
+ packet(0x0356,-1);
+ packet(0x0357,-1);
+ packet(0x0358,-1);
+ packet(0x0359,-1);
+ packet(0x035a,-1);
+#endif
+
+//2008-05-27aSakexe
+#if PACKETVER >= 20080527
+ packet(0x035b,-1);
+ packet(0x035c,2);
+ packet(0x035d,-1);
+ packet(0x035e,2);
+ packet(0x035f,-1);
+ packet(0x0389,-1);
+#endif
+
+//2008-08-20aSakexe
+#if PACKETVER >= 20080820
+ packet(0x040c,-1);
+ packet(0x040d,-1);
+ packet(0x040e,-1);
+ packet(0x040f,-1);
+ packet(0x0410,-1);
+ packet(0x0411,-1);
+ packet(0x0412,-1);
+ packet(0x0413,-1);
+ packet(0x0414,-1);
+ packet(0x0415,-1);
+ packet(0x0416,-1);
+ packet(0x0417,-1);
+ packet(0x0418,-1);
+ packet(0x0419,-1);
+ packet(0x041a,-1);
+ packet(0x041b,-1);
+ packet(0x041c,-1);
+ packet(0x041d,-1);
+ packet(0x041e,-1);
+ packet(0x041f,-1);
+ packet(0x0420,-1);
+ packet(0x0421,-1);
+ packet(0x0422,-1);
+ packet(0x0423,-1);
+ packet(0x0424,-1);
+ packet(0x0425,-1);
+ packet(0x0426,-1);
+ packet(0x0427,-1);
+ packet(0x0428,-1);
+ packet(0x0429,-1);
+ packet(0x042a,-1);
+ packet(0x042b,-1);
+ packet(0x042c,-1);
+ packet(0x042d,-1);
+ packet(0x042e,-1);
+ packet(0x042f,-1);
+ packet(0x0430,-1);
+ packet(0x0431,-1);
+ packet(0x0432,-1);
+ packet(0x0433,-1);
+ packet(0x0434,-1);
+ packet(0x0435,-1);
+#endif
+
+//2008-09-10aSakexe
+#if PACKETVER >= 20080910
+ packet(0x0436,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0437,7,clif->pActionRequest,2,6);
+ packet(0x0438,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0439,8,clif->pUseItem,2,4);
+#endif
+
+//2008-11-13aSakexe
+#if PACKETVER >= 20081113
+ packet(0x043d,8);
+ packet(0x043e,-1);
+ packet(0x043f,8);
+#endif
+
+//2008-11-26aSakexe
+#if PACKETVER >= 20081126
+ packet(0x01a2,37);
+ packet(0x0440,10);
+ packet(0x0441,4);
+#endif
+
+//2008-12-10aSakexe
+#if PACKETVER >= 20081210
+ packet(0x0442,-1);
+ packet(0x0443,8,clif->pSkillSelectMenu,2,6);
+#endif
+
+//2009-01-14aSakexe
+#if PACKETVER >= 20090114
+ packet(0x043f,25);
+ packet(0x0444,-1);
+ packet(0x0445,10);
+#endif
+
+//2009-02-18aSakexe
+#if PACKETVER >= 20090218
+ packet(0x0446,14);
+#endif
+
+//2009-02-25aSakexe
+#if PACKETVER >= 20090225
+ packet(0x0448,-1);
+#endif
+
+//2009-03-30aSakexe
+#if PACKETVER >= 20090330
+ packet(0x0449,4);
+#endif
+
+//2009-04-08aSakexe
+#if PACKETVER >= 20090408
+ packet(0x02a6,-1);
+ packet(0x02a7,-1);
+ packet(0x044a,6);
+#endif
+
+//2008-08-27aRagexeRE
+#if PACKETVER >= 20080827
+ packet(0x0072,22,clif->pUseSkillToId,9,15,18);
+ packet(0x007c,44);
+ packet(0x007e,105,clif->pUseSkillToPosMoreInfo,10,14,18,23,25);
+ packet(0x0085,10,clif->pChangeDir,4,9);
+ packet(0x0089,11,clif->pTickSend,7);
+ packet(0x008c,14,clif->pGetCharNameRequest,10);
+ packet(0x0094,19,clif->pMoveToKafra,3,15);
+ packet(0x009b,34,clif->pWantToConnection,7,15,25,29,33);
+ packet(0x009f,20,clif->pUseItem,7,20);
+ packet(0x00a2,14,clif->pSolveCharName,10);
+ packet(0x00a7,9,clif->pWalkToXY,6);
+ packet(0x00f5,11,clif->pTakeItem,7);
+ packet(0x00f7,17,clif->pMoveFromKafra,3,13);
+ packet(0x0113,25,clif->pUseSkillToPos,10,14,18,23);
+ packet(0x0116,17,clif->pDropItem,6,15);
+ packet(0x0190,23,clif->pActionRequest,9,22);
+ packet(0x02e2,20);
+ packet(0x02e3,22);
+ packet(0x02e4,11);
+ packet(0x02e5,9);
+#endif
+
+//2008-09-10aRagexeRE
+#if PACKETVER >= 20080910
+ packet(0x0436,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0437,7,clif->pActionRequest,2,6);
+ packet(0x0438,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0439,8,clif->pUseItem,2,4);
+
+#endif
+
+//2008-11-12aRagexeRE
+#if PACKETVER >= 20081112
+ packet(0x043d,8);
+ //packet(0x043e,-1);
+ packet(0x043f,8);
+#endif
+
+//2008-12-17aRagexeRE
+#if PACKETVER >= 20081217
+ packet(0x01a2,37);
+ //packet(0x0440,10);
+ //packet(0x0441,4);
+ //packet(0x0442,8);
+ //packet(0x0443,8);
+#endif
+
+//2008-12-17bRagexeRE
+#if PACKETVER >= 20081217
+ packet(0x006d,114);
+
+#endif
+
+//2009-01-21aRagexeRE
+#if PACKETVER >= 20090121
+ packet(0x043f,25);
+ //packet(0x0444,-1);
+ //packet(0x0445,10);
+#endif
+
+//2009-02-18aRagexeRE
+#if PACKETVER >= 20090218
+ //packet(0x0446,14);
+#endif
+
+//2009-02-26cRagexeRE
+#if PACKETVER >= 20090226
+ //packet(0x0448,-1);
+#endif
+
+//2009-04-01aRagexeRE
+#if PACKETVER >= 20090401
+ //packet(0x0449,4);
+#endif
+
+//2009-05-14aRagexeRE
+#if PACKETVER >= 20090514
+ //packet(0x044b,2);
+#endif
+
+//2009-05-20aRagexeRE
+#if PACKETVER >= 20090520
+ //packet(0x07d0,6);
+ //packet(0x07d1,2);
+ //packet(0x07d2,-1);
+ //packet(0x07d3,4);
+ //packet(0x07d4,4);
+ //packet(0x07d5,4);
+ //packet(0x07d6,4);
+ //packet(0x0447,2);
+#endif
+
+//2009-06-03aRagexeRE
+#if PACKETVER >= 20090603
+ packet(0x07d7,8,clif->pPartyChangeOption,2,6,7);
+ packet(0x07d8,8);
+ packet(0x07d9,254);
+ packet(0x07da,6,clif->pPartyChangeLeader,2);
+#endif
+
+//2009-06-10aRagexeRE
+#if PACKETVER >= 20090610
+ //packet(0x07db,8);
+#endif
+
+//2009-06-17aRagexeRE
+#if PACKETVER >= 20090617
+ packet(0x07d9,268);
+ //packet(0x07dc,6);
+ //packet(0x07dd,54);
+ //packet(0x07de,30);
+ //packet(0x07df,54);
+#endif
+
+//2009-07-01aRagexeRE
+#if PACKETVER >= 20090701
+ //packet(0x0275,37);
+ //packet(0x0276,-1);
+#endif
+
+//2009-07-08aRagexeRE
+#if PACKETVER >= 20090708
+ //packet(0x07e0,58);
+#endif
+
+//2009-07-15aRagexeRE
+#if PACKETVER >= 20090715
+ packet(0x07e1,15);
+#endif
+
+//2009-08-05aRagexeRE
+#if PACKETVER >= 20090805
+ packet(0x07e2,8);
+#endif
+
+//2009-08-18aRagexeRE
+#if PACKETVER >= 20090818
+ packet(0x07e3,6);
+ packet(0x07e4,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x07e6,8);
+#endif
+
+//2009-08-25aRagexeRE
+#if PACKETVER >= 20090825
+ //packet(0x07e6,28);
+ packet(0x07e7,5);
+#endif
+
+//2009-09-22aRagexeRE
+#if PACKETVER >= 20090922
+ packet(0x07e5,8);
+ packet(0x07e6,8);
+ packet(0x07e7,32);
+ packet(0x07e8,-1);
+ packet(0x07e9,5);
+#endif
+
+//2009-09-29aRagexeRE
+#if PACKETVER >= 20090929
+ //packet(0x07ea,2);
+ //packet(0x07eb,-1);
+ //packet(0x07ec,6);
+ //packet(0x07ed,8);
+ //packet(0x07ee,6);
+ //packet(0x07ef,8);
+ //packet(0x07f0,4);
+ //packet(0x07f2,4);
+ //packet(0x07f3,3);
+#endif
+
+//2009-10-06aRagexeRE
+#if PACKETVER >= 20091006
+ //packet(0x07ec,8);
+ //packet(0x07ed,10);
+ //packet(0x07f0,8);
+ //packet(0x07f1,15);
+ //packet(0x07f2,6);
+ //packet(0x07f3,4);
+ //packet(0x07f4,3);
+#endif
+
+//2009-10-27aRagexeRE
+#if PACKETVER >= 20091027
+ packet(0x07f5,6,clif->pGMReqAccountName,2);
+ packet(0x07f6,14);
+#endif
+
+//2009-11-03aRagexeRE
+#if PACKETVER >= 20091103
+ packet(0x07f7,-1);
+ packet(0x07f8,-1);
+ packet(0x07f9,-1);
+#endif
+
+//2009-11-17aRagexeRE
+#if PACKETVER >= 20091117
+ packet(0x07fa,8);
+
+#endif
+
+//2009-11-24aRagexeRE
+#if PACKETVER >= 20091124
+ packet(0x07fb,25);
+#endif
+
+//2009-12-01aRagexeRE
+#if PACKETVER >= 20091201
+ //packet(0x07fc,10);
+ //packet(0x07fd,-1);
+ packet(0x07fe,26);
+ //packet(0x07ff,-1);
+#endif
+
+//2009-12-15aRagexeRE
+#if PACKETVER >= 20091215
+ packet(0x0800,-1);
+ //packet(0x0801,-1);
+#endif
+
+//2009-12-22aRagexeRE
+#if PACKETVER >= 20091222
+ packet(0x0802,18,clif->pPartyBookingRegisterReq,2,4,6); // Booking System
+ packet(0x0803,4);
+ packet(0x0804,8); // Booking System
+ packet(0x0805,-1);
+ packet(0x0806,4,clif->pPartyBookingDeleteReq,2);// Booking System
+ //packet(0x0807,2);
+ packet(0x0808,4); // Booking System
+ //packet(0x0809,14);
+ //packet(0x080A,50);
+ //packet(0x080B,18);
+ //packet(0x080C,6);
+#endif
+
+ //2009-12-29aRagexeRE
+#if PACKETVER >= 20091229
+ packet(0x0804,14,clif->pPartyBookingSearchReq,2,4,6,8,12);// Booking System
+ packet(0x0806,2,clif->pPartyBookingDeleteReq,0);// Booking System
+ packet(0x0807,4);
+ packet(0x0808,14,clif->pPartyBookingUpdateReq,2); // Booking System
+ packet(0x0809,50);
+ packet(0x080A,18);
+ packet(0x080B,6);// Booking System
+#endif
+
+ //2010-01-05aRagexeRE
+#if PACKETVER >= 20100105
+ packet(0x0801,-1,clif->pPurchaseReq2,2,4,8,12);
+#endif
+
+ //2010-01-26aRagexeRE
+#if PACKETVER >= 20100126
+ //packet(0x080C,2);
+ //packet(0x080D,3);
+ packet(0x080E,14);
+#endif
+
+ //2010-02-09aRagexeRE
+#if PACKETVER >= 20100209
+ //packet(0x07F0,6);
+#endif
+
+ //2010-02-23aRagexeRE
+#if PACKETVER >= 20100223
+ packet(0x080F,20);
+#endif
+
+ //2010-03-03aRagexeRE
+#if PACKETVER >= 20100303
+ packet(0x0810,3);
+ packet(0x0811,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ //packet(0x0812,86);
+ //packet(0x0813,6);
+ //packet(0x0814,6);
+ //packet(0x0815,-1);
+ //packet(0x0817,-1);
+ //packet(0x0818,6);
+ //packet(0x0819,4);
+#endif
+
+ //2010-03-09aRagexeRE
+#if PACKETVER >= 20100309
+ packet(0x0813,-1);
+ //packet(0x0814,2);
+ //packet(0x0815,6);
+ packet(0x0816,6);
+ packet(0x0818,-1);
+ //packet(0x0819,10);
+ //packet(0x081A,4);
+ //packet(0x081B,4);
+ //packet(0x081C,6);
+ packet(0x081d,22);
+ packet(0x081e,8);
+#endif
+
+ //2010-03-23aRagexeRE
+#if PACKETVER >= 20100323
+ //packet(0x081F,-1);
+#endif
+
+ //2010-04-06aRagexeRE
+#if PACKETVER >= 20100406
+ //packet(0x081A,6);
+#endif
+
+ //2010-04-13aRagexeRE
+#if PACKETVER >= 20100413
+ //packet(0x081A,10);
+ packet(0x0820,11);
+ //packet(0x0821,2);
+ //packet(0x0822,9);
+ //packet(0x0823,-1);
+#endif
+
+ //2010-04-14dRagexeRE
+#if PACKETVER >= 20100414
+ //packet(0x081B,8);
+#endif
+
+ //2010-04-20aRagexeRE
+#if PACKETVER >= 20100420
+ packet(0x0812,8);
+ packet(0x0814,86);
+ packet(0x0815,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0817,6,clif->pReqClickBuyingStore,2);
+ packet(0x0819,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x081a,4);
+ packet(0x081b,10);
+ packet(0x081c,10);
+ packet(0x0824,6);
+#endif
+
+ //2010-06-01aRagexeRE
+#if PACKETVER >= 20100601
+ //packet(0x0825,-1);
+ //packet(0x0826,4);
+ packet(0x0835,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0836,-1);
+ packet(0x0837,3);
+ //packet(0x0838,3);
+#endif
+
+ //2010-06-08aRagexeRE
+#if PACKETVER >= 20100608
+ packet(0x0838,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x083A,4); // Search Stalls Feature
+ packet(0x083B,2,clif->pCloseSearchStoreInfo,0);
+ packet(0x083C,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x083D,6);
+#endif
+
+//2010-06-15aRagexeRE
+#if PACKETVER >= 20100615
+ //packet(0x083E,26);
+#endif
+
+//2010-06-22aRagexeRE
+#if PACKETVER >= 20100622
+ //packet(0x083F,22);
+#endif
+
+//2010-06-29aRagexeRE
+#if PACKETVER >= 20100629
+ packet(0x00AA,9);
+ //packet(0x07F1,18);
+ //packet(0x07F2,8);
+ //packet(0x07F3,6);
+#endif
+
+//2010-07-01aRagexeRE
+#if PACKETVER >= 20100701
+ packet(0x083A,5);// Search Stalls Feature
+#endif
+
+//2010-07-13aRagexeRE
+#if PACKETVER >= 20100713
+ //packet(0x0827,6);
+ //packet(0x0828,14);
+ //packet(0x0829,6);
+ //packet(0x082A,10);
+ //packet(0x082B,6);
+ //packet(0x082C,14);
+ //packet(0x0840,-1);
+ //packet(0x0841,19);
+#endif
+
+//2010-07-14aRagexeRE
+#if PACKETVER >= 20100714
+ //packet(0x841,4);
+#endif
+
+//2010-08-03aRagexeRE
+#if PACKETVER >= 20100803
+ packet(0x0839,66);
+ packet(0x0842,6,clif->pGMRecall2,2);
+ packet(0x0843,6,clif->pGMRemove2,2);
+#endif
+
+//2010-11-24aRagexeRE
+#if PACKETVER >= 20101124
+ packet(0x0288,-1,clif->pcashshop_buy,4,8);
+ packet(0x0436,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x035f,5,clif->pWalkToXY,2);
+ packet(0x0360,6,clif->pTickSend,2);
+ packet(0x0361,5,clif->pChangeDir,2,4);
+ packet(0x0362,6,clif->pTakeItem,2);
+ packet(0x0363,6,clif->pDropItem,2,4);
+ packet(0x0364,8,clif->pMoveToKafra,2,4);
+ packet(0x0365,8,clif->pMoveFromKafra,2,4);
+ packet(0x0366,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0367,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x0368,6,clif->pGetCharNameRequest,2);
+ packet(0x0369,6,clif->pSolveCharName,2);
+ packet(0x0856,-1);
+ packet(0x0857,-1);
+ packet(0x0858,-1);
+ packet(0x0859,-1);
+#endif
+
+//2011-10-05aRagexeRE
+#if PACKETVER >= 20111005
+ packet(0x0364,5,clif->pWalkToXY,2);
+ packet(0x0817,6,clif->pTickSend,2);
+ packet(0x0366,5,clif->pChangeDir,2,4);
+ packet(0x0815,6,clif->pTakeItem,2);
+ packet(0x0885,6,clif->pDropItem,2,4);
+ packet(0x0893,8,clif->pMoveToKafra,2,4);
+ packet(0x0897,8,clif->pMoveFromKafra,2,4);
+ packet(0x0369,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x08ad,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x088a,6,clif->pGetCharNameRequest,2);
+ packet(0x0838,6,clif->pSolveCharName,2);
+ packet(0x0439,8,clif->pUseItem,2,4);
+ packet(0x08d2,10);
+#endif
+
+//2011-11-02aRagexe
+#if PACKETVER >= 20111102
+ packet(0x0436,26,clif->pFriendsListAdd,2);
+ packet(0x0898,5,clif->pHomMenu,4);
+ packet(0x0281,36,clif->pStoragePassword,0);
+ packet(0x088d,26,clif->pPartyInvite2,2);
+ packet(0x083c,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x08aa,7,clif->pActionRequest,2,6);
+ packet(0x02c4,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0811,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x890,8);
+ packet(0x08a5,18,clif->pPartyBookingRegisterReq,2,4,6);
+ packet(0x0835,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x089b,2,clif->pReqCloseBuyingStore,0);
+ packet(0x08a1,6,clif->pReqClickBuyingStore,2);
+ packet(0x089e,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x08ab,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x088b,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x08a2,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+#endif
+
+//2012-03-07fRagexeRE
+#if PACKETVER >= 20120307
+ packet(0x086A,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0437,5,clif->pWalkToXY,2);
+ packet(0x0887,6,clif->pTickSend,2);
+ packet(0x0890,5,clif->pChangeDir,2,4);
+ packet(0x0865,6,clif->pTakeItem,2);
+ packet(0x02C4,6,clif->pDropItem,2,4);
+ packet(0x093B,8,clif->pMoveToKafra,2,4);
+ packet(0x0963,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x096A,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0369,26,clif->pFriendsListAdd,2);
+ packet(0x0863,5,clif->pHomMenu,4);
+ packet(0x0861,36,clif->pStoragePassword,0);
+ packet(0x0929,26,clif->pPartyInvite2,2);
+ packet(0x0885,7,clif->pActionRequest,2,6);
+ packet(0x0889,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0870,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x0926,18,clif->pPartyBookingRegisterReq,2,4,6);
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0884,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0439,8,clif->pUseItem,2,4);
+#endif
+
+//2012-04-10aRagexeRE
+#if PACKETVER >= 20120410
+ packet(0x01FD,15,clif->pRepairItem,2);
+ packet(0x089C,26,clif->pFriendsListAdd,2);
+ packet(0x0885,5,clif->pHomMenu,2,4);
+ packet(0x0961,36,clif->pStoragePassword,0);
+ packet(0x0288,-1,clif->pcashshop_buy,4,8);
+ packet(0x091C,26,clif->pPartyInvite2,2);
+ packet(0x094B,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0439,8,clif->pUseItem,2,4);
+ packet(0x0945,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0437,5,clif->pWalkToXY,2);
+ packet(0x0886,6,clif->pTickSend,2);
+ packet(0x0871,5,clif->pChangeDir,2,4);
+ packet(0x0938,6,clif->pTakeItem,2);
+ packet(0x0891,6,clif->pDropItem,2,4);
+ packet(0x086C,8,clif->pMoveToKafra,2,4);
+ packet(0x08A6,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x0889,6,clif->pGetCharNameRequest,2);
+ packet(0x0884,6,clif->pSolveCharName,2);
+ packet(0x08E5,41,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x08E6,4);
+ packet(0x08E7,10,clif->pPartyBookingSearchReq,2);
+ packet(0x08E8,-1);
+ packet(0x08E9,2,clif->pPartyBookingDeleteReq,2);
+ packet(0x08EA,4);
+ packet(0x08EB,39,clif->pPartyBookingUpdateReq,2);
+ packet(0x08EC,73);
+ packet(0x08ED,43);
+ packet(0x08EE,6);
+ //packet(0x08EF,6,bookingignorereq,2);
+ packet(0x08F0,6);
+ //packet(0x08F1,6,bookingjoinpartyreq,2);
+ packet(0x08F2,36);
+ packet(0x08F3,-1);
+ packet(0x08F4,6);
+ //packet(0x08F5,-1,bookingsummonmember,2,4);
+ packet(0x08F6,22);
+ packet(0x08F7,3);
+ packet(0x08F8,7);
+ packet(0x08F9,6);
+ packet(0x08FA,6);
+ //packet(0x08FB,6,bookingcanceljoinparty,2);
+ packet(0x0907,5,clif->pMoveItem,2,4);
+ packet(0x0908,5);
+ //packet(0x08D7,28,battlegroundreg,2,4);
+ packet(0x08CF,10);//Amulet spirits
+ packet(0x0977,14);//Monster HP Bar
+#endif
+
+//2012-04-18aRagexeRE [Special Thanks to Judas!]
+#if PACKETVER >= 20120418
+ packet(0x023B,26,clif->pFriendsListAdd,2);
+ packet(0x0361,5,clif->pHomMenu,2,4);
+ packet(0x08A8,36,clif->pStoragePassword,0);
+ packet(0x0802,26,clif->pPartyInvite2,2);
+ packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x035F,6,clif->pTickSend,2);
+ packet(0x0202,5,clif->pChangeDir,2,4);
+ packet(0x07E4,6,clif->pTakeItem,2);
+ packet(0x0362,6,clif->pDropItem,2,4);
+ packet(0x07EC,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x096A,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x08E5,41,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x08d2,10);
+#endif
+
+//2012-06-18aRagexeRE
+#if PACKETVER >= 20120618
+ packet(0x0983,29);
+#endif
+
+// ========== 2012-07-02aRagexeRE =============
+// - 2012-07-02 is NOT STABLE.
+// - The packets are kept here for reference, DONT USE THEM.
+#if PACKETVER >= 20120702
+ packet(0x0363,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0364,6,clif->pTickSend,2);
+ packet(0x085a,7,clif->pActionRequest,2,6);
+ packet(0x0861,8,clif->pMoveFromKafra,2,4);
+ packet(0x0862,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0863,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0886,6,clif->pSolveCharName,2);
+ packet(0x0889,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x089e,6,clif->pDropItem,2,4);
+ packet(0x089f,6,clif->pTakeItem,2);
+ packet(0x08a0,8,clif->pMoveToKafra,2,4);
+ packet(0x094a,6,clif->pGetCharNameRequest,2);
+ packet(0x0953,5,clif->pWalkToXY,2);
+ packet(0x0960,5,clif->pChangeDir,2,4);
+#endif
+
+//2013-03-20Ragexe (Judas)
+#if PACKETVER >= 20130320
+ packet(0x01FD,15,clif->pRepairItem,2);
+ packet(0x086D,26,clif->pFriendsListAdd,2);
+ packet(0x0897,5,clif->pHomMenu,2,4);
+ packet(0x0947,36,clif->pStoragePassword,0);
+ //packet(0x0288,-1,clif->pcashshop_buy,4,8);
+ packet(0x086F,26,clif->pPartyInvite2,2);
+ packet(0x0888,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x08c9,4);
+ packet(0x088E,7,clif->pActionRequest,2,6);
+ packet(0x089B,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0881,5,clif->pWalkToXY,2);
+ packet(0x0363,6,clif->pTickSend,2);
+ packet(0x093F,5,clif->pChangeDir,2,4);
+ packet(0x0933,6,clif->pTakeItem,2);
+ packet(0x0438,6,clif->pDropItem,2,4);
+ packet(0x08AC,8,clif->pMoveToKafra,2,4);
+ packet(0x0874,8,clif->pMoveFromKafra,2,4);
+ packet(0x0959,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x085A,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x0898,6,clif->pGetCharNameRequest,2);
+ packet(0x094C,6,clif->pSolveCharName,2);
+ packet(0x0907,5,clif->pMoveItem,2,4);
+ packet(0x0908,5);
+ packet(0x08CF,10); //Amulet spirits
+ packet(0x08d2,10);
+ packet(0x0977,14); //Monster HP Bar
+ packet(0x0998,8,clif->pEquipItem,2,4);
+ //packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x0938,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ //packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ //packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0922,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x094E,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ //packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ //packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+#endif
+
+#endif /* _PACKETS_H_ */
diff --git a/src/map/pc.c b/src/map/pc.c
index 104e5829f..796280308 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1050,10 +1050,10 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
//display login notice
ShowInfo("'"CL_WHITE"%s"CL_RESET"' logged in."
" (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"',"
- " Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"',"
+ " IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"',"
" Group '"CL_WHITE"%d"CL_RESET"').\n",
sd->status.name, sd->status.account_id, sd->status.char_id,
- sd->packet_ver, CONVIP(ip), sd->group_id);
+ CONVIP(ip), sd->group_id);
// Send friends list
clif->friendslist_send(sd);
diff --git a/src/map/pc.h b/src/map/pc.h
index af61b97e9..809822e78 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -183,7 +183,6 @@ struct map_session_data {
int group_id, group_pos, group_level;
unsigned int permissions;/* group permissions */
- int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 ... 18
struct mmo_charstatus status;
struct registry save_reg;
diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt
index 1d8bd5fe2..2efeabd02 100644
--- a/src/map/sql/CMakeLists.txt
+++ b/src/map/sql/CMakeLists.txt
@@ -27,6 +27,7 @@ set( SQL_MAP_HEADERS
"${SQL_MAP_SOURCE_DIR}/mercenary.h"
"${SQL_MAP_SOURCE_DIR}/mob.h"
"${SQL_MAP_SOURCE_DIR}/npc.h"
+ "${SQL_MAP_SOURCE_DIR}/packets.h"
"${SQL_MAP_SOURCE_DIR}/party.h"
"${SQL_MAP_SOURCE_DIR}/path.h"
"${SQL_MAP_SOURCE_DIR}/pc.h"