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

Multiple initiative rolls at the same time result in lost rolls #27

Open
LtChae opened this issue Jun 18, 2020 · 11 comments
Open

Multiple initiative rolls at the same time result in lost rolls #27

LtChae opened this issue Jun 18, 2020 · 11 comments

Comments

@LtChae
Copy link

LtChae commented Jun 18, 2020

How to reproduce:
Make two initiative rolls in quick succession:
proof
For logging purposes, "Today" is 6/17/2020

Recommendation is to build a patch for the initiative order, and then merge it with whatever the current order is at the end.

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020 via email

@LtChae
Copy link
Author

LtChae commented Jun 18, 2020

I don't think that would matter, would it? The issue seems to be the time it takes to complete the roll. It gets the init order at the start, performs all the steps needed, and then replaces the init already stored with the one it builds. With two running at the same time there's a high chance that one will overwrite the other.

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020 via email

@LtChae
Copy link
Author

LtChae commented Jun 18, 2020

Doesn't the roll function send messages while it does its thing?

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020 via email

@LtChae
Copy link
Author

LtChae commented Jun 18, 2020

It's distressingly easy. Maybe something has changed about the data api?

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020

oh yeah, this quick again. lemme sleep on it. till then roll slower

@LtChae
Copy link
Author

LtChae commented Jun 18, 2020

Appreciate you taking a look at it!

Looks like the other process is waited on. That would mean that it has to finish doing the roll messages before it updates the init:

let diceResult = await functions.roll(client, message, params, channelEmoji, 'Initiative roll');

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020 via email

@SkyJedi
Copy link
Owner

SkyJedi commented Jun 18, 2020

its _better_but not bullet proof. I need to completely overhaul initiative to really fix the problem. so now just have players space out imitative rolls

@LtChae
Copy link
Author

LtChae commented Jun 18, 2020

Cool, iterative fixes get us there eventually.

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

2 participants