Core/Guild: Use correct opcode to send note change, instead of sending whole roster

By gerripeach
This commit is contained in:
Aokromes committed 2017-09-24 19:19:34 +02:00
1 parent fab8e2c9a5
commit 3c7f9e53f1
2 files changed
+29 -1

No files matched your search

+28 -1
View File
@@ -1699,7 +1699,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note,
else
member->SetPublicNote(note);
HandleRoster(session); // FIXME - We should send SMSG_GUILD_MEMBER_UPDATE_NOTE
SendMemberUpdateNote(note, guid, officer);
}
}
@@ -2393,6 +2393,33 @@ void Guild::SendLoginInfo(WorldSession* session)
member->AddFlag(GUILDMEMBER_STATUS_ONLINE);
}
void Guild::SendMemberUpdateNote(std::string const& note, ObjectGuid guid, bool isPublic) const
{
uint8 length = note.length();
WorldPacket data(SMSG_GUILD_MEMBER_UPDATE_NOTE, 1 + 1 + 1 + 8 + length);
data.WriteBit(guid[7]);
data.WriteBit(guid[2]);
data.WriteBit(guid[3]);
data.WriteBits(length, 8); // note length
data.WriteBit(guid[5]);
data.WriteBit(guid[0]);
data.WriteBit(guid[6]);
data.WriteBit(guid[4]);
data.WriteBit(isPublic); // public
data.WriteBit(guid[1]);
data.WriteByteSeq(guid[3]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[5]);
data.WriteString(note); // note
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[4]);
BroadcastPacket(&data);
}
// Loading methods
bool Guild::LoadFromDB(Field* fields)
{
+1
View File
@@ -830,6 +830,7 @@ public:
void SendMoneyInfo(WorldSession* session) const;
void SendLoginInfo(WorldSession* session);
void SendNewsUpdate(WorldSession* session);
void SendMemberUpdateNote(std::string const& note, ObjectGuid guid, bool officer) const;
// Load from DB
bool LoadFromDB(Field* fields);