Core/PacketIO: 9.1.0 opcodes and packet structures
Port From (https://github.com/TrinityCore/TrinityCore/commit/cd5357dc185f95c6ef78089c5ab8bd2b885dd89f)
This commit is contained in:
@@ -658,7 +658,7 @@ namespace Game.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
SendToAll(new ChannelSayBuilder(this, lang, what, guid), !playerInfo.IsModerator() ? guid : ObjectGuid.Empty);
|
||||
SendToAll(new ChannelSayBuilder(this, lang, what, guid, _channelGuid), !playerInfo.IsModerator() ? guid : ObjectGuid.Empty);
|
||||
}
|
||||
|
||||
public void AddonSay(ObjectGuid guid, string prefix, string what, bool isLogged)
|
||||
@@ -883,9 +883,10 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
public uint GetChannelId() { return _channelId; }
|
||||
public ObjectGuid GetChannelGuid() { return _channelGuid; }
|
||||
public bool IsConstant() { return _channelId != 0; }
|
||||
|
||||
public ObjectGuid GetGUID() { return _channelGuid; }
|
||||
|
||||
public bool IsLFG() { return GetFlags().HasAnyFlag(ChannelFlags.Lfg); }
|
||||
bool IsAnnounce() { return _announceEnabled; }
|
||||
void SetAnnounce(bool nannounce) { _announceEnabled = nannounce; }
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Game.Chat
|
||||
//notify.InstanceID = 0;
|
||||
notify.Data.ChannelFlags = _source.GetFlags();
|
||||
notify.Data.Channel = _source.GetName(localeIdx);
|
||||
notify.Data.ChannelGUID = _source.GetChannelGuid();
|
||||
notify.Data.ChannelGUID = _source.GetGUID();
|
||||
return notify;
|
||||
}
|
||||
|
||||
@@ -105,12 +105,13 @@ namespace Game.Chat
|
||||
|
||||
class ChannelSayBuilder : MessageBuilder
|
||||
{
|
||||
public ChannelSayBuilder(Channel source, Language lang, string what, ObjectGuid guid)
|
||||
public ChannelSayBuilder(Channel source, Language lang, string what, ObjectGuid guid, ObjectGuid channelGuid)
|
||||
{
|
||||
_source = source;
|
||||
_lang = lang;
|
||||
_what = what;
|
||||
_guid = guid;
|
||||
_channelGuid = channelGuid;
|
||||
}
|
||||
|
||||
public override PacketSenderOwning<ChatPkt> Invoke(Locale locale = Locale.enUS)
|
||||
@@ -128,6 +129,8 @@ namespace Game.Chat
|
||||
packet.Data.TargetGUID = _guid;
|
||||
}
|
||||
|
||||
packet.Data.ChannelGUID.Set(_channelGuid);
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
@@ -135,6 +138,7 @@ namespace Game.Chat
|
||||
Language _lang;
|
||||
string _what;
|
||||
ObjectGuid _guid;
|
||||
ObjectGuid _channelGuid;
|
||||
}
|
||||
|
||||
class ChannelWhisperBuilder : MessageBuilder
|
||||
|
||||
@@ -58,6 +58,15 @@ namespace Game.Chat
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Channel GetChannelForPlayerByGuid(ObjectGuid channelGuid, Player playerSearcher)
|
||||
{
|
||||
foreach (Channel channel in playerSearcher.GetJoinedChannels())
|
||||
if (channel.GetGUID() == channelGuid)
|
||||
return channel;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Channel GetJoinChannel(uint channelId, string name, AreaTableRecord zoneEntry = null)
|
||||
{
|
||||
if (channelId != 0) // builtin
|
||||
|
||||
Reference in New Issue
Block a user