Esempio n. 1
0
		private static void OnLoad()
		{
			Persistence.Deserialize(
				_FilePath,
				reader =>
				{
					var version = reader.ReadInt();
					var count = reader.ReadInt();

					switch (version)
					{
						case 0:
							{
								for (var i = 0; i < count; ++i)
								{
									var sender = reader.ReadMobile();
									var message = reader.ReadString();
									var type = (PageType)reader.ReadInt();
									PageEntry pe = new PageEntry(sender, message, type)
									{
										Handler = reader.ReadMobile(),
										Sent = reader.ReadDateTime(),
										PageLocation = reader.ReadPoint3D(),
										PageMap = reader.ReadMap()
									};
									pe.Stop();

									PageQueue.Enqueue(pe);
								}
							}
							break;
					}
				});
		}
Esempio n. 2
0
        // Public Methods
        public static void NotifyOps( PageEntry p )
        {
            string pLocation = Region.Find(p.PageLocation, p.PageMap).Name;
            if ( pLocation == null || pLocation == "" )
                pLocation = "wilderness";

            SendNotice(StaffChannel, String.Format("[{0}] {1} ({2}): {3}", p.Type, p.Sender.Name, pLocation, p.Message));
        }
        public PageInfo( PageEntry entry )
        {
            m_PageType = entry.Type;

            m_TimeSent = entry.Sent;
            m_SentBy = GetAccount( entry.Sender );

            m_Message = entry.Message;
            m_Responses = new ResponseInfoCollection();
        }
Esempio n. 4
0
		public PageEntryGump( Mobile m, PageEntry entry ) : base( 30, 30 )
		{
			try
			{
				m_Mobile = m;
				m_Entry = entry;

				int buttons = 0;

				int bottom = 356;

				AddPage( 0 );

				AddImageTiled( 0, 0, 410, 456, 0xA40 );
				AddAlphaRegion( 1, 1, 408, 454 );

				AddPage( 1 );

				AddLabel( 18, 18, 2100, "Sent:" );
				AddLabelCropped( 128, 18, 264, 20, 2100, entry.Sent.ToString() );

				AddLabel( 18, 38, 2100, "Sender:" );
				AddLabelCropped( 128, 38, 264, 20, 2100, String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ) );

				AddButton( 18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 );
				AddImageTiled( 52, bottom - (buttons * 22) + 1, 340, 80, 0xA40/*0xBBC*//*0x2458*/ );
				AddImageTiled( 53, bottom - (buttons * 22) + 2, 338, 78, 0xBBC/*0x2426*/ );
				AddTextEntry( 55, bottom - (buttons++ * 22) + 2, 336, 78, 0x480, 0, "" );

				AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2 );
				AddLabel( 52, bottom - (buttons++ * 22), 2100, "Predefined Response" );

				if ( entry.Sender != m )
				{
					AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Sender" );
				}

				AddLabel(  18, 58, 2100, "Handler:" );

				if ( entry.Handler == null )
				{
                    AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

					AddButton( 18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "Delete Page" );

                    AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ * 22), 2100, "Handle Page");
				}
				else
				{
					AddLabelCropped( 128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name );

					if ( entry.Handler != m )
					{
						AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
						AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Handler" );

                        if (m.AccessLevel >= AccessLevel.Seer) //Taran: Seers and above can always delete pages
                        {
                            AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                            AddLabel(52, bottom - (buttons++ * 22), 2100, "Delete Page");
                        }
					}
					else
					{
						AddButton( 18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0 );
						AddLabel( 52, bottom - (buttons++ * 22), 2100, "Abandon Page" );

						AddButton( 18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0 );
						AddLabel( 52, bottom - (buttons++ * 22), 2100, "Page Handled" );
					}
				}

				AddLabel(  18, 78, 2100, "Page Location:" );
				AddLabelCropped( 128, 78, 264, 20, 2100, String.Format( "{0} [{1}]", entry.PageLocation, entry.PageMap ) );

				AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
				AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Page Location" );

				if ( entry.SpeechLog != null )
				{
					AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "View Speech Log" );
				}

				AddLabel(  18, 98, 2100, "Page Type:" );
				AddLabelCropped( 128, 98, 264, 20, 2100, PageQueue.GetPageTypeName( entry.Type ) );

				AddLabel(  18, 118, 2100, "Message:" );
				AddHtml(  128, 118, 250, 100, entry.Message, true, true );

				AddPage( 2 );

				ArrayList preresp = PredefinedResponse.List;

				AddButton( 18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 );
				AddButton( 410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0 );

				if ( preresp.Count == 0 )
				{
					AddLabel( 52, 18, 2100, "There are no predefined responses." );
				}
				else
				{
					AddLabel( 52, 18, 2100, "Back" );

					for ( int i = 0; i < preresp.Count; ++i )
					{
						AddButton( 18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0 );
						AddLabel( 52, 40 + (i * 22), 2100, ((PredefinedResponse)preresp[i]).Title );
					}
				}
			}
			catch ( Exception e )
			{
				Console.WriteLine(e);
			}
		}
