Generic cleanup of packets (#8369)
Standardized initial packet length of dynamic packets to sizeof Standardized normal casts of packet_buffer to reinterpret_cast Standardized packet length incrementations to static_cast with decltype Removed unused function clif_setdisguise Fixed an issue with string length in clif_scriptmenu Removed struct keywords Resolved a few warnings
This commit is contained in:
parent
4e77ada895
commit
1b9e46b247
@ -950,7 +950,7 @@ int chclif_parse_select_accessible_map( int fd, struct char_session_data* sd, ui
|
||||
|
||||
void chclif_accessible_maps( int fd ){
|
||||
#if PACKETVER >= 20100714
|
||||
struct PACKET_HC_NOTIFY_ACCESSIBLE_MAPNAME* p = (struct PACKET_HC_NOTIFY_ACCESSIBLE_MAPNAME*)packet_buffer;
|
||||
PACKET_HC_NOTIFY_ACCESSIBLE_MAPNAME* p = reinterpret_cast<PACKET_HC_NOTIFY_ACCESSIBLE_MAPNAME*>( packet_buffer );
|
||||
|
||||
p->packetType = HEADER_HC_NOTIFY_ACCESSIBLE_MAPNAME;
|
||||
p->packetLength = sizeof( *p );
|
||||
|
@ -111,7 +111,7 @@ static void logclif_auth_ok(struct login_session_data* sd) {
|
||||
login_log(ip, sd->userid, 100, "login ok");
|
||||
ShowStatus("Connection of the account '%s' accepted.\n", sd->userid);
|
||||
|
||||
PACKET_AC_ACCEPT_LOGIN* p = (PACKET_AC_ACCEPT_LOGIN*)packet_buffer;
|
||||
PACKET_AC_ACCEPT_LOGIN* p = reinterpret_cast<PACKET_AC_ACCEPT_LOGIN*>( packet_buffer );
|
||||
|
||||
p->packetType = HEADER_AC_ACCEPT_LOGIN;
|
||||
p->packetLength = sizeof( *p );
|
||||
|
622
src/map/clif.cpp
622
src/map/clif.cpp
File diff suppressed because it is too large
Load Diff
@ -718,7 +718,7 @@ void clif_blown(struct block_list *bl); // area
|
||||
void clif_slide(struct block_list *bl, int x, int y); // area
|
||||
void clif_fixpos( block_list& bl );
|
||||
void clif_npcbuysell( map_session_data& sd, npc_data& nd );
|
||||
void clif_buylist(map_session_data *sd, struct npc_data *nd); //self
|
||||
void clif_buylist( map_session_data& sd, npc_data& nd );
|
||||
void clif_selllist( map_session_data& sd );
|
||||
void clif_npc_market_open(map_session_data *sd, struct npc_data *nd);
|
||||
void clif_parse_NPCMarketClosed(int fd, map_session_data *sd);
|
||||
@ -748,7 +748,7 @@ void clif_changetraplook(struct block_list *bl,int val); // area
|
||||
void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
|
||||
void clif_arrowequip( map_session_data& sd );
|
||||
void clif_arrow_fail( map_session_data& sd, e_action_failure type );
|
||||
void clif_arrow_create_list(map_session_data *sd); //self
|
||||
void clif_arrow_create_list( map_session_data& sd );
|
||||
void clif_statusupack( map_session_data& sd, int32 type, bool success, int32 val = 0 );
|
||||
void clif_equipitemack( map_session_data& sd, uint8 flag, int index, int pos = 0 ); // self
|
||||
void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok); // self
|
||||
@ -757,7 +757,7 @@ void clif_changeoption_target(struct block_list* bl, struct block_list* target);
|
||||
#define clif_changeoption(bl) clif_changeoption_target(bl, nullptr) // area
|
||||
void clif_changeoption2( block_list& bl );
|
||||
void clif_useitemack(map_session_data *sd,int index,int amount,bool ok); // self
|
||||
void clif_GlobalMessage(struct block_list* bl, const char* message,enum send_target target);
|
||||
void clif_GlobalMessage( block_list& bl, const char* message, enum send_target target );
|
||||
void clif_createchat( map_session_data& sd, e_create_chatroom flag );
|
||||
void clif_dispchat(struct chat_data* cd, int fd); // area or fd
|
||||
void clif_joinchatfail( map_session_data& sd, e_refuse_enter_room result );
|
||||
@ -874,9 +874,9 @@ void clif_item_identified( map_session_data& sd, int32 idx, bool failure );
|
||||
void clif_item_repair_list( map_session_data& sd, map_session_data& dstsd, uint16 lv );
|
||||
void clif_item_repaireffect( map_session_data& sd, int32 idx, bool failure );
|
||||
void clif_item_damaged( map_session_data& sd, uint16 position );
|
||||
void clif_item_refine_list(map_session_data *sd);
|
||||
void clif_hat_effects( map_session_data* sd, struct block_list* bl, enum send_target target );
|
||||
void clif_hat_effect_single( map_session_data* sd, uint16 effectId, bool enable );
|
||||
void clif_item_refine_list( map_session_data& sd );
|
||||
void clif_hat_effects( map_session_data& sd, block_list& bl, enum send_target target );
|
||||
void clif_hat_effect_single( map_session_data& sd, uint16 effectId, bool enable );
|
||||
|
||||
void clif_item_skill(map_session_data *sd,uint16 skill_id,uint16 skill_lv);
|
||||
|
||||
@ -1039,7 +1039,7 @@ void clif_hom_food( map_session_data& sd, int32 foodid, bool success );
|
||||
void clif_send_homdata( homun_data& hd, e_hom_state2 state );
|
||||
|
||||
void clif_configuration( map_session_data* sd, enum e_config_type type, bool enabled );
|
||||
void clif_viewequip_ack(map_session_data* sd, map_session_data* tsd);
|
||||
void clif_viewequip_ack( map_session_data& sd, map_session_data& tsd );
|
||||
void clif_equipcheckbox(map_session_data* sd);
|
||||
|
||||
void clif_msg(map_session_data* sd, unsigned short id);
|
||||
@ -1089,7 +1089,7 @@ void clif_Auction_close(int fd, unsigned char flag);
|
||||
void clif_parse_Auction_cancelreg(int fd, map_session_data *sd);
|
||||
|
||||
void clif_bossmapinfo( map_session_data& sd, mob_data* md, e_bossmap_info flag );
|
||||
void clif_cashshop_show(map_session_data *sd, struct npc_data *nd);
|
||||
void clif_cashshop_show( map_session_data& sd, npc_data& nd );
|
||||
|
||||
// ADOPTION
|
||||
void clif_Adopt_reply(map_session_data *sd, int type);
|
||||
@ -1165,7 +1165,7 @@ void clif_parse_roulette_close(int fd, map_session_data *sd);
|
||||
void clif_parse_roulette_generate(int fd, map_session_data *sd);
|
||||
void clif_parse_roulette_item(int fd, map_session_data *sd);
|
||||
|
||||
void clif_elementalconverter_list(map_session_data *sd);
|
||||
void clif_elementalconverter_list( map_session_data& sd );
|
||||
|
||||
void clif_millenniumshield(struct block_list *bl, short shields);
|
||||
|
||||
|
@ -2141,7 +2141,7 @@ int npc_globalmessage(const char* name, const char* mes)
|
||||
return 0;
|
||||
|
||||
snprintf(temp, sizeof(temp), "%s", mes);
|
||||
clif_GlobalMessage(&nd->bl,temp,ALL_CLIENT);
|
||||
clif_GlobalMessage( nd->bl, temp, ALL_CLIENT );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2211,7 +2211,7 @@ int npc_click(map_session_data* sd, struct npc_data* nd)
|
||||
case NPCTYPE_CASHSHOP:
|
||||
case NPCTYPE_ITEMSHOP:
|
||||
case NPCTYPE_POINTSHOP:
|
||||
clif_cashshop_show(sd,nd);
|
||||
clif_cashshop_show( *sd, *nd );
|
||||
break;
|
||||
case NPCTYPE_MARKETSHOP:
|
||||
#if PACKETVER >= 20131223
|
||||
@ -2375,7 +2375,7 @@ int npc_buysellsel(map_session_data* sd, int id, int type)
|
||||
sd->npc_shopid = id;
|
||||
|
||||
if (type == 0) {
|
||||
clif_buylist(sd,nd);
|
||||
clif_buylist( *sd, *nd );
|
||||
} else {
|
||||
clif_selllist( *sd );
|
||||
}
|
||||
|
@ -16059,7 +16059,7 @@ BUILDIN_FUNC(chatmes)
|
||||
if (nd != nullptr && nd->chat_id) {
|
||||
char message[256];
|
||||
safesnprintf(message, sizeof(message), "%s", str);
|
||||
clif_GlobalMessage(map_id2bl(nd->chat_id), message, CHAT_WOS);
|
||||
clif_GlobalMessage( *map_id2bl( nd->chat_id ), message, CHAT_WOS );
|
||||
}
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
@ -17932,7 +17932,7 @@ BUILDIN_FUNC(callshop)
|
||||
clif_barter_open( *sd, *nd );
|
||||
}
|
||||
}else
|
||||
clif_cashshop_show(sd, nd);
|
||||
clif_cashshop_show( *sd, *nd );
|
||||
|
||||
sd->npc_shopid = nd->bl.id;
|
||||
script_pushint(st,1);
|
||||
@ -24402,7 +24402,7 @@ BUILDIN_FUNC(hateffect){
|
||||
}
|
||||
|
||||
if( !sd->state.connect_new ){
|
||||
clif_hat_effect_single( sd, effectID, enable );
|
||||
clif_hat_effect_single( *sd, effectID, enable );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -8554,8 +8554,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
break;
|
||||
|
||||
case AC_MAKINGARROW:
|
||||
if(sd) {
|
||||
clif_arrow_create_list(sd);
|
||||
if( sd != nullptr ){
|
||||
clif_arrow_create_list( *sd );
|
||||
clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
|
||||
}
|
||||
break;
|
||||
@ -8568,8 +8568,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
break;
|
||||
|
||||
case SA_CREATECON:
|
||||
if(sd) {
|
||||
clif_elementalconverter_list(sd);
|
||||
if( sd != nullptr ){
|
||||
clif_elementalconverter_list( *sd );
|
||||
clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
|
||||
}
|
||||
break;
|
||||
@ -9283,8 +9283,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
|
||||
// Weapon Refining [Celest]
|
||||
case WS_WEAPONREFINE:
|
||||
if(sd)
|
||||
clif_item_refine_list(sd);
|
||||
if( sd != nullptr ){
|
||||
clif_item_refine_list( *sd );
|
||||
}
|
||||
break;
|
||||
|
||||
case MC_VENDING:
|
||||
|
Loading…
x
Reference in New Issue
Block a user