Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CancelationToken has already been disposed #643

Open
lionaneesh opened this issue Dec 20, 2024 · 2 comments
Open

CancelationToken has already been disposed #643

lionaneesh opened this issue Dec 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@lionaneesh
Copy link

Description

Hello, in CastingHandler.cs there is cancelation token which can sometimes crash the bot. I think we should check if the token has been disposed or try catch that.

Addon Version

Latest

World of Warcraft Client

World of Warcraft Classic

Reproduction Steps

Its hard to reproduce it.

Last Good Version

No

Screenshots

No response

Logs

No response

@lionaneesh lionaneesh added the bug Something isn't working label Dec 20, 2024
@Xian55
Copy link
Owner

Xian55 commented Dec 20, 2024

Please provide logs to look at it.

Do not alter the log just upload the raw file.

And the used ClassProfile as well!

Thanks

@Xian55
Copy link
Owner

Xian55 commented Dec 29, 2024

Recently i've added a new feature #649 which more extensively uses the CancellationToken.

After conducting extensive testing i was failed to reproduce the the mentioned issue.

I've primarily tested KeyAction.Interrupt feature with

Also here's a test one with a low level(6-8lvl) mage profile which primarily uses Fireball. The Fireball DoT can trigger the Fire Blast conditions at various time window of the in progress cast.

{
  "ClassName": "Mage",
  "Loot": true,
  "PathFilename": "5_Gnome.json",
  "PathThereAndBack": true,
  "PathReduceSteps": false,
  "IntVariables": {
    "Item_Conjure_Drink": 5350,
    "Item_Conjure_Food": 5349,
    "MIN_FOOD%": 50,
    "MIN_WATER%": 50,
    "MIN_MANA_SPELL%": 10
  },
  "Pull": {
    "Sequence": [
      {
        "Name": "Frostbolt",
        "Key": "1",
        "HasCastBar": true,
        "Requirements": [
          "SpellInRange:3",
          "Mana% > MIN_MANA_SPELL%"
        ]
      },
      {
        "Name": "Shoot",
        "Key": "0",
        "Item": true,
        "Requirements": [
          "HasRangedWeapon",
          "!Shooting",
          "SpellInRange:1",
          "Mana% < MIN_MANA_SPELL%"
        ]
      },
      {
        "Name": "Approach",
        "Requirements": [
          "!Casting",
          "!Shooting"
        ]
      }
    ]
  },
  "Flee": {
    "Sequence": [
      {
        "Name": "Flee",
        "Requirement": "(MobCount > 1 && Health% < 60) || TargetElite" 
      }
    ]
  },
  "Combat": {
    "Sequence": [
      {
        "Name": "Fire Blast",
        "Key": "5",
        "Requirements": [
          "TargetAlive && TargetHealth% < 35",
          "SpellInRange:4"
        ]
      },
      {
        "Name": "Fireball",
        "Key": "2",
        "HasCastBar": true,
        "AfterCastWaitCastbar": true,
        "Requirements": [
          "Mana% > MIN_MANA_SPELL%",
          "TargetHealth% > 35"
        ],
        "Interrupt": "CanRun:Fire Blast",
        "CancelOnInterrupt": true
      },
      {
        "Name": "Shoot",
        "Key": "0",
        "Item": true,
        "Requirements": [
          "HasRangedWeapon",
          "!Shooting",
          "SpellInRange:1"
        ]
      },
      {
        "Name": "AutoAttack",
        "Requirements": [
          "!HasRangedWeapon",
          "!AutoAttacking"
        ]
      },
      {
        "Name": "Approach",
        "Requirements": [
          "!Casting",
          "AutoAttacking"
        ]
      }
    ]
  },
  "Parallel": {
    "Sequence": [
      {
        "Name": "Food",
        "Key": "=",
        "Requirement": "Health% < MIN_FOOD%"
      },
      {
        "Name": "Drink",
        "Key": "-",
        "Requirement": "Mana% < MIN_WATER%"
      }
    ]
  },
  "Adhoc": {
    "Sequence": [
      {
        "Name": "Frost Armor",
        "Key": "3",
        "Requirement": "!Frost Armor"
      },
      {
        "Name": "Arcane Intellect",
        "Key": "4",
        "Requirement": "!Arcane Intellect",
        "Log": false
      },
      {
        "Name": "Conjure Drink",
        "Key": "9",
        "HasCastBar": true,
        "Requirement": "!BagItem:Item_Conjure_Drink:4",
        "AfterCastWaitCastbar": true,
        "AfterCastWaitBag": true
      },
      {
        "Name": "Conjure Food",
        "Key": "8",
        "HasCastBar": true,
        "Requirement": "!BagItem:Item_Conjure_Food:4",
        "AfterCastWaitCastbar": true,
        "AfterCastWaitBag": true
      }
    ]
  },
  "NPC": {
    "Sequence": [
      {
        "Cost": 6,
        "Name": "Repair",
        "Key": "C",
        "Requirement": "Durability% < 35",
        "PathFilename": "5_Gnome_Vendor.json"
      },
      {
        "Cost": 6,
        "Name": "Sell",
        "Key": "C",
        "Requirements": [
          "BagFull",
          "BagGreyItem"
        ],
        "PathFilename": "5_Gnome_Vendor.json"
      }
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants