Skip to content

Commit

Permalink
Revert "Added support for clients up to 2018-03-07bRagexeRE (rathena#…
Browse files Browse the repository at this point in the history
…2975)"

This reverts commit 998af58.
  • Loading branch information
CrazyBS committed Apr 16, 2018
1 parent 8d44ad4 commit 354621b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 227 deletions.
4 changes: 0 additions & 4 deletions src/char/char.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,14 +2064,10 @@ int char_loadName(uint32 char_id, char* name){
safestrncpy(name, data, NAME_LENGTH);
return 1;
}
#if PACKETVER < 20180221
else
{
safestrncpy(name, charserv_config.char_config.unknown_char_name, NAME_LENGTH);
}
#else
name[0] = '\0';
#endif
return 0;
}

Expand Down
162 changes: 30 additions & 132 deletions src/map/clif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6509,23 +6509,13 @@ void clif_wis_end(int fd, int result)

/// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID).
/// 0194 <char id>.L <name>.24B
/// 0af7 <flag>.W <char id>.L <name>.24B
void clif_solved_charname(int fd, int charid, const char* name)
{
#if PACKETVER >= 20180221
WFIFOHEAD(fd,packet_len(0xaf7));
WFIFOW(fd,0) = 0xaf7;
WFIFOW(fd,2) = name[0] ? 3 : 2;
WFIFOL(fd,4) = charid;
safestrncpy(WFIFOCP(fd, 8), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x0af7));
#else
WFIFOHEAD(fd,packet_len(0x194));
WFIFOW(fd,0)=0x194;
WFIFOL(fd,2)=charid;
safestrncpy(WFIFOCP(fd,6), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x194));
#endif
}


Expand Down Expand Up @@ -12288,7 +12278,6 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
/// Request to use a ground skill.
/// 0116 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND)
/// 0366 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND2)
/// 0AF4 <skill lv>.W <skill id>.W <x>.W <y>.W <unknown>.B (CZ_USE_SKILL_TOGROUND3)
/// There are various variants of this packet, some of them have padding between fields.
void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
{
Expand All @@ -12303,8 +12292,6 @@ void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
RFIFOW(fd,info->pos[1]), //skill num
RFIFOW(fd,info->pos[2]), //pos x
RFIFOW(fd,info->pos[3]), //pos y
// TODO: find out what this is intended to do
//RFIFOB(fd, info->pos[4])
-1 //Skill more info.
);
}
Expand Down Expand Up @@ -14316,7 +14303,6 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)

/// Toggles a single friend online/offline [Skotlex] (ZC_FRIENDS_STATE).
/// 0206 <account id>.L <char id>.L <state>.B
/// 0206 <account id>.L <char id>.L <state>.B <name>.24B >= 20180221
/// state:
/// 0 = online
/// 1 = offline
Expand All @@ -14336,9 +14322,6 @@ void clif_friendslist_toggle(struct map_session_data *sd,uint32 account_id, uint
WFIFOL(fd, 2) = sd->status.friends[i].account_id;
WFIFOL(fd, 6) = sd->status.friends[i].char_id;
WFIFOB(fd,10) = !online; //Yeah, a 1 here means "logged off", go figure...
#if PACKETVER >= 20180221
safestrncpy(WFIFOCP(fd, 11), sd->status.friends[i].name, NAME_LENGTH);
#endif
WFIFOSET(fd, packet_len(0x206));
}

Expand All @@ -14357,29 +14340,21 @@ int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap)