Esempio n. 5
0
        public static void Enqueue(PageEntry entry)
        {
            m_List.Add(entry);
            m_KeyedBySender[entry.Sender] = entry;

            bool isStaffOnline = false;

            foreach (NetState ns in NetState.Instances)
            {
                Mobile m = ns.Mobile;

                #region Page In Queue Gump
                if (m != null && m.IsStaff() && m.AutoPageNotify && !IsHandling(m))
                {
                    m.CloseGump(typeof(PageInQueueGump));
                    m.SendGump(new PageInQueueGump(m));
                    //m.SendMessage( "A new page has been placed in the queue." );
                }
                #endregion

                if (m != null && m.IsStaff() && m.AutoPageNotify && m.LastMoveTime - Core.TickCount < 600000)
                {
                    isStaffOnline = true;
                }
            }

            if (!isStaffOnline)
            {
                entry.Sender.SendMessage(
                    "We are sorry, but no staff members are currently available to assist you.  Your page will remain in the queue until one becomes available, or until you cancel it manually.");
            }

            if (Email.FromAddress != null && Email.SpeechLogPageAddresses != null && entry.SpeechLog != null)
            {
                SendEmail(entry);
            }
        }
        //Al: Send PageSpyReport if:
        //      -Spy is GM or higher
        //      -The spy's accesslevel is higher than the answerer's
        //      -PageSpy is set to true
        private void PageSpyReport(PageEntry entry, Mobile answerer, string reply)
        {
            if (answerer == null || entry.Sender == null) return;

            foreach (NetState state in NetState.Instances)
            {
                Mobile m = state.Mobile;
                if (m != null && !m.Deleted && m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;
                    if (pm.PageSpy && m.AccessLevel >= AccessLevel.GameMaster && m.AccessLevel > answerer.AccessLevel)
                    {
                        m.SendMessage(467, "Page by {0} (acc: {1}):", entry.Sender.Name, entry.Sender.Account);
                        m.SendMessage(entry.Message);
                        m.SendMessage(467, "Response by {0} (acc: {1}):", answerer.Name, answerer.Account);
                        m.SendMessage(reply);
                    }
                }
            }
        }
Esempio n. 7
0
		private static void SendEmail( PageEntry entry )
		{
			Mobile sender = entry.Sender;
			DateTime time = DateTime.Now;

			MailMessage mail = new MailMessage( Email.FromAddress, Email.SpeechLogPageAddresses );

			mail.Subject = "RunUO Speech Log Page Forwarding";

			using ( StringWriter writer = new StringWriter() )
			{
				writer.WriteLine( "RunUO Speech Log Page - {0}", PageQueue.GetPageTypeName( entry.Type ) );
				writer.WriteLine();

				writer.WriteLine( "From: '{0}', Account: '{1}'", sender.RawName, sender.Account is Account ? sender.Account.Username : "******" );
				writer.WriteLine( "Location: {0} [{1}]", sender.Location, sender.Map );
				writer.WriteLine( "Sent on: {0}/{1:00}/{2:00} {3}:{4:00}:{5:00}", time.Year, time.Month, time.Day, time.Hour, time.Minute, time.Second );
				writer.WriteLine();

				writer.WriteLine( "Message:" );
				writer.WriteLine( "'{0}'", entry.Message );
				writer.WriteLine();

				writer.WriteLine( "Speech Log" );
				writer.WriteLine( "==========" );

				foreach ( SpeechLogEntry logEntry in entry.SpeechLog )
				{
					Mobile from = logEntry.From;
					string fromName = from.RawName;
					string fromAccount = from.Account is Account ? from.Account.Username : "******";
					DateTime created = logEntry.Created;
					string speech = logEntry.Speech;

					writer.WriteLine( "{0}:{1:00}:{2:00} - {3} ({4}): '{5}'", created.Hour, created.Minute, created.Second, fromName, fromAccount, speech );
				}

				mail.Body = writer.ToString();
			}

			Email.AsyncSend( mail );
		}
