Exemple #1
0
 protected override void OnTick()
 {
     for (int i = 0; i < Counter.List.Count; i++)
     {
         ((Counter)Counter.List[i]).Flag = false;
     }
     ClientCommunication.RequestTitlebarUpdate();
 }
Exemple #2
0
 protected override void OnTick()
 {
     m_Count++;
     if (m_Count > 30)
     {
         Stop();
     }
     ClientCommunication.RequestTitlebarUpdate();
 }
Exemple #3
0
        public static void Start()
        {
            m_Count = 0;

            if (m_Timer.Running)
            {
                m_Timer.Stop();
            }
            m_Timer.Start();
            ClientCommunication.RequestTitlebarUpdate();
        }
Exemple #4
0
 public void ResetCriminalTimer()
 {
     if (m_CriminalStart == DateTime.MinValue || DateTime.Now - m_CriminalStart >= TimeSpan.FromSeconds(1))
     {
         m_CriminalStart = DateTime.Now;
         if (m_CriminalTime == null)
         {
             m_CriminalTime = new CriminalTimer(this);
         }
         m_CriminalTime.Start();
         ClientCommunication.RequestTitlebarUpdate();
     }
 }
Exemple #5
0
        public static void Play()
        {
            if (m_Recording || Playing || m_GZIn == null)
            {
                return;
            }

            if (World.Player == null)
            {
                MessageBox.Show(Engine.MainWindow, "You must be logged in to ANY shard to play a packet video.", "Must Log in", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            btnPlay.Enabled = btnStop.Enabled = btnClose.Enabled = btnRec.Enabled = false;
            btnPlay.Text    = "Pause";

            // save the real player data
            m_TempWriter = new BinaryWriter(new MemoryStream());
            World.Player.SaveState(m_TempWriter);

            //m_InStream = new BinaryReader( new FileStream( fileName, FileMode.Open, FileAccess.Read, FileShare.Read ) );

            m_Playing = true;
            ClientCommunication.SetAllowDisconn(false);

            ClientCommunication.BringToFront(ClientCommunication.FindUOWindow());

            //ClientCommunication.SetDeathMsg( "Playing..." );
            ClientCommunication.ForceSendToClient(new DeathStatus(true));

            RemoveAll();

            m_GZIn.Seek(m_StartPos, SeekOrigin.Begin);

            LoadWorldState();

            m_PlayTimer = Timer.DelayedCallback(FadeDelay, m_BeginPlay);
            m_PlayTimer.Start();
            tbPos.Value = tbPos.Minimum;

            m_Elapsed = TimeSpan.Zero;
            UpdateTimeText();

            ClientCommunication.RequestTitlebarUpdate();
        }
Exemple #6
0
 protected override void OnNotoChange(byte old, byte cur)
 {
     if ((old == 3 || old == 4) && (cur != 3 && cur != 4))
     {
         // grey is turning off
         // SendMessage( "You are no longer a criminal." );
         if (m_CriminalTime != null)
         {
             m_CriminalTime.Stop();
         }
         m_CriminalStart = DateTime.MinValue;
         ClientCommunication.RequestTitlebarUpdate();
     }
     else if ((cur == 3 || cur == 4) && (old != 3 && old != 4 && old != 0))
     {
         // grey is turning on
         ResetCriminalTimer();
     }
 }
Exemple #7
0
        private static void EndPlayback()
        {
            m_PlayTimer = null;

            m_Playing = false;
            ClientCommunication.SetAllowDisconn(true);
            //ClientCommunication.SetDeathMsg( "You are dead." );

            PlayerData player;

            using (BinaryReader reader = new BinaryReader(m_TempWriter.BaseStream))
            {
                reader.BaseStream.Seek(0, SeekOrigin.Begin);
                player = World.Player = new PlayerData(reader, PlayerVersion);
            }
            m_TempWriter.Close();

            player.Contains.Clear();
            World.AddMobile(player);

            DoLogin(player);

            tbPos.Enabled = btnClose.Enabled = btnPlay.Enabled = btnStop.Enabled = btnRec.Enabled = true;
            tbPos.Value   = tbPos.Minimum;

            m_Elapsed = TimeSpan.Zero;
            UpdateTimeText();

            ClientCommunication.SendToClient(new MoveReject(World.Player.WalkSequence, World.Player));
            ClientCommunication.SendToServer(new ResyncReq());
            World.Player.Resync();
            ClientCommunication.RequestTitlebarUpdate();

            if (ClientCommunication.AllowBit(FeatureBit.LightFilter) && World.Player != null)
            {
                World.Player.LocalLightLevel = 0;

                ClientCommunication.SendToClient(new GlobalLightLevel(0));
                ClientCommunication.SendToClient(new PersonalLightLevel(World.Player));
            }
        }
Exemple #8
0
 public static void Stop()
 {
     m_Timer.Stop();
     ClientCommunication.RequestTitlebarUpdate();
 }
Exemple #9
0
 protected override void OnTick()
 {
     ClientCommunication.RequestTitlebarUpdate();
 }
Exemple #10
0
        private void Cast()
        {
            if (Config.GetBool("SpellUnequip") && ClientCommunication.AllowBit(FeatureBit.UnequipBeforeCast))
            {
                Item pack = World.Player.Backpack;
                if (pack != null)
                {
                    // dont worry about uneqipping RuneBooks or SpellBooks
                    Item item = World.Player.GetItemOnLayer(Layer.RightHand);
#if DEBUG
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield)
#else
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA)
#endif
                    {
                        DragDropManager.Drag(item, item.Amount);
                        DragDropManager.Drop(item, pack);
                    }

                    item = World.Player.GetItemOnLayer(Layer.LeftHand);
#if DEBUG
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield)
#else
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA)
#endif
                    {
                        DragDropManager.Drag(item, item.Amount);
                        DragDropManager.Drop(item, pack);
                    }
                }
            }

            for (int i = 0; i < Counter.List.Count; i++)
            {
                ((Counter)Counter.List[i]).Flag = false;
            }

            if (Config.GetBool("HighlightReagents"))
            {
                for (int r = 0; r < Reagents.Length; r++)
                {
                    for (int i = 0; i < Counter.List.Count; i++)
                    {
                        Counter c = (Counter)Counter.List[i];
                        if (c.Enabled && c.Format.ToLower() == Reagents[r])
                        {
                            c.Flag = true;
                            break;
                        }
                    }
                }

                if (m_UnflagTimer != null)
                {
                    m_UnflagTimer.Stop();
                }
                else
                {
                    m_UnflagTimer = new UnflagTimer();
                }
                m_UnflagTimer.Start();
            }

            ClientCommunication.RequestTitlebarUpdate();
            ClientCommunication.PostSpellCast(this.Number);

            if (World.Player != null)
            {
                World.Player.LastSpell  = GetID();
                LastCastTime            = DateTime.Now;
                Targeting.SpellTargetID = 0;
            }
        }
Exemple #11
0
 private static void UpdateTimeText()
 {
     lblTime.Text = ElapsedString;
     ClientCommunication.RequestTitlebarUpdate();
 }