diff options
author | shennetsind <ind@henn.et> | 2013-10-07 15:11:14 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-10-07 15:11:14 -0300 |
commit | 95caa2458c92c04c479e0dce18aaeb1e8846c214 (patch) | |
tree | a160aed015cfa234d40697370cbae08050961006 /src/map/clif.c | |
parent | 07cbb72a3e89ba0fe1fb4b3bed1cac6568259999 (diff) | |
download | hercules-95caa2458c92c04c479e0dce18aaeb1e8846c214.tar.gz hercules-95caa2458c92c04c479e0dce18aaeb1e8846c214.tar.bz2 hercules-95caa2458c92c04c479e0dce18aaeb1e8846c214.tar.xz hercules-95caa2458c92c04c479e0dce18aaeb1e8846c214.zip |
Follow up c56e3eb701658079f1de09db759f3b09327ec046
Adjusted PARTY_RECRUIT accordingly, special thanks to ossi0110 for bringing it up.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 155 |
1 files changed, 141 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e730823be..357c4dc6a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12190,7 +12190,6 @@ void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) { party->changeleader(sd, map->id2sd(RFIFOL(fd,2))); } -#ifndef PARTY_RECRUIT /// Party Booking in KRO [Spiria] /// @@ -12198,6 +12197,7 @@ void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) { /// 0802 <level>.W <map id>.W { <job>.W }*6 void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) { +#ifndef PARTY_RECRUIT short level = RFIFOW(fd,2); short mapid = RFIFOW(fd,4); short job[PARTY_BOOKING_JOBS]; @@ -12207,6 +12207,9 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) job[i] = RFIFOB(fd,6+i*2); party->booking_register(sd, level, mapid, job); +#else + return; +#endif } @@ -12218,12 +12221,16 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) /// 2 = already registered void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) { +#ifndef PARTY_RECRUIT int fd = sd->fd; WFIFOHEAD(fd,packet_len(0x803)); WFIFOW(fd,0) = 0x803; WFIFOW(fd,2) = flag; WFIFOSET(fd,packet_len(0x803)); +#else + return; +#endif } @@ -12231,6 +12238,7 @@ void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) /// 0804 <level>.W <map id>.W <job>.W <last index>.L <result count>.W void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) { +#ifndef PARTY_RECRUIT short level = RFIFOW(fd,2); short mapid = RFIFOW(fd,4); short job = RFIFOW(fd,6); @@ -12238,6 +12246,9 @@ void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) short resultcount = RFIFOW(fd,12); party->booking_search(sd, level, mapid, job, lastindex, resultcount); +#else + return; +#endif } @@ -12248,6 +12259,7 @@ void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) /// 1 = yes void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result) { +#ifndef PARTY_RECRUIT int i, j; int size = sizeof(struct party_booking_ad_info); // structure size (48) struct party_booking_ad_info *pb_ad; @@ -12267,6 +12279,9 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, WFIFOW(fd,i*size+41+j*2) = pb_ad->p_detail.job[j]; } WFIFOSET(fd,WFIFOW(fd,2)); +#else + return; +#endif } @@ -12274,8 +12289,12 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, /// 0806 void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) { +#ifndef PARTY_RECRUIT if(party->booking_delete(sd)) clif->PartyBookingDeleteAck(sd, 0); +#else + return; +#endif } @@ -12288,12 +12307,16 @@ void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) /// 3 = nothing registered void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag) { +#ifndef PARTY_RECRUIT int fd = sd->fd; WFIFOHEAD(fd,packet_len(0x807)); WFIFOW(fd,0) = 0x807; WFIFOW(fd,2) = flag; WFIFOSET(fd,packet_len(0x807)); +#else + return; +#endif } @@ -12301,6 +12324,7 @@ void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag) /// 0808 { <job>.W }*6 void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) { +#ifndef PARTY_RECRUIT short job[PARTY_BOOKING_JOBS]; int i; @@ -12308,6 +12332,9 @@ void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) job[i] = RFIFOW(fd,2+i*2); party->booking_update(sd, job); +#else + return; +#endif } @@ -12315,6 +12342,7 @@ void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) /// 0809 <index>.L <char name>.24B <expire time>.L <level>.W <map id>.W { <job>.W }*6 void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { +#ifndef PARTY_RECRUIT int i; uint8 buf[38+PARTY_BOOKING_JOBS*2]; @@ -12330,6 +12358,9 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo WBUFW(buf,38+i*2) = pb_ad->p_detail.job[i]; clif->send(buf, packet_len(0x809), &sd->bl, ALL_CLIENT); +#else + return; +#endif } @@ -12337,6 +12368,7 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo /// 080a <index>.L { <job>.W }*6 void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { +#ifndef PARTY_RECRUIT int i; uint8 buf[6+PARTY_BOOKING_JOBS*2]; @@ -12347,6 +12379,9 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo for(i=0; i<PARTY_BOOKING_JOBS; i++) WBUFW(buf,6+i*2) = pb_ad->p_detail.job[i]; clif->send(buf,packet_len(0x80a),&sd->bl,ALL_CLIENT); // Now UPDATE all client. +#else + return; +#endif } @@ -12354,26 +12389,33 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo /// 080b <index>.L void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index) { +#ifndef PARTY_RECRUIT uint8 buf[6]; WBUFW(buf,0) = 0x80b; WBUFL(buf,2) = index; clif->send(buf, packet_len(0x80b), &sd->bl, ALL_CLIENT); // Now UPDATE all client. +#else + return; +#endif } -#else /// Modified version of Party Booking System for 2012-04-10 or 2012-04-18 (RagexeRE). /// Code written by mkbu95, Spiria, Yommy and Ind /// Request to register a party booking advertisment (CZ_PARTY_RECRUIT_REQ_REGISTER). /// 08e5 <level>.W <notice>.37B -void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) +void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data* sd) { +#ifdef PARTY_RECRUIT short level = RFIFOW(fd,2); const char *notice = (const char*)RFIFOP(fd, 4); party->recruit_register(sd, level, notice); +#else + return; +#endif } /// Party booking search results (ZC_PARTY_RECRUIT_ACK_SEARCH). @@ -12381,8 +12423,9 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) /// more results: /// 0 = no /// 1 = yes -void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result) +void clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result) { +#ifdef PARTY_RECRUIT int i; int size = sizeof(struct party_booking_ad_info); struct party_booking_ad_info *pb_ad; @@ -12403,6 +12446,9 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, } WFIFOSET(fd,WFIFOW(fd,2)); +#else + return; +#endif } /// Result of request to register a party booking advertisment (ZC_PARTY_RECRUIT_ACK_REGISTER). @@ -12411,34 +12457,46 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, /// 0 = success /// 1 = failure /// 2 = already registered -void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) +void clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag) { +#ifdef PARTY_RECRUIT int fd = sd->fd; WFIFOHEAD(fd, packet_len(0x8e6)); WFIFOW(fd, 0) = 0x8e6; WFIFOW(fd, 2) = flag; WFIFOSET(fd, packet_len(0x8e6)); +#else + return; +#endif } /// Request to search for party booking advertisments (CZ_PARTY_RECRUIT_REQ_SEARCH). /// 08e7 <level>.W <map id>.W <last index>.L <result count>.W -void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) +void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd) { +#ifdef PARTY_RECRUIT short level = RFIFOW(fd, 2); short mapid = RFIFOW(fd, 4); unsigned long lastindex = RFIFOL(fd, 6); short resultcount = RFIFOW(fd, 10); party->recruit_search(sd, level, mapid, lastindex, resultcount); +#else + return; +#endif } /// Request to delete own party booking advertisment (CZ_PARTY_RECRUIT_REQ_DELETE). /// 08e9 -void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) +void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd) { +#ifdef PARTY_RECRUIT if(party->booking_delete(sd)) - clif->PartyBookingDeleteAck(sd, 0); + clif->PartyRecruitDeleteAck(sd, 0); +#else + return; +#endif } /// Result of request to delete own party booking advertisment (ZC_PARTY_RECRUIT_ACK_DELETE). @@ -12448,31 +12506,40 @@ void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) /// 1 = success (auto-removed expired ad) /// 2 = failure /// 3 = nothing registered -void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag) +void clif_PartyRecruitDeleteAck(struct map_session_data* sd, int flag) { +#ifdef PARTY_RECRUIT int fd = sd->fd; WFIFOHEAD(fd, packet_len(0x8ea)); WFIFOW(fd, 0) = 0x8ea; WFIFOW(fd, 2) = flag; WFIFOSET(fd, packet_len(0x8ea)); +#else + return; +#endif } /// Request to update party booking advertisment (CZ_PARTY_RECRUIT_REQ_UPDATE). /// 08eb <notice>.37B -void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data *sd) +void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT const char *notice; notice = (const char*)RFIFOP(fd, 2); party->recruit_update(sd, notice); +#else + return; +#endif } /// Notification about new party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_INSERT). /// 08ec <index>.L <expire time>.L <char name>.24B <level>.W <notice>.37B -void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) +void clif_PartyRecruitInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+6+24+4+37+1]; if (pb_ad == NULL) @@ -12485,12 +12552,16 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo WBUFW(buf,34) = pb_ad->p_detail.level; memcpy(WBUFP(buf, 36), pb_ad->p_detail.notice, PB_NOTICE_LENGTH); clif->send(buf, packet_len(0x8ec), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// Notification about updated party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_UPDATE). /// 08ed <index>.L <notice>.37B -void clif_PartyBookingUpdateNotify(struct map_session_data *sd, struct party_booking_ad_info* pb_ad) +void clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_booking_ad_info* pb_ad) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+37+1]; WBUFW(buf, 0) = 0x8ed; @@ -12498,51 +12569,71 @@ void clif_PartyBookingUpdateNotify(struct map_session_data *sd, struct party_boo memcpy(WBUFP(buf, 6), pb_ad->p_detail.notice, PB_NOTICE_LENGTH); clif->send(buf, packet_len(0x8ed), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// Notification about deleted party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_DELETE). /// 08ee <index>.L -void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index) +void clif_PartyRecruitDeleteNotify(struct map_session_data* sd, int index) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+1]; WBUFW(buf, 0) = 0x8ee; WBUFL(buf, 2) = index; clif->send(buf, packet_len(0x8ee), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// Request to add to filtering list (PARTY_RECRUIT_ADD_FILTERLINGLIST). /// 08ef <index>.L void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT int index = RFIFOL(fd, 2); clif->PartyBookingAddFilteringList(index, sd); +#else + return; +#endif } /// Request to remove from filtering list (PARTY_RECRUIT_SUB_FILTERLINGLIST). /// 08f0 <GID>.L void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT int gid = RFIFOL(fd, 2); clif->PartyBookingSubFilteringList(gid, sd); +#else + return; +#endif } /// Request to recruit volunteer (PARTY_RECRUIT_REQ_VOLUNTEER). /// 08f1 <index>.L void clif_parse_PartyBookingReqVolunteer(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT int index = RFIFOL(fd, 2); clif->PartyBookingVolunteerInfo(index, sd); +#else + return; +#endif } /// Request volunteer information (PARTY_RECRUIT_VOLUNTEER_INFO). /// 08f2 <AID>.L <job>.L <level>.W <char name>.24B void clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned char buf[2+4+4+2+24+1]; WBUFW(buf, 0) = 0x8f2; @@ -12552,6 +12643,9 @@ void clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd) memcpy(WBUFP(buf, 12), sd->status.name, NAME_LENGTH); clif->send(buf, packet_len(0x8f2), &sd->bl, ALL_CLIENT); +#else + return; +#endif } #if 0 //Disabled for now. Needs more info. @@ -12595,44 +12689,61 @@ void clif_PartyBookingFailedRecall(int fd, struct map_session_data *sd) /// 08f9 <refuse AID>.L void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned long aid = RFIFOL(fd, 2); clif->PartyBookingRefuseVolunteer(aid, sd); +#else + return; +#endif } /// 08fa <index>.L void clif_PartyBookingRefuseVolunteer(unsigned long aid, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6]; WBUFW(buf, 0) = 0x8fa; WBUFL(buf, 2) = aid; clif->send(buf, packet_len(0x8fa), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// 08fb <index>.L void clif_parse_PartyBookingCancelVolunteer(int fd, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT int index = RFIFOL(fd, 2); clif->PartyBookingCancelVolunteer(index, sd); +#else + return; +#endif } /// 0909 <index>.L void clif_PartyBookingCancelVolunteer(int index, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+1]; WBUFW(buf, 0) = 0x909; WBUFL(buf, 2) = index; clif->send(buf, packet_len(0x909), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// 090b <gid>.L <char name>.24B void clif_PartyBookingAddFilteringList(int index, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+24+1]; WBUFW(buf, 0) = 0x90b; @@ -12640,11 +12751,15 @@ void clif_PartyBookingAddFilteringList(int index, struct map_session_data *sd) memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH); clif->send(buf, packet_len(0x90b), &sd->bl, ALL_CLIENT); +#else + return; +#endif } /// 090c <gid>.L <char name>.24B void clif_PartyBookingSubFilteringList(int gid, struct map_session_data *sd) { +#ifdef PARTY_RECRUIT unsigned char buf[2+6+24+1]; WBUFW(buf, 0) = 0x90c; @@ -12652,6 +12767,9 @@ void clif_PartyBookingSubFilteringList(int gid, struct map_session_data *sd) memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH); clif->send(buf, packet_len(0x90c), &sd->bl, ALL_CLIENT); +#else + return; +#endif } #if 0 @@ -12665,7 +12783,6 @@ void clif_PartyBookingRefuseVolunteerToPM(struct map_session_data *sd) { } #endif //if 0 -#endif /// Request to close own vending (CZ_REQ_CLOSESTORE). /// 012e @@ -18344,6 +18461,12 @@ void clif_defaults(void) { clif->PartyBookingUpdateNotify = clif_PartyBookingUpdateNotify; clif->PartyBookingDeleteNotify = clif_PartyBookingDeleteNotify; clif->PartyBookingInsertNotify = clif_PartyBookingInsertNotify; + clif->PartyRecruitRegisterAck = clif_PartyRecruitRegisterAck; + clif->PartyRecruitDeleteAck = clif_PartyRecruitDeleteAck; + clif->PartyRecruitSearchAck = clif_PartyRecruitSearchAck; + clif->PartyRecruitUpdateNotify = clif_PartyRecruitUpdateNotify; + clif->PartyRecruitDeleteNotify = clif_PartyRecruitDeleteNotify; + clif->PartyRecruitInsertNotify = clif_PartyRecruitInsertNotify; /* Group Search System Update */ clif->PartyBookingVolunteerInfo = clif_PartyBookingVolunteerInfo; clif->PartyBookingRefuseVolunteer = clif_PartyBookingRefuseVolunteer; @@ -18498,6 +18621,10 @@ void clif_defaults(void) { clif->pPartyBookingSearchReq = clif_parse_PartyBookingSearchReq; clif->pPartyBookingDeleteReq = clif_parse_PartyBookingDeleteReq; clif->pPartyBookingUpdateReq = clif_parse_PartyBookingUpdateReq; + clif->pPartyRecruitRegisterReq = clif_parse_PartyRecruitRegisterReq; + clif->pPartyRecruitSearchReq = clif_parse_PartyRecruitSearchReq; + clif->pPartyRecruitDeleteReq = clif_parse_PartyRecruitDeleteReq; + clif->pPartyRecruitUpdateReq = clif_parse_PartyRecruitUpdateReq; clif->pCloseVending = clif_parse_CloseVending; clif->pVendingListReq = clif_parse_VendingListReq; clif->pPurchaseReq = clif_parse_PurchaseReq; |