void SendToOne(MessageBuilder builder, ObjectGuid who) { LocalizedPacketDo localizer = new LocalizedPacketDo(builder); Player player = Global.ObjAccessor.FindConnectedPlayer(who); if (player) { localizer.Invoke(player); } }
void SendToAllWithAddon(MessageBuilder builder, string addonPrefix, ObjectGuid guid = default(ObjectGuid)) { LocalizedPacketDo localizer = new LocalizedPacketDo(builder); foreach (var pair in _playersStore) { Player player = Global.ObjAccessor.FindConnectedPlayer(pair.Key); if (player) { if (player.GetSession().IsAddonRegistered(addonPrefix) && (guid.IsEmpty() || !player.GetSocial().HasIgnore(guid))) { localizer.Invoke(player); } } } }
void SendToAllButOne(MessageBuilder builder, ObjectGuid who) { LocalizedPacketDo localizer = new LocalizedPacketDo(builder); foreach (var pair in _playersStore) { if (pair.Key != who) { Player player = Global.ObjAccessor.FindConnectedPlayer(pair.Key); if (player) { localizer.Invoke(player); } } } }
void SendToAll(MessageBuilder builder, ObjectGuid guid = default(ObjectGuid)) { LocalizedPacketDo localizer = new LocalizedPacketDo(builder); foreach (var pair in _playersStore) { Player player = Global.ObjAccessor.FindConnectedPlayer(pair.Key); if (player) { if (guid.IsEmpty() || !player.GetSocial().HasIgnore(guid)) { localizer.Invoke(player); } } } }