summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-12 09:55:13 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-12 09:55:13 +0000
commited87621c65d7c13ddd4993101a5b7c2287b6609e (patch)
treea035e4d010d2b9a690c82114dff33dfa36d9f889 /src/map/clif.c
parent1c5fab35e935b870939bcae24ea95e957ed76d5a (diff)
downloadhercules-ed87621c65d7c13ddd4993101a5b7c2287b6609e.tar.gz
hercules-ed87621c65d7c13ddd4993101a5b7c2287b6609e.tar.bz2
hercules-ed87621c65d7c13ddd4993101a5b7c2287b6609e.tar.xz
hercules-ed87621c65d7c13ddd4993101a5b7c2287b6609e.zip
* Some preparations for the guild script update
- cleaned up npc event execution code - cleaned up guild data loading/saving code; to be improved later - removed dummy 'account name' expulsion list management code - removed columns 'rsv1' and 'rsv2' from guild member data - removed columns 'rsv1' 'rsv2' 'rsv3' and 'acc' from guild expulsion data - added upgrade_svn11895.sql for SQL git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11895 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 53227d286..e0d4c1ca0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6472,6 +6472,7 @@ int clif_guild_inviteack(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x169));
return 0;
}
+
/*==========================================
* ギルドメンバ脱退通知
*------------------------------------------*/
@@ -6487,23 +6488,24 @@ int clif_guild_leave(struct map_session_data *sd,const char *name,const char *me
clif_send(buf,packet_len(0x15a),&sd->bl,GUILD);
return 0;
}
+
/*==========================================
* ギルドメンバ追放通知
*------------------------------------------*/
-int clif_guild_expulsion(struct map_session_data *sd,const char *name,const char *mes,
- int account_id)
+int clif_guild_expulsion(struct map_session_data *sd,const char *name,const char *mes,int account_id)
{
unsigned char buf[128];
nullpo_retr(0, sd);
WBUFW(buf, 0)=0x15c;
- memcpy(WBUFP(buf, 2),name,NAME_LENGTH);
- memcpy(WBUFP(buf,26),mes,40);
- memcpy(WBUFP(buf,66),"dummy",NAME_LENGTH);
+ safestrncpy(WBUFP(buf, 2),name,NAME_LENGTH);
+ safestrncpy(WBUFP(buf,26),mes,40);
+ safestrncpy(WBUFP(buf,66),"",NAME_LENGTH); // account name (not used for security reasons)
clif_send(buf,packet_len(0x15c),&sd->bl,GUILD);
return 0;
}
+
/*==========================================
* ギルド追放メンバリスト
*------------------------------------------*/
@@ -6519,18 +6521,18 @@ int clif_guild_expulsionlist(struct map_session_data *sd)
g=guild_search(sd->status.guild_id);
if(g==NULL)
return 0;
- WFIFOHEAD(fd,MAX_GUILDEXPULSION * 88 + 4);
+ WFIFOHEAD(fd,4 + MAX_GUILDEXPULSION * 88);
WFIFOW(fd,0)=0x163;
for(i=c=0;i<MAX_GUILDEXPULSION;i++){
struct guild_expulsion *e=&g->expulsion[i];
if(e->account_id>0){
- memcpy(WFIFOP(fd,c*88+ 4),e->name,NAME_LENGTH);
- memcpy(WFIFOP(fd,c*88+28),e->acc,24);
- memcpy(WFIFOP(fd,c*88+52),e->mes,44);
+ safestrncpy(WFIFOP(fd,4 + c*88),e->name,NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,4 + c*88+24),"",24); // account name (not used for security reasons)
+ safestrncpy(WFIFOP(fd,4 + c*88+48),e->mes,40);
c++;
}
}
- WFIFOW(fd,2)=c*88+4;
+ WFIFOW(fd,2) = 4 + c*88;
WFIFOSET(fd,WFIFOW(fd,2));
return 0;
}
@@ -8542,7 +8544,9 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_DropItem(int fd, struct map_session_data *sd)
{
- int item_index, item_amount;
+ int item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
+ int item_amount = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
+
item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
item_amount = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
do {
@@ -8564,7 +8568,8 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
return;
} while (0);
- //Because the client does not likes being ignored.
+
+ //Because the client does not like being ignored.
clif_delitem(sd, item_index,0);
}
@@ -9991,7 +9996,8 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd)
}
/*==========================================
- * ギルド追放
+ * Request to expel a member of a guild
+ * S 015b <guild_id>.L <account_id>.L <char_id>.L <reason>.39B 00
*------------------------------------------*/
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd)
{