Esempio n. 8
0
		public static void Remove( PageEntry e )
		{
			if ( e == null )
				return;

			e.Stop();

			m_List.Remove( e );
			m_KeyedBySender.Remove( e.Sender );

			if ( e.Handler != null )
				m_KeyedByHandler.Remove( e.Handler );
		}
Esempio n. 9
0
		public static void OnHandlerChanged( Mobile old, Mobile value, PageEntry entry )
		{
			if ( old != null )
				m_KeyedByHandler.Remove( old );

			if ( value != null )
				m_KeyedByHandler[value] = entry;
		}
Esempio n. 10
0
        public PageEntryGump(Mobile m, PageEntry entry)
            : base(30, 30)
        {
            try
            {
                this.m_Mobile = m;
                this.m_Entry  = entry;

                int buttons = 0;

                int bottom = 356;

                this.AddPage(0);

                this.AddImageTiled(0, 0, 410, 456, 0xA40);
                this.AddAlphaRegion(1, 1, 408, 454);

                this.AddPage(1);

                this.AddLabel(18, 18, 2100, "Sent:");
                this.AddLabelCropped(128, 18, 264, 20, 2100, entry.Sent.ToString());

                this.AddLabel(18, 38, 2100, "Sender:");
                this.AddLabelCropped(128, 38, 264, 20, 2100, String.Format("{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map));

                this.AddButton(18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0);
                this.AddImageTiled(52, bottom - (buttons * 22) + 1, 340, 80, 0xA40 /*0xBBC*//*0x2458*/);
                this.AddImageTiled(53, bottom - (buttons * 22) + 2, 338, 78, 0xBBC /*0x2426*/);
                this.AddTextEntry(55, bottom - (buttons++ *22) + 2, 336, 78, 0x480, 0, "");

                this.AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
                this.AddLabel(52, bottom - (buttons++ *22), 2100, "Predefined Response");

                if (entry.Sender != m)
                {
                    this.AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                    this.AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Sender");
                }

                this.AddLabel(18, 58, 2100, "Handler:");

                if (entry.Handler == null)
                {
                    this.AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

                    this.AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                    this.AddLabel(52, bottom - (buttons++ *22), 2100, "Delete Page");

                    this.AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
                    this.AddLabel(52, bottom - (buttons++ *22), 2100, "Handle Page");
                }
                else
                {
                    this.AddLabelCropped(128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name);

                    if (entry.Handler != m)
                    {
                        this.AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
                        this.AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Handler");
                    }
                    else
                    {
                        this.AddButton(18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0);
                        this.AddLabel(52, bottom - (buttons++ *22), 2100, "Abandon Page");

                        this.AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0);
                        this.AddLabel(52, bottom - (buttons++ *22), 2100, "Page Handled");
                    }
                }

                this.AddLabel(18, 78, 2100, "Page Location:");
                this.AddLabelCropped(128, 78, 264, 20, 2100, String.Format("{0} [{1}]", entry.PageLocation, entry.PageMap));

                this.AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
                this.AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Page Location");

                if (entry.SpeechLog != null)
                {
                    this.AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0);
                    this.AddLabel(52, bottom - (buttons++ *22), 2100, "View Speech Log");
                }

                this.AddLabel(18, 98, 2100, "Page Type:");
                this.AddLabelCropped(128, 98, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type));

                this.AddLabel(18, 118, 2100, "Message:");
                this.AddHtml(128, 118, 250, 100, entry.Message, true, true);

                this.AddPage(2);

                ArrayList preresp = PredefinedResponse.List;

                this.AddButton(18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
                this.AddButton(410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0);

                if (preresp.Count == 0)
                {
                    this.AddLabel(52, 18, 2100, "There are no predefined responses.");
                }
                else
                {
                    this.AddLabel(52, 18, 2100, "Back");

                    for (int i = 0; i < preresp.Count; ++i)
                    {
                        this.AddButton(18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0);
                        this.AddLabel(52, 40 + (i * 22), 2100, ((PredefinedResponse)preresp[i]).Title);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 11
0
        public PageEntryGump( Mobile m, PageEntry entry )
            : base(30, 30)
        {
            try
            {
                m_Mobile = m;
                m_Entry = entry;

                int buttons = 0;

                int bottom = 356;

                AddPage( 0 );

                AddImageTiled( 0, 0, 410, 486, 2624 );
                AddAlphaRegion( 0, 0, 410, 486 );

                AddPage( 1 );

                AddHtml( 18, 18, 110, 20, Color( "Sent", LabelColor32 ), false, false );
                AddHtml( 128, 18, 264, 20, Color( entry.Sent.ToString(), LabelColor32 ), false, false );

                AddHtml( 18, 38, 110, 20, Color( "Sender", LabelColor32 ), false, false );
                AddHtml( 128, 38, 264, 20, Color( String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ), LabelColor32 ), false, false );

                // Response Textbox
                AddButton( 18, bottom - ( buttons * 22 ), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 );
                AddImageTiled( 52, bottom - ( buttons * 22 ) + 1, 340, 110, 0xA40 );
                AddImageTiled( 53, bottom - ( buttons * 22 ) + 2, 338, 108, 0xBBC );
                AddTextEntry( 55, bottom - ( buttons++ * 22 ) + 2, 336, 108, 0x480, 0, "" );

                AddButton( 18, bottom - ( buttons * 22 ), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2 );
                AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Predefined Response", LabelColor32 ), false, false );

                if ( entry.Sender != m )
                {
                    AddButton( 18, bottom - ( buttons * 22 ), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
                    AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Go to Sender", LabelColor32 ), false, false );
                }

                AddHtml( 18, 58, 110, 20, Color( "Handler:", LabelColor32 ), false, false );

                if ( entry.Handler == null )
                {
                    AddHtml( 128, 58, 264, 20, Color( "Unhandled", LabelColor32 ), false, false );

                    AddButton( 18, bottom - ( buttons * 22 ), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0 );
                    AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Delete Page", LabelColor32 ), false, false );

                    AddButton( 18, bottom - ( buttons * 22 ), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0 );
                    AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Handle Page", LabelColor32 ), false, false );
                }
                else
                {
                    AddLabelCropped( 128, 58, 264, 20, m_AccessLevelHues[(int) entry.Handler.AccessLevel], entry.Handler.Name );

                    if ( entry.Handler != m )
                    {
                        AddButton( 18, bottom - ( buttons * 22 ), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
                        AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Go to Handler", LabelColor32 ), false, false );
                    }
                    else
                    {
                        AddButton( 18, bottom - ( buttons * 22 ), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0 );
                        AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Abandon Page", LabelColor32 ), false, false );

                        AddButton( 18, bottom - ( buttons * 22 ), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0 );
                        AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Page Handled", LabelColor32 ), false, false );
                    }
                }

                AddHtml( 18, 78, 110, 20, Color( "Page Location:", LabelColor32 ), false, false );
                AddHtml( 128, 78, 264, 20, Color( String.Format( "{0} [{1}]", entry.PageLocation, entry.PageMap ), LabelColor32 ), false, false );

                AddButton( 18, bottom - ( buttons * 22 ), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
                AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "Go to Page Location", LabelColor32 ), false, false );

                if ( entry.SpeechLog != null )
                {
                    AddButton( 18, bottom - ( buttons * 22 ), 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0 );
                    AddHtml( 52, bottom - ( buttons++ * 22 ), 200, 20, Color( "View Speech Log", LabelColor32 ), false, false );
                }

                AddHtml( 18, 98, 110, 20, Color( "Page Type:", LabelColor32 ), false, false );
                AddHtml( 128, 98, 264, 20, Color( PageQueue.GetPageTypeName( entry.Type ), LabelColor32 ), false, false );

                AddHtml( 18, 118, 110, 20, Color( "Message:", LabelColor32 ), false, false );
                AddHtml( 128, 118, 250, 100, entry.Message, true, true );

                AddPage( 2 );

                ArrayList preresp = PredefinedResponse.List;

                AddButton( 18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 );
                AddButton( 410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0 );

                if ( preresp.Count == 0 )
                {
                    AddHtml( 52, 18, 300, 20, Color( "There are no predefined responses.", LabelColor32 ), false, false );
                }
                else
                {
                    AddHtml( 52, 18, 200, 20, Color( "Back", LabelColor32 ), false, false );

                    for ( int i = 0; i < preresp.Count; ++i )
                    {
                        AddButton( 18, 40 + ( i * 22 ), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0 );
                        AddHtml( 52, 40 + ( i * 22 ), 200, 20, Color( ( (PredefinedResponse) preresp[i] ).Title, LabelColor32 ), false, false );
                    }
                }
            }
            catch ( Exception e )
            {
                Console.WriteLine( e );
            }
        }
Esempio n. 12
0
        public PageQueueGump(Mobile m)
            : base(30, 30)
        {
            Add(new GumpPage(0));

            if (m != null && m.NetState != null && m.NetState.IsEnhancedClient)
            {
                AddBackground(1, 1, 408, 446, 9300);
            }
            else
            {
                Add(new GumpImageTiled(0, 0, 410, 448, 0xA40));
                Add(new GumpAlphaRegion(1, 1, 408, 446));
            }

            Add(new GumpLabel(180, 12, 2100, "Page Queue"));

            ArrayList list = PageQueue.List;

            for (int i = 0; i < list.Count;)
            {
                PageEntry e = (PageEntry)list[i];

                if (e.Sender.Deleted)
                {
                    e.AddResponse(e.Sender, "[Logout]");
                    PageQueue.Remove(e);
                }
                else
                {
                    ++i;
                }
            }

            m_List = (PageEntry[])list.ToArray(typeof(PageEntry));

            if (m_List.Length > 0)
            {
                Add(new GumpPage(1));

                for (int i = 0; i < m_List.Length; ++i)
                {
                    PageEntry e = m_List[i];

                    if (i >= 5 && (i % 5) == 0)
                    {
                        AddButton(368, 12, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (i / 5) + 1);
                        Add(new GumpLabel(298, 12, 2100, "Next Page"));
                        Add(new GumpPage((i / 5) + 1));
                        AddButton(12, 12, 0xFAE, 0xFB0, 0, GumpButtonType.Page, (i / 5));
                        Add(new GumpLabel(48, 12, 2100, "Previous Page"));
                    }

                    string typeString = PageQueue.GetPageTypeName(e.Type);

                    string html = String.Format("[{0}] {1} <basefont color=#{2:X6}>[<u>{3}</u>]</basefont>", typeString, e.Message, e.Handler == null ? 0xFF0000 : 0xFF, e.Handler == null ? "Unhandled" : "Handling");

                    Add(new GumpHtml(12, 44 + ((i % 5) * 80), 350, 70, html, true, true));
                    AddButton(370, 44 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                Add(new GumpLabel(12, 44, 2100, "The page queue is empty."));
            }
        }
Esempio n. 13
0
        public PageEntryGump(Mobile m, PageEntry entry) : base(30, 30)
        {
            m_Mobile = m;
            m_Entry  = entry;

            var buttons = 0;

            var bottom = 356;

            AddPage(0);

            AddImageTiled(0, 0, 410, 456, 0xA40);
            AddAlphaRegion(1, 1, 408, 454);

            AddPage(1);

            AddLabel(18, 18, 2100, "Sent:");
            AddLabelCropped(128, 18, 264, 20, 2100, entry.Sent.ToString());

            AddLabel(18, 38, 2100, "Sender:");
            AddLabelCropped(
                128,
                38,
                264,
                20,
                2100,
                $"{entry.Sender.RawName} {entry.Sender.Location} [{entry.Sender.Map}]"
                );

            AddButton(18, bottom - buttons * 22, 0xFAB, 0xFAD, 8);
            AddImageTiled(52, bottom - buttons * 22 + 1, 340, 80, 0xA40 /*0xBBC*/ /*0x2458*/);
            AddImageTiled(53, bottom - buttons * 22 + 2, 338, 78, 0xBBC /*0x2426*/);
            AddTextEntry(55, bottom - buttons++ *22 + 2, 336, 78, 0x480, 0, "");

            AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
            AddLabel(52, bottom - buttons++ *22, 2100, "Predefined Response");

            if (entry.Sender != m)
            {
                AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 1);
                AddLabel(52, bottom - buttons++ *22, 2100, "Go to Sender");
            }

            AddLabel(18, 58, 2100, "Handler:");

            if (entry.Handler == null)
            {
                AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

                AddButton(18, bottom - buttons * 22, 0xFB1, 0xFB3, 5);
                AddLabel(52, bottom - buttons++ *22, 2100, "Delete Page");

                AddButton(18, bottom - buttons * 22, 0xFB7, 0xFB9, 4);
                AddLabel(52, bottom - buttons++ *22, 2100, "Handle Page");
            }
            else
            {
                AddLabelCropped(128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name);

                if (entry.Handler != m)
                {
                    AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 2);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Go to Handler");
                }
                else
                {
                    AddButton(18, bottom - buttons * 22, 0xFA2, 0xFA4, 6);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Abandon Page");

                    AddButton(18, bottom - buttons * 22, 0xFB7, 0xFB9, 7);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Page Handled");
                }
            }

            AddLabel(18, 78, 2100, "Page Location:");
            AddLabelCropped(128, 78, 264, 20, 2100, $"{entry.PageLocation} [{entry.PageMap}]");

            AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 3);
            AddLabel(52, bottom - buttons++ *22, 2100, "Go to Page Location");

            if (entry.SpeechLog != null)
            {
                AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 10);
                AddLabel(52, bottom - buttons * 22, 2100, "View Speech Log");
            }

            AddLabel(18, 98, 2100, "Page Type:");
            AddLabelCropped(128, 98, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type));

            AddLabel(18, 118, 2100, "Message:");
            AddHtml(128, 118, 250, 100, entry.Message, true, true);

            AddPage(2);

            var preresp = PredefinedResponse.List;

            AddButton(18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
            AddButton(410 - 18 - 32, 18, 0xFAB, 0xFAC, 9);

            if (preresp.Count == 0)
            {
                AddLabel(52, 18, 2100, "There are no predefined responses.");
            }
            else
            {
                AddLabel(52, 18, 2100, "Back");

                for (var i = 0; i < preresp.Count; ++i)
                {
                    AddButton(18, 40 + i * 22, 0xFA5, 0xFA7, 100 + i);
                    AddLabel(52, 40 + i * 22, 2100, preresp[i].Title);
                }
            }
        }
Esempio n. 14
0
        public static void Enqueue( PageEntry entry )
        {
            m_List.Add( entry );
            m_KeyedBySender[entry.Sender] = entry;

            foreach ( NetState ns in NetState.Instances )
            {
                Mobile m = ns.Mobile;

                if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && !IsHandling( m ) )
                    m.SendAsciiMessage( "A new page has been placed in the queue." );
            }
        }
Esempio n. 15
0
 public InternalTimer(PageEntry entry)
     : base(TimeSpan.FromSeconds(1.0), StatusDelay)
 {
     m_Entry = entry;
 }
Esempio n. 16
0
			public InternalTimer( PageEntry entry ) : base( TimeSpan.FromSeconds( 1.0 ), StatusDelay )
			{
				m_Entry = entry;
			}
Esempio n. 17
0
 public static int IndexOf(PageEntry e)
 {
     return(m_List.IndexOf(e));
 }
Esempio n. 18
0
		public static int IndexOf( PageEntry e )
		{
			return m_List.IndexOf( e );
		}
Esempio n. 19
0
        public static void Enqueue( PageEntry entry )
        {
            m_List.Add( entry );
            m_KeyedBySender[entry.Sender] = entry;

            //bool isStaffOnline = false;

            foreach ( GameClient ns in GameServer.Instance.Clients )
            {
                Mobile m = ns.Mobile;

                if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && !IsHandling( m ) )
                {
                    m.SendMessage( "A new page has been placed in the queue." );

                    if ( !m.HasGump( typeof( PagePendingGump ) ) )
                        m.SendGump( new PagePendingGump() );
                }

                //if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && m.LastMoveTime >= ( DateTime.Now - TimeSpan.FromMinutes( 10.0 ) ) )
                //	isStaffOnline = true;
            }

            //if ( !isStaffOnline )
            //	entry.Sender.SendMessage( "We are sorry, but no staff members are currently available to assist you.  Your page will remain in the queue until one becomes available, or until you cancel it manually." );
        }
