summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-20 03:38:47 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-20 03:38:47 +0000
commit0a4feb1f7d662faeefd1072d39530c2f610a3a1a (patch)
treeb2a82245d6672ca1261efc076caf052bc62f726c /src/map
parent0f4b1a36a2552e62227ee1350e8034a8f122c028 (diff)
downloadhercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.gz
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.bz2
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.tar.xz
hercules-0a4feb1f7d662faeefd1072d39530c2f610a3a1a.zip
* Corrected packet_db.txt. See topic:158382 for details. As a side-effect, the latest packet version is now 22 instead of 21.
* Added a charserver config option for the character renaming flag, along with a detailed comment on what it's supposed to be. This eliminates all that "change PACKETVER to 8 and recompile" mess. * Moved PACKETVER back to clif.h, cleaned the related code a bit. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10888 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c18
-rw-r--r--src/map/clif.h8
2 files changed, 16 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index f9fc08a56..72295dc4c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -776,7 +776,7 @@ static int clif_set0078(struct block_list* bl, unsigned char* buf)
struct map_session_data* sd;
BL_CAST(BL_PC, bl, sd);
-#if PACKETVER > 6
+#if PACKETVER >= 7
memset(buf,0,packet_len(0x22a));
WBUFW(buf,0)=0x22a;
@@ -943,7 +943,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
struct map_session_data* sd;
BL_CAST(BL_PC, bl, sd);
-#if PACKETVER > 6
+#if PACKETVER >= 7
memset(buf,0,packet_len(0x22c));
WBUFW(buf,0)=0x22c;
@@ -1054,7 +1054,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
#endif
}
//Non-player sprites only require a few fields.
-#if PACKETVER > 6
+#if PACKETVER >= 7
memset(buf,0,packet_len(0x22c));
WBUFW(buf,0)=0x22c;
@@ -1132,7 +1132,7 @@ static void clif_setdisguise(struct map_session_data *sd, unsigned char *buf,int
{
if (flag) {
WBUFL(buf,2)=sd->bl.id;
-#if PACKETVER > 6
+#if PACKETVER >= 7
switch (WBUFW(buf,0)) {
case 0x22c:
case 0x22b:
@@ -1144,7 +1144,7 @@ static void clif_setdisguise(struct map_session_data *sd, unsigned char *buf,int
#endif
WBUFW(buf,12)=OPTION_INVISIBLE;
WBUFW(buf,14)=sd->status.class_;
-#if PACKETVER > 6
+#if PACKETVER >= 7
break;
}
#endif
@@ -1301,7 +1301,7 @@ int clif_spawn(struct block_list *bl)
clif_setdisguise((TBL_PC*)bl, buf, packet_len(0x1d9), 0);
break;
#endif
-#if PACKETVER > 6
+#if PACKETVER >= 7
case 0x22a: //Convert to 0x22b
WBUFW(buf, 0) = 0x22b;
WBUFW(buf,55) = WBUFW(buf,56); //Lv is placed on offset 56
@@ -3071,7 +3071,7 @@ int clif_changeoption(struct block_list* bl)
sc = status_get_sc(bl);
if (!sc) return 0; //How can an option change if there's no sc?
-#if PACKETVER > 6
+#if PACKETVER >= 7
WBUFW(buf,0) = 0x229;
WBUFL(buf,2) = bl->id;
WBUFW(buf,6) = sc->opt1;
@@ -3709,7 +3709,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
ud = unit_bl2ud(bl);
if (ud && ud->walktimer != -1)
{
-#if PACKETVER > 6
+#if PACKETVER >= 7
WFIFOHEAD(fd, packet_len(0x22c));
#elif PACKETVER > 3
WFIFOHEAD(fd, packet_len(0x1da));
@@ -3719,7 +3719,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
len = clif_set007b(bl,vd,ud,WFIFOP(fd,0));
WFIFOSET(fd,len);
} else {
-#if PACKETVER > 6
+#if PACKETVER >= 7
WFIFOHEAD(fd,packet_len(0x22a));
#elif PACKETVER > 3
WFIFOHEAD(fd,packet_len(0x1d8));
diff --git a/src/map/clif.h b/src/map/clif.h
index b91b8d9a7..159c1546a 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -6,9 +6,15 @@
#include "map.h"
+// server->client protocol version
+// v7 - 2005-04-11aSakexe+ - 0x229, 0x22a, 0x22b, 0x22c
+#ifndef PACKETVER
+ #define PACKETVER 7
+#endif
+
// packet DB
#define MAX_PACKET_DB 0x300
-#define MAX_PACKET_VER 21
+#define MAX_PACKET_VER 22
struct packet_db_t {
short len;