コード例 #1
0
        public static void PrivateMessage(ChatUser from, Channel channel, string param)
        {
            int indexOf = param.IndexOf(' ');

            string name = param.Substring(0, indexOf);
            string text = param.Substring(indexOf + 1);

            ChatUser target = ChatSystem.SearchForUser(from, name);

            if (target == null)
            {
                return;
            }

            if (target.IsIgnored(from))
            {
                from.SendMessage(35, target.Username); // %1 has chosen to ignore you. None of your messages to them will get through.
            }
            else if (target.IgnorePrivateMessage)
            {
                from.SendMessage(42, target.Username); // %1 has chosen to not receive private messages at the moment.
            }
            else
            {
                target.SendMessage(59, from.Mobile, from.GetColorCharacter() + from.Username, text); // [%1]: %2
            }
        }
コード例 #2
0
        public static void Kick(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target != null)
            {
                channel.Kick(target, from);
            }
        }
コード例 #3
0
        public static void RemoveModerator(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target != null)
            {
                channel.RemoveModerator(target, from);
            }
        }
コード例 #4
0
        public static void RemoveIgnore(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target == null)
            {
                return;
            }

            from.RemoveIgnored(target);
        }
コード例 #5
0
        public static void QueryWhoIs(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target == null)
            {
                return;
            }

            if (target.Anonymous)
            {
                from.SendMessage(41, target.Username); // %1 is remaining anonymous.
            }
            else
            {
                from.SendMessage(43, target.Username, target.Mobile.Name); // %2 is known in the lands of Britannia as %2.
            }
        }
コード例 #6
0
        public static void ToggleModerator(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target == null)
            {
                return;
            }

            if (channel.IsModerator(target))
            {
                channel.RemoveModerator(target, from);
            }
            else
            {
                channel.AddModerator(target, from);
            }
        }
コード例 #7
0
        public static void ToggleIgnore(ChatUser from, Channel channel, string param)
        {
            ChatUser target = ChatSystem.SearchForUser(from, param);

            if (target == null)
            {
                return;
            }

            if (from.IsIgnored(target))
            {
                from.RemoveIgnored(target);
            }
            else
            {
                from.AddIgnored(target);
            }
        }