Пример #1
0
        private void OnDisconnected()
        {
            PacketHandlers.Party.Clear();
            //TODO reset window title
            Engine.MainWindow.UpdateTitle();
            UOAssist.PostLogout();

            World.Player = null;
            World.Items.Clear();
            World.Mobiles.Clear();
            Macros.MacroManager.Stop();
            ActionQueue.Stop();
            Counter.Reset();
            GoldPerHourTimer.Stop();
            BandageTimer.Stop();
            GateTimer.Stop();
            BuffsTimer.Stop();
            StealthSteps.Unhide();
            Engine.MainWindow.OnLogout();
            if (Engine.MainWindow.MapWindow != null)
            {
                Engine.MainWindow.MapWindow.Close();
            }
            PacketHandlers.Party.Clear();
            PacketHandlers.IgnoreGumps.Clear();
            Config.Save();
        }
Пример #2
0
        private void OnLogout(bool fake)
        {
            if (!fake)
            {
                PacketHandlers.Party.Clear();

                SetTitleStr("");
                Engine.MainWindow.UpdateTitle();
                UOAssist.PostLogout();
                m_ConnStart = DateTime.MinValue;
            }

            World.Player = null;
            World.Items.Clear();
            World.Mobiles.Clear();
            Macros.MacroManager.Stop();
            ActionQueue.Stop();
            Counter.Reset();
            GoldPerHourTimer.Stop();
            DamageTracker.Stop();
            BandageTimer.Stop();
            GateTimer.Stop();
            BuffsTimer.Stop();
            StealthSteps.Unhide();
            Engine.MainWindow.OnLogout();
            if (Engine.MainWindow.MapWindow != null)
            {
                Engine.MainWindow.MapWindow.Close();
            }
            PacketHandlers.Party.Clear();
            PacketHandlers.IgnoreGumps.Clear();
            Config.Save();

            //TranslateEnabled = false;
        }
Пример #3
0
        internal static int Drag(Item i, int amount, bool fromClient, bool doLast)
        {
            LiftReq lr   = new LiftReq(i.Serial, amount, fromClient, doLast);
            LiftReq prev = null;

            if (Full)
            {
                Log("Queue FULL {0}", lr);
                World.Player.SendMessage(MsgLevel.Error, LocString.DragDropQueueFull);
                if (fromClient)
                {
                    Assistant.Client.Instance.SendToClient(new LiftRej());
                }
                return(0);
            }

            Log("Queuing Drag request {0}", lr);

            if (m_Back >= m_LiftReqs.Length)
            {
                m_Back = 0;
            }

            if (m_Back <= 0)
            {
                prev = m_LiftReqs[m_LiftReqs.Length - 1];
            }
            else if (m_Back <= m_LiftReqs.Length)
            {
                prev = m_LiftReqs[m_Back - 1];
            }

            // if the current last req must stay last, then insert this one in its place
            if (prev != null && prev.DoLast)
            {
                Log("Back-Queuing {0}", prev);
                if (m_Back <= 0)
                {
                    m_LiftReqs[m_LiftReqs.Length - 1] = lr;
                }
                else if (m_Back <= m_LiftReqs.Length)
                {
                    m_LiftReqs[m_Back - 1] = lr;
                }

                // and then re-insert it at the end
                lr = prev;
            }

            m_LiftReqs[m_Back++] = lr;

            ActionQueue.SignalLift(!fromClient);
            return(lr.Id);
        }
Пример #4
0
        public static int Drag(Item i, int amount, bool fromClient, bool doLast)
        {
            LiftReq lr   = new LiftReq(i.Serial, amount, fromClient, doLast);
            LiftReq prev = null;

            if (Full)
            {
                if (fromClient)
                {
                    ClientCommunication.SendToClient(new LiftRej());
                }
                return(0);
            }

            Log("Queuing Drag request {0}", lr);

            if (m_Back >= m_LiftReqs.Length)
            {
                m_Back = 0;
            }

            if (m_Back <= 0)
            {
                prev = m_LiftReqs[m_LiftReqs.Length - 1];
            }
            else if (m_Back <= m_LiftReqs.Length)
            {
                prev = m_LiftReqs[m_Back - 1];
            }

            // if the current last req must stay last, then insert this one in its place
            if (prev != null && prev.DoLast)
            {
                Log("Back-Queuing {0}", prev);
                if (m_Back <= 0)
                {
                    m_LiftReqs[m_LiftReqs.Length - 1] = lr;
                }
                else if (m_Back <= m_LiftReqs.Length)
                {
                    m_LiftReqs[m_Back - 1] = lr;
                }

                // and then re-insert it at the end
                lr = prev;
            }

            m_LiftReqs[m_Back++] = lr;

            ActionQueue.SignalLift(!fromClient);
            return(lr.Id);
        }
Пример #5
0
        private static void OnDisconnected()
        {
            PacketHandlers.Party.Clear();



            World.Player = null;
            World.Items.Clear();
            World.Mobiles.Clear();
            ActionQueue.Stop();

            BuffsTimer.Stop();

            PacketHandlers.Party.Clear();
            PacketHandlers.IgnoreGumps.Clear();
        }