/// Sends the whole friends list (ZC_FRIENDS_LIST).
/// 0201 <packet len>.W { <account id>.L <char id>.L <name>.24B }*
/// 0201 <packet len>.W { <account id>.L <char id>.L }* >= 20180221
void clif_friendslist_send(struct map_session_data *sd)
{
int i = 0, n, fd = sd->fd;
#if PACKETVER >= 20180221
const int size = 8;
#else
const int size = 8 + NAME_LENGTH;
#endif

// Send friends list
WFIFOHEAD(fd, MAX_FRIENDS * size + 4);
WFIFOHEAD(fd, MAX_FRIENDS * 32 + 4);
WFIFOW(fd, 0) = 0x201;
for(i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id; i++) {
WFIFOL(fd, 4 + size * i + 0) = sd->status.friends[i].account_id;
WFIFOL(fd, 4 + size * i + 4) = sd->status.friends[i].char_id;
#if PACKETVER < 20180221
safestrncpy(WFIFOCP(fd, 4 + size * i + 8), sd->status.friends[i].name, NAME_LENGTH);
#endif
WFIFOL(fd, 4 + 32 * i + 0) = sd->status.friends[i].account_id;
WFIFOL(fd, 4 + 32 * i + 4) = sd->status.friends[i].char_id;
safestrncpy(WFIFOCP(fd, 4 + 32 * i + 8), sd->status.friends[i].name, NAME_LENGTH);
}

if (i) {
WFIFOW(fd,2) = 4 + size * i;
WFIFOW(fd,2) = 4 + 32 * i;
WFIFOSET(fd, WFIFOW(fd,2));
}

Expand Down Expand Up @@ -16586,10 +16561,10 @@ static void clif_quest_len(int def_len, int info_len, int avail_quests, int *lim
(*len_out) = ((*limit_out) * info_len) + def_len;
}

/// Sends list of all quest states
/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num (ZC_ALL_QUEST_LIST)
/// Sends list of all quest states (ZC_ALL_QUEST_LIST).
/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num
/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST2)
/// 09f8 <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <hunt identification>.L <mob type>.L <mob_id>.L <min level>.W <max level>.W <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST3)
/// 09f8 <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST3) // TODO!
void clif_quest_send_list(struct map_session_data *sd)
{
int fd = sd->fd;
Expand All @@ -16598,19 +16573,9 @@ void clif_quest_send_list(struct map_session_data *sd)
int limit = 0;

#if PACKETVER >= 20141022
#if PACKETVER >= 20150513
int size = 22 + NAME_LENGTH;
#else
int size = 10 + NAME_LENGTH;
#endif

clif_quest_len(offset, 15 + ( size * MAX_QUEST_OBJECTIVES), sd->avail_quests, &limit, &i);
clif_quest_len(offset, 15 + ((10 + NAME_LENGTH) * MAX_QUEST_OBJECTIVES), sd->avail_quests, &limit, &i);
WFIFOHEAD(fd,i);
#if PACKETVER >= 20150513
WFIFOW(fd, 0) = 0x9f8;
#else
WFIFOW(fd, 0) = 0x97a;
#endif
WFIFOL(fd, 4) = limit;

for (i = 0; i < limit; i++) {
Expand All @@ -16634,20 +16599,8 @@ void clif_quest_send_list(struct map_session_data *sd)
for( j = 0; j < qi->objectives_count; j++ ){
mob = mob_db(qi->objectives[j].mob);

#if PACKETVER >= 20150513
WFIFOL(fd, offset) = sd->quest_log[i].quest_id * 1000 + j;
offset += 4;
WFIFOL(fd, offset) = 0; // TODO: Find info - mobType
offset += 4;
#endif
WFIFOL(fd, offset) = qi->objectives[j].mob;
offset += 4;
#if PACKETVER >= 20150513
WFIFOW(fd, offset) = 0; // TODO: Find info - levelMin
offset += 2;
WFIFOW(fd, offset) = 0; // TODO: Find info - levelMax
offset += 2;
#endif
WFIFOW(fd, offset) = sd->quest_log[i].count[j];
offset += 2;
WFIFOW(fd, offset) = qi->objectives[j].count;
Expand Down Expand Up @@ -16713,71 +16666,31 @@ void clif_quest_send_mission(struct map_session_data *sd)
}


/// Notification about a new quest
/// 02b3 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3 (ZC_ADD_QUEST)
/// 08fe <packet len>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3 (ZC_HUNTING_QUEST_INFO)
/// 09f9 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <hunt identification>.L <mob type>.L <mob id>.L <min level>.W <max level>.W <mob count>.W <mob name>.24B }*3 (ZC_ADD_QUEST_EX)
/// Notification about a new quest (ZC_ADD_QUEST).
/// 02b3 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3
void clif_quest_add(struct map_session_data *sd, struct quest *qd)
{
int fd = sd->fd;
int i, offset;
int i;
struct quest_db *qi = quest_search(qd->quest_id);
#if PACKETVER >= 20150513
int cmd = 0x9f9;
#else
int cmd = 0x2b3;
#endif

WFIFOHEAD(fd, packet_len(cmd));
WFIFOW(fd, 0) = cmd;
WFIFOHEAD(fd, packet_len(0x2b3));
WFIFOW(fd, 0) = 0x2b3;
WFIFOL(fd, 2) = qd->quest_id;
WFIFOB(fd, 6) = qd->state;
WFIFOB(fd, 7) = qd->time - qi->time;
WFIFOL(fd, 11) = qd->time;
WFIFOW(fd, 15) = qi->objectives_count;

for (i = 0, offset = 17; i < qi->objectives_count; i++) {
for (i = 0; i < qi->objectives_count; i++) {
struct mob_db *mob;
#if PACKETVER >= 20150513
WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
offset += 4;
WFIFOL(fd, offset) = 0; // TODO: Find info - mobType
offset += 4;
#endif
WFIFOL(fd, offset) = qi->objectives[i].mob;
offset += 4;
#if PACKETVER >= 20150513
WFIFOW(fd, offset) = 0; // TODO: Find info - levelMin
offset += 2;
WFIFOW(fd, offset) = 0; // TODO: Find info - levelMax
offset += 2;
#endif
WFIFOW(fd, offset) = qd->count[i];
offset += 2;
WFIFOL(fd, i*30+17) = qi->objectives[i].mob;
WFIFOW(fd, i*30+21) = qd->count[i];
mob = mob_db(qi->objectives[i].mob);
safestrncpy(WFIFOCP(fd, offset), mob->jname, NAME_LENGTH);
offset += NAME_LENGTH;
}

WFIFOSET(fd, packet_len(cmd));

#if PACKETVER >= 20150513
int len = 4 + qi->objectives_count * 12;

WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x8fe;
WFIFOW(fd, 2) = len;

for( i = 0, offset = 4; i < qi->objectives_count; i++, offset += 12 ){
WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
WFIFOL(fd, offset+4) = qi->objectives[i].mob;
WFIFOW(fd, offset + 10) = qi->objectives[i].count;
WFIFOW(fd, offset + 12) = qd->count[i];
safestrncpy(WFIFOCP(fd, i*30+23), mob->jname, NAME_LENGTH);
}

WFIFOSET(fd, len);

#endif
WFIFOSET(fd, packet_len(0x2b3));
}


Expand All @@ -16794,45 +16707,30 @@ void clif_quest_delete(struct map_session_data *sd, int quest_id)
}


/// Notification of an update to the hunting mission counter
/// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3 (ZC_UPDATE_MISSION_HUNT)
/// 09fa <packet len>.W <mobs>.W { <quest id>.L <hunt identification>.L <total count>.W <current count>.W }*3 (ZC_UPDATE_MISSION_HUNT_EX)
/// Notification of an update to the hunting mission counter (ZC_UPDATE_MISSION_HUNT).
/// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3
void clif_quest_update_objective(struct map_session_data *sd, struct quest *qd, int mobid)
{
int fd = sd->fd;
int i, offset;
int i;
struct quest_db *qi = quest_search(qd->quest_id);
int len = qi->objectives_count * 12 + 6;
#if PACKETVER >= 20150513
int cmd = 0x9fa;
#else
int cmd = 0x2b5;
#endif

WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = cmd;
WFIFOW(fd, 0) = 0x2b5;
WFIFOW(fd, 2) = len;
WFIFOW(fd, 4) = qi->objectives_count;

for (i = 0, offset = 6; i < qi->objectives_count; i++) {
for (i = 0; i < qi->objectives_count; i++) {
if (mobid == 0 || mobid == qi->objectives[i].mob) {
WFIFOL(fd, offset) = qd->quest_id;
offset += 4;
#if PACKETVER >= 20150513
WFIFOL(fd, offset) = qd->quest_id * 1000 + i;
offset += 4;
#else
WFIFOL(fd, offset) = qi->objectives[i].mob;
offset += 4;
#endif
WFIFOW(fd, offset) = qi->objectives[i].count;
offset += 2;
WFIFOW(fd, offset) = qd->count[i];
offset += 2;
WFIFOL(fd, i * 12 + 6) = qd->quest_id;
WFIFOL(fd, i * 12 + 10) = qi->objectives[i].mob;
WFIFOW(fd, i * 12 + 14) = qi->objectives[i].count;
WFIFOW(fd, i * 12 + 16) = qd->count[i];
}
}

WFIFOW(fd, 2) = offset;
WFIFOSET(fd, offset);
WFIFOSET(fd, len);
}


Expand Down
4 changes: 0 additions & 4 deletions src/map/clif_obfuscation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,6 @@
packet_keys(0x45AA1B44,0x20E716B7,0x5388105C);
#elif PACKETVER == 20180213 // 2018-02-13aRagexeRE
packet_keys(0x189D69B2,0x43B85EAD,0x2B7A687E);
#elif PACKETVER == 20180221 // 2018-02-21aRagexeRE or 2018-02-21bRagexeRE
packet_keys(0x6E2F6233,0x193B0A66,0x0D1D2CA5);
#elif PACKETVER == 20180307 // 2018-03-07bRagexeRE
packet_keys(0x47DA10EB,0x4B922CCF,0x765C5055);
#elif PACKETVER > 20110817
#error Unsupported packet version.
#endif
Expand Down
26 changes: 1 addition & 25 deletions src/map/clif_packetdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,7 @@
packet(0x09FD,-1); // ZC_NOTIFY_MOVEENTRY11
packet(0x09FE,-1); // ZC_NOTIFY_NEWENTRY11
packet(0x09FF,-1); // ZC_NOTIFY_STANDENTRY11
//packet(0x09F8,-1); // ZC_ALL_QUEST_LIST3
#endif

// 2015-02-25aRagexeRE
Expand Down Expand Up @@ -2281,12 +2282,6 @@
// Pet Evolution System
parseable_packet(0x09FB,-1,clif_parse_dull,0); // CZ_PET_EVOLUTION
packet(0x09FC,6); // ZC_PET_EVOLUTION_RESULT

// Quest UI
packet(0x08FE,-1); // ZC_HUNTING_QUEST_INFO
packet(0x09F8,-1); // ZC_ALL_QUEST_LIST3
packet(0x09F9,143); // ZC_ADD_QUEST_EX
packet(0x09FA,-1); // ZC_UPDATE_MISSION_HUNT_EX
#endif

// 2015-05-20aRagexe
Expand Down Expand Up @@ -2358,23 +2353,4 @@
packet(0x0ACC,18);
#endif

// 2018-02-07bRagexeRE
#if PACKETVER >= 20180207
parseable_packet(0x0AF4,11,clif_parse_UseSkillToPos,2,4,6,8,10);
#endif

// 2018-02-21aRagexeRE or 2018-02-21bRagexeRE
#if PACKETVER >= 20180221
packet(0x0206,35); // ZC_FRIENDS_STATE
packet(0x0af7,32);
#endif

// 2018-03-07bRagexeRE
#if PACKETVER >= 20180307
parseable_packet(0x0A68,3,clif_parse_dull,0);
packet(0x0AE2,7);
parseable_packet(0x0AEF,2,clif_parse_dull,0);
packet(0x0AF0,10);
#endif

#endif /* _CLIF_PACKETDB_HPP_ */

0 comments on commit 354621b

Please sign in to comment.