Esempio n. 20
0
		public static void Enqueue( PageEntry entry )
		{
			m_List.Add( entry );
			m_KeyedBySender[entry.Sender] = entry;

			bool isStaffOnline = false;

			foreach ( NetState ns in NetState.Instances )
			{
				Mobile m = ns.Mobile;

				if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && !IsHandling( m ) )
					m.SendMessage( "A new page has been placed in the queue." );

				if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && m.LastMoveTime >= (DateTime.Now - TimeSpan.FromMinutes( 10.0 )) )
					isStaffOnline = true;
			}

			if ( !isStaffOnline )
				entry.Sender.SendMessage( "We are sorry, but no staff members are currently available to assist you.  Your page will remain in the queue until one becomes available, or until you cancel it manually." );

			if ( Email.FromAddress != null && Email.SpeechLogPageAddresses != null && entry.SpeechLog != null )
				SendEmail( entry );
		}
Esempio n. 21
0
        public static void Remove( PageEntry e )
        {
            if ( e == null )
                return;

            e.Stop();

            m_List.Remove( e );
            m_KeyedBySender.Remove( e.Sender );

            if ( e.Handler != null )
                m_KeyedByHandler.Remove( e.Handler );

            if ( m_List.Count == 0 )
            {
                foreach ( GameClient ns in GameServer.Instance.Clients )
                {
                    Mobile m = ns.Mobile;

                    if ( m != null && m.AccessLevel >= AccessLevel.Counselor )
                        m.CloseGump( typeof( PagePendingGump ) );
                }
            }
        }
