Esempio n. 1
0
        private static void OnPm(CommandEventArgs e)
        {
            try{
                ChatInfo info = ChatInfo.GetInfo(e.Mobile);

                if (!CanPm(info, true))
                {
                    return;
                }

                if (e.ArgString == null || e.ArgString == "")
                {
                    ListGump.SendTo(e.Mobile, Listing.Messages);
                }
                else
                {
                    string name = e.GetString(0);
                    string text = "";

                    if (e.Arguments.Length > 1)
                    {
                        text = e.ArgString.Substring(name.Length + 1, e.ArgString.Length - name.Length - 1);
                    }

                    ArrayList list = GetPmCanidates(info, name);

                    if (list.Count > 10)
                    {
                        e.Mobile.SendMessage(info.SystemColor, "Too many name search results, please be more specific.");
                    }
                    else if (list.Count == 0)
                    {
                        e.Mobile.SendMessage(info.SystemColor, "No name containing '{0}' was found.", name);
                    }
                    else if (list.Count == 1)
                    {
                        PmGump.SendTo(info.Mobile, (Mobile)list[0], text);
                    }
                    else
                    {
                        Hashtable table = new Hashtable();
                        foreach (Mobile m in list)
                        {
                            table.Add(new object[3] {
                                e.Mobile, m, text
                            }, m.Name);
                        }

                        ChoiceGump.SendTo(info.Mobile, "", 200, new TimerStateCallback(ChoiceCallback), table);
                    }
                }
            }catch { Errors.Report(String.Format("Pm-> OnPm-> |{0}|", e.Mobile)); }
        }
Esempio n. 2
0
        private void Ban()
        {
            Hashtable table = new Hashtable();

            table.Add(TimeSpan.FromMinutes(5), "Five Minutes");
            table.Add(TimeSpan.FromMinutes(30), "Thirty Minutes");
            table.Add(TimeSpan.FromHours(5), "Five Hours");
            table.Add(TimeSpan.FromDays(1), "One Day");
            table.Add(TimeSpan.FromDays(7), "One Week");
            table.Add(TimeSpan.FromDays(30), "One Month");
            table.Add(TimeSpan.FromDays(365), "One Year");

            ChoiceGump.SendTo(Owner, "Select Duration", 200, new TimerStateCallback(BanCallback), table);
        }
Esempio n. 3
0
        private void MiniList()
        {
            Hashtable table = new Hashtable();

            if (Owner.AccessLevel > AccessLevel.Player)
            {
                table.Add((int)Listing.Banned, "Banned");
            }

            if (ChatInfo.ShowStaff ||
                Owner.AccessLevel != AccessLevel.Player)
            {
                table.Add((int)Listing.Staff, "Staff");
            }

            if (Owner.Guild != null)
            {
                table.Add((int)Listing.Guild, "Guild");
            }

            if (FactionChat.IsInFaction(Owner) && ChatInfo.AllowFaction)
            {
                table.Add((int)Listing.Faction, "Faction");
            }

            table.Add((int)Listing.Ignores, "Ignores");
            table.Add((int)Listing.Messages, "Messages");

            if (ChatInfo.IrcEnabled &&
                IrcConnection.Connection.Connected &&
                c_Info.IrcOn)
            {
                table.Add((int)Listing.IRC, "IRC");
            }

            if (!c_Info.PublicDisabled)
            {
                table.Add((int)Listing.Search, "Search");
            }

            table.Add((int)Listing.Friends, "Friends");

            if (!c_Info.PublicDisabled)
            {
                table.Add((int)Listing.Public, "Public");
            }

            ChoiceGump.SendTo(Owner, "", 100, new TimerStateCallback(List), table);
        }
Esempio n. 4
0
        private void Ban(object obj)
        {
            if (!(obj is int))
            {
                return;
            }

            if ((int)obj >= c_List.Count || (int)obj < 0)
            {
                return;
            }

            Hashtable table = new Hashtable();

            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromMinutes(5)
            }, "Five Minutes");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromMinutes(30)
            }, "Thirty Minutes");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromHours(5)
            }, "Five Hours");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromDays(1)
            }, "One Day");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromDays(7)
            }, "One Week");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromDays(30)
            }, "One Month");
            table.Add(new object[2] {
                c_List[(int)obj], TimeSpan.FromDays(365)
            }, "One Year");

            ChoiceGump.SendTo(Owner, "Select Duration", 200, new TimerStateCallback(BanCallback), table);
        }