aboutsummaryrefslogtreecommitdiff
path: root/src/game/Channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Channel.cpp')
-rw-r--r--src/game/Channel.cpp149
1 files changed, 143 insertions, 6 deletions
diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp
index 5ff403b9484..c7155d7d2b1 100644
--- a/src/game/Channel.cpp
+++ b/src/game/Channel.cpp
@@ -17,10 +17,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include "Channel.h"
#include "ObjectMgr.h"
#include "SocialMgr.h"
#include "World.h"
+
Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
: m_name(name), m_announce(true), m_moderate(false), m_channelId(channel_id), m_ownerGUID(0), m_password(""), m_flags(0)
{
@@ -31,11 +33,15 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
{
channel_id = ch->ChannelID; // built-in channel
m_announce = false; // no join/leave announces
+
m_flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
+
if(ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
m_flags |= CHANNEL_FLAG_TRADE;
+
if(ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
m_flags |= CHANNEL_FLAG_CITY;
+
if(ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
m_flags |= CHANNEL_FLAG_LFG;
else // for all other channels
@@ -56,12 +62,14 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
m_moderate = fields[3].GetBool();
m_password = fields[4].GetString();
const char* db_BannedList = fields[5].GetString();
+
m_IsSaved = true;
+
if(db_BannedList)
{
Tokens tokens = StrSplit(db_BannedList, " ");
Tokens::iterator iter;
- for (iter = tokens.begin();iter != tokens.end(); ++iter)
+ for (iter = tokens.begin(); iter != tokens.end(); ++iter)
{
uint64 banned_guid = atol((*iter).c_str());
if(banned_guid)
@@ -83,6 +91,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
}
}
}
+
void Channel::Join(uint64 p, const char *pass)
{
WorldPacket data;
@@ -95,19 +104,23 @@ void Channel::Join(uint64 p, const char *pass)
}
return;
}
+
if(IsBanned(p))
{
MakeBanned(&data);
SendToOne(&data, p);
return;
}
+
if(m_password.length() > 0 && strcmp(pass, m_password.c_str()))
{
MakeWrongPassword(&data);
SendToOne(&data, p);
return;
}
+
Player *plr = objmgr.GetPlayer(p);
+
if(plr)
{
if(HasFlag(CHANNEL_FLAG_LFG) &&
@@ -118,23 +131,31 @@ void Channel::Join(uint64 p, const char *pass)
SendToOne(&data, p);
return;
}
+
if(plr->GetGuildId() && (GetFlags() == 0x38))
return;
+
plr->JoinedChannel(this);
}
+
if(m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL) ))
{
MakeJoined(&data, p);
SendToAll(&data);
}
+
data.clear();
+
PlayerInfo pinfo;
pinfo.player = p;
pinfo.flags = MEMBER_FLAG_NONE;
players[p] = pinfo;
+
MakeYouJoined(&data);
SendToOne(&data, p);
+
JoinNotify(p);
+
// if no owner first logged will become
if(!IsConstant() && !m_ownerGUID)
{
@@ -148,6 +169,7 @@ void Channel::Join(uint64 p, const char *pass)
players[p].SetModerator(true);
}*/
}
+
void Channel::Leave(uint64 p, bool send)
{
if(!IsOn(p))
@@ -162,6 +184,7 @@ void Channel::Leave(uint64 p, bool send)
else
{
Player *plr = objmgr.GetPlayer(p);
+
if(send)
{
WorldPacket data;
@@ -171,7 +194,9 @@ void Channel::Leave(uint64 p, bool send)
plr->LeftChannel(this);
data.clear();
}
+
bool changeowner = players[p].IsOwner();
+
players.erase(p);
if(m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL) ))
{
@@ -179,7 +204,9 @@ void Channel::Leave(uint64 p, bool send)
MakeLeft(&data, p);
SendToAll(&data);
}
+
LeaveNotify(p);
+
if(changeowner)
{
uint64 newowner = !players.empty() ? players.begin()->second.player : 0;
@@ -188,12 +215,14 @@ void Channel::Leave(uint64 p, bool send)
}
}
}
+
void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{
AccountTypes sec = SEC_PLAYER;
Player *gplr = objmgr.GetPlayer(good);
if(gplr)
sec = gplr->GetSession()->GetSecurity();
+
if(!IsOn(good))
{
WorldPacket data;
@@ -224,7 +253,9 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
else
{
bool changeowner = (m_ownerGUID == bad->GetGUID());
+
WorldPacket data;
+
if(ban && !IsBanned(bad->GetGUID()))
{
banned.insert(bad->GetGUID());
@@ -234,7 +265,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{
std::ostringstream banlist;
BannedList::iterator iter;
- for (iter = banned.begin();iter != banned.end(); ++iter)
+ for (iter = banned.begin(); iter != banned.end(); ++iter)
{
banlist << (*iter) << " ";
}
@@ -245,12 +276,15 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
sLog.outDebug("Channel(%s) BannedList saved", m_name.c_str());
}
}
+
}
else
MakePlayerKicked(&data, bad->GetGUID(), good);
+
SendToAll(&data);
players.erase(bad->GetGUID());
bad->LeftChannel(this);
+
if(changeowner)
{
uint64 newowner = !players.empty() ? good : false;
@@ -260,12 +294,14 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
}
}
}
+
void Channel::UnBan(uint64 good, const char *badname)
{
uint32 sec = 0;
Player *gplr = objmgr.GetPlayer(good);
if(gplr)
sec = gplr->GetSession()->GetSecurity();
+
if(!IsOn(good))
{
WorldPacket data;
@@ -290,6 +326,7 @@ void Channel::UnBan(uint64 good, const char *badname)
else
{
banned.erase(bad->GetGUID());
+
WorldPacket data;
MakePlayerUnbanned(&data, bad->GetGUID(), good);
SendToAll(&data);
@@ -298,7 +335,7 @@ void Channel::UnBan(uint64 good, const char *badname)
{
std::ostringstream banlist;
BannedList::iterator iter;
- for (iter = banned.begin();iter != banned.end(); ++iter)
+ for (iter = banned.begin(); iter != banned.end(); ++iter)
{
banlist << (*iter) << " ";
}
@@ -312,12 +349,14 @@ void Channel::UnBan(uint64 good, const char *badname)
}
}
}
+
void Channel::Password(uint64 p, const char *pass)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -333,6 +372,7 @@ void Channel::Password(uint64 p, const char *pass)
else
{
m_password = pass;
+
WorldPacket data;
MakePasswordChanged(&data, p);
SendToAll(&data);
@@ -347,12 +387,15 @@ void Channel::Password(uint64 p, const char *pass)
}
}
}
+
void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
{
Player *plr = objmgr.GetPlayer(p);
if (!plr)
return;
+
uint32 sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -375,9 +418,11 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
SendToOne(&data, p);
return;
}
+
PlayerInfo inf = players[newp->GetGUID()];
if(p == m_ownerGUID && newp->GetGUID() == m_ownerGUID && mod)
return;
+
if(!IsOn(newp->GetGUID()))
{
WorldPacket data;
@@ -385,6 +430,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
SendToOne(&data, p);
return;
}
+
// allow make moderator from another team only if both is GMs
// at this moment this only way to show channel post for GM from another team
if( (plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) &&
@@ -395,6 +441,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
SendToOne(&data, p);
return;
}
+
if(m_ownerGUID == newp->GetGUID() && m_ownerGUID != p)
{
WorldPacket data;
@@ -402,18 +449,22 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
SendToOne(&data, p);
return;
}
+
if(mod)
SetModerator(newp->GetGUID(), set);
else
SetMute(newp->GetGUID(), set);
}
}
+
void Channel::SetOwner(uint64 p, const char *newname)
{
Player *plr = objmgr.GetPlayer(p);
if (!plr)
return;
+
uint32 sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -421,6 +472,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
if(sec < SEC_GAMEMASTER && p != m_ownerGUID)
{
WorldPacket data;
@@ -428,6 +480,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
Player *newp = objmgr.GetPlayer(newname);
if(newp == NULL || !IsOn(newp->GetGUID()))
{
@@ -436,6 +489,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
if(newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
{
WorldPacket data;
@@ -443,9 +497,11 @@ void Channel::SetOwner(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
players[newp->GetGUID()].SetModerator(true);
SetOwner(newp->GetGUID());
}
+
void Channel::SendWhoOwner(uint64 p)
{
if(!IsOn(p))
@@ -461,9 +517,11 @@ void Channel::SendWhoOwner(uint64 p)
SendToOne(&data, p);
}
}
+
void Channel::List(Player* player)
{
uint64 p = player->GetGUID();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -476,13 +534,17 @@ void Channel::List(Player* player)
data << uint8(1); // channel type?
data << GetName(); // channel name
data << uint8(GetFlags()); // channel flags?
+
size_t pos = data.wpos();
data << uint32(0); // size of list, placeholder
+
uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
+
uint32 count = 0;
- for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
+ for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = objmgr.GetPlayer(i->first);
+
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (plr && (player->GetSession()->GetSecurity() > SEC_PLAYER || plr->GetSession()->GetSecurity() <= gmLevelInWhoList) &&
@@ -493,16 +555,20 @@ void Channel::List(Player* player)
++count;
}
}
+
data.put<uint32>(pos,count);
+
SendToOne(&data, p);
}
}
+
void Channel::Announce(uint64 p)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -518,6 +584,7 @@ void Channel::Announce(uint64 p)
else
{
m_announce = !m_announce;
+
WorldPacket data;
if(m_announce)
MakeAnnouncementsOn(&data, p);
@@ -533,14 +600,17 @@ void Channel::Announce(uint64 p)
sLog.outDebug("Channel(%s) announce saved", m_name.c_str());
}
}
+
}
}
+
void Channel::Moderate(uint64 p)
{
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -556,6 +626,7 @@ void Channel::Moderate(uint64 p)
else
{
m_moderate = !m_moderate;
+
WorldPacket data;
if(m_moderate)
MakeModerationOn(&data, p);
@@ -573,16 +644,19 @@ void Channel::Moderate(uint64 p)
}
}
}
+
void Channel::Say(uint64 p, const char *what, uint32 lang)
{
if(!what)
return;
if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL;
+
uint32 sec = 0;
Player *plr = objmgr.GetPlayer(p);
if(plr)
sec = plr->GetSession()->GetSecurity();
+
if(!IsOn(p))
{
WorldPacket data;
@@ -604,6 +678,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
else
{
uint32 messageLength = strlen(what) + 1;
+
WorldPacket data(SMSG_MESSAGECHAT, 1+4+8+4+m_name.size()+1+8+4+messageLength+1);
data << (uint8)CHAT_MSG_CHANNEL;
data << (uint32)lang;
@@ -614,9 +689,11 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
data << messageLength;
data << what;
data << uint8(plr ? plr->chatTag() : 0);
+
SendToAll(&data, !players[p].IsModerator() ? p : false);
}
}
+
void Channel::Invite(uint64 p, const char *newname)
{
if(!IsOn(p))
@@ -626,6 +703,7 @@ void Channel::Invite(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
Player *newp = objmgr.GetPlayer(newname);
if(!newp)
{
@@ -634,9 +712,11 @@ void Channel::Invite(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
Player *plr = objmgr.GetPlayer(p);
if (!plr)
return;
+
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
{
WorldPacket data;
@@ -644,6 +724,7 @@ void Channel::Invite(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
if(IsOn(newp->GetGUID()))
{
WorldPacket data;
@@ -651,6 +732,7 @@ void Channel::Invite(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
+
WorldPacket data;
if(!newp->GetSocial()->HasIgnore(GUID_LOPART(p)))
{
@@ -661,6 +743,7 @@ void Channel::Invite(uint64 p, const char *newname)
MakePlayerInvited(&data, newp->GetName());
SendToOne(&data, p);
}
+
void Channel::SetOwner(uint64 guid, bool exclaim)
{
if(m_ownerGUID)
@@ -670,15 +753,18 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
if(p_itr != players.end())
p_itr->second.SetOwner(false);
}
+
m_ownerGUID = guid;
if(m_ownerGUID)
{
uint8 oldFlag = GetPlayerFlags(m_ownerGUID);
players[m_ownerGUID].SetModerator(true);
players[m_ownerGUID].SetOwner(true);
+
WorldPacket data;
MakeModeChange(&data, m_ownerGUID, oldFlag);
SendToAll(&data);
+
if(exclaim)
{
MakeOwnerChanged(&data, m_ownerGUID);
@@ -693,11 +779,13 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
sLog.outDebug("Channel(%s) owner saved", m_name.c_str());
}
}*/
+
}
}
+
void Channel::SendToAll(WorldPacket *data, uint64 p)
{
- for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
+ for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = objmgr.GetPlayer(i->first);
if(plr)
@@ -707,9 +795,10 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
}
}
}
+
void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
{
- for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
+ for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
if(i->first != who)
{
@@ -719,18 +808,24 @@ void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
}
}
}
+
void Channel::SendToOne(WorldPacket *data, uint64 who)
{
Player *plr = objmgr.GetPlayer(who);
if(plr)
plr->GetSession()->SendPacket(data);
}
+
void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/)
{
+
}
+
void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/)
{
+
}
+
// done
void Channel::MakeNotifyPacket(WorldPacket *data, uint8 notify_type)
{
@@ -738,18 +833,21 @@ void Channel::MakeNotifyPacket(WorldPacket *data, uint8 notify_type)
*data << uint8(notify_type);
*data << m_name;
}
+
// done 0x00
void Channel::MakeJoined(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_JOINED_NOTICE);
*data << uint64(guid);
}
+
// done 0x01
void Channel::MakeLeft(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_LEFT_NOTICE);
*data << uint64(guid);
}
+
// done 0x02
void Channel::MakeYouJoined(WorldPacket *data)
{
@@ -758,6 +856,7 @@ void Channel::MakeYouJoined(WorldPacket *data)
*data << uint32(GetChannelId());
*data << uint32(0);
}
+
// done 0x03
void Channel::MakeYouLeft(WorldPacket *data)
{
@@ -765,53 +864,64 @@ void Channel::MakeYouLeft(WorldPacket *data)
*data << uint32(GetChannelId());
*data << uint8(0); // can be 0x00 and 0x01
}
+
// done 0x04
void Channel::MakeWrongPassword(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_WRONG_PASSWORD_NOTICE);
}
+
// done 0x05
void Channel::MakeNotMember(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_MEMBER_NOTICE);
}
+
// done 0x06
void Channel::MakeNotModerator(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE);
}
+
// done 0x07
void Channel::MakePasswordChanged(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE);
*data << uint64(guid);
}
+
// done 0x08
void Channel::MakeOwnerChanged(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE);
*data << uint64(guid);
}
+
// done 0x09
void Channel::MakePlayerNotFound(WorldPacket *data, const std::string& name)
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_FOUND_NOTICE);
*data << name;
}
+
// done 0x0A
void Channel::MakeNotOwner(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_OWNER_NOTICE);
}
+
// done 0x0B
void Channel::MakeChannelOwner(WorldPacket *data)
{
std::string name = "";
+
if(!objmgr.GetPlayerNameByGUID(m_ownerGUID, name) || name.empty())
name = "PLAYER_NOT_FOUND";
+
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);
*data << ((IsConstant() || !m_ownerGUID) ? "Nobody" : name);
}
+
// done 0x0C
void Channel::MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags)
{
@@ -820,35 +930,41 @@ void Channel::MakeModeChange(WorldPacket *data, uint64 guid, uint8 oldflags)
*data << uint8(oldflags);
*data << uint8(GetPlayerFlags(guid));
}
+
// done 0x0D
void Channel::MakeAnnouncementsOn(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE);
*data << uint64(guid);
}
+
// done 0x0E
void Channel::MakeAnnouncementsOff(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE);
*data << uint64(guid);
}
+
// done 0x0F
void Channel::MakeModerationOn(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_MODERATION_ON_NOTICE);
*data << uint64(guid);
}
+
// done 0x10
void Channel::MakeModerationOff(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_MODERATION_OFF_NOTICE);
*data << uint64(guid);
}
+
// done 0x11
void Channel::MakeMuted(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_MUTED_NOTICE);
}
+
// done 0x12
void Channel::MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good)
{
@@ -856,11 +972,13 @@ void Channel::MakePlayerKicked(WorldPacket *data, uint64 bad, uint64 good)
*data << uint64(bad);
*data << uint64(good);
}
+
// done 0x13
void Channel::MakeBanned(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_BANNED_NOTICE);
}
+
// done 0x14
void Channel::MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good)
{
@@ -868,6 +986,7 @@ void Channel::MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good)
*data << uint64(bad);
*data << uint64(good);
}
+
// done 0x15
void Channel::MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good)
{
@@ -875,90 +994,107 @@ void Channel::MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good)
*data << uint64(bad);
*data << uint64(good);
}
+
// done 0x16
void Channel::MakePlayerNotBanned(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE);
*data << uint64(guid);
}
+
// done 0x17
void Channel::MakePlayerAlreadyMember(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE);
*data << uint64(guid);
}
+
// done 0x18
void Channel::MakeInvite(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_INVITE_NOTICE);
*data << uint64(guid);
}
+
// done 0x19
void Channel::MakeInviteWrongFaction(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_INVITE_WRONG_FACTION_NOTICE);
}
+
// done 0x1A
void Channel::MakeWrongFaction(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_WRONG_FACTION_NOTICE);
}
+
// done 0x1B
void Channel::MakeInvalidName(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_INVALID_NAME_NOTICE);
}
+
// done 0x1C
void Channel::MakeNotModerated(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE);
}
+
// done 0x1D
void Channel::MakePlayerInvited(WorldPacket *data, const std::string& name)
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE);
*data << name;
}
+
// done 0x1E
void Channel::MakePlayerInviteBanned(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE);
*data << uint64(guid);
}
+
// done 0x1F
void Channel::MakeThrottled(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_THROTTLED_NOTICE);
}
+
// done 0x20
void Channel::MakeNotInArea(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_IN_AREA_NOTICE);
}
+
// done 0x21
void Channel::MakeNotInLfg(WorldPacket *data)
{
MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE);
}
+
// done 0x22
void Channel::MakeVoiceOn(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE);
*data << uint64(guid);
}
+
// done 0x23
void Channel::MakeVoiceOff(WorldPacket *data, uint64 guid)
{
MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE);
*data << uint64(guid);
}
+
void Channel::JoinNotify(uint64 guid)
{
WorldPacket data;
+
if(IsConstant())
data.Initialize(SMSG_USERLIST_ADD, 8+1+1+4+GetName().size()+1);
else
data.Initialize(SMSG_USERLIST_UPDATE, 8+1+1+4+GetName().size()+1);
+
data << uint64(guid);
data << uint8(GetPlayerFlags(guid));
data << uint8(GetFlags());
@@ -966,6 +1102,7 @@ void Channel::JoinNotify(uint64 guid)
data << GetName();
SendToAll(&data);
}
+
void Channel::LeaveNotify(uint64 guid)
{
WorldPacket data(SMSG_USERLIST_REMOVE, 8+1+4+GetName().size()+1);