예제 #1
0
        void SendToOne(MessageBuilder builder, ObjectGuid who)
        {
            LocalizedPacketDo localizer = new LocalizedPacketDo(builder);

            Player player = Global.ObjAccessor.FindConnectedPlayer(who);

            if (player)
            {
                localizer.Invoke(player);
            }
        }
예제 #2
0
        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);
                    }
                }
            }
        }
예제 #3
0
        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);
                    }
                }
            }
        }
예제 #4
0
        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);
                    }
                }
            }
        }