summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-14 22:48:30 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-25 01:43:47 +0300
commit4465180912d4757791b1365f7df0a8b889e9cafe (patch)
tree14210bbffb070d16af19cbb8701f8b5b29f56491
parente3c5ed763c8d9250cd96ad38d74993fb9717e576 (diff)
downloadhercules-4465180912d4757791b1365f7df0a8b889e9cafe.tar.gz
hercules-4465180912d4757791b1365f7df0a8b889e9cafe.tar.bz2
hercules-4465180912d4757791b1365f7df0a8b889e9cafe.tar.xz
hercules-4465180912d4757791b1365f7df0a8b889e9cafe.zip
Add packet 0xa44 for party info. Based on rathena commit:
commit 816d8ab2d0934f823a1d26f7fcac244f8245f14b Author: Lemongrass3110 <lemongrass@kstp.at> Date: Mon Jun 5 23:07:09 2017 +0200 Fixed party window for 2017 clients Thanks to @mrdiablo for his help again!
-rw-r--r--src/map/clif.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 0556ef8f4..f91e58b89 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6577,6 +6577,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
/// Sends party information (ZC_GROUP_LIST).
/// 00fb <packet len>.W <party name>.24B { <account id>.L <nick>.24B <map name>.16B <role>.B <state>.B }*
+/// 0a44 <packet len>.W <party name>.24B { <account id>.L <nick>.24B <map name>.16B <role>.B <state>.B <class>.W <base level>.W }* <item pickup rule>.B <item share rule>.B <unknown>.L
/// role:
/// 0 = leader
/// 1 = normal
@@ -6585,30 +6586,51 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
/// 1 = disconnected
void clif_party_info(struct party_data* p, struct map_session_data *sd)
{
- unsigned char buf[2 + 2 + NAME_LENGTH + (4 + NAME_LENGTH + MAP_NAME_LENGTH_EXT + 1 + 1) * MAX_PARTY];
struct map_session_data* party_sd = NULL;
int i, c;
+#if PACKETVER < 20170524
+ const int cmd = 0xfb;
+ const int size = 46;
+ unsigned char buf[2 + 2 + NAME_LENGTH + 46 * MAX_PARTY];
+#else
+// [4144] probably 0xa44 packet can works on older clients because in client was added in 2015-10-07
+ const int cmd = 0xa44;
+ const int size = 50;
+ unsigned char buf[2 + 2 + NAME_LENGTH + 50 * MAX_PARTY + 6];
+#endif
nullpo_retv(p);
- WBUFW(buf, 0) = 0xfb;
+ WBUFW(buf, 0) = cmd;
memcpy(WBUFP(buf, 4), p->party.name, NAME_LENGTH);
for(i = 0, c = 0; i < MAX_PARTY; i++)
{
struct party_member *m = &p->party.member[i];
- if (!m->account_id) continue;
+ if (!m->account_id)
+ continue;
if (party_sd == NULL)
party_sd = p->data[i].sd;
- WBUFL(buf, 28 + c * 46) = m->account_id;
- memcpy(WBUFP(buf, 28 + c * 46 + 4), m->name, NAME_LENGTH);
- mapindex->getmapname_ext(mapindex_id2name(m->map), WBUFP(buf, 28 + c * 46 + 28));
- WBUFB(buf, 28 + c * 46 + 44) = (m->leader) ? 0 : 1;
- WBUFB(buf, 28 + c * 46 + 45) = (m->online) ? 0 : 1;
+ WBUFL(buf, 28 + c * size) = m->account_id;
+ memcpy(WBUFP(buf, 28 + c * size + 4), m->name, NAME_LENGTH);
+ mapindex->getmapname_ext(mapindex_id2name(m->map), WBUFP(buf, 28 + c * size + 28));
+ WBUFB(buf, 28 + c * size + 44) = (m->leader) ? 0 : 1;
+ WBUFB(buf, 28 + c * size + 45) = (m->online) ? 0 : 1;
+#if PACKETVER >= 20170524
+ WBUFW(buf, 28 + c * size + 46) = m->class;
+ WBUFW(buf, 28 + c * size + 48) = m->lv;
+#endif
c++;
}
- WBUFW(buf, 2) = 28 + c * 46;
+#if PACKETVER < 20170524
+ WBUFW(buf, 2) = 28 + c * size;
+#else
+ WBUFB(buf, 28 + c * size) = (p->party.item & 1) ? 1 : 0;
+ WBUFB(buf, 28 + c * size + 1) = (p->party.item & 2) ? 1 : 0;
+ WBUFL(buf, 28 + c * size + 2) = 0; // unknown
+ WBUFW(buf, 2) = 28 + c * size + 6;
+#endif
if (sd) { // send only to self
clif->send(buf, WBUFW(buf, 2), &sd->bl, SELF);