* Fixed party invite packet 0xfe (ZC_REQ_JOIN_GROUP) using account id of the inviter rather than party id.

- Added support for new party invite packet 0x2c6 (ZC_PARTY_JOIN_REQ), introduction date guessed.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14844 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ai4rei 2011-06-11 16:08:44 +00:00
parent 0eb61f5a95
commit bb48f685e7
6 changed files with 40 additions and 25 deletions

View File

@ -1,6 +1,9 @@
Date Added
2011/05/02
2011/06/11
* Fixed party invite packet 0xfe (ZC_REQ_JOIN_GROUP) using account id of the inviter rather than party id. [Ai4rei]
- Added support for new party invite packet 0x2c6 (ZC_PARTY_JOIN_REQ), introduction date guessed.
2011/06/02
* Fixed a crash in clif_parse_FriendsListAdd, when a player is added that is not online (bugreport:4947, since r14835). [Ai4rei]
2011/05/31
* Fixed a typo in buyingstore_create. [Inkfish]

View File

@ -5821,28 +5821,32 @@ void clif_partyinvitationstate(struct map_session_data* sd)
WFIFOSET(fd, packet_len(0x2c9));
}
/*==========================================
* ƒp<EFBFBD>[ƒeƒBŠ©U
*------------------------------------------*/
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,

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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)