Hi,
would you be willing to add a feature to the project to automatically log players into the Wolrd chat channel where everyone can interact with everyone?
The code might look something like this:
#include "Chat.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ChannelMgr.h"
#include "WorldSession.h"
class WorldChannelJoin : public PlayerScript
{
public:
WorldChannelJoin() : PlayerScript("WorldChannelJoin") { }
void OnLogin(Player* player) override
{
if (!player->IsInWorld())
return;
std::string channelName = "World";
uint32 team = player->GetTeam();
ChannelMgr* channelMgr = ChannelMgr::forTeam(team);
if (!channelMgr)
return;
Channel* channel = channelMgr->GetChannel(channelName, player);
if (!channel)
{
channel = channelMgr->GetCreateChannel(channelName, player->GetSession()->GetPlayer());
}
if (!channel->IsMember(player->GetGUID()))
{
channel->Join(player->GetSession()->GetPlayer(), "");
}
}
};
void AddSC_WorldChannelJoin()
{
new WorldChannelJoin();
}