Esempio n. 22
0
//		private static int GetHueFor( Mobile m )
//		{
//			switch ( m.AccessLevel )
//			{
//				case AccessLevel.Owner: return 0x35;
//				case AccessLevel.Administrator: return 0x516;
//				case AccessLevel.Seer: return 0x144;
//				case AccessLevel.GameMaster: return 0x21;
//				case AccessLevel.Counselor: default: return 0x2;
//			}
//		}
//		private static int[] m_AccessLevelHues = new int[]
//			{
//				/*
//				 * 
//				OldPlayer = 0,
//				OldCounselor = 1,
//				OldGameMaster = 2,
//				OldSeer = 3,
//				OldAdministrator = 4,
//				Player = 100,
//				Reporter = 115,
//				FightBroker = 130,
//				Counselor = 145,
//				GameMaster = 160,
//				Seer = 175,
//				Administrator = 205,
//				Owner = 220,
//				ReadOnly = 255
//				 * */
//
//				2100, // player
//				2122, // counselor
//				2117, // game master
//				2129, // seer
//				2415, // administrator
//
//
//				2100, // player
//				2122, // counselor
//			2122, // Reporter
//			2122, // FightBroker
//				2117, // game master
//				2129, // seer
//				2415, // administrator
//			2415, // readonly
//			};

		public PageEntryGump( Mobile m, PageEntry entry ) : base( 30, 30 )
		{
			m_Mobile = m;
			m_Entry = entry;

			int buttons = 0;

			int bottom = 336;

			AddPage( 0 );

			AddImageTiled( 0, 0, 410, 436, 0xA40 );
			AddAlphaRegion( 1, 1, 408, 434 );

			AddPage( 1 );

			AddLabel( 18, 18, 2100, "Sent:" );
			AddLabelCropped( 128, 18, 264, 20, 2100, entry.Sent.ToString() );

			AddLabel( 18, 38, 2100, "Sender:" );
			AddLabelCropped( 128, 38, 264, 20, 2100, String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ) );

			AddButton( 18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 );
			AddImageTiled( 52, bottom - (buttons * 22) + 1, 340, 80, 0xA40/*0xBBC*//*0x2458*/ );
			AddImageTiled( 53, bottom - (buttons * 22) + 2, 338, 78, 0xBBC/*0x2426*/ );
			AddTextEntry( 55, bottom - (buttons++ * 22) + 2, 336, 78, 0x480, 0, "" );

			AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2 );
			AddLabel( 52, bottom - (buttons++ * 22), 2100, "Predefined Response" );

			if ( entry.Sender != m )
			{
				AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
				AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Sender" );
			}

			AddLabel(  18, 58, 2100, "Handler:" );

			if ( entry.Handler == null )
			{
				AddLabelCropped( 128, 58, 264, 20, 2100, "Unhandled" );

				AddButton( 18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0 );
				AddLabel( 52, bottom - (buttons++ * 22), 2100, "Delete Page" );

				AddButton( 18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0 );
				AddLabel( 52, bottom - (buttons++ * 22), 2100, "Handle Page" );
			}
			else
			{
				AddLabelCropped( 128, 58, 264, 20, entry.Handler.GetHueForNameInList(), entry.Handler.Name );

				if ( entry.Handler != m )
				{
					AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Handler" );
				}
				else
				{
					AddButton( 18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "Abandon Page" );

					AddButton( 18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0 );
					AddLabel( 52, bottom - (buttons++ * 22), 2100, "Page Handled" );
				}
			}

			AddLabel(  18, 78, 2100, "Page Location:" );
			AddLabelCropped( 128, 78, 264, 20, 2100, String.Format( "{0} [{1}]", entry.PageLocation, entry.PageMap ) );

			AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
			AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Page Location" );

			AddLabel(  18, 98, 2100, "Page Type:" );
			AddLabelCropped( 128, 98, 264, 20, 2100, entry.Type.ToString() );

			AddLabel(  18, 118, 2100, "Message:" );
			AddHtml(  128, 118, 250, 100, entry.Message, true, true );

			AddPage( 2 );

			ArrayList preresp = PredefinedResponse.List;

			AddButton( 18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 );
			AddButton( 410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0 );

			if ( preresp.Count == 0 )
			{
				AddLabel( 52, 18, 2100, "There are no predefined responses." );
			}
			else
			{
				AddLabel( 52, 18, 2100, "Back" );

				for ( int i = 0; i < preresp.Count; ++i )
				{
					AddButton( 18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0 );
					AddLabel( 52, 40 + (i * 22), 2100, ((PredefinedResponse)preresp[i]).Title );
				}
			}
		}
Esempio n. 23
0
        public static void Enqueue(PageEntry entry)
        {
            if (entry.Sender is PlayerMobile)
            {
                LoggingCustom.Log("LOG_Pages.txt",
                    DateTime.Now + "\t" + entry.Sender + "\t" +
                    (entry.Sender != null ? entry.Sender.Account.ToString() : "") + "\t" + entry.Message);
            }
            m_List.Add(entry);
            m_KeyedBySender[entry.Sender] = entry;

            //bool isStaffOnline = false;

            foreach (NetState ns in NetState.Instances)
            {
                Mobile m = ns.Mobile;

                if (m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && !IsHandling(m))
                    m.SendMessage("A new page has been placed in the queue.");

                //if ( m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify && m.LastMoveTime >= (DateTime.UtcNow - TimeSpan.FromMinutes( 10.0 )) )
                //isStaffOnline = true;
            }

            // if ( !isStaffOnline )
            //		entry.Sender.SendMessage( "We are sorry, but no staff members are currently available to assist you.  Your page will remain in the queue until one becomes available, or until you cancel it manually." );

            //if ( Email.SpeechLogPageAddresses != null && entry.SpeechLog != null )
            //	SendEmail( entry );
        }