diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 7a2a00332..a1b617b83 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7013,7 +7013,7 @@ int clif_guild_leave(struct map_session_data *sd,const char *name,const char *me /*========================================== * ギルドメンバ追放通知 *------------------------------------------*/ -int clif_guild_expulsion(struct map_session_data *sd,const char *name,const char *mes,int account_id) +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 @@ -7022,55 +7022,58 @@ int clif_guild_expulsion(struct map_session_data *sd,const char *name,const char const unsigned short cmd = 0x839; #endif - nullpo_ret(sd); + nullpo_retv(sd); WBUFW(buf,0) = cmd; - safestrncpy((char*)WBUFP(buf, 2),name,NAME_LENGTH); - safestrncpy((char*)WBUFP(buf,26),mes,40); + safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH); + safestrncpy((char*)WBUFP(buf,26), mes, 40); #if PACKETVER < 20100803 - safestrncpy((char*)WBUFP(buf,66),"",NAME_LENGTH); // account name (not used for security reasons) + memset(WBUFP(buf,66), 0, NAME_LENGTH); // account name (not used for security reasons) #endif - clif_send(buf,packet_len(cmd),&sd->bl,GUILD_NOBG); - return 0; + clif_send(buf, packet_len(cmd), &sd->bl, GUILD_NOBG); } /*========================================== * ギルド追放メンバリスト *------------------------------------------*/ -int clif_guild_expulsionlist(struct map_session_data *sd) +void clif_guild_expulsionlist(struct map_session_data* sd) { #if PACKETVER < 20100803 - const int offset = NAME_LENGTH+64; + const int offset = NAME_LENGTH*2+40; #else const int offset = NAME_LENGTH+40; #endif - int fd; - int i,c; - struct guild *g; + int fd, i, c = 0; + struct guild* g; + + nullpo_retv(sd); - nullpo_ret(sd); if( (g = guild_search(sd->status.guild_id)) == NULL ) - return 0; + return; fd = sd->fd; + WFIFOHEAD(fd,4 + MAX_GUILDEXPULSION * offset); - WFIFOW(fd,0)=0x163; - for(i=c=0;i<MAX_GUILDEXPULSION;i++){ - struct guild_expulsion *e=&g->expulsion[i]; - if(e->account_id>0){ - safestrncpy((char*)WFIFOP(fd,4 + c*offset),e->name,NAME_LENGTH); + WFIFOW(fd,0) = 0x163; + + for( i = 0; i < MAX_GUILDEXPULSION; i++ ) + { + struct guild_expulsion* e = &g->expulsion[i]; + + if( e->account_id > 0 ) + { + memcpy(WFIFOP(fd,4 + c*offset), e->name, NAME_LENGTH); #if PACKETVER < 20100803 - safestrncpy((char*)WFIFOP(fd,4 + c*offset+24),"",24); // account name (not used for security reasons) - safestrncpy((char*)WFIFOP(fd,4 + c*offset+48),e->mes,40); + memset(WFIFOP(fd,4 + c*offset+24), 0, NAME_LENGTH); // account name (not used for security reasons) + memcpy(WFIFOP(fd,4 + c*offset+48), e->mes, 40); #else - safestrncpy((char*)WFIFOP(fd,4 + c*offset+24),e->mes,40); + memcpy(WFIFOP(fd,4 + c*offset+24), e->mes, 40); #endif c++; } } WFIFOW(fd,2) = 4 + c*offset; WFIFOSET(fd,WFIFOW(fd,2)); - return 0; } /*========================================== |