quisquous/cactbot

raidemulator can't reset battles correctly

choyike opened this issue · 8 comments

I'm trying out use the raidemulator to write my own scripts. It will work fine until July 10th. When I tried to load logs yesterday, a logs file only read first fight fine, it couldn't read other fights under the same log file correctly anymore. When the battle is wipe, it reports the following error. My logs files(include old files) have same error.
bug

By the way,I have tried masking my own scripts file,not using OVERLAY_WS to load raidemulator(using the url:https://quisquous.github.io/cactbot/ui/raidboss/raidemulator.html), clear the browser cache, use another network and so on,
it has the same error.

I try to split the logs into one file has only one fight, the raidemulator can read the file correctly.

I also encountered the same issue, and I've been trying to pinpoint the problem. Currently, I've noticed that this issue started occurring after c245ef6. However, I haven't made any progress on how to fix it. It seems like the Emulator's team initialization logic doesn't fully adapt to the new State update logic.

The code interrupts in the updateState function of AnalyzedEncounter.ts due to the inability to correctly retrieve the job.

I believe that the actual data parsing currently occurs after the load logic in the Raid Emulator, including ID and job information. This is causing the initialization of the party list to fail.

The issue only exists in non-first encounters.

Perhaps it's an issue with encounter segmentation, but I'm not entirely sure. Here is the partyList log:

  • 11|2023-08-30T21:02:53.0760000+08:00|8|1034xxxx|102Fxxxx|1031xxxx|102Fxxxx|1029xxxx|102Exxxx|102Bxxxx|102Cxxxx|d8ba31f23845f110
  • 11|2023-08-30T21:06:26.0640000+08:00|8|1034xxxx|1031xxxx|102Fxxxx|1029xxxx|102Exxxx|102Bxxxx|102Cxxxx|cd6d7cff39b8e2f2
  • 11|2023-08-30T21:08:07.2590000+08:00|8|1034xxxx|102Fxxxx|1031xxxx|102Fxxxx|1029xxxx|102Exxxx|102Bxxxx|102Cxxxx|a08937fe180a9eea
  • 11|2023-08-30T21:45:21.0270000+08:00|0|651c08c365944360

At 21:06, it seems like someone disconnected or something happened. Although the count is 8, there are only 7 IDs. I'm not sure if this is the reason?

This log was also given to me by someone else, so I don't know exactly what happened at that time.

This is the segmented encounter:
image

It seems to be caused by being split by the fflogs uploader.

edit: It seems not, even complete logs can cause problems.

I have been deeply troubled by this issue, as a large number of battle records were unusable. Therefore, I have been trying to figure out how to fix this problem.

Now, I have made some progress.

With this commit (edited), I can now successfully read battle records.

Hmm! What is the bug here, ultimately? Is it that nextState(0) can't find a state that nextState(encStart) can? That is kind of surprising to me.

(cc @valarnin)

@valarnin This happens with the 2nd and 3rd pulls in the log (and others) of the log you sent me.

Yeah, this is on my list of things to look into but it's a bit far down the list since it's resolved with a refresh when it happens.

For what it's worth, that's not true for me. The 2nd and 3rd pulls in the log you sent me always have this error, regardless of refreshes or db clears and reloads.