void Channel::JoinNotify(Player const* player) { ObjectGuid const& guid = player->GetGUID(); if (IsConstant()) { WorldPackets::Channel::UserlistAdd userlistAdd; userlistAdd.AddedUserGUID = guid; userlistAdd._ChannelFlags = GetFlags(); userlistAdd.UserFlags = GetPlayerFlags(guid); userlistAdd.ChannelID = GetChannelId(); userlistAdd.ChannelName = GetName(); SendToAllButOne(userlistAdd.Write(), guid); } else { WorldPackets::Channel::UserlistUpdate userlistUpdate; userlistUpdate.UpdatedUserGUID = guid; userlistUpdate._ChannelFlags = GetFlags(); userlistUpdate.UserFlags = GetPlayerFlags(guid); userlistUpdate.ChannelID = GetChannelId(); userlistUpdate.ChannelName = GetName(); SendToAll(userlistUpdate.Write()); } }
void Channel::LeaveNotify(uint64 guid) { WorldPacket data(SMSG_USERLIST_REMOVE, 8+1+4+GetName().size()+1); data << uint64(guid); data << uint8(GetFlags()); data << uint32(GetNumPlayers()); data << GetName(); if (IsConstant()) SendToAllButOne(&data, guid); else SendToAll(&data); }
void Channel::JoinNotify(uint64 guid) { WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size()); data << uint64(guid); data << uint8(GetPlayerFlags(guid)); data << uint8(GetFlags()); data << uint32(GetNumPlayers()); data << GetName(); if (IsConstant()) SendToAllButOne(&data, guid); else SendToAll(&data); }
void Channel::LeaveNotify(Player const* player) { ObjectGuid const& guid = player->GetGUID(); WorldPackets::Channel::UserlistRemove userlistRemove; userlistRemove.RemovedUserGUID = guid; userlistRemove._ChannelFlags = GetFlags(); userlistRemove.ChannelID = GetChannelId(); userlistRemove.ChannelName = GetName(); if (IsConstant()) SendToAllButOne(userlistRemove.Write(), guid); else SendToAll(userlistRemove.Write()); }
void Channel::LeaveNotify(Player const* player) { ObjectGuid const& guid = player->GetGUID(); auto builder = [&](LocaleConstant locale) { LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); WorldPackets::Channel::UserlistRemove* userlistRemove = new WorldPackets::Channel::UserlistRemove(); userlistRemove->RemovedUserGUID = guid; userlistRemove->_ChannelFlags = GetFlags(); userlistRemove->ChannelID = GetChannelId(); userlistRemove->ChannelName = GetName(localeIdx); return userlistRemove; }; if (IsConstant()) SendToAllButOne(builder, guid); else SendToAll(builder); }
void Channel::JoinNotify(Player const* player) { ObjectGuid const& guid = player->GetGUID(); if (IsConstant()) { auto builder = [&](LocaleConstant locale) { LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); WorldPackets::Channel::UserlistAdd* userlistAdd = new WorldPackets::Channel::UserlistAdd(); userlistAdd->AddedUserGUID = guid; userlistAdd->_ChannelFlags = GetFlags(); userlistAdd->UserFlags = GetPlayerFlags(guid); userlistAdd->ChannelID = GetChannelId(); userlistAdd->ChannelName = GetName(localeIdx); return userlistAdd; }; SendToAllButOne(builder, guid); } else { auto builder = [&](LocaleConstant locale) { LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); WorldPackets::Channel::UserlistUpdate* userlistUpdate = new WorldPackets::Channel::UserlistUpdate(); userlistUpdate->UpdatedUserGUID = guid; userlistUpdate->_ChannelFlags = GetFlags(); userlistUpdate->UserFlags = GetPlayerFlags(guid); userlistUpdate->ChannelID = GetChannelId(); userlistUpdate->ChannelName = GetName(localeIdx); return userlistUpdate; }; SendToAll(builder); } }