Skip to content

PartyChanged event desync issues when players disconnect and reconnect #261

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

Open
valarnin opened this issue Apr 27, 2022 · 0 comments
Open

Comments

@valarnin
Copy link

Description

In a given instance, if a player disconnects and reconnects, the PartyChanged event either doesn't fire or doesn't have the reconnected player's details, causing raidboss trigger data.party.details object no longer knows about them.

Additional information

I use the following helper function for custom triggers:

const getRole = (data, targetId) => {
  const detail = data.party.details.find(d => d.id === targetId);
  const job = Util.jobEnumToJob(detail.job);
  return Util.jobToRole(job);
};

This is being used in the following trigger:

    {
      id: 'Custom - P4S Curtain Call Callouts',
      // Durations could be 12s, 22s, 32s, and 42s
      type: 'GainsEffect',
      netRegex: NetRegexes.gainsEffect({ effectId: 'AF4', capture: true }),
      condition: (data) => data.act === 'curtain' && ['Some Main', 'Some Alt'].includes(data.me),
      delaySeconds: (data, matches) => parseFloat(matches.duration) - (getRole(data, matches.targetId) === 'dps' ? 12 : 7),
      alertText: (_data, matches) => matches.target,
    }

This results in the following error stack when that trigger fires for the given player after they've disconnected and reconnected (trimmed irrelevant lines):

[2022-04-26 23:29:06] Info: cactbot2: BrowserConsole: Error in trigger: Custom - P4S Curtain Call Callouts (C:\Stuff\Games\ACT\Plugins\cactbot-0.23.10\cactbot\user\raidboss\custom-p4s.js) (Source: http://localhost:8080/ui/raidboss/raidboss.bundle.js, Line: 14512)
[2022-04-26 23:29:06] Info: cactbot2: BrowserConsole: TypeError: Cannot read properties of undefined (reading 'job') (Source: http://localhost:8080/ui/raidboss/raidboss.bundle.js, Line: 14519)
[2022-04-26 23:29:06] Info: cactbot2: BrowserConsole:     at getRole (C:\Stuff\Games\ACT\Plugins\cactbot-0.23.10\cactbot\user\raidboss\custom-p4s.js:26:40) (Source: http://localhost:8080/ui/raidboss/raidboss.bundle.js, Line: 14519)

Possibly related to #151.

Relevant Cactbot code segments:

https://github.com/quisquous/cactbot/blob/ed9b3b912a3107f3481cc5d92fa9b81349c68f5a/ui/raidboss/popup-text.ts#L519-L521

https://github.com/quisquous/cactbot/blob/ed9b3b912a3107f3481cc5d92fa9b81349c68f5a/resources/party.ts#L28-L48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant