59 msg.readUInt8(
"allow party");
64 const BeingId id =
msg.readBeingId(
"account id");
65 if (
msg.getVersion() >= 20171207)
66 msg.readBeingId(
"char id");
67 const bool leader =
msg.readInt32(
"leader") == 0U;
69 if (
msg.getVersionMain() >= 20170524 ||
70 msg.getVersionRe() >= 20170502 ||
73 msg.readInt16(
"class");
74 level =
msg.readInt16(
"level");
76 const int x =
msg.readInt16(
"x");
77 const int y =
msg.readInt16(
"y");
78 const bool online =
msg.readInt8(
"online") == 0U;
79 msg.readString(24,
"party name");
80 const std::string nick =
msg.readString(24,
"player name");
81 const std::string map =
msg.readString(16,
"map name");
82 msg.readInt8(
"pickup item share (&1)");
83 msg.readInt8(
"get item share (&2)");
89 if (member !=
nullptr)
105 const BeingId id =
msg.readBeingId(
"account id");
106 msg.readInt16(
"class");
107 const int level =
msg.readInt16(
"level");
113 if (member !=
nullptr)
121 reportAlways(
"processPartyMemberJobLevel: party member not exists.")
136 msg.readInt32(
"party exp"));
138 if (
msg.getVersion() >= 20090603)
141 msg.readInt8(
"pickup item share (&1)"));
144 msg.readInt8(
"get auto item share (&2)"));
151 bool isOldParty =
false;
152 std::set<std::string> names;
153 std::set<std::string> onlineNames;
156 logger->
log1(
"error: party empty in SMSG_PARTY_INFO");
169 FOR_EACHP (Party::MemberList::const_iterator, it, members)
171 if ((*it)->getOnline())
172 onlineNames.insert((*it)->getName());
180 logger->
log1(
"error: localPlayer==0 in SMSG_PARTY_INFO");
185 const int length =
msg.readInt16(
"len");
188 const std::string name =
msg.readString(24,
"party name");
193 msg.readString(24,
"party name");
197 const int offset = 28;
198 if (
msg.getVersion() >= 20171207)
200 partySize = 4 + 4 + 24 + 16 + 1 + 1 + 2 + 2;
202 else if (
msg.getVersionMain() >= 20170524 ||
203 msg.getVersionRe() >= 20170502 ||
206 partySize = 4 + 24 + 16 + 1 + 1 + 2 + 2;
210 partySize = 4 + 24 + 16 + 1 + 1;
213 const int count = (length - offset) / partySize;
221 for (
int i = 0; i < count; i++)
223 const BeingId id =
msg.readBeingId(
"account id");
224 if (
msg.getVersion() >= 20171207)
225 msg.readBeingId(
"char id");
226 std::string nick =
msg.readString(24,
"nick");
227 std::string map =
msg.readString(16,
"map name");
228 const bool leader =
msg.readUInt8(
"leader") == 0U;
229 const bool online =
msg.readUInt8(
"online") == 0U;
231 if (
msg.getVersionMain() >= 20170524 ||
232 msg.getVersionRe() >= 20170502 ||
235 msg.readInt16(
"class");
236 level =
msg.readInt16(
"level");
245 if (names.find(nick) == names.end())
253 if (member !=
nullptr)
255 if (!joined && (
partyTab !=
nullptr))
257 if (!names.empty() && ((onlineNames.find(nick)
258 == onlineNames.end() && online)
259 || (onlineNames.find(nick) != onlineNames.end()
275 if (
msg.getVersion() >= 20170502 &&
msg.getUnreadLength() >= 6)
277 msg.readInt8(
"pickup item share (&1)");
278 msg.readInt8(
"get item share (&2)");
279 msg.readInt32(
"unknown");
296 const int msgLength =
msg.readInt16(
"len") - 8;
301 std::string chatMsg =
msg.readString(msgLength,
"message");
303 const size_t pos = chatMsg.find(
" : ", 0);
304 if (pos != std::string::npos)
305 chatMsg.erase(0, pos + 3);
310 if (member !=
nullptr)
327 const std::string nick =
msg.readString(24,
"nick");
329 switch (
msg.readInt32(
"result"))
369 msg.readBeingId(
"account id");
370 msg.readItemId(
"item id");
371 msg.readUInt8(
"identify");
372 msg.readUInt8(
"attribute");
373 msg.readUInt8(
"refine");
375 msg.readItemId(
"card");
376 msg.readInt16(
"equip location");
377 msg.readUInt8(
"item type");
384 msg.readBeingId(
"old leder id"));
386 msg.readBeingId(
"new leder id"));
387 if (oldMember !=
nullptr)
389 if (newMember !=
nullptr)
397 msg.readInt32(
"party id");
398 msg.readString(24,
"party name");
401 const int id =
msg.readInt32(
"party id");
402 const std::string partyName =
msg.readString(24,
"party name");
440 const BeingId id =
msg.readBeingId(
"account id");
441 const int isDead =
msg.readUInt8(
"is dead");
443 if (member !=
nullptr && isDead != 0)
#define fromBool(val, name)
#define reportAlways(...)
void setOnline(const bool online)
void setLevel(const int level)
void setMap(const std::string &map)
std::string getName() const
void setParty(Party *const party)
const std::string & getName() const
void setPartyName(const std::string &name)
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void showOnline(const std::string &nick, const Online online)
void log1(const char *const log_text)
void setLeader(const bool leader)
std::vector< PartyMember * > MemberList
const MemberList * getMembers() const
void setName(const std::string &name)
PartyMember * addMember(const BeingId id, const std::string &name)
PartyMember * getMember(const BeingId id) const
void getNamesSet(std::set< std::string > &names) const
static Party * getParty(const int16_t id)
void showPartyInvite(const std::string &partyName, const std::string &inviter, const int partyId)
#define FOR_EACHP(type, iter, array)
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
#define UNIMPLEMENTEDPACKET
bool msg(InputEvent &event)
void processPartyMemberInfo(Net::MessageIn &msg)
void processPartyItemPickup(Net::MessageIn &msg)
void processPartyLeader(Net::MessageIn &msg)
void processPartyInvitationStats(Net::MessageIn &msg)
void processPartyMemberJobLevel(Net::MessageIn &msg)
void processPartyAutoItemSettingsContinue(Net::MessageIn &msg, const PartyShareT item)
void processPartyInviteResponse(Net::MessageIn &msg)
void processPartyInvited(Net::MessageIn &msg)
void processPartyMemberDead(Net::MessageIn &msg)
void processPartyInfo(Net::MessageIn &msg)
void processPartySettings(Net::MessageIn &msg)
void processPartyMessage(Net::MessageIn &msg)
PartyShareT mShareAutoItems
void processPartyItemSettingsContinue(Net::MessageIn &msg, const PartyShareT item)
void processPartyExpSettingsContinue(Net::MessageIn &msg, const PartyShareT exp)
const std::string & getName(const int id)
void notify(const unsigned int message)
@ PARTY_INVITE_ALREADY_MEMBER
@ PARTY_INVITE_PARTY_BLOCKED_INVITE
@ PARTY_INVITE_PARTY_SAME_ACCOUNT
@ PARTY_INVITE_PARTY_FULL
@ PARTY_INVITE_PARTY_NOT_ONLINE
PartyShare ::T PartyShareT
SocialWindow * socialWindow