Ejemplo n.º 1
0
        public DirtyDeeds()
        {
            InitializeComponent();

            if (!MagicHelpers.SetDebugPrivileges())
            {
                MessageBox.Show("Failed to set debug privileges. Run as Administrator.");
                return;
            }

            InstallFont();

            //clientsComboBox.DataSource = games;
            UpdateGames();
            UpdateTrayItemList();

            hookProc    = new HookProc(HookCallback);
            keyHookId   = SetKeyHook(hookProc);
            mouseHookId = SetMouseHook(hookProc);

            ItemProcessingSettings = new ItemProcessingSettings(ItemConfigFileName);
            ItemProcessingSettings.Load();

            LoadSettings();

            clientsToolStripMenuItem.DropDown.Closing += RestrictClosing;

            //var testForm = new TestForm();
            //testForm.Show();
        }
Ejemplo n.º 2
0
        public bool ItemActionHandler(byte[] data)
        {
            var i = ReadItemAction(data);

            if (i == null)
            {
                return(true);
            }

            switch (i.action)
            {
            case ItemActionType.Equip:
            case ItemActionType.IndirectlySwapBodyItem:
            case ItemActionType.Unequip:
            case ItemActionType.SwapBodyItem:
                break;
            }

            if (!Settings.ReceivePacketHack.ItemTracker.Enabled)
            {
                return(true);
            }

            if (Pickit == null /* || pickit.fullInventory*/)
            {
                return(true);
            }

            var itemInfo = ItemStorage.GetInfo(i.code);

            if (itemInfo == null)
            {
                return(true);
            }

            var matchingEntries = ItemProcessingSettings.GetMatches(itemInfo, (uint)i.sockets, i.IsEth, i.quality);

            i.info           = itemInfo;
            i.processingInfo = matchingEntries.Where(it => it.Pick).ToList();

            var log  = matchingEntries.Where(it => it.Log).Count() != 0;
            var pick = Settings.ReceivePacketHack.ItemTracker.EnablePickit.IsEnabled() && (!IsInTown() || Settings.ReceivePacketHack.ItemTracker.TownPick.IsEnabled()) ? i.processingInfo.Count != 0 : false;

            if (i.quality == ItemQuality.Set && Settings.ReceivePacketHack.ItemTracker.LogSets.IsEnabled() ||
                i.quality == ItemQuality.Unique && Settings.ReceivePacketHack.ItemTracker.LogUniques.IsEnabled() ||
                itemInfo.IsRune() && Settings.ReceivePacketHack.ItemTracker.LogRunes.IsEnabled() ||
                log && Settings.ReceivePacketHack.ItemTracker.LogItems.IsEnabled())
            {
                LogDrop(i);
            }

            if (pick)
            {
                Task.Factory.StartNew(() => Pickit.AddPendingItem(i));
                //Log("Added {0} {1} to pickit", i.code, i.uid);
            }

            return(true);
        }