diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-28 19:55:43 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-28 19:55:43 +0000 |
commit | c4e36c889232d8d59ce42433f13c2969574ae458 (patch) | |
tree | 9055f10a15b7dd75f5722284993ba019a05668a1 | |
parent | 9869ec7eebde772ae9d3730a14f4831d4adfc290 (diff) | |
download | hercules-c4e36c889232d8d59ce42433f13c2969574ae458.tar.gz hercules-c4e36c889232d8d59ce42433f13c2969574ae458.tar.bz2 hercules-c4e36c889232d8d59ce42433f13c2969574ae458.tar.xz hercules-c4e36c889232d8d59ce42433f13c2969574ae458.zip |
* Fixed a typo that was causing /in to always report failure
* Link "wisexin", "wisexlist" and "wisall" to the PM ignore functions, and "friendslistadd" and "friendslistremove" to the friends list functions when parsing the packet DB [celest]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1010 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog.txt | 6 | ||||
-rw-r--r-- | src/map/clif.c | 44 |
2 files changed, 45 insertions, 5 deletions
diff --git a/Changelog.txt b/Changelog.txt index 04789d919..36036db98 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,12 @@ Date Added 01/28 + * Fixed a typo that was causing /in to always report failure even when the + name was removed from the ignore list [celest] + * Link "wisexin", "wisexlist" and "wisall" to the PM ignore functions, and + "friendslistadd" and "friendslistremove" to the friends list functions + when parsing the packet DB [celest] + * added clif_parse_PMIgnoreList (packet 0xd3) from jA [celest] * Added DUMP_ALL_PACKETS and moved dump packets code in clif_parse a bit to support it [celest] * Added base code for Party Item Sharing -- still needs some work in client- diff --git a/src/map/clif.c b/src/map/clif.c index d3b00a306..f1a1f1ac6 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10158,7 +10158,7 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by for(i = 0; i < MAX_IGNORE_LIST; i++) if (strcmp(sd->ignore[i].name, nick) == 0) { memset(sd->ignore[i].name, 0, sizeof(sd->ignore[i].name)); - if (pos != -1) { + if (pos == -1) { WFIFOB(fd,3) = 0; // success WFIFOSET(fd, packet_len_table[0x0d1]); pos = i; // don't break, to remove ALL same nick @@ -10210,6 +10210,38 @@ void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd) { // Rewritten return; } +/*========================================== + * Wis���ۃ��X�g + *------------------------------------------ + */ + int pstrcmp(const void *a, const void *b) +{ + return strcmp((char *)a, (char *)b); +} +void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd) +{ + int i,j=0,count=0; + + qsort (sd->ignore[0].name, MAX_IGNORE_LIST, sizeof(sd->ignore[0].name), pstrcmp); + for(i = 0; i < MAX_IGNORE_LIST; i++){ //���g������̂𐔂��� + if(sd->ignore[i].name[0] != 0) + count++; + } + WFIFOW(fd,0) = 0xd4; + WFIFOW(fd,2) = 4 + (24 * count); + for(i = 0; i < MAX_IGNORE_LIST; i++){ + if(sd->ignore[i].name[0] != 0){ + memcpy(WFIFOP(fd, 4 + j * 24),sd->ignore[i].name, 24); + j++; + } + } + WFIFOSET(fd, WFIFOW(fd,2)); + if(count >= MAX_IGNORE_LIST) //���^���Ȃ�Ō��1������ + sd->ignore[MAX_IGNORE_LIST - 1].name[0] = 0; + + return; +} + void clif_parse_skillMessage(int fd, struct map_session_data *sd) { // Added by RoVeRT int skillid,skilllv, x, y; char *mes; @@ -10427,7 +10459,7 @@ static void (*clif_parse_func_table[MAX_PACKET_DB])(int, struct map_session_data NULL, clif_parse_HowManyConnections, NULL, NULL, NULL, clif_parse_NpcBuySellSelected, NULL, NULL, clif_parse_NpcBuyListSend, clif_parse_NpcSellListSend, NULL, NULL, clif_parse_GMKick, NULL, clif_parse_GMkillall, clif_parse_PMIgnore, // d0 - clif_parse_PMIgnoreAll, NULL, NULL, NULL, NULL, clif_parse_CreateChatRoom, NULL, NULL, + clif_parse_PMIgnoreAll, NULL, NULL, clif_parse_PMIgnoreList, NULL, clif_parse_CreateChatRoom, NULL, NULL, NULL, clif_parse_ChatAddMember, NULL, NULL, NULL, NULL, clif_parse_ChatRoomStatusChange, NULL, // e0 clif_parse_ChangeChatOwner, NULL, clif_parse_KickFromChat, clif_parse_ChatLeave, clif_parse_TradeRequest, NULL, clif_parse_TradeAck, NULL, @@ -10869,9 +10901,11 @@ static int packetdb_readdb(void) {clif_parse_GMReqNoChatCount,"gmreqnochatcount"}, {clif_parse_sn_doridori,"sndoridori"}, {clif_parse_sn_explosionspirits,"snexplosionspirits"}, -// {clif_parse_wisexin,"wisexin"}, -// {clif_parse_wisexlist,"wisexlist"}, -// {clif_parse_wisall,"wisall"}, + {clif_parse_PMIgnore,"wisexin"}, + {clif_parse_PMIgnoreList,"wisexlist"}, + {clif_parse_PMIgnoreAll,"wisall"}, + {clif_parse_friends_list_add,"friendslistadd"}, + {clif_parse_friends_list_remove,"friendslistremove"}, {clif_parse_GMkillall,"killall"}, {clif_parse_GM_Monster_Item,"summon"}, {clif_parse_Shift,"shift"}, |