summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_party.c44
-rw-r--r--src/char/inter.c2
2 files changed, 22 insertions, 24 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index b340aa9cf..2ae9e5319 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -309,29 +309,29 @@ int mapif_party_created(int fd,int account_id, int char_id, struct party *p)
}
// パ?ティ情報見つからず
-int mapif_party_noinfo(int fd, int party_id) {
- WFIFOHEAD(fd, 8);
+static void mapif_party_noinfo(int fd, int party_id, int char_id)
+{
+ WFIFOHEAD(fd, 12);
WFIFOW(fd,0) = 0x3821;
- WFIFOW(fd,2) = 8;
- WFIFOL(fd,4) = party_id;
- WFIFOSET(fd,8);
- ShowWarning("int_party: info not found %d\n", party_id);
-
- return 0;
+ WFIFOW(fd,2) = 12;
+ WFIFOL(fd,4) = char_id;
+ WFIFOL(fd,8) = party_id;
+ WFIFOSET(fd,12);
+ ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id);
}
// パ?ティ情報まとめ送り
-int mapif_party_info(int fd, struct party *p) {
- unsigned char buf[2048];
-
+static void mapif_party_info(int fd, struct party* p, int char_id)
+{
+ unsigned char buf[8 + sizeof(struct party)];
WBUFW(buf,0) = 0x3821;
- memcpy(buf + 4, p, sizeof(struct party));
- WBUFW(buf,2) = 4 + sizeof(struct party);
+ WBUFW(buf,2) = 8 + sizeof(struct party);
+ WBUFL(buf,4) = char_id;
+ memcpy(WBUFP(buf,8), p, sizeof(struct party));
if (fd < 0)
mapif_sendall(buf, WBUFW(buf,2));
else
mapif_send(fd, buf, WBUFW(buf,2));
- return 0;
}
// パ?ティメンバ追加可否
@@ -472,25 +472,23 @@ int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct part
int_party_calc_state(p);
idb_put(party_db, p->party.party_id, p);
+ mapif_party_info(fd, &p->party, 0);
mapif_party_created(fd, leader->account_id, leader->char_id, &p->party);
- mapif_party_info(fd, &p->party);
return 0;
}
// パ?ティ情報要求
-int mapif_parse_PartyInfo(int fd, int party_id)
+static void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
{
struct party_data *p;
p = (struct party_data*)idb_get(party_db, party_id);
if (p != NULL)
- mapif_party_info(fd, &p->party);
+ mapif_party_info(fd, &p->party, char_id);
else {
- mapif_party_noinfo(fd, party_id);
+ mapif_party_noinfo(fd, party_id, char_id);
}
-
- return 0;
}
// パーティ追加要求
@@ -524,8 +522,8 @@ int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member
int_party_check_lv(p);
}
+ mapif_party_info(-1, &p->party, 0);
mapif_party_memberadded(fd, party_id, member->account_id, member->char_id, 0);
- mapif_party_info(-1, &p->party);
return 0;
}
@@ -574,7 +572,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
int_party_check_lv(p);
}
if (party_check_empty(&p->party) == 0)
- mapif_party_info(-1, &p->party);
+ mapif_party_info(-1, &p->party, 0);
return 0;
}
}
@@ -679,7 +677,7 @@ int inter_party_parse_frommap(int fd) {
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)) {
case 0x3020: mapif_parse_CreateParty(fd, (char*)RFIFOP(fd,4), RFIFOB(fd,28), RFIFOB(fd,29), (struct party_member*)RFIFOP(fd,30)); break;
- case 0x3021: mapif_parse_PartyInfo(fd, RFIFOL(fd,2)); break;
+ case 0x3021: mapif_parse_PartyInfo(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,4), (struct party_member*)RFIFOP(fd,8)); break;
case 0x3023: mapif_parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break;
case 0x3024: mapif_parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
diff --git a/src/char/inter.c b/src/char/inter.c
index 8d9cac99f..298ed38a5 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -52,7 +52,7 @@ int inter_send_packet_length[]={
int inter_recv_packet_length[]={
-1,-1, 7,-1, -1,13,36, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3000-0x300f
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, //0x3010-0x301f
- -1, 6,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, //0x3020-0x302f
+ -1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, //0x3020-0x302f Party
-1, 6,-1,-1, 55,19, 6,-1, 14,-1,-1,-1, 18,19,186,-1, //0x3030-0x303f
5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3040-0x304f
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3050-0x305f