From a675e06c38ec4e31a2758435a582b58a2199cfc4 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 28 Jun 2018 03:17:32 +0200 Subject: Change functions to static where possible (Part 4 - map) This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru --- src/map/clif.c | 2362 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 1299 insertions(+), 1063 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index bae079f3e..f8600cf02 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -77,10 +77,10 @@ #include #include -struct clif_interface clif_s; +static struct clif_interface clif_s; struct clif_interface *clif; -struct s_packet_db packet_db[MAX_PACKET_DB + 1]; +static struct s_packet_db packet_db[MAX_PACKET_DB + 1]; /* re-usable */ static struct packet_itemlist_normal itemlist_normal; @@ -96,7 +96,8 @@ static struct packet_npc_market_open npcmarket_open; //#define DUMP_INVALID_PACKET //Converts item type in case of pet eggs. -static inline int itemtype(int type) { +static inline int itemtype(int type) +{ switch( type ) { #if PACKETVER >= 20080827 case IT_WEAPON: @@ -111,7 +112,8 @@ static inline int itemtype(int type) { } } -static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir) { +static inline void WBUFPOS(uint8 *p, unsigned short pos, short x, short y, unsigned char dir) +{ p += pos; p[0] = (uint8)(x>>2); p[1] = (uint8)((x<<6) | ((y>>4)&0x3f)); @@ -119,7 +121,8 @@ static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsig } // client-side: x0+=sx0*0.0625-0.5 and y0+=sy0*0.0625-0.5 -static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) { +static inline void WBUFPOS2(uint8 *p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) +{ p += pos; p[0] = (uint8)(x0>>2); p[1] = (uint8)((x0<<6) | ((y0>>4)&0x3f)); @@ -130,16 +133,19 @@ static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, sh } #if 0 // Currently unused -static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir) { +static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir) +{ WBUFPOS(WFIFOP(fd,pos), 0, x, y, dir); } #endif // 0 -static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) { +static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) +{ WBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0); } -static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir) { +static inline void RBUFPOS(const uint8 *p, unsigned short pos, short *x, short *y, unsigned char *dir) +{ p += pos; if( x ) { @@ -155,12 +161,14 @@ static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* } } -static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir) { +static inline void RFIFOPOS(int fd, unsigned short pos, short *x, short *y, unsigned char *dir) +{ RBUFPOS(RFIFOP(fd,pos), 0, x, y, dir); } #if 0 // currently unused -static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) { +static inline void RBUFPOS2(const uint8 *p, unsigned short pos, short *x0, short *y0, short *x1, short *y1, unsigned char *sx0, unsigned char *sy0) +{ p += pos; if( x0 ) { @@ -187,13 +195,15 @@ static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short sy0[0] = ( p[5] & 0x0f ) >> 0; } } -static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) { + +static inline void RFIFOPOS2(int fd, unsigned short pos, short *x0, short *y0, short *x1, short *y1, unsigned char *sx0, unsigned char *sy0) +{ RBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0); } #endif // 0 //To identify disguised characters. -bool clif_isdisguised(struct block_list* bl) +static bool clif_isdisguised(struct block_list *bl) { struct map_session_data *sd = BL_CAST(BL_PC, bl); if (sd == NULL || sd->disguise == -1) @@ -204,7 +214,8 @@ bool clif_isdisguised(struct block_list* bl) /*========================================== * Ip setting of map-server *------------------------------------------*/ -bool clif_setip(const char* ip) { +static bool clif_setip(const char *ip) +{ char ip_str[16]; nullpo_retr(false, ip); clif->map_ip = sockt->host2ip(ip); @@ -218,7 +229,8 @@ bool clif_setip(const char* ip) { return true; } -bool clif_setbindip(const char* ip) { +static bool clif_setbindip(const char *ip) +{ nullpo_retr(false, ip); clif->bind_ip = sockt->host2ip(ip); if ( clif->bind_ip ) { @@ -234,7 +246,7 @@ bool clif_setbindip(const char* ip) { * Sets map port to 'port' * is run from map.c upon loading map server configuration *------------------------------------------*/ -void clif_setport(uint16 port) +static void clif_setport(uint16 port) { clif->map_port = port; } @@ -242,7 +254,7 @@ void clif_setport(uint16 port) /*========================================== * Returns map server IP *------------------------------------------*/ -uint32 clif_getip(void) +static uint32 clif_getip(void) { return clif->map_ip; } @@ -250,14 +262,14 @@ uint32 clif_getip(void) /*========================================== * Returns map port which is set by clif_setport() *------------------------------------------*/ -uint16 clif_getport(void) +static uint16 clif_getport(void) { return clif->map_port; } /*========================================== * Updates server ip resolution and returns it *------------------------------------------*/ -uint32 clif_refresh_ip(void) +static uint32 clif_refresh_ip(void) { uint32 new_ip = sockt->host2ip(clif->map_ip_str); if ( new_ip && new_ip != clif->map_ip ) { @@ -268,7 +280,7 @@ uint32 clif_refresh_ip(void) return 0; } -unsigned char clif_bl_type(struct block_list *bl) +static unsigned char clif_bl_type(struct block_list *bl) { #if PACKETVER >= 20071106 struct view_data *vd; @@ -327,7 +339,8 @@ unsigned char clif_bl_type(struct block_list *bl) * - AREA_WOS (AREA WITHOUT SELF) : Not run for self * - AREA_CHAT_WOC : Everyone in the area of your chat without a chat *------------------------------------------*/ -int clif_send_sub(struct block_list *bl, va_list ap) { +static int clif_send_sub(struct block_list *bl, va_list ap) +{ struct block_list *src_bl; struct map_session_data *sd; void *buf; @@ -383,7 +396,7 @@ int clif_send_sub(struct block_list *bl, va_list ap) { return clif->send_actual(fd, buf, len); } -int clif_send_actual(int fd, void *buf, int len) +static int clif_send_actual(int fd, void *buf, int len) { nullpo_retr(0, buf); WFIFOHEAD(fd, len); @@ -407,7 +420,8 @@ int clif_send_actual(int fd, void *buf, int len) * Packet Delegation (called on all packets that require data to be sent to more than one client) * functions that are sent solely to one use whose ID it posses use WFIFOSET *------------------------------------------*/ -bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target type) { +static bool clif_send(const void *buf, int len, struct block_list *bl, enum send_target type) +{ int i; struct map_session_data *sd, *tsd; struct party_data *p = NULL; @@ -694,7 +708,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target /// Notifies the client, that it's connection attempt was accepted. /// 0073 .L .3B .B .B (ZC_ACCEPT_ENTER) /// 02eb .L .3B .B .B .W (ZC_ACCEPT_ENTER2) -void clif_authok(struct map_session_data *sd) +static void clif_authok(struct map_session_data *sd) { struct packet_authok p; @@ -722,7 +736,7 @@ void clif_authok(struct map_session_data *sd) /// 2 = mobile - out of available time /// 3 = mobile - already logged in /// 4 = mobile - waiting state -void clif_authrefuse(int fd, uint8 error_code) +static void clif_authrefuse(int fd, uint8 error_code) { WFIFOHEAD(fd,packet_len(0x74)); WFIFOW(fd,0) = 0x74; @@ -765,7 +779,7 @@ void clif_authrefuse(int fd, uint8 error_code) /// 115 = You are in game connection ban period. /// ? = disconnected -> MsgStringTable[3] // TODO: type enum -void clif_authfail_fd(int fd, int type) +static void clif_authfail_fd(int fd, int type) { if (!fd || !sockt->session[fd] || sockt->session[fd]->func_parse != clif->parse) //clif_authfail should only be invoked on players! return; @@ -783,7 +797,8 @@ void clif_authfail_fd(int fd, int type) /// type: /// 1 = disconnect, char-select /// ? = nothing -void clif_charselectok(int id, uint8 ok) { +static void clif_charselectok(int id, uint8 ok) +{ struct map_session_data* sd; int fd; @@ -800,7 +815,8 @@ void clif_charselectok(int id, uint8 ok) { /// Makes an item appear on the ground. /// 009e .L .W .B .W .W .B .B .W (ZC_ITEM_FALL_ENTRY) /// 084b (ZC_ITEM_FALL_ENTRY4) -void clif_dropflooritem(struct flooritem_data* fitem) { +static void clif_dropflooritem(struct flooritem_data *fitem) +{ struct packet_dropflooritem p; int view; @@ -835,7 +851,7 @@ void clif_dropflooritem(struct flooritem_data* fitem) { /// Makes an item disappear from the ground. /// 00a1 .L (ZC_ITEM_DISAPPEAR) -void clif_clearflooritem(struct flooritem_data *fitem, int fd) +static void clif_clearflooritem(struct flooritem_data *fitem, int fd) { unsigned char buf[16]; @@ -861,7 +877,7 @@ void clif_clearflooritem(struct flooritem_data *fitem, int fd) /// 2 = logged out /// 3 = teleport /// 4 = trickdead -void clif_clearunit_single(int id, clr_type type, int fd) +static void clif_clearunit_single(int id, clr_type type, int fd) { WFIFOHEAD(fd, packet_len(0x80)); WFIFOW(fd,0) = 0x80; @@ -878,7 +894,7 @@ void clif_clearunit_single(int id, clr_type type, int fd) /// 2 = logged out /// 3 = teleport /// 4 = trickdead -void clif_clearunit_area(struct block_list* bl, clr_type type) +static void clif_clearunit_area(struct block_list *bl, clr_type type) { unsigned char buf[8]; @@ -899,14 +915,16 @@ void clif_clearunit_area(struct block_list* bl, clr_type type) /// Used to make monsters with player-sprites disappear after dying /// like normal monsters, because the client does not remove those /// automatically. -int clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) { +static int clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) +{ struct block_list *bl = (struct block_list *)data; clif->clearunit_area(bl, (clr_type) id); ers_free(clif->delay_clearunit_ers,bl); return 0; } -void clif_clearunit_delayed(struct block_list* bl, clr_type type, int64 tick) { +static void clif_clearunit_delayed(struct block_list *bl, clr_type type, int64 tick) +{ struct block_list *tbl; nullpo_retv(bl); @@ -916,7 +934,7 @@ void clif_clearunit_delayed(struct block_list* bl, clr_type type, int64 tick) { } /// Gets weapon view info from sd's inventory_data and points (*rhand,*lhand) -void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand) +static void clif_get_weapon_view(struct map_session_data *sd, unsigned short *rhand, unsigned short *lhand) { nullpo_retv(sd); nullpo_retv(rhand); @@ -956,7 +974,8 @@ void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, un } //To make the assignation of the level based on limits clearer/easier. [Skotlex] -static int clif_setlevel_sub(int lv) { +static int clif_setlevel_sub(int lv) +{ if( lv < battle_config.max_lv ) { ; } else if( lv < battle_config.aura_lv ) { @@ -968,7 +987,8 @@ static int clif_setlevel_sub(int lv) { return lv; } -static int clif_setlevel(struct block_list* bl) { +static int clif_setlevel(struct block_list *bl) +{ int lv = status->get_lv(bl); nullpo_retr(0, bl); if( battle_config.client_limit_unit_lv&bl->type ) @@ -981,8 +1001,10 @@ static int clif_setlevel(struct block_list* bl) { } return lv; } + /* for 'packetver < 20091103' 0x78 non-pc-looking unit handling */ -void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, enum send_target target) { +static void clif_set_unit_idle2(struct block_list *bl, struct map_session_data *tsd, enum send_target target) +{ #if PACKETVER < 20091103 struct map_session_data* sd; struct status_change* sc = status->get_sc(bl); @@ -1034,10 +1056,12 @@ void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, en return; #endif } + /*========================================== * Prepares 'unit standing' packet *------------------------------------------*/ -void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enum send_target target) { +static void clif_set_unit_idle(struct block_list *bl, struct map_session_data *tsd, enum send_target target) +{ struct map_session_data* sd; struct status_change* sc = status->get_sc(bl); struct view_data* vd = status->get_viewdata(bl); @@ -1143,8 +1167,10 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu } } + /* for 'packetver < 20091103' 0x7c non-pc-looking unit handling */ -void clif_spawn_unit2(struct block_list* bl, enum send_target target) { +static void clif_spawn_unit2(struct block_list *bl, enum send_target target) +{ #if PACKETVER < 20091103 struct map_session_data* sd; struct status_change* sc = status->get_sc(bl); @@ -1190,7 +1216,9 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) { return; #endif } -void clif_spawn_unit(struct block_list* bl, enum send_target target) { + +static void clif_spawn_unit(struct block_list *bl, enum send_target target) +{ struct map_session_data* sd; struct status_change* sc = status->get_sc(bl); struct view_data* vd = status->get_viewdata(bl); @@ -1301,7 +1329,8 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { /*========================================== * Prepares 'unit walking' packet *------------------------------------------*/ -void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, struct unit_data* ud, enum send_target target) { +static void clif_set_unit_walking(struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target target) +{ struct map_session_data* sd; struct status_change* sc = status->get_sc(bl); struct view_data* vd = status->get_viewdata(bl); @@ -1402,7 +1431,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, /// 01b0 .L .B .L /// type: /// unused -void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) +static void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) { nullpo_retv(bl); @@ -1424,7 +1453,8 @@ void clif_class_change(struct block_list *bl, int class_, int type, struct map_s /// Notifies the client of an object's spirits. /// 01d0 .L .W (ZC_SPIRITS) /// 01e1 .L .W (ZC_SPIRITS2) -void clif_spiritball_single(int fd, struct map_session_data *sd) { +static void clif_spiritball_single(int fd, struct map_session_data *sd) +{ nullpo_retv(sd); WFIFOHEAD(fd, packet_len(0x1e1)); WFIFOW(fd,0)=0x1e1; @@ -1436,7 +1466,7 @@ void clif_spiritball_single(int fd, struct map_session_data *sd) { /*========================================== * Kagerou/Oboro amulet spirit *------------------------------------------*/ -void clif_charm_single(int fd, struct map_session_data *sd) +static void clif_charm_single(int fd, struct map_session_data *sd) { #if PACKETVER >= 20110809 nullpo_retv(sd); @@ -1453,7 +1483,8 @@ void clif_charm_single(int fd, struct map_session_data *sd) * Run when player changes map / refreshes * Tells its client to display all weather settings being used by this map *------------------------------------------*/ -void clif_weather_check(struct map_session_data *sd) { +static void clif_weather_check(struct map_session_data *sd) +{ int16 m; int fd; @@ -1478,10 +1509,11 @@ void clif_weather_check(struct map_session_data *sd) { if (map->list[m].flag.leaves) clif->specialeffect_single(&sd->bl, 333, fd); } + /** * Run when the weather on a map changes, throws all players in map id 'm' to clif_weather_check function **/ -void clif_weather(int16 m) +static void clif_weather(int16 m) { struct s_mapiterator* iter; struct map_session_data *sd=NULL; @@ -1493,10 +1525,11 @@ void clif_weather(int16 m) } mapit->free(iter); } + /** * Main function to spawn a unit on the client (player/mob/pet/etc) **/ -bool clif_spawn(struct block_list *bl) +static bool clif_spawn(struct block_list *bl) { struct view_data *vd; @@ -1574,7 +1607,8 @@ bool clif_spawn(struct block_list *bl) /// Sends information about owned homunculus to the client (ZC_PROPERTY_HOMUN). [orn] /// 022e .24B .B .W .W .W .W .W .W .W .W .W .W .W .W .W .W .W .W .L .L .W .W -void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) { +static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) +{ struct status_data *hstatus; unsigned char buf[128]; enum homun_type htype; @@ -1675,7 +1709,7 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) /// 2 = hunger /// 3 = accessory? /// ? = ignored -void clif_send_homdata(struct map_session_data *sd, int state, int param) +static void clif_send_homdata(struct map_session_data *sd, int state, int param) { int fd; @@ -1696,7 +1730,8 @@ void clif_send_homdata(struct map_session_data *sd, int state, int param) } /// Prepares and sends homun related information [orn] -void clif_homskillinfoblock(struct map_session_data *sd) { +static void clif_homskillinfoblock(struct map_session_data *sd) +{ struct homun_data *hd; int fd; int i,j; @@ -1737,7 +1772,9 @@ void clif_homskillinfoblock(struct map_session_data *sd) { return; } -void clif_homskillup(struct map_session_data *sd, uint16 skill_id) { //[orn] +//[orn] +static void clif_homskillup(struct map_session_data *sd, uint16 skill_id) +{ struct homun_data *hd; int fd, idx; nullpo_retv(sd); @@ -1757,7 +1794,7 @@ void clif_homskillup(struct map_session_data *sd, uint16 skill_id) { //[orn] WFIFOSET(fd,packet_len(0x239)); } -void clif_hom_food(struct map_session_data *sd,int foodid,int fail) +static void clif_hom_food(struct map_session_data *sd, int foodid, int fail) { int fd; nullpo_retv(sd); @@ -1774,7 +1811,7 @@ void clif_hom_food(struct map_session_data *sd,int foodid,int fail) /// Notifies the client, that it is walking (ZC_NOTIFY_PLAYERMOVE). /// 0087 .L .6B -void clif_walkok(struct map_session_data *sd) +static void clif_walkok(struct map_session_data *sd) { int fd; @@ -1787,7 +1824,8 @@ void clif_walkok(struct map_session_data *sd) WFIFOSET(fd,packet_len(0x87)); } -void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) { +static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) +{ #ifdef ANTI_MAYAP_CHEAT struct status_change *sc = NULL; #endif @@ -1841,7 +1879,7 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u /// Notifies clients in an area, that an other visible object is walking (ZC_NOTIFY_PLAYERMOVE). /// 0086 .L .6B .L /// Note: unit must not be self -void clif_move(struct unit_data *ud) +static void clif_move(struct unit_data *ud) { unsigned char buf[16]; struct view_data *vd; @@ -1895,7 +1933,8 @@ void clif_move(struct unit_data *ud) /*========================================== * Delays the map->quit of a player after they are disconnected. [Skotlex] *------------------------------------------*/ -int clif_delayquit(int tid, int64 tick, int id, intptr_t data) { +static int clif_delayquit(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = NULL; //Remove player from map server @@ -1907,7 +1946,8 @@ int clif_delayquit(int tid, int64 tick, int id, intptr_t data) { /*========================================== * *------------------------------------------*/ -void clif_quitsave(int fd, struct map_session_data *sd) { +static void clif_quitsave(int fd, struct map_session_data *sd) +{ nullpo_retv(sd); if (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) @@ -1923,7 +1963,8 @@ void clif_quitsave(int fd, struct map_session_data *sd) { /// Notifies the client of a position change to coordinates on given map (ZC_NPCACK_MAPMOVE). /// 0091 .16B .W .W -void clif_changemap(struct map_session_data *sd, short m, int x, int y) { +static void clif_changemap(struct map_session_data *sd, short m, int x, int y) +{ int fd; nullpo_retv(sd); fd = sd->fd; @@ -1938,7 +1979,7 @@ void clif_changemap(struct map_session_data *sd, short m, int x, int y) { /// Notifies the client of a position change (on air ship) to coordinates on given map (ZC_AIRSHIP_MAPMOVE). /// 0A4B .16B .W .W -void clif_changemap_airship(struct map_session_data *sd, short m, int x, int y) +static void clif_changemap_airship(struct map_session_data *sd, short m, int x, int y) { #if PACKETVER_MAIN_NUM >= 20180620 || PACKETVER_RE_NUM >= 20180321 || PACKETVER_ZERO_NUM >= 20171027 // [4144] this packet is not used yet by kro, but it here @@ -1958,7 +1999,8 @@ void clif_changemap_airship(struct map_session_data *sd, short m, int x, int y) /// Notifies the client of a position change to coordinates on given map, which is on another map-server (ZC_NPCACK_SERVERMOVE). /// 0092 .16B .W .W .L .W /// 0ac7 .16B .W .W .L .W .128B -void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) { +static void clif_changemapserver(struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) +{ int fd; #if PACKETVER >= 20170315 const int cmd = 0xac7; @@ -1980,7 +2022,7 @@ void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, /// Notifies the client of a position change (with air ship) to coordinates on given map, which is on another map-server (ZC_NPCACK_SERVERMOVE). /// 0a4c .16B .W .W .L .W -void clif_changemapserver_airship(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) +static void clif_changemapserver_airship(struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) { #if (PACKETVER_MAIN_NUM >= 20180620) || (PACKETVER_RE_NUM >= 20180321) || (PACKETVER_ZERO_NUM >= 20171027) // [4144] this packet is not used yet by kro, but it here @@ -2000,7 +2042,7 @@ void clif_changemapserver_airship(struct map_session_data* sd, unsigned short ma #endif } -void clif_blown(struct block_list *bl) +static void clif_blown(struct block_list *bl) { //Aegis packets says fixpos, but it's unsure whether slide works better or not. nullpo_retv(bl); @@ -2012,7 +2054,8 @@ void clif_blown(struct block_list *bl) /// isn't walkable, the char doesn't move at all. If the char is /// sitting it will stand up (ZC_STOPMOVE). /// 0088 .L .W .W -void clif_fixpos(struct block_list *bl) { +static void clif_fixpos(struct block_list *bl) +{ unsigned char buf[10]; nullpo_retv(bl); @@ -2031,7 +2074,7 @@ void clif_fixpos(struct block_list *bl) { /// Displays the buy/sell dialog of an NPC shop (ZC_SELECT_DEALTYPE). /// 00c4 .L -void clif_npcbuysell(struct map_session_data* sd, int id) +static void clif_npcbuysell(struct map_session_data *sd, int id) { int fd; @@ -2046,7 +2089,8 @@ void clif_npcbuysell(struct map_session_data* sd, int id) /// Presents list of items, that can be bought in an NPC shop (ZC_PC_PURCHASE_ITEMLIST). /// 00c6 .W { .L .L .B .W }* -void clif_buylist(struct map_session_data *sd, struct npc_data *nd) { +static void clif_buylist(struct map_session_data *sd, struct npc_data *nd) +{ struct npc_item_list *shop = NULL; unsigned short shop_size = 0; int fd,i,c; @@ -2088,7 +2132,7 @@ void clif_buylist(struct map_session_data *sd, struct npc_data *nd) { /// Presents list of items, that can be sold to an NPC shop (ZC_PC_SELL_ITEMLIST). /// 00c7 .W { .W .L .L }* -void clif_selllist(struct map_session_data *sd) +static void clif_selllist(struct map_session_data *sd) { int fd,i,c=0,val; @@ -2131,7 +2175,7 @@ void clif_selllist(struct map_session_data *sd) /// - set npcid of dialog window (0 by default) /// - if set to clear on next mes, clear contents /// - append this text -void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) +static void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) { int fd, slen; #ifdef SCRIPT_MES_STRIP_LINEBREAK @@ -2176,7 +2220,7 @@ void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) /// - 00B9 .L /// - set to clear on next mes /// - remove 'next' button -void clif_scriptnext(struct map_session_data *sd, int npcid) +static void clif_scriptnext(struct map_session_data *sd, int npcid) { int fd; @@ -2204,7 +2248,7 @@ void clif_scriptnext(struct map_session_data *sd, int npcid) /// - close the dialog window /// - close the menu window /// - 0146 .L -void clif_scriptclose(struct map_session_data *sd, int npcid) +static void clif_scriptclose(struct map_session_data *sd, int npcid) { int fd; @@ -2220,7 +2264,8 @@ void clif_scriptclose(struct map_session_data *sd, int npcid) /*========================================== * *------------------------------------------*/ -void clif_sendfakenpc(struct map_session_data *sd, int npcid) { +static void clif_sendfakenpc(struct map_session_data *sd, int npcid) +{ unsigned char *buf; int fd; @@ -2263,7 +2308,7 @@ void clif_sendfakenpc(struct map_session_data *sd, int npcid) { /// WARNING: the 'cancel' button closes other windows besides the dialog window and the menu window. /// Which suggests their have intertwined behavior. (probably the mouse targeting) /// TODO investigate behavior of other windows [FlavioJS] -void clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes) +static void clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes) { int fd, slen; struct block_list *bl = NULL; @@ -2299,7 +2344,8 @@ void clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes) /// - if npcid exists in the client: /// - 0143 .L .L /// - close inputnum window -void clif_scriptinput(struct map_session_data *sd, int npcid) { +static void clif_scriptinput(struct map_session_data *sd, int npcid) +{ int fd; struct block_list *bl = NULL; @@ -2328,7 +2374,8 @@ void clif_scriptinput(struct map_session_data *sd, int npcid) { /// - if npcid is 0 or npcid exists in the client: /// - 01d5 .W .L .?B /// - close inputstr window -void clif_scriptinputstr(struct map_session_data *sd, int npcid) { +static void clif_scriptinputstr(struct map_session_data *sd, int npcid) +{ int fd; struct block_list *bl = NULL; @@ -2356,7 +2403,7 @@ void clif_scriptinputstr(struct map_session_data *sd, int npcid) { /// 2 = remove mark /// color: /// 0x00RRGGBB -void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color) +static void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color) { int fd; @@ -2384,7 +2431,7 @@ void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, in /// 3 = middle of screen, inside a movable window /// 4 = middle of screen, movable with a close button, chrome-less /// 255 = hide -void clif_cutin(struct map_session_data* sd, const char* image, int type) +static void clif_cutin(struct map_session_data *sd, const char *image, int type) { int fd; @@ -2401,7 +2448,8 @@ void clif_cutin(struct map_session_data* sd, const char* image, int type) /*========================================== * Fills in card data from the given item and into the buffer. [Skotlex] *------------------------------------------*/ -void clif_addcards(unsigned char* buf, struct item* item) { +static void clif_addcards(unsigned char *buf, struct item *item) +{ int i=0,j; nullpo_retv(buf); if( item == NULL ) { //Blank data @@ -2451,7 +2499,8 @@ void clif_addcards(unsigned char* buf, struct item* item) { WBUFW(buf,6) = item->card[i]; } -void clif_addcards2(unsigned short *cards, struct item* item) { +static void clif_addcards2(unsigned short *cards, struct item *item) +{ int i=0,j; nullpo_retv(cards); if( item == NULL ) { //Blank data @@ -2509,7 +2558,7 @@ void clif_addcards2(unsigned short *cards, struct item* item) { * @param buf[in,out] The buffer to write to. The pointer must be valid and initialized. * @param item[in] The source item. */ - int clif_add_item_options(struct ItemOptions *buf, const struct item *it) +static int clif_add_item_options(struct ItemOptions *buf, const struct item *it) { int i = 0, j = 0, total_options = 0; @@ -2542,7 +2591,7 @@ void clif_addcards2(unsigned short *cards, struct item* item) { /// 0990 .W .W .W .B .B .B .W .W .W .W .L .B .B .L .W (ZC_ITEM_PICKUP_ACK_V5) /// 0a0c .W .W .W .B .B .B .W .W .W .W .L .B .B .L .W (ZC_ITEM_PICKUP_ACK_V6) /// 0a37 .W .W .W .B .B .B .W .W .W .W .L .B .B .L .W .B .W (ZC_ITEM_PICKUP_ACK_V7) -void clif_additem(struct map_session_data *sd, int n, int amount, int fail) +static void clif_additem(struct map_session_data *sd, int n, int amount, int fail) { struct packet_additem p; nullpo_retv(sd); @@ -2596,7 +2645,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) /// Notifies the client, that an inventory item was deleted or dropped (ZC_ITEM_THROW_ACK). /// 00af .W .W -void clif_dropitem(struct map_session_data *sd,int n,int amount) +static void clif_dropitem(struct map_session_data *sd, int n, int amount) { int fd; @@ -2613,7 +2662,7 @@ void clif_dropitem(struct map_session_data *sd,int n,int amount) /// Notifies the client, that an inventory item was deleted (ZC_DELETE_ITEM_FROM_BODY). /// 07fa .W .W .W /// delete type: @see enum delitem_reason -void clif_delitem(struct map_session_data *sd,int n,int amount, short reason) +static void clif_delitem(struct map_session_data *sd, int n, int amount, short reason) { #if PACKETVER < 20091117 clif->dropitem(sd,n,amount); @@ -2637,7 +2686,8 @@ void clif_delitem(struct map_session_data *sd,int n,int amount, short reason) // Equip is >= 0 for equippable items (holds the equip-point, is 0 for pet // armor/egg) -1 for stackable items, -2 for stackable items where arrows must send in the equip-point. // look like unused, not adding checks -void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip) { +static void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip) +{ if (id->view_id > 0) WBUFW(buf,n)=id->view_id; else @@ -2659,7 +2709,7 @@ void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data * } -void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struct item_data *id, int eqp_pos) +static void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struct item_data *id, int eqp_pos) { nullpo_retv(p); nullpo_retv(it); @@ -2710,7 +2760,8 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struc #endif } -void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) { +static void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) +{ nullpo_retv(p); nullpo_retv(i); nullpo_retv(id); @@ -2746,7 +2797,8 @@ void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, stru #endif } -void clif_inventorylist(struct map_session_data *sd) { +static void clif_inventorylist(struct map_session_data *sd) +{ int i, normal = 0, equip = 0; nullpo_retv(sd); @@ -2789,7 +2841,8 @@ void clif_inventorylist(struct map_session_data *sd) { } //Required when items break/get-repaired. Only sends equippable item list. -void clif_equiplist(struct map_session_data *sd) { +static void clif_equiplist(struct map_session_data *sd) +{ int i, equip = 0; nullpo_retv(sd); @@ -2820,7 +2873,8 @@ void clif_equiplist(struct map_session_data *sd) { #endif } -void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length) { +static void clif_storagelist(struct map_session_data *sd, struct item *items, int items_length) +{ int i = 0; struct item_data *id; @@ -2868,7 +2922,8 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items } -void clif_cartlist(struct map_session_data *sd) { +static void clif_cartlist(struct map_session_data *sd) +{ int i, normal = 0, equip = 0; struct item_data *id; @@ -2905,7 +2960,7 @@ void clif_cartlist(struct map_session_data *sd) { /// Client behavior: /// Closes the cart storage and removes all it's items from memory. /// The Num & Weight values of the cart are left untouched and the cart is NOT removed. -void clif_clearcart(int fd) +static void clif_clearcart(int fd) { WFIFOHEAD(fd, packet_len(0x12b)); WFIFOW(fd,0) = 0x12b; @@ -2915,7 +2970,7 @@ void clif_clearcart(int fd) /// Guild XY locators (ZC_NOTIFY_POSITION_TO_GUILDM) [Valaris] /// 01eb .L .W .W -void clif_guild_xy(struct map_session_data *sd) +static void clif_guild_xy(struct map_session_data *sd) { unsigned char buf[10]; @@ -2931,7 +2986,7 @@ void clif_guild_xy(struct map_session_data *sd) /*========================================== * Sends x/y dot to a single fd. [Skotlex] *------------------------------------------*/ -void clif_guild_xy_single(int fd, struct map_session_data *sd) +static void clif_guild_xy_single(int fd, struct map_session_data *sd) { if( sd->bg_id ) return; @@ -2946,7 +3001,7 @@ void clif_guild_xy_single(int fd, struct map_session_data *sd) } // Guild XY locators [Valaris] -void clif_guild_xy_remove(struct map_session_data *sd) +static void clif_guild_xy_remove(struct map_session_data *sd) { unsigned char buf[10]; @@ -2962,7 +3017,7 @@ void clif_guild_xy_remove(struct map_session_data *sd) /*========================================== * *------------------------------------------*/ -int clif_hpmeter_sub(struct block_list *bl, va_list ap) +static int clif_hpmeter_sub(struct block_list *bl, va_list ap) { #if PACKETVER < 20100126 const int cmd = 0x106; @@ -3004,7 +3059,8 @@ int clif_hpmeter_sub(struct block_list *bl, va_list ap) * Server tells all players that are allowed to view HP bars * and are nearby 'sd' that 'sd' hp bar was updated. *------------------------------------------*/ -int clif_hpmeter(struct map_session_data *sd) { +static int clif_hpmeter(struct map_session_data *sd) +{ nullpo_ret(sd); map->foreachinarea(clif->hpmeter_sub, sd->bl.m, sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE, sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd); return 0; @@ -3018,7 +3074,7 @@ int clif_hpmeter(struct map_session_data *sd) { /// 013a .W (ZC_ATTACK_RANGE) /// 0141 .L .L .L (ZC_COUPLESTATUS) /// TODO: Extract individual packets. -void clif_updatestatus(struct map_session_data *sd,int type) +static void clif_updatestatus(struct map_session_data *sd, int type) { int fd,len; @@ -3274,7 +3330,7 @@ void clif_updatestatus(struct map_session_data *sd,int type) /// Notifies client of a parameter change of an another player (ZC_PAR_CHANGE_USER). /// 01ab .L .W .L -void clif_changestatus(struct map_session_data* sd,int type,int val) +static void clif_changestatus(struct map_session_data *sd, int type, int val) { unsigned char buf[12]; @@ -3298,7 +3354,7 @@ void clif_changestatus(struct map_session_data* sd,int type,int val) } /// Updates sprite/style properties of an object. -void clif_changelook(struct block_list *bl,int type,int val) +static void clif_changelook(struct block_list *bl, int type, int val) { struct map_session_data* sd; struct status_change* sc; @@ -3451,14 +3507,14 @@ void clif_changelook(struct block_list *bl,int type,int val) } //Sends a change-base-look packet required for traps as they are triggered. -void clif_changetraplook(struct block_list *bl,int val) +static void clif_changetraplook(struct block_list *bl, int val) { clif->sendlook(bl, bl->id, LOOK_BASE, val, 0, AREA); } /// 00c3 .L .B .B (ZC_SPRITE_CHANGE) /// 01d7 .L .B .L (ZC_SPRITE_CHANGE2) -void clif_sendlook(struct block_list *bl, int id, int type, int val, int val2, enum send_target target) +static void clif_sendlook(struct block_list *bl, int id, int type, int val, int val2, enum send_target target) { unsigned char buf[32]; #if PACKETVER < 4 @@ -3478,7 +3534,7 @@ void clif_sendlook(struct block_list *bl, int id, int type, int val, int val2, e } //For the stupid cloth-dye bug. Resends the given view data to the area specified by bl. -void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target) +static void clif_refreshlook(struct block_list *bl, int id, int type, int val, enum send_target target) { clif->sendlook(bl, id, type, val, 0, target); } @@ -3488,7 +3544,8 @@ void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_ta /// .B .B .B .B .B .B .W .W /// .W .W .W .W .W .W .W /// .W .W .W .W .W -void clif_initialstatus(struct map_session_data *sd) { +static void clif_initialstatus(struct map_session_data *sd) +{ int fd, mdef2; unsigned char *buf; @@ -3548,7 +3605,7 @@ void clif_initialstatus(struct map_session_data *sd) { /// Marks an ammunition item in inventory as equipped (ZC_EQUIP_ARROW). /// 013c .W -void clif_arrowequip(struct map_session_data *sd,int val) +static void clif_arrowequip(struct map_session_data *sd, int val) { int fd; @@ -3573,7 +3630,7 @@ void clif_arrowequip(struct map_session_data *sd,int val) /// 3 = assassin, baby_assassin, assassin_cross => MsgStringTable[1040]="You have equipped throwing daggers." /// gunslinger => MsgStringTable[1175]="Bullets have been equipped." /// NOT ninja => MsgStringTable[245]="Ammunition has been equipped." -void clif_arrow_fail(struct map_session_data *sd,int type) +static void clif_arrow_fail(struct map_session_data *sd, int type) { int fd; @@ -3588,7 +3645,7 @@ void clif_arrow_fail(struct map_session_data *sd,int type) /// Presents a list of items, that can be processed by Arrow Crafting (ZC_MAKINGARROW_LIST). /// 01ad .W { .W }* -void clif_arrow_create_list(struct map_session_data *sd) +static void clif_arrow_create_list(struct map_session_data *sd) { int i, c; int fd; @@ -3627,7 +3684,7 @@ void clif_arrow_create_list(struct map_session_data *sd) /// result: /// 0 = failure /// 1 = success -void clif_statusupack(struct map_session_data *sd,int type,int ok,int val) +static void clif_statusupack(struct map_session_data *sd, int type, int ok, int val) { int fd; @@ -3645,7 +3702,8 @@ void clif_statusupack(struct map_session_data *sd,int type,int ok,int val) /// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK). /// 00aa .W .W .B /// 00aa .W .W .W .B (PACKETVER >= 20100629) -void clif_equipitemack(struct map_session_data *sd,int n,int pos,enum e_EQUIP_ITEM_ACK result) { +static void clif_equipitemack(struct map_session_data *sd, int n, int pos, enum e_EQUIP_ITEM_ACK result) +{ struct packet_equipitem_ack p; nullpo_retv(sd); @@ -3666,7 +3724,8 @@ void clif_equipitemack(struct map_session_data *sd,int n,int pos,enum e_EQUIP_IT /// Notifies the client about the result of a request to take off an item (ZC_REQ_TAKEOFF_EQUIP_ACK). /// 00ac .W .W .B -void clif_unequipitemack(struct map_session_data *sd,int n,int pos,enum e_UNEQUIP_ITEM_ACK result) { +static void clif_unequipitemack(struct map_session_data *sd, int n, int pos, enum e_UNEQUIP_ITEM_ACK result) +{ struct packet_unequipitem_ack p; nullpo_retv(sd); @@ -3692,7 +3751,7 @@ void clif_unequipitemack(struct map_session_data *sd,int n,int pos,enum e_UNEQUI /// 7 = base level up (super novice) /// 8 = job level up (super novice) /// 9 = base level up (taekwon) -void clif_misceffect(struct block_list* bl,int type) +static void clif_misceffect(struct block_list *bl, int type) { unsigned char buf[32]; @@ -3708,7 +3767,7 @@ void clif_misceffect(struct block_list* bl,int type) /// Notifies clients in the area of a state change. /// 0119 .L .W .W .W .B (ZC_STATE_CHANGE) /// 0229 .L .W .W .L .B (ZC_STATE_CHANGE3) -void clif_changeoption(struct block_list* bl) +static void clif_changeoption(struct block_list *bl) { unsigned char buf[32]; struct status_change *sc; @@ -3759,7 +3818,8 @@ void clif_changeoption(struct block_list* bl) /// Displays status change effects on NPCs/monsters (ZC_NPC_SHOWEFST_UPDATE). /// 028a .L .L .L .L -void clif_changeoption2(struct block_list* bl) { +static void clif_changeoption2(struct block_list *bl) +{ unsigned char buf[20]; struct status_change *sc; @@ -3786,7 +3846,7 @@ void clif_changeoption2(struct block_list* bl) { /// Notifies the client about the result of an item use request. /// 00a8 .W .W .B (ZC_USE_ITEM_ACK) /// 01c8 .W .W .L .W .B (ZC_USE_ITEM_ACK2) -void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok) +static void clif_useitemack(struct map_session_data *sd, int index, int amount, bool ok) { nullpo_retv(sd); @@ -3832,7 +3892,7 @@ void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok) /// 1 = Room limit exceeded /// 2 = Same room already exists // TODO: Flag enum -void clif_createchat(struct map_session_data* sd, int flag) +static void clif_createchat(struct map_session_data *sd, int flag) { int fd; @@ -3852,7 +3912,7 @@ void clif_createchat(struct map_session_data* sd, int flag) /// 1 = public /// 2 = arena (npc waiting room) /// 3 = PK zone (non-clickable) -void clif_dispchat(struct chat_data *cd, int fd) +static void clif_dispchat(struct chat_data *cd, int fd) { unsigned char buf[128]; uint8 type; @@ -3892,7 +3952,7 @@ void clif_dispchat(struct chat_data *cd, int fd) /// 1 = public /// 2 = arena (npc waiting room) /// 3 = PK zone (non-clickable) -void clif_changechatstatus(struct chat_data *cd) +static void clif_changechatstatus(struct chat_data *cd) { unsigned char buf[128]; uint8 type; @@ -3921,7 +3981,7 @@ void clif_changechatstatus(struct chat_data *cd) /// Removes the chatroom (ZC_DESTROY_ROOM). /// 00d8 .L -void clif_clearchat(struct chat_data *cd,int fd) +static void clif_clearchat(struct chat_data *cd, int fd) { unsigned char buf[32]; @@ -3949,7 +4009,7 @@ void clif_clearchat(struct chat_data *cd,int fd) /// 5 = too low level /// 6 = too high level /// 7 = unsuitable job class -void clif_joinchatfail(struct map_session_data *sd,int flag) +static void clif_joinchatfail(struct map_session_data *sd, int flag) { int fd; @@ -3968,7 +4028,7 @@ void clif_joinchatfail(struct map_session_data *sd,int flag) /// role: /// 0 = owner (menu) /// 1 = normal -void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd) +static void clif_joinchatok(struct map_session_data *sd, struct chat_data *cd) { int fd; int i,t; @@ -4004,7 +4064,7 @@ void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd) /// Notifies clients in a chat about a new member (ZC_MEMBER_NEWENTRY). /// 00dc .W .24B -void clif_addchat(struct chat_data* cd,struct map_session_data *sd) +static void clif_addchat(struct chat_data *cd, struct map_session_data *sd) { unsigned char buf[32]; @@ -4022,7 +4082,7 @@ void clif_addchat(struct chat_data* cd,struct map_session_data *sd) /// role: /// 0 = owner (menu) /// 1 = normal -void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd) +static void clif_changechatowner(struct chat_data *cd, struct map_session_data *sd) { unsigned char buf[64]; @@ -4045,7 +4105,7 @@ void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd) /// flag: /// 0 = left /// 1 = kicked -void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag) +static void clif_leavechat(struct chat_data *cd, struct map_session_data *sd, bool flag) { unsigned char buf[32]; @@ -4063,7 +4123,7 @@ void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag /// Opens a trade request window from char 'name'. /// 00e5 .24B (ZC_REQ_EXCHANGE_ITEM) /// 01f4 .24B .L .W (ZC_REQ_EXCHANGE_ITEM2) -void clif_traderequest(struct map_session_data *sd, const char *name) +static void clif_traderequest(struct map_session_data *sd, const char *name) { int fd; #if PACKETVER >= 6 @@ -4102,7 +4162,7 @@ void clif_traderequest(struct map_session_data *sd, const char *name) /// 3 = Accept /// 4 = Cancel /// 5 = Busy -void clif_tradestart(struct map_session_data *sd, uint8 type) +static void clif_tradestart(struct map_session_data *sd, uint8 type) { int fd; #if PACKETVER >= 6 @@ -4132,7 +4192,7 @@ void clif_tradestart(struct map_session_data *sd, uint8 type) /// Notifies the client about an item from other player in current trade. /// 00e9 .L .W .B .B .B .W .W .W .W (ZC_ADD_EXCHANGE_ITEM) /// 080f .W .B .L .B .B .B .W .W .W .W (ZC_ADD_EXCHANGE_ITEM2) -void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount) +static void clif_tradeadditem(struct map_session_data *sd, struct map_session_data *tsd, int index, int amount) { int fd; unsigned char *buf; @@ -4200,7 +4260,7 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd /// 0 = success /// 1 = overweight /// 2 = trade canceled -void clif_tradeitemok(struct map_session_data* sd, int index, int fail) +static void clif_tradeitemok(struct map_session_data *sd, int index, int fail) { int fd; nullpo_retv(sd); @@ -4218,7 +4278,7 @@ void clif_tradeitemok(struct map_session_data* sd, int index, int fail) /// who: /// 0 = self /// 1 = other player -void clif_tradedeal_lock(struct map_session_data* sd, int fail) +static void clif_tradedeal_lock(struct map_session_data *sd, int fail) { int fd; nullpo_retv(sd); @@ -4232,7 +4292,7 @@ void clif_tradedeal_lock(struct map_session_data* sd, int fail) /// Notifies the client about the trade being canceled (ZC_CANCEL_EXCHANGE_ITEM). /// 00ee -void clif_tradecancelled(struct map_session_data* sd) +static void clif_tradecancelled(struct map_session_data *sd) { int fd; nullpo_retv(sd); @@ -4248,7 +4308,7 @@ void clif_tradecancelled(struct map_session_data* sd) /// result: /// 0 = success /// 1 = failure -void clif_tradecompleted(struct map_session_data* sd, int fail) +static void clif_tradecompleted(struct map_session_data *sd, int fail) { int fd; nullpo_retv(sd); @@ -4265,7 +4325,7 @@ void clif_tradecompleted(struct map_session_data* sd, int fail) /// NOTE: Unknown purpose. Items are not removed until the window is /// refreshed (ex. by putting another item in there). /// unused -void clif_tradeundo(struct map_session_data* sd) +static void clif_tradeundo(struct map_session_data *sd) { int fd; @@ -4278,7 +4338,7 @@ void clif_tradeundo(struct map_session_data* sd) /// Updates storage total amount (ZC_NOTIFY_STOREITEM_COUNTINFO). /// 00f2 .W .W -void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount) +static void clif_updatestorageamount(struct map_session_data *sd, int amount, int max_amount) { int fd; @@ -4295,7 +4355,7 @@ void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_a /// Notifies the client of an item being added to the storage. /// 00f4 .W .L .W .B .B .B .W .W .W .W (ZC_ADD_ITEM_TO_STORE) /// 01c4 .W .L .W .B .B .B .B .W .W .W .W (ZC_ADD_ITEM_TO_STORE2) -void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount) +static void clif_storageitemadded(struct map_session_data *sd, struct item *i, int index, int amount) { int view,fd; int offset = 0; @@ -4326,7 +4386,7 @@ void clif_storageitemadded(struct map_session_data* sd, struct item* i, int inde /// Notifies the client of an item being deleted from the storage (ZC_DELETE_ITEM_FROM_STORE). /// 00f6 .W .L -void clif_storageitemremoved(struct map_session_data* sd, int index, int amount) +static void clif_storageitemremoved(struct map_session_data *sd, int index, int amount) { int fd; @@ -4343,7 +4403,7 @@ void clif_storageitemremoved(struct map_session_data* sd, int index, int amount) /// Closes storage (ZC_CLOSE_STORE). /// 00f8 -void clif_storageclose(struct map_session_data* sd) +static void clif_storageclose(struct map_session_data *sd) { int fd; @@ -4358,7 +4418,8 @@ void clif_storageclose(struct map_session_data* sd) /*========================================== * Server tells 'sd' player client the abouts of 'dstsd' player *------------------------------------------*/ -void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* dstsd) { +static void clif_getareachar_pc(struct map_session_data *sd, struct map_session_data *dstsd) +{ struct block_list *d_bl; int i; @@ -4398,7 +4459,8 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds clif->devotion(d_bl, sd); } -void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) { +static void clif_getareachar_unit(struct map_session_data *sd, struct block_list *bl) +{ struct unit_data *ud; struct view_data *vd; @@ -4499,7 +4561,8 @@ static inline int clif_calc_delay(int type, int div, int damage, int delay) /*========================================== * Estimates walk delay based on the damage criteria. [Skotlex] *------------------------------------------*/ -int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int damage, int div_) { +static int clif_calc_walkdelay(struct block_list *bl, int delay, int type, int damage, int div_) +{ if (type == 4 || type == 9 || damage <=0) return 0; @@ -4523,7 +4586,8 @@ int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int damage, i /// 08c8 .L .L .L .L .L .L .B
.W .B .L (ZC_NOTIFY_ACT2) /// type: @see enum battle_dmg_type /// for BDT_NORMAL: [ damage: total damage, div: amount of hits, damage2: assassin dual-wield damage ] -int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type, int64 in_damage2) { +static int clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type, int64 in_damage2) +{ struct packet_damage p; struct status_change *sc; #if PACKETVER < 20071113 @@ -4602,7 +4666,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int /*========================================== * src picks up dst *------------------------------------------*/ -void clif_takeitem(struct block_list* src, struct block_list* dst) +static void clif_takeitem(struct block_list *src, struct block_list *dst) { //clif->damage(src,dst,0,0,0,0,BDT_PICKUP,0); unsigned char buf[32]; @@ -4621,7 +4685,7 @@ void clif_takeitem(struct block_list* src, struct block_list* dst) /*========================================== * inform clients in area that `bl` is sitting *------------------------------------------*/ -void clif_sitting(struct block_list* bl) +static void clif_sitting(struct block_list *bl) { unsigned char buf[32]; nullpo_retv(bl); @@ -4640,7 +4704,7 @@ void clif_sitting(struct block_list* bl) /*========================================== * inform clients in area that `bl` is standing *------------------------------------------*/ -void clif_standing(struct block_list* bl) +static void clif_standing(struct block_list *bl) { unsigned char buf[32]; nullpo_retv(bl); @@ -4658,7 +4722,8 @@ void clif_standing(struct block_list* bl) /// Inform client(s) about a map-cell change (ZC_UPDATE_MAPINFO). /// 0192 .W .W .W .16B -void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target) { +static void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target) +{ unsigned char buf[32]; WBUFW(buf,0) = 0x192; @@ -4683,7 +4748,8 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe /// Notifies the client about an item on floor (ZC_ITEM_ENTRY). /// 009d .L .W .B .W .W .W .B .B -void clif_getareachar_item(struct map_session_data* sd,struct flooritem_data* fitem) { +static void clif_getareachar_item(struct map_session_data *sd, struct flooritem_data *fitem) +{ int view,fd; nullpo_retv(sd); @@ -4706,7 +4772,8 @@ void clif_getareachar_item(struct map_session_data* sd,struct flooritem_data* fi WFIFOSET(fd,packet_len(0x9d)); } -void clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum send_target target) { +static void clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum send_target target) +{ struct packet_graffiti_entry p; nullpo_retv(bl); @@ -4730,7 +4797,8 @@ void clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum send /// 01c9 .L .L .W .W .B .B .B .80B (ZC_SKILL_ENTRY2) /// 08c7 .W L .L .W .W .B .W .B (ZC_SKILL_ENTRY3) /// 099f .W L .L .W .W .L .W .B (ZC_SKILL_ENTRY4) -void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, enum send_target target) { +static void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, enum send_target target) +{ struct packet_skill_entry p; nullpo_retv(bl); nullpo_retv(su); @@ -4784,7 +4852,8 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, en /*========================================== * Server tells client to remove unit of id 'unit->bl.id' *------------------------------------------*/ -void clif_clearchar_skillunit(struct skill_unit *su, int fd) { +static void clif_clearchar_skillunit(struct skill_unit *su, int fd) +{ nullpo_retv(su); WFIFOHEAD(fd,packet_len(0x120)); @@ -4798,7 +4867,8 @@ void clif_clearchar_skillunit(struct skill_unit *su, int fd) { /// Removes a skill unit (ZC_SKILL_DISAPPEAR). /// 0120 .L -void clif_skill_delunit(struct skill_unit *su) { +static void clif_skill_delunit(struct skill_unit *su) +{ unsigned char buf[16]; nullpo_retv(su); @@ -4811,7 +4881,7 @@ void clif_skill_delunit(struct skill_unit *su) { /// Sent when an object gets ankle-snared (ZC_SKILL_UPDATE). /// 01ac .L /// Only affects units with class [139,153] client-side. -void clif_skillunit_update(struct block_list* bl) +static void clif_skillunit_update(struct block_list *bl) { unsigned char buf[6]; nullpo_retv(bl); @@ -4825,7 +4895,8 @@ void clif_skillunit_update(struct block_list* bl) /*========================================== * *------------------------------------------*/ -int clif_getareachar(struct block_list* bl,va_list ap) { +static int clif_getareachar(struct block_list *bl, va_list ap) +{ struct map_session_data *sd; nullpo_ret(bl); @@ -4854,7 +4925,7 @@ int clif_getareachar(struct block_list* bl,va_list ap) { /*========================================== * tbl has gone out of view-size of bl *------------------------------------------*/ -int clif_outsight(struct block_list *bl,va_list ap) +static int clif_outsight(struct block_list *bl, va_list ap) { struct block_list *tbl; struct view_data *vd; @@ -4911,7 +4982,7 @@ int clif_outsight(struct block_list *bl,va_list ap) /*========================================== * tbl has come into view of bl *------------------------------------------*/ -int clif_insight(struct block_list *bl,va_list ap) +static int clif_insight(struct block_list *bl, va_list ap) { struct block_list *tbl; struct map_session_data *sd, *tsd; @@ -4944,7 +5015,7 @@ int clif_insight(struct block_list *bl,va_list ap) /// Updates whole skill tree (ZC_SKILLINFO_LIST). /// 010f .W { .W .L .W .W .W .24B .B }* -void clif_skillinfoblock(struct map_session_data *sd) +static void clif_skillinfoblock(struct map_session_data *sd) { int fd; int i,len,id; @@ -5000,7 +5071,7 @@ void clif_skillinfoblock(struct map_session_data *sd) /// Adds new skill to the skill tree (ZC_ADD_SKILL). /// 0111 .W .L .W .W .W .24B .B -void clif_addskill(struct map_session_data *sd, int id) +static void clif_addskill(struct map_session_data *sd, int id) { int fd, skill_lv, idx = skill->get_index(id); @@ -5036,7 +5107,7 @@ void clif_addskill(struct map_session_data *sd, int id) /// Deletes a skill from the skill tree (ZC_SKILLINFO_DELETE). /// 0441 .W -void clif_deleteskill(struct map_session_data *sd, int id) +static void clif_deleteskill(struct map_session_data *sd, int id) { #if PACKETVER >= 20081217 int fd; @@ -5059,7 +5130,7 @@ void clif_deleteskill(struct map_session_data *sd, int id) /// flag: /// 0: guild call /// 1: player call -void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, int flag) +static void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, int flag) { int fd; nullpo_retv(sd); @@ -5082,7 +5153,7 @@ void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, in /// Updates a skill in the skill tree (ZC_SKILLINFO_UPDATE2). /// 07e1 .W .L .W .W .W .B -void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf) +static void clif_skillinfo(struct map_session_data *sd, int skill_id, int inf) { const int fd = sd->fd; int idx = skill->get_index(skill_id); @@ -5127,7 +5198,7 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf) /// is disposable: /// 0 = yellow chat text "[src name] will use skill [skill name]." /// 1 = no text -void clif_useskill(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime) +static void clif_useskill(struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime) { #if PACKETVER < 20091124 const int cmd = 0x13e; @@ -5164,7 +5235,7 @@ void clif_useskill(struct block_list* bl, int src_id, int dst_id, int dst_x, int /// Notifies clients in area, that an object canceled casting (ZC_DISPEL). /// 01b9 .L -void clif_skillcastcancel(struct block_list* bl) +static void clif_skillcastcancel(struct block_list *bl) { unsigned char buf[16]; @@ -5198,7 +5269,7 @@ void clif_skillcastcancel(struct block_list* bl) /// if(result!=0) doesn't display any of the previous messages /// Note: when this packet is received an unknown flag is always set to 0, /// suggesting this is an ACK packet for the UseSkill packets and should be sent on success too [FlavioJS] -void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype) +static void clif_skill_fail(struct map_session_data *sd, uint16 skill_id, enum useskill_fail_cause cause, int btype) { int fd; @@ -5234,7 +5305,7 @@ void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_f /// Skill cooldown display icon (ZC_SKILL_POSTDELAY). /// 043d .W .L -void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int duration) +static void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int duration) { #if PACKETVER>=20081112 int fd; @@ -5253,7 +5324,8 @@ void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned /// Skill attack effect and damage. /// 0114 .W .L .L .L .L .L .W .W
.W .B (ZC_NOTIFY_SKILL) /// 01de .W .L .L .L .L .L .L .W
.W .B (ZC_NOTIFY_SKILL2) -int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 in_damage, int div, uint16 skill_id, uint16 skill_lv, int type) { +static int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 in_damage, int div, uint16 skill_id, uint16 skill_lv, int type) +{ unsigned char buf[64]; struct status_change *sc; int damage; @@ -5354,7 +5426,8 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick /// Ground skill attack effect and damage (ZC_NOTIFY_SKILL_POSITION). /// 0115 .W .L .L .L .L .L .W .W .W .W
.W .B #if 0 -int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int damage, int div, uint16 skill_id, uint16 skill_lv, int type) { +static int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int damage, int div, uint16 skill_id, uint16 skill_lv, int type) +{ unsigned char buf[64]; struct status_change *sc; @@ -5411,7 +5484,7 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic /// Non-damaging skill effect. /// 011a .W .W .L .L .B (ZC_USE_SKILL) /// 09cb .W .L .L .L .B (ZC_USE_SKILL2) -int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail) +static int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail) { unsigned char buf[32]; short offset = 0; @@ -5455,7 +5528,8 @@ int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 s /// Non-damaging ground skill effect (ZC_NOTIFY_GROUNDSKILL). /// 0117 .W .L .W .W .W .L -void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick) { +static void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick) +{ unsigned char buf[32]; nullpo_retv(src); @@ -5478,7 +5552,7 @@ void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int /// Presents a list of available warp destinations (ZC_WARPLIST). /// 011c .W { .16B }*4 -void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4) +static void clif_skill_warppoint(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4) { int fd; @@ -5515,7 +5589,7 @@ void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 s /// /// @param sd Who receives the message /// @param type What message -void clif_skill_memomessage(struct map_session_data* sd, int type) +static void clif_skill_memomessage(struct map_session_data *sd, int type) { int fd; @@ -5538,7 +5612,7 @@ void clif_skill_memomessage(struct map_session_data* sd, int type) /// /// @param sd Who receives the message /// @param type What message -void clif_skill_mapinfomessage(struct map_session_data *sd, int type) +static void clif_skill_mapinfomessage(struct map_session_data *sd, int type) { int fd; @@ -5554,7 +5628,8 @@ void clif_skill_mapinfomessage(struct map_session_data *sd, int type) /// Displays Sense (WZ_ESTIMATION) information window (ZC_MONSTER_INFO). /// 018c .W .W .W .L .W .W .W .W /// .B .B .B .B .B .B .B .B .B -void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) { +static void clif_skill_estimation(struct map_session_data *sd, struct block_list *dst) +{ struct status_data *dstatus; unsigned char buf[64]; int i;//, fix; @@ -5591,7 +5666,7 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) { /// 018d .W { .W { .W }*3 }* /// material id: /// unused by the client -void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id , int trigger) +static void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger) { int i,c,view,fd; nullpo_retv(sd); @@ -5637,7 +5712,7 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id , int /// 4 = GN_MIX_COOKING /// 5 = GN_MAKEBOMB /// 6 = GN_S_PHARMACY -void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type) +static void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type) { int fd; int i, c; @@ -5691,7 +5766,8 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id } } -void clif_status_change_notick(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3) { +static void clif_status_change_notick(struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3) +{ struct packet_sc_notick p; struct map_session_data *sd; @@ -5719,7 +5795,8 @@ void clif_status_change_notick(struct block_list *bl,int type,int flag,int tick, /// 08ff .L .W .L { .L }*3 (PACKETVER >= 20111108) /// 0983 .W .L .B .L .L { .L }*3 (PACKETVER >= 20120618) /// 0984 .L .W .L .L { .L }*3 (PACKETVER >= 20120618) -void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3) { +static void clif_status_change(struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3) +{ struct packet_status_change p; struct map_session_data *sd; @@ -5755,7 +5832,7 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val /// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT). /// 008e .W .?B -void clif_displaymessage(const int fd, const char *mes) +static void clif_displaymessage(const int fd, const char *mes) { nullpo_retv(mes); @@ -5780,7 +5857,8 @@ void clif_displaymessage(const int fd, const char *mes) } } -void clif_displaymessage2(const int fd, const char* mes) { +static void clif_displaymessage2(const int fd, const char *mes) +{ nullpo_retv(mes); //Scrapped, as these are shared by disconnected players =X [Skotlex] @@ -5812,9 +5890,11 @@ void clif_displaymessage2(const int fd, const char* mes) { aFree(message); } } + /* oh noo! another version of 0x8e! */ -void clif_displaymessage_sprintf(const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3))); -void clif_displaymessage_sprintf(const int fd, const char *mes, ...) { +static void clif_displaymessage_sprintf(const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3))); +static void clif_displaymessage_sprintf(const int fd, const char *mes, ...) +{ va_list ap; nullpo_retv(mes); @@ -5846,9 +5926,10 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) { WFIFOSET(fd, 5 + len); } } + /// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST). /// 009a .W .?B -void clif_broadcast(struct block_list *bl, const char *mes, int len, int type, enum send_target target) +static void clif_broadcast(struct block_list *bl, const char *mes, int len, int type, enum send_target target) { int lp = (type&BC_COLOR_MASK) ? 4 : 0; unsigned char *buf = NULL; @@ -5872,7 +5953,7 @@ void clif_broadcast(struct block_list *bl, const char *mes, int len, int type, e * Displays a message on a 'bl' to all it's nearby clients * Used by npc_globalmessage *------------------------------------------*/ -void clif_GlobalMessage(struct block_list *bl, const char *message) +static void clif_GlobalMessage(struct block_list *bl, const char *message) { char buf[256]; int len; @@ -5897,7 +5978,7 @@ void clif_GlobalMessage(struct block_list *bl, const char *message) /// Send broadcast message with font formatting (ZC_BROADCAST2). /// 01c3 .W .L .W .W .W .W .?B -void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) +static void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) { unsigned char *buf; @@ -5923,7 +6004,7 @@ void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned i /// 5 = HP (SP_HP) /// 7 = SP (SP_SP) /// ? = ignored -void clif_heal(int fd, int type, int val) +static void clif_heal(int fd, int type, int val) { #if PACKETVER < 20150513 short cmd = 0x13d; @@ -5947,7 +6028,7 @@ void clif_heal(int fd, int type, int val) /// 0148 .L .W /// type: /// ignored -void clif_resurrection(struct block_list *bl,int type) +static void clif_resurrection(struct block_list *bl, int type) { unsigned char buf[16]; @@ -5971,7 +6052,7 @@ void clif_resurrection(struct block_list *bl,int type) /// Sets the map property (ZC_NOTIFY_MAPPROPERTY). /// 0199 .W -void clif_map_property(struct map_session_data* sd, enum map_property property) +static void clif_map_property(struct map_session_data *sd, enum map_property property) { int fd; @@ -5986,7 +6067,8 @@ void clif_map_property(struct map_session_data* sd, enum map_property property) /// Set the map type (ZC_NOTIFY_MAPPROPERTY2). /// 01d6 .W -void clif_map_type(struct map_session_data* sd, enum map_type type) { +static void clif_map_type(struct map_session_data *sd, enum map_type type) +{ int fd; nullpo_retv(sd); @@ -6001,7 +6083,7 @@ void clif_map_type(struct map_session_data* sd, enum map_type type) { /// Updates PvP ranking (ZC_NOTIFY_RANKING). /// 019a .L .L .L // FIXME: missing documentation for the 'type' parameter -void clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type) +static void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum, int type) { nullpo_retv(sd); @@ -6034,7 +6116,7 @@ void clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type) /*========================================== * *------------------------------------------*/ -void clif_map_property_mapall(int mapid, enum map_property property) +static void clif_map_property_mapall(int mapid, enum map_property property) { struct block_list bl; unsigned char buf[16]; @@ -6053,7 +6135,7 @@ void clif_map_property_mapall(int mapid, enum map_property property) /// 0 = success /// 1 = failure /// 2 = downgrade -void clif_refine(int fd, int fail, int index, int val) +static void clif_refine(int fd, int fail, int index, int val) { WFIFOHEAD(fd,packet_len(0x188)); WFIFOW(fd,0)=0x188; @@ -6070,7 +6152,7 @@ void clif_refine(int fd, int fail, int index, int val) /// 1 = "weapon upgraded: %s" MsgStringTable[912] in rgb(0,205,205) /// 2 = "cannot upgrade %s until you level up the upgrade weapon skill" MsgStringTable[913] in rgb(255,200,200) /// 3 = "you lack the item %s to upgrade the weapon" MsgStringTable[914] in rgb(255,200,200) -void clif_upgrademessage(int fd, int result, int item_id) +static void clif_upgrademessage(int fd, int result, int item_id) { WFIFOHEAD(fd,packet_len(0x223)); WFIFOW(fd,0)=0x223; @@ -6082,7 +6164,7 @@ void clif_upgrademessage(int fd, int result, int item_id) /// Whisper is transmitted to the destination player (ZC_WHISPER). /// 0097 .W .24B .?B /// 0097 .W .24B .L .?B (PACKETVER >= 20091104) -void clif_wis_message(int fd, const char *nick, const char *mes, int mes_len) +static void clif_wis_message(int fd, const char *nick, const char *mes, int mes_len) { #if PACKETVER >= 20091104 struct map_session_data *ssd = NULL; @@ -6117,7 +6199,8 @@ void clif_wis_message(int fd, const char *nick, const char *mes, int mes_len) /// 1 = target character is not logged in /// 2 = ignored by target /// 3 = everyone ignored by target -void clif_wis_end(int fd, int flag) { +static void clif_wis_end(int fd, int flag) +{ struct map_session_data *sd = sockt->session_is_valid(fd) ? sockt->session[fd]->session_data : NULL; struct packet_wis_end p; @@ -6136,7 +6219,7 @@ void clif_wis_end(int fd, int flag) { /// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID). /// 0194 .L .24B /// 0af7 .W .L .24B -void clif_solved_charname(int fd, int charid, const char* name) +static void clif_solved_charname(int fd, int charid, const char *name) { nullpo_retv(name); #if PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221 || PACKETVER_ZERO_NUM >= 20180328 @@ -6162,7 +6245,7 @@ void clif_solved_charname(int fd, int charid, const char* name) /// Presents a list of items that can be carded/composed (ZC_ITEMCOMPOSITION_LIST). /// 017b .W { .W }* -void clif_use_card(struct map_session_data *sd,int idx) +static void clif_use_card(struct map_session_data *sd, int idx) { int i, c; int fd; @@ -6195,7 +6278,7 @@ void clif_use_card(struct map_session_data *sd,int idx) /// result: /// 0 = success /// 1 = failure -void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag) +static void clif_insert_card(struct map_session_data *sd, int idx_equip, int idx_card, int flag) { int fd; @@ -6212,7 +6295,7 @@ void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int /// Presents a list of items that can be identified (ZC_ITEMIDENTIFY_LIST). /// 0177 .W { .W }* -void clif_item_identify_list(struct map_session_data *sd) +static void clif_item_identify_list(struct map_session_data *sd) { int i,c; int fd; @@ -6240,7 +6323,7 @@ void clif_item_identify_list(struct map_session_data *sd) /// Notifies the client about the result of a item identify request (ZC_ACK_ITEMIDENTIFY). /// 0179 .W .B -void clif_item_identified(struct map_session_data *sd,int idx,int flag) +static void clif_item_identified(struct map_session_data *sd, int idx, int flag) { int fd; @@ -6256,7 +6339,7 @@ void clif_item_identified(struct map_session_data *sd,int idx,int flag) /// Presents a list of items that can be repaired (ZC_REPAIRITEMLIST). /// 01fc .W { .W .W .B .W .W .W .W }* -void clif_item_repair_list(struct map_session_data *sd,struct map_session_data *dstsd, int lv) +static void clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv) { int i,c; int fd; @@ -6295,7 +6378,7 @@ void clif_item_repair_list(struct map_session_data *sd,struct map_session_data * /// result: /// 0 = Item repair success. /// 1 = Item repair failure. -void clif_item_repaireffect(struct map_session_data *sd,int idx,int flag) +static void clif_item_repaireffect(struct map_session_data *sd, int idx, int flag) { int fd; @@ -6313,7 +6396,7 @@ void clif_item_repaireffect(struct map_session_data *sd,int idx,int flag) /// Displays a message, that an equipment got damaged (ZC_EQUIPITEM_DAMAGED). /// 02bb .W .L -void clif_item_damaged(struct map_session_data* sd, unsigned short position) +static void clif_item_damaged(struct map_session_data *sd, unsigned short position) { int fd; @@ -6329,7 +6412,7 @@ void clif_item_damaged(struct map_session_data* sd, unsigned short position) /// Presents a list of weapon items that can be refined [Taken from jAthena] (ZC_NOTIFY_WEAPONITEMLIST). /// 0221 .W { .W .W .B .W .W .W .W }* -void clif_item_refine_list(struct map_session_data *sd) +static void clif_item_refine_list(struct map_session_data *sd) { int i,c; int fd; @@ -6365,7 +6448,7 @@ void clif_item_refine_list(struct map_session_data *sd) /// Notification of an auto-casted skill (ZC_AUTORUN_SKILL). /// 0147 .W .L .W .W .W .24B .B -void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv) +static void clif_item_skill(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { int fd; @@ -6387,7 +6470,7 @@ void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv /// Adds an item to character's cart. /// 0124 .W .L .W .B .B .B .W .W .W .W (ZC_ADD_ITEM_TO_CART) /// 01c5 .W .L .W .B .B .B .B .W .W .W .W (ZC_ADD_ITEM_TO_CART2) -void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail) +static void clif_cart_additem(struct map_session_data *sd, int n, int amount, int fail) { int view,fd; unsigned char *buf; @@ -6424,7 +6507,7 @@ void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail) /// Deletes an item from character's cart (ZC_DELETE_ITEM_FROM_CART). /// 0125 .W .L -void clif_cart_delitem(struct map_session_data *sd,int n,int amount) +static void clif_cart_delitem(struct map_session_data *sd, int n, int amount) { int fd; @@ -6443,7 +6526,7 @@ void clif_cart_delitem(struct map_session_data *sd,int n,int amount) /// 012d .W /// num: /// number of allowed item slots -void clif_openvendingreq(struct map_session_data* sd, int num) +static void clif_openvendingreq(struct map_session_data *sd, int num) { int fd; @@ -6458,7 +6541,7 @@ void clif_openvendingreq(struct map_session_data* sd, int num) /// Displays a vending board to target/area (ZC_STORE_ENTRY). /// 0131 .L .80B -void clif_showvendingboard(struct block_list* bl, const char* message, int fd) +static void clif_showvendingboard(struct block_list *bl, const char *message, int fd) { unsigned char buf[128]; @@ -6479,7 +6562,7 @@ void clif_showvendingboard(struct block_list* bl, const char* message, int fd) /// Removes a vending board from screen (ZC_DISAPPEAR_ENTRY). /// 0132 .L -void clif_closevendingboard(struct block_list* bl, int fd) +static void clif_closevendingboard(struct block_list *bl, int fd) { unsigned char buf[16]; @@ -6499,7 +6582,8 @@ void clif_closevendingboard(struct block_list* bl, int fd) /// Sends a list of items in a shop. /// R 0133 .W .L { .L .W .W .B .W .B .B .B .W .W .W .W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC) /// R 0800 .W .L .L { .L .W .W .B .W .B .B .B .W .W .W .W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC2) -void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_vending* vending_items) { +static void clif_vendinglist(struct map_session_data *sd, unsigned int id, struct s_vending *vending_items) +{ int i,fd; int count; struct map_session_data* vsd; @@ -6569,7 +6653,7 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven /// 5 = "cannot use an npc shop while in a trade" /// 6 = Because the store information was incorrect the item was not purchased. /// 7 = No sales information. -void clif_buyvending(struct map_session_data* sd, int index, int amount, int fail) +static void clif_buyvending(struct map_session_data *sd, int index, int amount, int fail) { int fd; @@ -6586,7 +6670,8 @@ void clif_buyvending(struct map_session_data* sd, int index, int amount, int fai /// Shop creation success (ZC_PC_PURCHASE_MYITEMLIST). /// 0136 .W .L { .L .W .W .B .W .B .B .B .W .W .W .W }* -void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending_items) { +static void clif_openvending(struct map_session_data *sd, int id, struct s_vending *vending_items) +{ int i,fd; int count; @@ -6636,7 +6721,7 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven /// Inform merchant that someone has bought an item. /// 0137 .W .W (ZC_DELETEITEM_FROM_MCSTORE). /// 09e5 .W .W .L .L .L (ZC_DELETEITEM_FROM_MCSTORE2). -void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny) +static void clif_vendingreport(struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny) { int fd; #if PACKETVER < 20141016 // TODO : not sure for client date [Napster] @@ -6669,7 +6754,7 @@ void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint /// 2 = MsgStringTable[79]="already in a party" /// 3 = cannot organize parties on this map /// ? = nothing -void clif_party_created(struct map_session_data *sd,int result) +static void clif_party_created(struct map_session_data *sd, int result) { int fd; @@ -6689,7 +6774,7 @@ void clif_party_created(struct map_session_data *sd,int result) /// state: /// 0 = connected /// 1 = disconnected -void clif_party_member_info(struct party_data *p, struct map_session_data *sd) +static void clif_party_member_info(struct party_data *p, struct map_session_data *sd) { int i; struct PACKET_ZC_ADD_MEMBER_TO_GROUP packet; @@ -6735,7 +6820,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd) /// state: /// 0 = connected /// 1 = disconnected -void clif_party_info(struct party_data* p, struct map_session_data *sd) +static void clif_party_info(struct party_data *p, struct map_session_data *sd) { struct PACKET_ZC_GROUP_LIST *packet; struct map_session_data* party_sd = NULL; @@ -6781,7 +6866,7 @@ void clif_party_info(struct party_data* p, struct map_session_data *sd) /// Updates the job and level of a party member /// 0abd .L .W .W -void clif_party_job_and_level(struct map_session_data *sd) +static void clif_party_job_and_level(struct map_session_data *sd) { // [4144] packet 0xabd added in client in 2017-02-15 because this probably it can works for clients older than 20170502 #if PACKETVER >= 20170502 @@ -6803,7 +6888,7 @@ void clif_party_job_and_level(struct map_session_data *sd) /// flag: /// 0 = allow party invites /// 1 = auto-deny party invites -void clif_partyinvitationstate(struct map_session_data* sd) +static void clif_partyinvitationstate(struct map_session_data *sd) { int fd; nullpo_retv(sd); @@ -6818,7 +6903,7 @@ void clif_partyinvitationstate(struct map_session_data* sd) /// Party invitation request. /// 00fe .L .24B (ZC_REQ_JOIN_GROUP) /// 02c6 .L .24B (ZC_PARTY_JOIN_REQ) -void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd) +static void clif_party_invite(struct map_session_data *sd, struct map_session_data *tsd) { #if PACKETVER < 20070821 const int cmd = 0xfe; @@ -6855,7 +6940,7 @@ void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd) /// result=7 : char is not online or doesn't exist -> MsgStringTable[71] (since 20070904) /// result=8 : (%s) TODO instance related? -> MsgStringTable[1388] (since 20080527) /// return=9 : TODO map prohibits party joining? -> MsgStringTable[1871] (since 20110205) -void clif_party_inviteack(struct map_session_data* sd, const char* nick, int result) +static void clif_party_inviteack(struct map_session_data *sd, const char *nick, int result) { int fd; nullpo_retv(sd); @@ -6895,7 +6980,7 @@ void clif_party_inviteack(struct map_session_data* sd, const char* nick, int res /// flag: /// 0 = send to party /// 1 = send to sd -void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag) +static void clif_party_option(struct party_data *p, struct map_session_data *sd, int flag) { unsigned char buf[16]; #if PACKETVER < 20090603 @@ -6932,7 +7017,7 @@ void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag /// 1 = expel /// 2 = cannot leave party on this map /// 3 = cannot expel from party on this map -void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag) +static void clif_party_withdraw(struct party_data *p, struct map_session_data *sd, int account_id, const char *name, int flag) { unsigned char buf[64]; @@ -6962,7 +7047,7 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int /// Party chat message (ZC_NOTIFY_CHAT_PARTY). /// 0109 .W .L .?B -void clif_party_message(struct party_data *p, int account_id, const char *mes, int len) +static void clif_party_message(struct party_data *p, int account_id, const char *mes, int len) { struct map_session_data *sd; int i; @@ -6993,7 +7078,7 @@ void clif_party_message(struct party_data *p, int account_id, const char *mes, i /// Updates the position of a party member on the minimap (ZC_NOTIFY_POSITION_TO_GROUPM). /// 0107 .L .W .W -void clif_party_xy(struct map_session_data *sd) +static void clif_party_xy(struct map_session_data *sd) { unsigned char buf[16]; @@ -7009,7 +7094,7 @@ void clif_party_xy(struct map_session_data *sd) /*========================================== * Sends x/y dot to a single fd. [Skotlex] *------------------------------------------*/ -void clif_party_xy_single(int fd, struct map_session_data *sd) +static void clif_party_xy_single(int fd, struct map_session_data *sd) { nullpo_retv(sd); WFIFOHEAD(fd,packet_len(0x107)); @@ -7023,7 +7108,7 @@ void clif_party_xy_single(int fd, struct map_session_data *sd) /// Updates HP bar of a party member. /// 0106 .L .W .W (ZC_NOTIFY_HP_TO_GROUPM) /// 080e .L .L .L (ZC_NOTIFY_HP_TO_GROUPM_R2) -void clif_party_hp(struct map_session_data *sd) +static void clif_party_hp(struct map_session_data *sd) { unsigned char buf[16]; #if PACKETVER < 20100126 @@ -7054,7 +7139,7 @@ void clif_party_hp(struct map_session_data *sd) /*========================================== * Sends HP bar to a single fd. [Skotlex] *------------------------------------------*/ -void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) +static void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) { #if PACKETVER < 20100126 const int cmd = 0x106; @@ -7082,7 +7167,7 @@ void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) /// Notifies the client, that it's attack target is too far (ZC_ATTACK_FAILURE_FOR_DISTANCE). /// 0139 .L .W .W .W .W .W -void clif_movetoattack(struct map_session_data *sd,struct block_list *bl) +static void clif_movetoattack(struct map_session_data *sd, struct block_list *bl) { int fd; @@ -7108,7 +7193,7 @@ void clif_movetoattack(struct map_session_data *sd,struct block_list *bl) /// 1 = failure /// 2 = success (alchemist) /// 3 = failure (alchemist) -void clif_produceeffect(struct map_session_data* sd,int flag,int nameid) +static void clif_produceeffect(struct map_session_data *sd, int flag, int nameid) { int view,fd; @@ -7128,7 +7213,7 @@ void clif_produceeffect(struct map_session_data* sd,int flag,int nameid) /// Initiates the pet taming process (ZC_START_CAPTURE). /// 019e -void clif_catch_process(struct map_session_data *sd) +static void clif_catch_process(struct map_session_data *sd) { int fd; @@ -7144,7 +7229,7 @@ void clif_catch_process(struct map_session_data *sd) /// 01a0 .B /// 0 = failure /// 1 = success -void clif_pet_roulette(struct map_session_data *sd,int data) +static void clif_pet_roulette(struct map_session_data *sd, int data) { int fd; @@ -7159,7 +7244,8 @@ void clif_pet_roulette(struct map_session_data *sd,int data) /// Presents a list of pet eggs that can be hatched (ZC_PETEGG_LIST). /// 01a6 .W { .W }* -void clif_sendegg(struct map_session_data *sd) { +static void clif_sendegg(struct map_session_data *sd) +{ int i, n, fd; nullpo_retv(sd); @@ -7199,7 +7285,7 @@ void clif_sendegg(struct map_session_data *sd) { /// 5 = hairstyle /// /// If sd is null, the update is sent to nearby objects, otherwise it is sent only to that player. -void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param) +static void clif_send_petdata(struct map_session_data *sd, struct pet_data *pd, int type, int param) { uint8 buf[16]; nullpo_retv(pd); @@ -7216,7 +7302,7 @@ void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int typ /// Pet's base data (ZC_PROPERTY_PET). /// 01a2 .24B .B .W .W .W .W .W -void clif_send_petstatus(struct map_session_data *sd) +static void clif_send_petstatus(struct map_session_data *sd) { int fd; struct s_pet *p; @@ -7244,7 +7330,7 @@ void clif_send_petstatus(struct map_session_data *sd) /// 01aa .L .L /// data: /// @see CZ_PET_ACT. -void clif_pet_emotion(struct pet_data *pd,int param) +static void clif_pet_emotion(struct pet_data *pd, int param) { unsigned char buf[16]; @@ -7273,7 +7359,7 @@ void clif_pet_emotion(struct pet_data *pd,int param) /// result: /// 0 = failure /// 1 = success -void clif_pet_food(struct map_session_data *sd,int foodid,int fail) +static void clif_pet_food(struct map_session_data *sd, int foodid, int fail) { int fd; @@ -7289,7 +7375,7 @@ void clif_pet_food(struct map_session_data *sd,int foodid,int fail) /// Presents a list of skills that can be auto-spelled (ZC_AUTOSPELLLIST). /// 01cd { .L }*7 -void clif_autospell(struct map_session_data *sd,uint16 skill_lv) +static void clif_autospell(struct map_session_data *sd, uint16 skill_lv) { int fd; @@ -7335,7 +7421,7 @@ void clif_autospell(struct map_session_data *sd,uint16 skill_lv) /// Devotion's visual effect (ZC_DEVOTIONLIST). /// 01cf .L { .L }*5 .W -void clif_devotion(struct block_list *src, struct map_session_data *tsd) +static void clif_devotion(struct block_list *src, struct map_session_data *tsd) { unsigned char buf[56]; @@ -7386,7 +7472,8 @@ void clif_devotion(struct block_list *src, struct map_session_data *tsd) * 01d0 .L .W (ZC_SPIRITS) * 01e1 .L .W (ZC_SPIRITS2) *------------------------------------------*/ -void clif_spiritball(struct block_list *bl) { +static void clif_spiritball(struct block_list *bl) +{ unsigned char buf[16]; struct map_session_data *sd = BL_CAST(BL_PC,bl); struct homun_data *hd = BL_CAST(BL_HOM,bl); @@ -7405,7 +7492,7 @@ void clif_spiritball(struct block_list *bl) { /// Notifies clients in area of a character's combo delay (ZC_COMBODELAY). /// 01d2 .L .L -void clif_combo_delay(struct block_list *bl,int wait) +static void clif_combo_delay(struct block_list *bl, int wait) { unsigned char buf[32]; @@ -7422,7 +7509,7 @@ void clif_combo_delay(struct block_list *bl,int wait) /// flag: /// 0 = inactive /// 1 = active -void clif_bladestop(struct block_list *src, int dst_id, int active) +static void clif_bladestop(struct block_list *src, int dst_id, int active) { unsigned char buf[32]; @@ -7438,7 +7525,7 @@ void clif_bladestop(struct block_list *src, int dst_id, int active) /// MVP effect (ZC_MVP). /// 010c .L -void clif_mvp_effect(struct map_session_data *sd) +static void clif_mvp_effect(struct map_session_data *sd) { unsigned char buf[16]; @@ -7451,7 +7538,7 @@ void clif_mvp_effect(struct map_session_data *sd) /// MVP item reward message (ZC_MVP_GETTING_ITEM). /// 010a .W -void clif_mvp_item(struct map_session_data *sd,int nameid) +static void clif_mvp_item(struct map_session_data *sd, int nameid) { int view,fd; @@ -7469,7 +7556,7 @@ void clif_mvp_item(struct map_session_data *sd,int nameid) /// MVP EXP reward message (ZC_MVP_GETTING_SPECIAL_EXP). /// 010b .L -void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) +static void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) { #if PACKETVER >= 20131223 // Kro removed this packet [Napster] if (battle_config.mvp_exp_reward_message) { @@ -7495,7 +7582,7 @@ void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) /// /// "You are the MVP, but cannot obtain the reward because /// you are overweight." -void clif_mvp_noitem(struct map_session_data* sd) +static void clif_mvp_noitem(struct map_session_data *sd) { int fd = sd->fd; @@ -7511,7 +7598,7 @@ void clif_mvp_noitem(struct map_session_data* sd) /// 1 = "You are already in a Guild." /// 2 = "That Guild Name already exists." /// 3 = "You need the necessary item to create a Guild." -void clif_guild_created(struct map_session_data *sd,int flag) +static void clif_guild_created(struct map_session_data *sd, int flag) { int fd; @@ -7527,7 +7614,7 @@ void clif_guild_created(struct map_session_data *sd,int flag) /// Notifies the client that it is belonging to a guild (ZC_UPDATE_GDID). /// 016c .L .L .L .B .L .24B /// mode: @see enum guild_permission -void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) +static void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) { int ps,fd; nullpo_retv(sd); @@ -7552,7 +7639,7 @@ void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) /// status: /// 0 = offline /// 1 = online -void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag) +static void clif_guild_memberlogin_notice(struct guild *g, int idx, int flag) { unsigned char buf[64]; struct map_session_data* sd; @@ -7589,7 +7676,7 @@ void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag) // At next time the client would always show the message. // The function sends all the statuses in the single packet // to economize traffic. [LuzZza] -void clif_guild_send_onlineinfo(struct map_session_data *sd) +static void clif_guild_send_onlineinfo(struct map_session_data *sd) { struct guild *g; unsigned char buf[14*128]; @@ -7628,7 +7715,7 @@ void clif_guild_send_onlineinfo(struct map_session_data *sd) /// &0x10 = Expulsion list /// &0x40 = Unknown (GMENUFLAG_ALLGUILDLIST) /// &0x80 = Notice -void clif_guild_masterormember(struct map_session_data *sd) +static void clif_guild_masterormember(struct map_session_data *sd) { int fd; @@ -7644,7 +7731,7 @@ void clif_guild_masterormember(struct map_session_data *sd) /// Guild basic information (Territories [Valaris]) /// 0150 .L .L .L .L .L .L .L .L .L .L .24B .24B .16B (ZC_GUILD_INFO) /// 01b6 .L .L .L .L .L .L .L .L .L .L .24B .24B .16B .L (ZC_GUILD_INFO2) -void clif_guild_basicinfo(struct map_session_data *sd) +static void clif_guild_basicinfo(struct map_session_data *sd) { int fd; struct guild *g; @@ -7690,7 +7777,7 @@ void clif_guild_basicinfo(struct map_session_data *sd) /// Guild alliance and opposition list (ZC_MYGUILD_BASIC_INFO). /// 014c .W { .L .L .24B }* -void clif_guild_allianceinfo(struct map_session_data *sd) +static void clif_guild_allianceinfo(struct map_session_data *sd) { int fd,i,c; struct guild *g; @@ -7722,7 +7809,7 @@ void clif_guild_allianceinfo(struct map_session_data *sd) /// 1 = online /// memo: /// probably member's self-introduction (unused, no client UI/packets for editing it) -void clif_guild_memberlist(struct map_session_data *sd) +static void clif_guild_memberlist(struct map_session_data *sd) { int fd; int i,c; @@ -7772,7 +7859,8 @@ void clif_guild_memberlist(struct map_session_data *sd) /// Guild position name information (ZC_POSITION_ID_NAME_INFO). /// 0166 .W { .L .24B }* -void clif_guild_positionnamelist(struct map_session_data *sd) { +static void clif_guild_positionnamelist(struct map_session_data *sd) +{ int i,fd; struct guild *g; @@ -7796,7 +7884,8 @@ void clif_guild_positionnamelist(struct map_session_data *sd) { /// mode: @see enum guild_permission /// ranking: /// TODO -void clif_guild_positioninfolist(struct map_session_data *sd) { +static void clif_guild_positioninfolist(struct map_session_data *sd) +{ int i,fd; struct guild *g; @@ -7823,7 +7912,7 @@ void clif_guild_positioninfolist(struct map_session_data *sd) { /// mode: @see enum guild_permission /// ranking: /// TODO -void clif_guild_positionchanged(struct guild *g,int idx) +static void clif_guild_positionchanged(struct guild *g, int idx) { // FIXME: This packet is intended to update the clients after a // commit of position info changes, not sending one packet per @@ -7848,7 +7937,7 @@ void clif_guild_positionchanged(struct guild *g,int idx) /// Notifies clients in a guild about updated member position assignments (ZC_ACK_REQ_CHANGE_MEMBERS). /// 0156 .W { .L .L .L }* -void clif_guild_memberpositionchanged(struct guild *g,int idx) +static void clif_guild_memberpositionchanged(struct guild *g, int idx) { // FIXME: This packet is intended to update the clients after a // commit of member position assignment changes, not sending one @@ -7871,7 +7960,7 @@ void clif_guild_memberpositionchanged(struct guild *g,int idx) /// Sends emblems bitmap data to the client that requested it (ZC_GUILD_EMBLEM_IMG). /// 0152 .W .L .L .?B -void clif_guild_emblem(struct map_session_data *sd,struct guild *g) +static void clif_guild_emblem(struct map_session_data *sd, struct guild *g) { int fd; nullpo_retv(sd); @@ -7892,7 +7981,7 @@ void clif_guild_emblem(struct map_session_data *sd,struct guild *g) /// Sends update of the guild id/emblem id to everyone in the area (ZC_CHANGE_GUILD). /// 01b4 .L .L .W -void clif_guild_emblem_area(struct block_list* bl) +static void clif_guild_emblem_area(struct block_list *bl) { uint8 buf[12]; @@ -7909,7 +7998,7 @@ void clif_guild_emblem_area(struct block_list* bl) /// Sends guild skills (ZC_GUILD_SKILLINFO). /// 0162 .W .W { .W .L .W .W .W .24B .B }* -void clif_guild_skillinfo(struct map_session_data* sd) +static void clif_guild_skillinfo(struct map_session_data *sd) { int fd; struct guild* g; @@ -7948,7 +8037,7 @@ void clif_guild_skillinfo(struct map_session_data* sd) /// Sends guild notice to client (ZC_GUILD_NOTICE). /// 016f .60B .120B -void clif_guild_notice(struct map_session_data* sd, struct guild* g) +static void clif_guild_notice(struct map_session_data *sd, struct guild *g) { int fd; @@ -7972,7 +8061,7 @@ void clif_guild_notice(struct map_session_data* sd, struct guild* g) /// Guild invite (ZC_REQ_JOIN_GUILD). /// 016a .L .24B -void clif_guild_invite(struct map_session_data *sd,struct guild *g) +static void clif_guild_invite(struct map_session_data *sd, struct guild *g) { int fd; @@ -7994,7 +8083,7 @@ void clif_guild_invite(struct map_session_data *sd,struct guild *g) /// 1 = Offer rejected. /// 2 = Offer accepted. /// 3 = Guild full. -void clif_guild_inviteack(struct map_session_data *sd,int flag) +static void clif_guild_inviteack(struct map_session_data *sd, int flag) { int fd; @@ -8009,7 +8098,7 @@ void clif_guild_inviteack(struct map_session_data *sd,int flag) /// Notifies clients of a guild of a leaving member (ZC_ACK_LEAVE_GUILD). /// 015a .24B .40B -void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes) +static void clif_guild_leave(struct map_session_data *sd, const char *name, const char *mes) { unsigned char buf[128]; @@ -8024,7 +8113,7 @@ void clif_guild_leave(struct map_session_data *sd,const char *name,const char *m /// Notifies clients of a guild of an expelled member. /// 015c .24B .40B .24B (ZC_ACK_BAN_GUILD) /// 0839 .24B .40B (ZC_ACK_BAN_GUILD_SSO) -void clif_guild_expulsion(struct map_session_data* sd, const char* name, const char* mes, int account_id) +static void clif_guild_expulsion(struct map_session_data *sd, const char *name, const char *mes, int account_id) { unsigned char buf[128]; #if PACKETVER < 20100803 @@ -8049,7 +8138,8 @@ void clif_guild_expulsion(struct map_session_data* sd, const char* name, const c /// Guild expulsion list (ZC_BAN_LIST). /// 0163 .W { .24B .24B .40B }* /// 0163 .W { .24B .40B }* (PACKETVER >= 20100803) -void clif_guild_expulsionlist(struct map_session_data* sd) { +static void clif_guild_expulsionlist(struct map_session_data *sd) +{ #if PACKETVER < 20100803 const int offset = NAME_LENGTH*2+40; #else @@ -8090,7 +8180,7 @@ void clif_guild_expulsionlist(struct map_session_data* sd) { /// Guild chat message (ZC_GUILD_CHAT). /// 017f .W .?B -void clif_guild_message(struct guild *g,int account_id,const char *mes,int len) +static void clif_guild_message(struct guild *g, int account_id, const char *mes, int len) {// TODO: account_id is not used, candidate for deletion? [Ai4rei] struct map_session_data *sd; uint8 buf[256]; @@ -8114,7 +8204,7 @@ void clif_guild_message(struct guild *g,int account_id,const char *mes,int len) /// Request for guild alliance (ZC_REQ_ALLY_GUILD). /// 0171 .L .24B -void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const char *name) +static void clif_guild_reqalliance(struct map_session_data *sd, int account_id, const char *name) { int fd; @@ -8138,7 +8228,7 @@ void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const cha /// 3 = They have too any alliances. /// 4 = You have too many alliances. /// 5 = Alliances are disabled. -void clif_guild_allianceack(struct map_session_data *sd,int flag) +static void clif_guild_allianceack(struct map_session_data *sd, int flag) { int fd; @@ -8156,7 +8246,7 @@ void clif_guild_allianceack(struct map_session_data *sd,int flag) /// relation: /// 0 = Ally /// 1 = Enemy -void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag) +static void clif_guild_delalliance(struct map_session_data *sd, int guild_id, int flag) { int fd; @@ -8179,7 +8269,7 @@ void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag) /// 1 = Guild has too many Antagonists. /// 2 = Already set as an Antagonist. /// 3 = Antagonists are disabled. -void clif_guild_oppositionack(struct map_session_data *sd,int flag) +static void clif_guild_oppositionack(struct map_session_data *sd, int flag) { int fd; @@ -8194,8 +8284,8 @@ void clif_guild_oppositionack(struct map_session_data *sd,int flag) /// Adds alliance or opposition (ZC_ADD_RELATED_GUILD). /// 0185 .L .L .24B -/* -void clif_guild_allianceadded(struct guild *g,int idx) +#if 0 +static void clif_guild_allianceadded(struct guild *g, int idx) { unsigned char buf[64]; WBUFW(buf,0)=0x185; @@ -8204,14 +8294,14 @@ void clif_guild_allianceadded(struct guild *g,int idx) memcpy(WBUFP(buf,10),g->alliance[idx].name,NAME_LENGTH); clif->send(buf,packet_len(0x185),guild->getavailablesd(g),GUILD); } -*/ +#endif // 0 /// Notifies the client about the result of a guild break (ZC_ACK_DISORGANIZE_GUILD_RESULT). /// 015e .L /// 0 = success /// 1 = invalid key (guild name, @see clif_parse_GuildBreak) /// 2 = there are still members in the guild -void clif_guild_broken(struct map_session_data *sd,int flag) +static void clif_guild_broken(struct map_session_data *sd, int flag) { int fd; @@ -8228,7 +8318,7 @@ void clif_guild_broken(struct map_session_data *sd,int flag) /// 00c0 .L .B /// type: /// enum emotion_type -void clif_emotion(struct block_list *bl,int type) +static void clif_emotion(struct block_list *bl, int type) { unsigned char buf[8]; @@ -8242,7 +8332,7 @@ void clif_emotion(struct block_list *bl,int type) /// Displays the contents of a talkiebox trap (ZC_TALKBOX_CHATCONTENTS). /// 0191 .L .80B -void clif_talkiebox(struct block_list* bl, const char* talkie) +static void clif_talkiebox(struct block_list *bl, const char *talkie) { unsigned char buf[MESSAGE_SIZE+6]; nullpo_retv(bl); @@ -8256,7 +8346,7 @@ void clif_talkiebox(struct block_list* bl, const char* talkie) /// Displays wedding effect centered on an object (ZC_CONGRATULATION). /// 01ea .L -void clif_wedding_effect(struct block_list *bl) +static void clif_wedding_effect(struct block_list *bl) { unsigned char buf[6]; @@ -8269,7 +8359,8 @@ void clif_wedding_effect(struct block_list *bl) /// Notifies the client of the name of the partner character (ZC_COUPLENAME). /// 01e6 .24B -void clif_callpartner(struct map_session_data *sd) { +static void clif_callpartner(struct map_session_data *sd) +{ unsigned char buf[26]; nullpo_retv(sd); @@ -8294,8 +8385,8 @@ void clif_callpartner(struct map_session_data *sd) { /// Initiates the partner "taming" process [DracoRPG] (ZC_START_COUPLE). /// 01e4 /// This packet while still implemented by the client is no longer being officially used. -/* -void clif_marriage_process(struct map_session_data *sd) +#if 0 +static void clif_marriage_process(struct map_session_data *sd) { int fd; nullpo_retv(sd); @@ -8305,11 +8396,11 @@ void clif_marriage_process(struct map_session_data *sd) WFIFOW(fd,0)=0x1e4; WFIFOSET(fd,packet_len(0x1e4)); } -*/ +#endif // 0 /// Notice of divorce (ZC_DIVORCE). /// 0205 .24B -void clif_divorced(struct map_session_data* sd, const char* name) +static void clif_divorced(struct map_session_data *sd, const char *name) { int fd; nullpo_retv(sd); @@ -8324,8 +8415,8 @@ void clif_divorced(struct map_session_data* sd, const char* name) /// Marriage proposal (ZC_REQ_COUPLE). /// 01e2 .L .L .24B /// This packet while still implemented by the client is no longer being officially used. -/* -void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_session_data* ssd) +#if 0 +static void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_session_data *ssd) { nullpo_retv(sd); @@ -8336,12 +8427,12 @@ void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_sess safestrncpy(WFIFOP(fd,10), ssd->status.name, NAME_LENGTH); WFIFOSET(fd, packet_len(0x1e2)); } -*/ +#endif // 0 /*========================================== * Displays a message using the guild-chat colors to the specified targets. [Skotlex] *------------------------------------------*/ -void clif_disp_message(struct block_list *src, const char *mes, enum send_target target) +static void clif_disp_message(struct block_list *src, const char *mes, enum send_target target) { unsigned char buf[256]; int len; @@ -8370,7 +8461,7 @@ void clif_disp_message(struct block_list *src, const char *mes, enum send_target /// result: /// 0 = failure /// 1 = success -void clif_GM_kickack(struct map_session_data *sd, int result) +static void clif_GM_kickack(struct map_session_data *sd, int result) { int fd; @@ -8383,7 +8474,8 @@ void clif_GM_kickack(struct map_session_data *sd, int result) WFIFOSET(fd, packet_len(0xcd)); } -void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd) { +static void clif_GM_kick(struct map_session_data *sd, struct map_session_data *tsd) +{ int fd; nullpo_retv(tsd); @@ -8407,7 +8499,7 @@ void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd) { /// 3 = "Chat Block has been applied by GM due to your ill-mannerous action." /// 4 = "Automated Chat Block has been applied due to Anti-Spam System." /// 5 = "You got a good point from %s." -void clif_manner_message(struct map_session_data* sd, uint32 type) +static void clif_manner_message(struct map_session_data *sd, uint32 type) { int fd; nullpo_retv(sd); @@ -8424,7 +8516,7 @@ void clif_manner_message(struct map_session_data* sd, uint32 type) /// type: /// 0 = positive (unmute) /// 1 = negative (mute) -void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type) +static void clif_GM_silence(struct map_session_data *sd, struct map_session_data *tsd, uint8 type) { int fd; nullpo_retv(sd); @@ -8447,7 +8539,8 @@ void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, /// 0 = success /// 1 = failure /// 2 = too many blocks -void clif_wisexin(struct map_session_data *sd,int type,int flag) { +static void clif_wisexin(struct map_session_data *sd, int type, int flag) +{ int fd; nullpo_retv(sd); @@ -8468,7 +8561,8 @@ void clif_wisexin(struct map_session_data *sd,int type,int flag) { /// result: /// 0 = success /// 1 = failure -void clif_wisall(struct map_session_data *sd,int type,int flag) { +static void clif_wisall(struct map_session_data *sd, int type, int flag) +{ int fd; nullpo_retv(sd); @@ -8483,7 +8577,7 @@ void clif_wisall(struct map_session_data *sd,int type,int flag) { /// Play a BGM! [Rikter/Yommy] (ZC_PLAY_NPC_BGM). /// 07fe .24B -void clif_playBGM(struct map_session_data* sd, const char* name) +static void clif_playBGM(struct map_session_data *sd, const char *name) { int fd; @@ -8509,7 +8603,7 @@ void clif_playBGM(struct map_session_data* sd, const char* name) /// npc id: /// The acoustic direction of the sound is determined by the /// relative position of the NPC to the player (3D sound). -void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type) +static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, int type) { int fd; @@ -8527,7 +8621,7 @@ void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const WFIFOSET(fd,packet_len(0x1d3)); } -void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum send_target coverage) +static void clif_soundeffectall(struct block_list *bl, const char *name, int type, enum send_target coverage) { unsigned char buf[40]; @@ -8546,7 +8640,7 @@ void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum /// 01f3 .L .L /// effect id: /// @see doc/effect_list.txt -void clif_specialeffect(struct block_list* bl, int type, enum send_target target) +static void clif_specialeffect(struct block_list *bl, int type, enum send_target target) { unsigned char buf[24]; @@ -8566,7 +8660,8 @@ void clif_specialeffect(struct block_list* bl, int type, enum send_target target } } -void clif_specialeffect_single(struct block_list* bl, int type, int fd) { +static void clif_specialeffect_single(struct block_list *bl, int type, int fd) +{ nullpo_retv(bl); WFIFOHEAD(fd,10); WFIFOW(fd,0) = 0x1f3; @@ -8581,7 +8676,7 @@ void clif_specialeffect_single(struct block_list* bl, int type, int fd) { /// @see doc/effect_list.txt /// num data: /// effect-dependent value -void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, send_target target) +static void clif_specialeffect_value(struct block_list *bl, int effect_id, int num, send_target target) { uint8 buf[14]; @@ -8606,7 +8701,7 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen * @param color Message color (RGB format: 0xRRGGBB) * @param msg Message text */ -void clif_messagecolor_self(int fd, uint32 color, const char *msg) +static void clif_messagecolor_self(int fd, uint32 color, const char *msg) { int msg_len; @@ -8632,7 +8727,7 @@ void clif_messagecolor_self(int fd, uint32 color, const char *msg) * @param color Message color (RGB format: 0xRRGGBB) * @param msg Message text */ -void clif_messagecolor(struct block_list *bl, uint32 color, const char *msg) +static void clif_messagecolor(struct block_list *bl, uint32 color, const char *msg) { int msg_len; uint8 buf[256]; @@ -8662,7 +8757,7 @@ void clif_messagecolor(struct block_list *bl, uint32 color, const char *msg) * Should only be used in cases where the client closed the * storage window without server's consent **/ -void clif_refresh_storagewindow(struct map_session_data *sd) +static void clif_refresh_storagewindow(struct map_session_data *sd) { nullpo_retv(sd); // Notify the client that the storage is open @@ -8689,7 +8784,7 @@ void clif_refresh_storagewindow(struct map_session_data *sd) } // refresh the client's screen, getting rid of any effects -void clif_refresh(struct map_session_data *sd) +static void clif_refresh(struct map_session_data *sd) { nullpo_retv(sd); @@ -8754,7 +8849,7 @@ void clif_refresh(struct map_session_data *sd) /// Updates the object's (bl) name on client. /// 0095 .L .24B (ZC_ACK_REQNAME) /// 0195 .L .24B .24B .24B .24B (ZC_ACK_REQNAMEALL) -void clif_charnameack (int fd, struct block_list *bl) +static void clif_charnameack(int fd, struct block_list *bl) { unsigned char buf[103]; int cmd = 0x95; @@ -8888,7 +8983,7 @@ void clif_charnameack (int fd, struct block_list *bl) //Used to update when a char leaves a party/guild. [Skotlex] //Needed because when you send a 0x95 packet, the client will not remove the cached party/guild info that is not sent. -void clif_charnameupdate (struct map_session_data *ssd) +static void clif_charnameupdate(struct map_session_data *ssd) { unsigned char buf[103]; int cmd = 0x195, ps = -1; @@ -8946,7 +9041,7 @@ void clif_charnameupdate (struct map_session_data *ssd) /// Visually moves(instant) a character to x,y. The char moves even /// when the target cell isn't walkable. If the char is sitting it /// stays that way. -void clif_slide(struct block_list *bl, int x, int y) +static void clif_slide(struct block_list *bl, int x, int y) { unsigned char buf[10]; nullpo_retv(bl); @@ -8965,7 +9060,7 @@ void clif_slide(struct block_list *bl, int x, int y) /// Public chat message (ZC_NOTIFY_CHAT). lordalfa/Skotlex - used by @me as well /// 008d .W .L .?B -void clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl) +static void clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl) { char buf[CHAT_SIZE_MAX + (int)sizeof(struct PACKET_ZC_NOTIFY_CHAT)]; int max_len = CHAT_SIZE_MAX - (int)sizeof(struct PACKET_ZC_NOTIFY_CHAT); @@ -8997,7 +9092,7 @@ void clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target } } -void clif_notify_playerchat(struct block_list *bl, const char *mes) +static void clif_notify_playerchat(struct block_list *bl, const char *mes) { char buf[CHAT_SIZE_MAX + (int)sizeof(struct PACKET_ZC_NOTIFY_PLAYERCHAT)]; int max_len = CHAT_SIZE_MAX - (int)sizeof(struct PACKET_ZC_NOTIFY_PLAYERCHAT); @@ -9023,7 +9118,7 @@ void clif_notify_playerchat(struct block_list *bl, const char *mes) * Minimap fix [Kevin] * Remove dot from minimap *--------------------------*/ -void clif_party_xy_remove(struct map_session_data *sd) +static void clif_party_xy_remove(struct map_session_data *sd) { unsigned char buf[16]; nullpo_retv(sd); @@ -9049,7 +9144,7 @@ void clif_party_xy_remove(struct map_session_data *sd) /// 0x20 = HIT/Flee +50 (PA_GOSPEL) /// 0x28 = Full strip failed because of coating (ST_FULLSTRIP) /// ? = nothing -void clif_gospel_info(struct map_session_data *sd, int type) +static void clif_gospel_info(struct map_session_data *sd, int type) { int fd; @@ -9090,7 +9185,7 @@ void clif_gospel_info(struct map_session_data *sd, int type) /// 22 = [Collector Rank] Target Item : /// 30 = [Sun, Moon and Stars Angel] Designed places and monsters have been reset. /// 40 = Target HP : -void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result) +static void clif_starskill(struct map_session_data *sd, const char *mapname, int monster_id, unsigned char star, unsigned char result) { int fd; @@ -9111,7 +9206,7 @@ void clif_starskill(struct map_session_data* sd, const char* mapname, int monste * Info about Star Gladiator save map [Komurka] * type: 1: Information, 0: Map registered *------------------------------------------*/ -void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type) +static void clif_feel_info(struct map_session_data *sd, unsigned char feel_level, unsigned char type) { char mapname[MAP_NAME_LENGTH_EXT]; @@ -9125,7 +9220,7 @@ void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsig * Info about Star Gladiator hate mob [Komurka] * type: 1: Register mob, 0: Information. *------------------------------------------*/ -void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type) +static void clif_hate_info(struct map_session_data *sd, unsigned char hate_level, int class_, unsigned char type) { if( pc->db_checkid(class_) ) { clif->starskill(sd, pc->job_name(class_), class_, hate_level, type ? 10 : 11); @@ -9139,7 +9234,7 @@ void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int cl /*========================================== * Info about TaeKwon Do TK_MISSION mob [Skotlex] *------------------------------------------*/ -void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress) +static void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress) { clif->starskill(sd, mob->db(mob_id)->jname, mob_id, progress, 20); } @@ -9147,7 +9242,7 @@ void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char pr /*========================================== * Feel/Hate reset (thanks to Rayce) [Skotlex] *------------------------------------------*/ -void clif_feel_hate_reset(struct map_session_data *sd) +static void clif_feel_hate_reset(struct map_session_data *sd) { clif->starskill(sd, "", 0, 0, 30); } @@ -9160,7 +9255,7 @@ void clif_feel_hate_reset(struct map_session_data *sd) /// value: /// 0 = disabled /// 1 = enabled -void clif_zc_config(struct map_session_data* sd, enum CZ_CONFIG type, int flag) +static void clif_zc_config(struct map_session_data *sd, enum CZ_CONFIG type, int flag) { int fd; nullpo_retv(sd); @@ -9178,7 +9273,7 @@ void clif_zc_config(struct map_session_data* sd, enum CZ_CONFIG type, int flag) /// open equip window: /// 0 = disabled /// 1 = enabled -void clif_equpcheckbox(struct map_session_data* sd) +static void clif_equpcheckbox(struct map_session_data *sd) { int fd; nullpo_retv(sd); @@ -9195,7 +9290,8 @@ void clif_equpcheckbox(struct map_session_data* sd) /// 02d7 .W .24B .W .W .W .W .W .W .W .B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE, PACKETVER >= 20100629) /// 0859 .W .24B .W .W .W .W .W .W .W .B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20101124) /// 0859 .W .24B .W .W .W .W .W .W .W .W .B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20110111) -void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd) { +static void clif_viewequip_ack(struct map_session_data *sd, struct map_session_data *tsd) +{ int i, equip = 0; nullpo_retv(sd); @@ -9239,7 +9335,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts * @param sd The target character. * @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) */ -void clif_msgtable(struct map_session_data* sd, enum clif_messages msg_id) +static void clif_msgtable(struct map_session_data *sd, enum clif_messages msg_id) { int fd; nullpo_retv(sd); @@ -9260,7 +9356,7 @@ void clif_msgtable(struct map_session_data* sd, enum clif_messages msg_id) * @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) * @param value The value to fill %d. */ -void clif_msgtable_num(struct map_session_data *sd, enum clif_messages msg_id, int value) +static void clif_msgtable_num(struct map_session_data *sd, enum clif_messages msg_id, int value) { #if PACKETVER >= 20090805 int fd; @@ -9287,7 +9383,7 @@ void clif_msgtable_num(struct map_session_data *sd, enum clif_messages msg_id, i * @param skill_id ID of the skill to display. * @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) */ -void clif_msgtable_skill(struct map_session_data* sd, uint16 skill_id, enum clif_messages msg_id) +static void clif_msgtable_skill(struct map_session_data *sd, uint16 skill_id, enum clif_messages msg_id) { int fd; @@ -9302,13 +9398,13 @@ void clif_msgtable_skill(struct map_session_data* sd, uint16 skill_id, enum clif } /** -* Displays a format string from msgstringtable.txt with a %s value (ZC_FORMATSTRING_MSG). -* -* @param sd The target character. -* @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) -* @param value The value to fill %s. -*/ -void clif_msgtable_str(struct map_session_data *sd, enum clif_messages msg_id, const char *value) + * Displays a format string from msgstringtable.txt with a %s value (ZC_FORMATSTRING_MSG). + * + * @param sd The target character. + * @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) + * @param value The value to fill %s. + */ +static void clif_msgtable_str(struct map_session_data *sd, enum clif_messages msg_id, const char *value) { int message_len; int len; @@ -9332,13 +9428,13 @@ void clif_msgtable_str(struct map_session_data *sd, enum clif_messages msg_id, c } /** -* Displays a format string from msgstringtable.txt with a color (ZC_MSG_COLOR). -* -* @param sd The target character. -* @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) -* @param color The color to use -*/ -void clif_msgtable_color(struct map_session_data *sd, enum clif_messages msg_id, uint32 color) + * Displays a format string from msgstringtable.txt with a color (ZC_MSG_COLOR). + * + * @param sd The target character. + * @param msg_id msgstringtable message index, 0-based (@see enum clif_messages) + * @param color The color to use + */ +static void clif_msgtable_color(struct map_session_data *sd, enum clif_messages msg_id, uint32 color) { struct PACKET_ZC_MSG_COLOR p; @@ -9363,7 +9459,7 @@ void clif_msgtable_color(struct map_session_data *sd, enum clif_messages msg_id, * @retval NULL if the validation failed, the messages was a command or the * character can't send chat messages. out_buf shan't be used. */ -const char *clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) +static const char *clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) { const char *srcname = NULL, *srcmessage = NULL, *message = NULL; int textlen = 0, namelen = 0, messagelen = 0; @@ -9434,7 +9530,7 @@ const char *clif_process_chat_message(struct map_session_data *sd, const struct * character can't send chat messages. out_name and out_message * shan't be used. */ -bool clif_process_whisper_message(struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen) +static bool clif_process_whisper_message(struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen) { int namelen = 0, messagelen = 0; @@ -9485,7 +9581,7 @@ bool clif_process_whisper_message(struct map_session_data *sd, const struct pack return true; } -void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg) +static void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg) { struct DBIterator *iter; struct map_session_data *user; @@ -9520,7 +9616,7 @@ void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, ch dbi_destroy(iter); } -void clif_channel_msg2(struct channel_data *chan, char *msg) +static void clif_channel_msg2(struct channel_data *chan, char *msg) { struct DBIterator *iter; struct map_session_data *user; @@ -9552,7 +9648,7 @@ void clif_channel_msg2(struct channel_data *chan, char *msg) // TODO: [4144] same packet with login server. need somehow use one function for both servers // 3 - Rejected by server -void clif_auth_error(int fd, int errorCode) +static void clif_auth_error(int fd, int errorCode) { struct packet_ZC_REFUSE_LOGIN p; const int len = sizeof(p); @@ -9575,7 +9671,8 @@ void clif_auth_error(int fd, int errorCode) /// 0072 .L .L .L .L .B (CZ_ENTER) /// 0436 .L .L .L .L .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) { +static 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; @@ -9643,10 +9740,11 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd) { chrif->authreq(sd,false); } -void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); /// Notification from the client, that it has finished map loading and is about to display player's character (CZ_NOTIFY_ACTORINIT). /// 007d -void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) { +static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) +{ bool first_time = false; if(sd->bl.prev != NULL) @@ -10019,7 +10117,8 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) { /// Server's tick (ZC_NOTIFY_TIME). /// 007f