Example #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)); }
        }
Example #2
0
        private void NewMessage(object obj)
        {
            if (!(obj is int))
            {
                return;
            }

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

            Mobile m = (Mobile)c_List[(int)obj];

            NewGump();
            PmGump.SendTo(Owner, m);
        }
Example #3
0
        private void OpenMessage(object obj)
        {
            if (!(obj is int))
            {
                return;
            }

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

            Message msg = (Message)c_List[(int)obj];

            c_Info.RemoveMessage(msg);
            NewGump();
            PmGump.SendTo(Owner, msg);
        }
Example #4
0
        private static void ChoiceCallback(object obj)
        {
            if (!(obj is object[]))
            {
                return;
            }

            object[] info = (object[])obj;

            if (info.Length != 3 ||
                !(info[0] is Mobile) ||
                !(info[1] is Mobile) ||
                !(info[2] is string))
            {
                return;
            }

            PmGump.SendTo((Mobile)info[0], (Mobile)info[1], info[2].ToString());
        }
Example #5
0
 private void Message()
 {
     NewGump();
     PmGump.SendTo(Owner, c_Target);
 }
Example #6
0
 private void Message()
 {
     PmGump.SendMostRecent(Owner);
 }