From 912b6444998f5ccaaaed69e01e1eae41ce24b8d4 Mon Sep 17 00:00:00 2001 From: aleos89 Date: Thu, 24 Apr 2014 13:15:45 -0400 Subject: [PATCH] Added support for 2013-12-23 client. --- db/packet_db.txt | 140 +++++++++++++++++++++++++++++---------------- src/common/mmo.h | 8 ++- src/common/utils.c | 5 +- src/map/clif.c | 140 ++++++++++++++++++++++++++++++++++----------- src/map/clif.h | 10 ++-- 5 files changed, 213 insertions(+), 90 deletions(-) diff --git a/db/packet_db.txt b/db/packet_db.txt index 3ff9a34f33..7975f9c919 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -33,7 +33,7 @@ // Main packet version of the DB to use (default = max available version) // Client detection is faster when all clients use this version. // Version 23 is the latest Sakexe (above versions are for Renewal clients) -//packet_db_ver: 45 +//packet_db_ver: 46 packet_db_ver: default packet_ver: 5 @@ -1045,7 +1045,7 @@ packet_ver: 22 0x02c5,30 0x02c6,30 0x02c7,7,replypartyinvite2,2:6 -0x02c8,3 +0x02c8,3,partytick,2 0x02c9,3 0x02ca,3 0x02cb,20 @@ -1311,7 +1311,7 @@ packet_ver: 23 //2009-04-08aSakexe 0x02a6,-1 0x02a7,-1 -0x044a,6 +0x044a,6,clientversion,2 //Renewal Clients //2008-08-27aRagexeRE @@ -1481,7 +1481,7 @@ packet_ver: 25 0x0803,4 0x0804,8 // Booking System 0x0805,-1 -0x0806,2,bookingdelreq,0 // Booking System +0x0806,4,bookingdelreq,2 // Booking System //0x0807,2 0x0808,4 // Booking System //0x0809,14 @@ -1604,7 +1604,7 @@ packet_ver: 25 //0x0841,19 //2010-07-14aRagexeRE -//0x841,4 +//0x0841,4 //2010-08-03aRagexeRE 0x0839,66 @@ -1613,7 +1613,7 @@ packet_ver: 25 //2010-11-24aRagexeRE packet_ver: 26 -0x0288,-1,cashshopbuy,2:4:6:10 +0x0288,-1,cashshopbuy,2:4:8:10 0x0436,19,wanttoconnection,2:6:10:14:18 0x035f,5,walktoxy,2 0x0360,6,ticksend,2 @@ -1648,7 +1648,7 @@ packet_ver: 27 0x0439,8,useitem,2:4 0x08d2,10 0x08d1,7 -0x846,4,cashshopreqtab,2 //2011-07-18 +0x0846,4,cashshopreqtab,2 //2011-07-18 // 2011-11-02aRagexe packet_ver: 28 @@ -1660,7 +1660,7 @@ packet_ver: 28 0x08aa,7,actionrequest,2:6 0x02c4,10,useskilltoid,2:4:6 0x0811,-1,itemlistwindowselected,2:4:8:12 -0x890,8 +0x0890,8 0x08a5,18,bookingregreq,2:4:6 0x0835,-1,reqopenbuyingstore,2:4:8:9:89 0x089b,2,reqclosebuyingstore,0 @@ -1669,6 +1669,7 @@ packet_ver: 28 0x08ab,-1,searchstoreinfo,2:4:5:9:13:14:15 0x088b,2,searchstoreinfonextpage,0 0x08a2,12,searchstoreinfolistitemclick,2:6:10 +0x08cf,10 //Amulet spirits //2012-03-07fRagexeRE packet_ver:29 @@ -1691,7 +1692,7 @@ packet_ver:29 0x0885,7,actionrequest,2:6 0x0889,10,useskilltoid,2:4:6 0x0870,-1,itemlistwindowselected,2:4:8:12 -//0x0926,18,bookingregreq,2:4:6 +//0x0926,41,bookingregreq,2:4:6 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0817,2,reqclosebuyingstore,0 0x0360,6,reqclickbuyingstore,2 @@ -1700,7 +1701,7 @@ packet_ver:29 0x0835,2,searchstoreinfonextpage,0 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0439,8,useitem,2:4 -0x0365,18,bookingregreq,2:4:6 +0x0365,41,bookingregreq,2:4:6 //2012-04-10aRagexeRE packet_ver: 30 @@ -1757,15 +1758,14 @@ packet_ver: 30 0x08fb,6,bookingcanceljoinparty,2 0x0907,5,moveitem,2:4 0x0908,5 -0x08d7,28,battlegroundreg,2:4 //Added to prevent disconnections -0x08cf,10 //Amulet spirits +0x08d7,28,battlegroundreg,2:4 0x0977,14 //Monster HP Bar 0x0916,26,guildinvite2,2 -0x091d,18,bookingregreq,2:4:6 +0x091d,41,bookingregreq,2:4:6 0x08cb,10,ZC_PERSONAL_INFOMATION,2:4:6:8:10:11:13:15 //Still need further information //2012-04-18aRagexeRE [Special Thanks to Judas!] -packet_ver:31 +packet_ver: 31 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x08A8,36,storagepassword,2:4:20 @@ -1786,7 +1786,7 @@ packet_ver:31 //2012-06-18 packet_ver: 32 0x0983,29 -0x0861,18,bookingregreq,2:4:6 //actually 12-05-03 +0x0861,41,bookingregreq,2:4:6 //actually 12-05-03 //2012-07-02aRagexeRE (unstable) packet_ver: 33 @@ -1804,7 +1804,7 @@ packet_ver: 33 0x094a,6,getcharnamerequest,2 0x0953,5,walktoxy,2 0x0960,5,changedir,2:4 -0x0879,18,bookingregreq,2:4:6 +0x0879,41,bookingregreq,2:4:6 //2013-03-20Ragexe (Judas) packet_ver: 34 @@ -1872,7 +1872,7 @@ packet_ver: 34 0x099a,9 // take_off_equipv5 0x099b,8 //maptypeproperty2 -//2013-05-15a Ragexe (Yommy) +//2013-05-15aRagexe (Yommy) packet_ver: 35 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -1904,7 +1904,7 @@ packet_ver: 35 0x0931,5,hommenu,2:4 0x093e,36,storagepassword,2:4:20 -//2013-05-22 Ragexe (Yommy) +//2013-05-22Ragexe (Yommy) packet_ver: 36 0x08A2,7,actionrequest,2:6 0x095C,10,useskilltoid,2:4:6 @@ -1936,7 +1936,7 @@ packet_ver: 36 0x0926,5,hommenu,2:4 0x088e,36,storagepassword,2:4:20 -//2013-05-29 Ragexe (Shakto) +//2013-05-29Ragexe (Shakto) packet_ver: 37 0x0890,7,actionrequest,2:6 0x0438,10,useskilltoid,2:4:6 @@ -1958,17 +1958,17 @@ packet_ver: 37 0x0892,6,reqclickbuyingstore,2 0x0964,2,reqclosebuyingstore,0 0x0869,-1,reqopenbuyingstore,2:4:8:9:89 -0x0874,41,bookingregreq,2,4:6 -// 0x088E,8); // CZ_JOIN_BATTLE_FIELD +0x0874,18,bookingregreq,2,4:6 +//0x088E,8 // CZ_JOIN_BATTLE_FIELD 0x0958,-1,itemlistwindowselected,2:4:8:12 0x0919,19,wanttoconnection,2:6:10:14:18 0x08A8,26,partyinvite2,2 -// 0x0888,4); // CZ_GANGSI_RANK +//0x0888,4 // CZ_GANGSI_RANK 0x0877,26,friendslistadd,2 0x023B,5,hommenu,2:4 0x0956,36,storagepassword,2:4:20 -//2013-06-05 Ragexe (Shakto) +//2013-06-05Ragexe (Shakto) packet_ver: 38 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -1990,17 +1990,18 @@ packet_ver: 38 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 -0x0365,41,bookingregreq,2:4:6 -// 0x0363,8 // CZ_JOIN_BATTLE_FIELD +0x0365,18,bookingregreq,2:4:6 +//0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 -// 0x0436,4 // CZ_GANGSI_RANK +//0x0436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2,4 0x0883,36,storagepassword,2:4:20 +0x097C,4,ranklist,2 -//2013-06-12 Ragexe (Shakto) +//2013-06-12Ragexe (Shakto) packet_ver: 39 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -2023,16 +2024,16 @@ packet_ver: 39 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 -// 0x0363,8 CZ_JOIN_BATTLE_FIELD +//0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x0919,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 -// 0x0436,4 CZ_GANGSI_RANK +//0x0436,4 // CZ_GANGSI_RANK 0x0940,26,friendslistadd,2 0x093A,5,hommenu,2:4 0x0964,36,storagepassword,2:4:20 -//2013-06-18 Ragexe (Shakto) +//2013-06-18Ragexe (Shakto) packet_ver: 40 0x0889,7,actionrequest,2:6 0x0951,10,useskilltoid,2:4:6 @@ -2055,16 +2056,16 @@ packet_ver: 40 0x085A,2,reqclosebuyingstore,0 0x0932,-1,reqopenbuyingstore,2:4:8:9:89 0x08A7,18,bookingregreq,2:4:6 -// 0x087A,8 CZ_JOIN_BATTLE_FIELD +//0x087A,8 // CZ_JOIN_BATTLE_FIELD 0x0942,-1,itemlistwindowselected,2:4:8:12 0x095B,19,wanttoconnection,2:6:10:14:18 0x0887,26,partyinvite2,2 -// 0x0878,4 CZ_GANGSI_RANK +//0x0878,4 // CZ_GANGSI_RANK 0x0953,26,friendslistadd,2 0x02C4,5,hommenu,2:4 0x0864,36,storagepassword,2:4:20 -//2013-06-26 Ragexe +//2013-06-26Ragexe packet_ver: 41 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -2087,16 +2088,16 @@ packet_ver: 41 0x0365,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0894,18,bookingregreq,2:4:6 -// 0x0860,8 CZ_JOIN_BATTLE_FIELD +//0x0860,8 // CZ_JOIN_BATTLE_FIELD 0x08A5,-1,itemlistwindowselected,2:4:8:12 0x088C,19,wanttoconnection,2:6:10:14:18 0x0895,26,partyinvite2,2 -// 0x088F,4 CZ_GANGSI_RANK +//0x088F,4 // CZ_GANGSI_RANK 0x08AB,26,friendslistadd,2 0x0960,5,hommenu,2:4 0x0930,36,storagepassword,2:4:20 -//2013-07-03 Ragexe +//2013-07-03Ragexe packet_ver: 42 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -2119,17 +2120,16 @@ packet_ver: 42 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 -// 0x0363,8 CZ_JOIN_BATTLE_FIELD +//0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 -// 0x0436,4 CZ_GANGSI_RANK +//0x0436,4 // CZ_GANGSI_RANK 0x0360,26,friendslistadd,2 0x094A,5,hommenu,2:4 0x0873,36,storagepassword,2:4:20 -0x097C,4,ranklist,2 -//2013-07-10 Ragexe +//2013-07-10Ragexe packet_ver: 43 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -2152,18 +2152,18 @@ packet_ver: 43 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 -// 0x0363,8 CZ_JOIN_BATTLE_FIELD +//0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 -// 0x0436,4 CZ_GANGSI_RANK +//0x0436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x0880,36,storagepassword,2:4:20 0x0848,-1,cashshopbuy,2:6:4:10 -0x97D,288 //ZC_ACK_RANKING +0x097D,288 //ZC_ACK_RANKING -//2013-07-17 Ragexe +//2013-07-17Ragexe packet_ver: 44 0x0918,7,actionrequest,2:6 0x091E,10,useskilltoid,2:4:6 @@ -2186,11 +2186,11 @@ packet_ver: 44 0x096A,2,reqclosebuyingstore,0 0x08AA,-1,reqopenbuyingstore,2:4:8:9:89 0x0862,18,bookingregreq,2:4:6 -// 0x08A6,8 CZ_JOIN_BATTLE_FIELD +//0x08A6,8 // CZ_JOIN_BATTLE_FIELD 0x0897,-1,itemlistwindowselected,2:4:8:12 0x091D,19,wanttoconnection,2:6:10:14:18 0x092F,26,partyinvite2,2 -// 0x086C,4 CZ_GANGSI_RANK +//0x086C,4 // CZ_GANGSI_RANK 0x0863,26,friendslistadd,2 0x088A,5,hommenu,2:4 0x095B,36,storagepassword,2:4:20 @@ -2205,7 +2205,7 @@ packet_ver: 44 0x09B8,6,bankclose,2 0x09B9,4,ZC_ACK_CLOSE_BANKING,2 -//2013-08-07Ragexe (Shakto) +//2013-08-07Ragexe packet_ver: 45 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 @@ -2228,11 +2228,53 @@ packet_ver: 45 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 -// 0x363,8 CZ_JOIN_BATTLE_FIELD +//0x363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 -// 0x436,4 CZ_GANGSI_RANK +//0x436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x0887,36,storagepassword,2:4:20 + +//2013-12-23Ragexe +packet_ver: 46 +0x0369,7,actionrequest,2:6 +0x083C,10,useskilltoid,2:4:6 +0x0437,5,walktoxy,2 +0x035F,6,ticksend,2 +0x0202,5,changedir,2:4 +0x07E4,6,takeitem,2 +0x0362,6,dropitem,2:4 +0x07EC,8,movetokafra,2:4 +0x0364,8,movefromkafra,2:4 +0x0438,10,useskilltopos,2:4:6:8 +0x0366,90,useskilltoposinfo,2:4:6:8:10 +0x096A,6,getcharnamerequest,2 +0x0368,6,solvecharname,2 +0x0838,12,searchstoreinfolistitemclick,2:6:10 +0x0835,2,searchstoreinfonextpage,0 +0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 +0x0811,-1,reqtradebuyingstore,2:4:8:12 +0x0360,6,reqclickbuyingstore,2 +0x0817,2,reqclosebuyingstore,0 +0x0815,-1,reqopenbuyingstore,2:4:8:9:89 +0x0365,18,bookingregreq,2:4:6 +//0x363,8 // CZ_JOIN_BATTLE_FIELD +0x0281,-1,itemlistwindowselected,2:4:8:12 +0x022D,19,wanttoconnection,2:6:10:14:18 +0x0802,26,partyinvite2,2 +//0x436,4 // CZ_GANGSI_RANK +0x023B,26,friendslistadd,2 +0x0361,5,hommenu,2:4 +0x08A4,36,storagepassword,2:4:20 +//New Packets +0x09D4,2,dull,0 //npcshopclosed +0x09CE,102,itemmonster,2 +//NPC Market +0x09D8,2,dull,0 //npcmarketclosed +0x09D6,-1,dull,0 //npcmarketpurchase +0x09DF,7 + +//Add new packets here +//packet_ver: 47 diff --git a/src/common/mmo.h b/src/common/mmo.h index d6feeb6e17..3be88fd51a 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -201,6 +201,12 @@ enum e_skill_flag //... }; +enum e_mmo_charstatus_opt { + OPT_NONE = 0x0, + OPT_SHOW_EQUIP = 0x1, + OPT_ALLOW_PARTY = 0x2, +}; + struct s_skill { unsigned short id; unsigned char lv; @@ -374,7 +380,7 @@ struct mmo_charstatus { #ifdef HOTKEY_SAVING struct hotkey hotkeys[MAX_HOTKEYS]; #endif - bool show_equip; + bool show_equip,allow_party; short rename; time_t delete_date; diff --git a/src/common/utils.c b/src/common/utils.c index e6411211e9..ecb4c68ba7 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -259,7 +259,7 @@ uint32 MakeDWord(uint16 word0, uint16 word1) ( (uint32)(word1 << 0x10) ); } -uint32 date2version(int date){ +uint32 date2version(int date) { if(date < 20040906) return 5; else if(date < 20040920) return 10; else if(date < 20041005) return 11; @@ -298,7 +298,8 @@ uint32 date2version(int date){ else if(date < 20130710) return 42; else if(date < 20130717) return 43; else if(date < 20130807) return 44; - else if(date >= 20130807) return 45; + else if(date < 20131223) return 45; + else if(date >= 20131223) return 46; else return 30; //default } diff --git a/src/map/clif.c b/src/map/clif.c index 00dd67ef01..906d09c69a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5898,12 +5898,25 @@ void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len) /// 1 = target character is not loged in /// 2 = ignored by target /// 3 = everyone ignored by target -void clif_wis_end(int fd, int flag) +void clif_wis_end(int fd, int result) { + struct map_session_data *sd = (session_isValid(fd) ? session[fd]->session_data : NULL); + + if (!sd) + return; + +#if PACKETVER >= 20131223 + WFIFOHEAD(fd,packet_len(0x9df)); + WFIFOW(fd,0) = 0x9df; + WFIFOB(fd,2) = (char)result; + WFIFOL(fd,3) = 0; + WFIFOSET(fd,packet_len(0x9df)); +#else WFIFOHEAD(fd,packet_len(0x98)); WFIFOW(fd,0) = 0x98; - WFIFOW(fd,2) = flag; + WFIFOB(fd,2) = (char)result; WFIFOSET(fd,packet_len(0x98)); +#endif } @@ -13081,30 +13094,64 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd) /// /item /monster (CZ_ITEM_CREATE). -/// Request to make items or spawn monsters. +/// Request to execute GM commands. +/// Usage: +/// /item n - summon n monster or acquire n item/s +/// /item money - grants 2147483647 zenies +/// /item whereisboss - locate boss mob in current map.(not yet implemented) +/// /item regenboss_n t - regenerate n boss monster by t millisecond.(not yet implemented) +/// /item onekillmonster - toggle an ability to kill mobs in one hit.(not yet implemented) +/// /item bossinfo - display the information of a boss monster in current map.(not yet implemented) +/// /item cap_n - capture n monster as pet.(not yet implemented) +/// /item agitinvest - reset current global agit investments.(not yet implemented) /// 013f .24B -void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) +/// 09ce .100B [Ind/Yommy] +void clif_parse_GM_Item_Monster(int fd, struct map_session_data *sd) { - char *monster_item_name; - char command[NAME_LENGTH+10]; + int i, count; + char *item_monster_name; + struct item_data *item_array[10]; + struct mob_db *mob_array[10]; + char command[256]; +#if PACKETVER >= 20131218 + char str[100]; +#else + char str[24]; +#endif - monster_item_name = (char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]); - monster_item_name[NAME_LENGTH-1] = '\0'; + item_monster_name = str; + item_monster_name[(sizeof(str) - 2) - 1] = '\0'; - // FIXME: Should look for item first, then for monster. - // FIXME: /monster takes mob_db Sprite_Name as argument - if( mobdb_searchname(monster_item_name) ) { - safesnprintf(command, sizeof(command)-1, "%cmonster %s", atcommand_symbol, monster_item_name); + if( (count = itemdb_searchname_array(item_array, 10, item_monster_name)) > 0 ) { + for( i = 0; i < count; i++ ) + if( !item_array[i] ) + continue; + + if( i < count ) { + if( item_array[i]->type == IT_WEAPON || item_array[i]->type == IT_ARMOR ) //Nonstackable + safesnprintf(command, sizeof(command) - 1, "%citem2 %d 1 0 0 0 0 0 0 0", atcommand_symbol, item_array[i]->nameid); + else + safesnprintf(command, sizeof(command) - 1, "%citem %d 20", atcommand_symbol, item_array[i]->nameid); + is_atcommand(fd, sd, command, 1); + return; + } + } + + if( strcmp(item_monster_name, "money") == 0 ) { + safesnprintf(command, sizeof(command) - 1, "%czeny %d", atcommand_symbol, INT_MAX); is_atcommand(fd, sd, command, 1); return; } - // FIXME: Stackables have a quantity of 20. - // FIXME: Equips are supposed to be unidentified. - if( itemdb_searchname(monster_item_name) ) { - safesnprintf(command, sizeof(command)-1, "%citem %s", atcommand_symbol, monster_item_name); - is_atcommand(fd, sd, command, 1); - return; + if( (count = mobdb_searchname_array(mob_array, 10, item_monster_name)) > 0 ) { + for( i = 0; i < count; i++ ) + if( !mob_array[i] ) + continue; + + if( i < count ) { + safesnprintf(command, sizeof(command) - 1, "%cmonster %s", atcommand_symbol, mob_array[i]->sprite); + is_atcommand(fd, sd, command, 1); + } } } @@ -15033,7 +15080,7 @@ void clif_cashshop_result( struct map_session_data *sd, uint16 item_id, uint16 r /// 0288 .W .W .L (PACKETVER >= 20070711) /// 0288 .W .L .W { .W .W }.4B*count (PACKETVER >= 20100803) /// 0848 .W .W .W .L .W { .W .W .W }.6B*count (PACKETVER >= 20130000) -void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){ +void clif_parse_cashshop_buy(int fd, struct map_session_data *sd) { struct s_packet_db* info; int cmd = RFIFOW(fd,0); @@ -15044,8 +15091,7 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){ if( sd->state.trading || !sd->npc_shopid ) { clif_cashshop_ack(sd,1); return; - } - else { + } else { #if PACKETVER < 20101116 short nameid = RFIFOW(fd,info->pos[0]); short amount = RFIFOW(fd,info->pos[1]); @@ -15059,11 +15105,11 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){ int count = RFIFOW(fd,info->pos[2]); unsigned short* item_list = (unsigned short*)RFIFOP(fd,info->pos[3]); - if( len < 10 || len != 10 + count * s_itl){ + if( len < 10 || len != 10 + count * s_itl) { ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * s_itl); return; } - if(cmd==0x848){ + if(cmd == 0x848) { if (cashshop_buylist( sd, points, count, item_list)) clif_cashshop_ack(sd,0); return; @@ -15228,6 +15274,16 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd) clif_equiptickack(sd, flag); } +/// Request to change party invitation tick. +/// value: +/// 0 = disabled +/// 1 = enabled +void clif_parse_PartyTick(int fd, struct map_session_data* sd) +{ + bool flag = RFIFOB(fd,6) ? true : false; + sd->status.allow_party = flag; + clif_partytickack(sd, flag); +} /// Questlog System [Kevin] [Inkfish] /// @@ -16922,6 +16978,18 @@ void clif_monster_hp_bar( struct mob_data* md, int fd ) { #endif } +/* [Ind] placeholder for unsupported incoming packets (avoids server disconnecting client) */ +void __attribute__ ((unused)) clif_parse_dull(int fd, struct map_session_data *sd) { + return; +} + +void clif_partytickack(struct map_session_data* sd, bool flag) { + WFIFOHEAD(sd->fd, packet_len(0x2c9)); + WFIFOW(sd->fd,0) = 0x2c9; + WFIFOB(sd->fd,2) = flag; + WFIFOSET(sd->fd, packet_len(0x2c9)); +} + /// Ack world info (ZC_ACK_BEFORE_WORLD_INFO) /// 0979 .24B .24B void clif_ackworldinfo(struct map_session_data* sd) { @@ -16954,7 +17022,7 @@ void clif_parse_blocking_playcancel(int fd,struct map_session_data *sd){ /// req world info (CZ_CLIENT_VERSION) /// 044A .L -void clif_parse_client_version(int fd,struct map_session_data *sd){ +void clif_parse_client_version(int fd, struct map_session_data *sd) { //if(sd) ; } @@ -17001,9 +17069,9 @@ void clif_sub_ranklist(unsigned char *buf,int idx,struct map_session_data* sd, i } /// 097d .W {.24B L}*10 L (ZC_ACK_RANKING) -void clif_ranklist(struct map_session_data *sd, int16 rankingType){ +void clif_ranklist(struct map_session_data *sd, int16 rankingType) { unsigned char buf[MAX_FAME_LIST * sizeof(struct fame_list)]; - int mypoint=0; + int mypoint = 0; WBUFW(buf,0) = 0x97d; WBUFW(buf,2) = rankingType; @@ -17027,14 +17095,14 @@ void clif_ranklist(struct map_session_data *sd, int16 rankingType){ * 2: /taekwon * 3: /pk * */ -void clif_parse_ranklist(int fd,struct map_session_data *sd){ +void clif_parse_ranklist(int fd,struct map_session_data *sd) { struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)]; int16 rankingtype = RFIFOW(fd,info->pos[0]); //type if(rankingtype != 3) clif_ranklist(sd,rankingtype); // pk_list unsuported atm } // 097e .W .L .L (ZC_UPDATE_RANKING_POINT) -void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int point){ +void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int point) { #if PACKETVER < 20130710 switch(rankingtype){ case 0: clif_fame_blacksmith(sd,point); break; // Blacksmith @@ -17644,7 +17712,7 @@ void packetdb_readdb(void) #if PACKETVER < 20130000 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #else - 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 19, 0, 0, 0, 0, #endif 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -17674,7 +17742,11 @@ void packetdb_readdb(void) 31, 0, 0, 0, 0, 0, 0, -1, 8, 11, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 10, 14, 10, 14, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 6, 4, 0, 0, 0, 0, 0, 0, - + //#0x09C0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102, 0, + 0, 0, 0, 0, 2, 0, -1, 0, 2, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; struct { void (*func)(int, struct map_session_data *); @@ -17797,7 +17869,7 @@ void packetdb_readdb(void) {clif_parse_GMKickAll,"killall"}, {clif_parse_GMRecall,"recall"}, {clif_parse_GMRecall,"summon"}, - {clif_parse_GM_Monster_Item,"itemmonster"}, + {clif_parse_GM_Item_Monster,"itemmonster"}, {clif_parse_GMShift,"remove"}, {clif_parse_GMShift,"shift"}, {clif_parse_GMChangeMapType,"changemaptype"}, @@ -17890,6 +17962,8 @@ void packetdb_readdb(void) { clif_parse_CashShopReqTab, "cashshopreqtab"}, /* */ { clif_parse_MoveItem , "moveitem" }, + { clif_parse_PartyTick, "partytick" }, + { clif_parse_dull, "dull" }, { clif_parse_GuildInvite2 , "guildinvite2" }, { clif_parse_reqworldinfo, "reqworldinfo"}, { clif_parse_client_version, "clientversion"}, @@ -17917,7 +17991,7 @@ void packetdb_readdb(void) memset(packet_db,0,sizeof(packet_db)); for( i = 0; i < ARRAYLENGTH(packet_len_table); ++i ) packet_len(i) = packet_len_table[i]; - + clif_config.packet_db_ver = MAX_PACKET_VER; for(f = 0; f MAX_PACKET_VER ) { //Check to avoid overflowing. [Skotlex] diff --git a/src/map/clif.h b/src/map/clif.h index 52e2c6fa73..d7e08b341b 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -6,8 +6,8 @@ #include "../common/cbasetypes.h" #include "../common/db.h" //dbmap - //#include "../common/mmo.h" + struct Channel; struct item; struct storage_data; @@ -32,10 +32,9 @@ struct quest; struct party_booking_ad_info; #include -enum -{// packet DB +enum { // packet DB MAX_PACKET_DB = 0xf00, - MAX_PACKET_VER = 45, + MAX_PACKET_VER = 46, MAX_PACKET_POS = 20, }; @@ -523,7 +522,7 @@ void clif_status_change(struct block_list *bl, int type, int flag, int tick, int void clif_status_change2(struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len); -void clif_wis_end(int fd, int flag); +void clif_wis_end(int fd, int result); void clif_solved_charname(int fd, int charid, const char* name); void clif_charnameack(int fd, struct block_list *bl); @@ -693,6 +692,7 @@ int clif_hom_food(struct map_session_data *sd,int foodid,int fail); //[orn] void clif_send_homdata(struct map_session_data *sd, int state, int param); //[orn] void clif_equiptickack(struct map_session_data* sd, int flag); +void clif_partytickack(struct map_session_data* sd, bool flag); void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd); void clif_equipcheckbox(struct map_session_data* sd);