Пример #6
0
 private static void OnLogout(bool fake)
 {
     World.Player = null;
     World.Items.Clear();
     World.Mobiles.Clear();
     Macros.MacroManager.Stop();
     ActionQueue.Stop();
     StealthSteps.Unhide();
     Engine.MainWindow.OnLogout();
     if (Engine.MainWindow.MapWindow != null)
     {
         Engine.MainWindow.MapWindow.Close();
     }
     PacketHandlers.Party.Clear();
     PacketHandlers.IgnoreGumps.Clear();
     Config.Save();
 }
Пример #7
0
        public static bool DoubleClick(object clicked, bool silent)
        {
            Serial s;

            if (clicked is Mobile)
            {
                s = ((Mobile)clicked).Serial.Value;
            }
            else if (clicked is Item)
            {
                s = ((Item)clicked).Serial.Value;
            }
            else if (clicked is Serial)
            {
                s = ((Serial)clicked).Value;
            }
            else
            {
                s = Serial.Zero;
            }

            if (s != Serial.Zero)
            {
                Item free = null, pack = World.Player.Backpack;
                if (s.IsItem && pack != null && Config.GetBool("PotionEquip") &&
                    Client.Instance.AllowBit(FeatureBit.AutoPotionEquip))
                {
                    Item i = World.FindItem(s);
                    if (i != null && i.IsPotion && i.ItemID != 3853) // dont unequip for exploison potions
                    {
                        // dont worry about uneqipping RuneBooks or SpellBooks
                        Item left  = World.Player.GetItemOnLayer(Layer.LeftHand);
                        Item right = World.Player.GetItemOnLayer(Layer.RightHand);

                        if (left != null && (right != null || left.IsTwoHanded))
                        {
                            free = left;
                        }
                        else if (right != null && right.IsTwoHanded)
                        {
                            free = right;
                        }

                        if (free != null)
                        {
                            if (DragDropManager.HasDragFor(free.Serial))
                            {
                                free = null;
                            }
                            else
                            {
                                DragDropManager.DragDrop(free, pack);
                            }
                        }
                    }
                }

                ActionQueue.DoubleClick(silent, s);

                if (free != null)
                {
                    DragDropManager.DragDrop(free, World.Player, free.Layer, true);
                }

                if (s.IsItem)
                {
                    World.Player.m_LastObj = s;
                }
            }

            return(false);
        }
Пример #8
0
        private void OnLogout(bool fake)
        {
            if (!fake)
            {
                PacketHandlers.Party.Clear();

                Engine.MainWindow.UpdateTitle();
                // Felix Fix
                //foreach (WndRegEnt t in m_WndReg)
                //	DLLImport.Win.PostMessage((IntPtr)((WndRegEnt)t).Handle, (uint)Assistant.UOAssist.UOAMessage.LOGOUT, IntPtr.Zero, IntPtr.Zero);
                m_ConnectionStart = DateTime.MinValue;
            }

            Assistant.Client.Instance.SetTitleStr("");             // Restore titlebar standard

            if (World.Player != null)
            {
                // Stop forzato di tutti i thread agent
                RazorEnhanced.AutoLoot.AutoMode    = false;
                RazorEnhanced.Scavenger.AutoMode   = false;
                RazorEnhanced.BandageHeal.AutoMode = false;

                if (RazorEnhanced.Scripts.Timer != null)
                {
                    RazorEnhanced.Scripts.Timer.Close();
                }

                if (Assistant.Engine.MainWindow.AutolootCheckBox.Checked == true)
                {
                    Assistant.Engine.MainWindow.AutolootCheckBox.Checked = false;
                }

                if (Assistant.Engine.MainWindow.BandageHealenableCheckBox.Checked == true)
                {
                    Assistant.Engine.MainWindow.BandageHealenableCheckBox.Checked = false;
                }

                if (Assistant.Engine.MainWindow.ScavengerCheckBox.Checked == true)
                {
                    Assistant.Engine.MainWindow.ScavengerCheckBox.Checked = false;
                }

                if (Assistant.Engine.MainWindow.OrganizerStop.Enabled == true)
                {
                    Assistant.Engine.MainWindow.OrganizerStop.PerformClick();
                }

                if (Assistant.Engine.MainWindow.DressStopButton.Enabled == true)
                {
                    Assistant.Engine.MainWindow.DressStopButton.PerformClick();
                }

                if (Assistant.Engine.MainWindow.RestockStop.Enabled == true)
                {
                    Assistant.Engine.MainWindow.RestockStop.PerformClick();
                }

                if (Assistant.Engine.MainWindow.SellCheckBox.Checked == true)
                {
                    Assistant.Engine.MainWindow.SellCheckBox.Checked = false;
                }

                if (Assistant.Engine.MainWindow.BuyCheckBox.Checked == true)
                {
                    Assistant.Engine.MainWindow.BuyCheckBox.Checked = false;
                }

                if (RazorEnhanced.ToolBar.ToolBarForm != null)
                {
                    RazorEnhanced.ToolBar.ToolBarForm.Close();
                }

                if (RazorEnhanced.SpellGrid.SpellGridForm != null)
                {
                    RazorEnhanced.SpellGrid.SpellGridForm.Close();
                }

                //Stop video recorder
                Assistant.MainForm.StopVideoRecorder();
            }

            PlayerData.ExternalZ   = false;
            World.Player           = null;
            PlayerData.FastWalkKey = 0;
            World.Items.Clear();
            World.Mobiles.Clear();
            ActionQueue.Stop();
            StealthSteps.Unhide();

            PacketHandlers.Party.Clear();
            PacketHandlers.IgnoreGumps.Clear();
        }