Exemplo n.º 1
0
        //
        // Call this from your chat system command handler to have public
        // chat monitored.
        // For instance, to add monitoring to Knives chat 2.0
        // Search for:
        // string text = Filter( e.Mobile, e.ArgString );
        // and insert this line directly after it (uncommented):
        // Xanthos.SpeechCop.Jail.CheckChatSpeech( e.Mobile, text );	// <- xanthos Jail speech change this line only
        //
        public static void CheckChatSpeech(Mobile mobile, string speech)
        {
            PlayerMobile player = mobile as PlayerMobile;

            if (JailConfig.JailWordsEnabled && null != player && CheckSpeech(speech))
            {
                JailLog.WriteString("CheckChatSpeech: jailing player " + player.Name + " for speech " + speech);
                JailThem(player, Jail.JailOption.None);
            }
        }
Exemplo n.º 2
0
        //
        // This handler monitors local speech for use of the above words.
        //
        public static void EventSink_Speech(SpeechEventArgs args)
        {
            PlayerMobile player = args.Mobile as PlayerMobile;

            if (JailConfig.JailWordsEnabled && null != player && CheckSpeech(args.Speech))
            {
                JailLog.WriteString("EventSink_Speech: jailing player " + player.Name + " for speech " + args.Speech);
                JailThem(player, Jail.JailOption.None);
            }
        }
Exemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targ)
            {
                PlayerMobile player = targ as PlayerMobile;

                if (null == player)
                {
                    from.SendMessage("You can only Jail Players.");
                }
                else
                {
                    JailLog.WriteString("JailTarget: jailing player " + from.Name);
                    JailThem(player, m_Option);
                }
            }
Exemplo n.º 4
0
        private static bool CheckSpeech(string speech)
        {
            if (null != m_JailWords)
            {
                try
                {
                    string[] saidWords = speech.Split(' ');

                    foreach (string said in saidWords)
                    {
                        if (m_JailWords.ContainsKey(said))
                        {
                            JailLog.WriteString("CheckSpeech: match on " + said);
                            return(true);
                        }
                    }
                }
                catch {}
            }
            return(false);
        }