diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 42 | ||||
-rw-r--r-- | src/map/clif.h | 2 | ||||
-rw-r--r-- | src/map/party.c | 12 | ||||
-rw-r--r-- | src/map/party.h | 2 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
5 files changed, 36 insertions, 24 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index afa8f79fd..82b23ef3e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5821,28 +5821,32 @@ void clif_partyinvitationstate(struct map_session_data* sd) WFIFOSET(fd, packet_len(0x2c9)); } -/*========================================== - * p[eBU - *------------------------------------------*/ -int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd) +/// Party invitation request (ZC_REQ_JOIN_GROUP/ZC_PARTY_JOIN_REQ) +/// 00fe <party id>.L <party name>.24B +/// 02c6 <party id>.L <party name>.24B +void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd) { +#if PACKETVER < 20070821 + const int cmd = 0xfe; +#else + const int cmd = 0x2c6; +#endif int fd; struct party_data *p; - nullpo_ret(sd); - nullpo_ret(tsd); + nullpo_retv(sd); + nullpo_retv(tsd); fd=tsd->fd; if( (p=party_search(sd->status.party_id))==NULL ) - return 0; + return; - WFIFOHEAD(fd,packet_len(0xfe)); - WFIFOW(fd,0)=0xfe; - WFIFOL(fd,2)=sd->status.account_id; // FIXME: This is party_id + WFIFOHEAD(fd,packet_len(cmd)); + WFIFOW(fd,0)=cmd; + WFIFOL(fd,2)=sd->status.party_id; memcpy(WFIFOP(fd,6),p->party.name,NAME_LENGTH); - WFIFOSET(fd,packet_len(0xfe)); - return 0; + WFIFOSET(fd,packet_len(cmd)); } /*========================================== @@ -10620,12 +10624,12 @@ void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) party_invite(sd, t_sd); } -/*========================================== - * Party invitation reply - * S 00ff <account ID>.L <flag>.L - * S 02c7 <account ID>.L <flag>.B - * flag: 0-reject, 1-accept - *------------------------------------------*/ +/// Party invitation reply (CZ_JOIN_GROUP/CZ_PARTY_JOIN_REQ_ACK) +/// 00ff <party id>.L <flag>.L +/// 02c7 <party id>.L <flag>.B +/// flag: +/// 0 = reject +/// 1 = accept void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd) { party_reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6)); @@ -14919,7 +14923,7 @@ static int packetdb_readdb(void) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, -1, -1,107, 6, -1, 7, 7, 22,191, 0, 0, 0, 0, 0, 0, //#0x02C0 - 0, 0, 0, 0, 0, 30, 0, 0, 0, 3, 0, 65, 4, 71, 10, 0, + 0, 0, 0, 0, 0, 30, 30, 0, 0, 3, 0, 65, 4, 71, 10, 0, 0, 0, 0, 0, 29, 0, 6, -1, 10, 10, 3, 0, -1, 32, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 59, 60, 8, 10, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/map/clif.h b/src/map/clif.h index a4adba85b..744af37b7 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -404,7 +404,7 @@ int clif_movetoattack(struct map_session_data *sd,struct block_list *bl); int clif_party_created(struct map_session_data *sd,int result); int clif_party_member_info(struct party_data *p, struct map_session_data *sd); int clif_party_info(struct party_data *p, struct map_session_data *sd); -int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd); +void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd); void clif_party_inviteack(struct map_session_data* sd, const char* nick, int flag); int clif_party_option(struct party_data *p,struct map_session_data *sd,int flag); int clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag); diff --git a/src/map/party.c b/src/map/party.c index 47dba49e9..d229c576e 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -369,11 +369,19 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd) return 1; } -void party_reply_invite(struct map_session_data *sd,int account_id,int flag) +void party_reply_invite(struct map_session_data *sd,int party_id,int flag) { - struct map_session_data *tsd= map_id2sd(account_id); + struct map_session_data* tsd; struct party_member member; + if( sd->party_invite != party_id ) + {// forged + sd->party_invite = 0; + sd->party_invite_account = 0; + return; + } + tsd = map_id2sd(sd->party_invite_account); + if( flag == 1 && !sd->party_creating && !sd->party_joining ) {// accepted and allowed sd->party_joining = true; diff --git a/src/map/party.h b/src/map/party.h index 31e46f5ec..1c59197b3 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -62,7 +62,7 @@ int party_member_added(int party_id,int account_id,int char_id,int flag); int party_leave(struct map_session_data *sd); int party_removemember(struct map_session_data *sd,int account_id,char *name); int party_member_withdraw(int party_id,int account_id,int char_id); -void party_reply_invite(struct map_session_data *sd,int account_id,int flag); +void party_reply_invite(struct map_session_data *sd,int party_id,int flag); int party_recv_noinfo(int party_id); int party_recv_info(struct party *sp); int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short map,int online,int lv); diff --git a/src/map/unit.c b/src/map/unit.c index 3cec43f70..b1cca0d4c 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1881,7 +1881,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, storage_guild_storage_quit(sd,0); sd->state.storage_flag = 0; //Force close it when being warped. if(sd->party_invite>0) - party_reply_invite(sd,sd->party_invite_account,0); + party_reply_invite(sd,sd->party_invite,0); if(sd->guild_invite>0) guild_reply_invite(sd,sd->guild_invite,0); if(sd->guild_alliance>0) |