示例#1
0
 private static void StopEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         try
         {
             game.EndGameCommand();
             from.SendMessage("The game has been stopped.");
         }
         catch (EventException e)
         {
             from.SendMessage(e.ToString());
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         game.Started = false;
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         game.Started = false;
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StopEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
示例#2
0
            protected override void OnTick()
            {
                if (m_EndTime == DateTime.MinValue)
                {
                    m_EndTime    = DateTime.Now + m_Game.Length;
                    m_NextUpdate = DateTime.Now + TimeSpan.FromSeconds(10);
                }

                if (DateTime.Now > m_EndTime)
                {
                    m_Game.EndGameCommand();
                    Stop();
                }

                if (m_EndTime - DateTime.Now < TimeSpan.FromSeconds(60))
                {
                    this.Interval = TimeSpan.FromMilliseconds(500);
                }


                if (DateTime.Now >= m_NextUpdate)
                {
                    if (m_Game.m_UseGump)
                    {
                        m_Game.SendGMGump();
                        m_Game.SendPlayerGumps();
                    }
                    if (m_EndTime - DateTime.Now < TimeSpan.FromSeconds(60))
                    {
                        m_NextUpdate = DateTime.Now + TimeSpan.FromSeconds(1);
                    }
                    else
                    {
                        m_NextUpdate = DateTime.Now + TimeSpan.FromSeconds(10);
                    }
                }
            }
示例#3
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 1:
            {
                from.SendGump(new PropertiesGump(m_User, m_Game));
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 2:
            {
                from.SendGump(new PropertiesGump(m_User, m_Game.Supplier));
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 3:
            {
                m_Game.Supplier.OnDoubleClick(m_User);
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 4:
            {
                m_Game.Open = true;
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 5:
            {
                m_Game.Open = false;
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 6:
            {
                m_Game.StartCommand(m_User);
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 7:
            {
                m_Game.EndGameCommand();
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 8:
            {
                from.SendGump(new GameAdminGump(from, m_Game));
                m_Game.OnDoubleClick(m_User);
                break;
            }
            }
        }