feat(Core/Packets): Port packet handling from TrinityCore (#5617)

* feat(Core/Packets): Port packet handling from TrinityCore

* 1

* 2

* 3

* 1

* 2

* #3670

* 3

* 1

* codestyle

* fix msvc warnings
This commit is contained in:
Kargatum
2021-05-22 05:10:46 +07:00
committed by GitHub
parent 537ebe87aa
commit 63a273507c
29 changed files with 2768 additions and 1868 deletions

View File

@@ -818,32 +818,6 @@ void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
SendToAll(&data, pinfo.IsModerator() ? ObjectGuid::Empty : guid);
}
void Channel::EveryoneSayToSelf(const char* what)
{
if (!what)
return;
uint32 messageLength = strlen(what) + 1;
WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + _name.size() + 1 + 8 + 4 + messageLength + 1);
data << (uint8)CHAT_MSG_CHANNEL;
data << (uint32)LANG_UNIVERSAL;
data << uint64(0); // put player guid here
data << uint32(0);
data << _name;
data << uint64(0); // put player guid here
data << messageLength;
data << what;
data << uint8(0);
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
{
data.put(5, i->first);
data.put(17 + _name.size() + 1, i->first);
i->second.plrPtr->GetSession()->SendPacket(&data);
}
}
void Channel::Invite(Player const* player, std::string const& newname)
{
ObjectGuid guid = player->GetGUID();

View File

@@ -209,7 +209,6 @@ public:
void List(Player const* player);
void Announce(Player const* player);
void Say(ObjectGuid guid, std::string const& what, uint32 lang);
void EveryoneSayToSelf(const char* what);
void Invite(Player const* player, std::string const& newp);
void Voice(ObjectGuid guid1, ObjectGuid guid2);
void DeVoice(ObjectGuid guid1, ObjectGuid guid2);

View File

@@ -8,6 +8,7 @@
#define AZEROTHCORE_CHAT_H
#include "SharedDefines.h"
#include "Errors.h"
#include "WorldSession.h"
#include <vector>