Beispiel #1
0
        protected override void OnBattlePreparing(DateTime when)
        {
            base.OnBattlePreparing(when);

            foreach (GlobalJoinGump g in
                     NetState.Instances.Select(s => s.Mobile)
                     .OfType <PlayerMobile>()
                     .Not(m => IsQueued(m) || IsParticipant(m) || ActionCams.IsCamera(m) || CentralGump.EnsureProfile(m).IgnoreBattles)
                     .Select(CreateJoinGump)
                     .Where(g => g != null))
            {
                g.Send();
            }
        }
Beispiel #2
0
        protected override void OnBattleOpened(DateTime when)
        {
            base.OnBattleOpened(when);

            if (PlayerStarted)
            {
                GiveTrophies = true;
            }

            foreach (GlobalJoinGump g in
                     NetState.Instances.Select(s => s.Mobile)
                     .OfType <PlayerMobile>()
                     .Not(m => IsQueued(m) || ActionCams.IsCamera(m) || CentralGump.EnsureProfile(m).IgnoreBattles)
                     .Select(CreateJoinGump)
                     .Where(g => g != null))
            {
                g.Send();
            }
        }
Beispiel #3
0
        private static void SendWarning(Mobile m, string speech, bool jailed, bool banned)
        {
            if (m == null || m.Deleted || !m.Player || String.IsNullOrWhiteSpace(speech))
            {
                return;
            }

            string message;

            if (CMOptions.NotifyStaff)
            {
                message = "[Warning: Advertising Detected]: " + GetDetectedString(m, speech, jailed, banned);

                NetState.Instances.AsParallel()
                .Where(
                    ns => ns != null && ns.Mobile != null && ns.Mobile is PlayerMobile && !ns.Mobile.Deleted && ns.Mobile.AccessLevel >= CMOptions.NotifyAccess && !ActionCams.IsCamera(ns.Mobile as PlayerMobile))
                .ForEach(ns => ns.Mobile.SendNotification <AntiAdvertNotifyGump>(message, false, color: Color.OrangeRed));
            }

            if (CMOptions.NotifyPlayer)
            {
                var pm = m as PlayerMobile;

                if (pm == null)
                {
                    return;
                }

                message = String.Empty;

                message += "A recent check shows that you may be trying to advertise on " + ServerList.ServerName + ".\n";
                message += "Advertising is not allowed.\n";

                if (jailed)
                {
                    message += "You have been jailed until a member of staff can review your case.\n";
                    message += "If you are found to be innocent, you will be promptly released and free to adventure again.\n";
                }
                else
                {
                    message += "A report has been submitted to the staff team for review.\n";
                }

                message += "\nOffending Speech:\n" + speech;

                new NoticeDialogGump(pm)
                {
                    Width          = 420,
                    Height         = 420,
                    CanMove        = false,
                    CanDispose     = false,
                    BlockSpeech    = true,
                    RandomButtonID = true,
                    Title          = jailed ? "Jailed! Why?" : "Advertising Reported",
                    Html           = message
                }.Send();
            }
        }
Beispiel #4
0
 public override bool CanSendInvite(PlayerMobile pm)
 {
     return(base.CanSendInvite(pm) && !ActionCams.IsCamera(pm));
 }
Beispiel #5
0
        private void SendToStaffMessage(Mobile from, string text)
        {
            Packet p = null;

            foreach (NetState ns in from.GetClientsInRange(8))
            {
                Mobile mob = ns.Mobile;

                if (mob != null && mob.AccessLevel >= AccessLevel.GameMaster && mob.AccessLevel > from.AccessLevel && mob.Party != this && !m_Listeners.Contains(mob) && !ActionCams.IsCamera(mob as PlayerMobile))
                {
                    if (p == null)
                    {
                        p = Packet.Acquire(new UnicodeMessage(from.Serial, from.Body, MessageType.Regular, from.SpeechHue, 3, from.Language, from.Name, text));
                    }

                    ns.Send(p);
                }
            }

            Packet.Release(p);
        }