baabaablackgoat / stalnks

stonks 📈 a small discord bot all about turnip exchange in animal crossing - new horizons that got out of hand AGAIN AAAAAAAA
Apache License 2.0
0 stars 2 forks source link

Players signed up for infinite should get a priority recheck after n sells to break up infinite queues #44

Closed baabaablackgoat closed 4 years ago

baabaablackgoat commented 4 years ago

Here's the plan of action:

Add a frozenSubgroup property

Once a certain threshold (most likely 9 visits) has been reached, check for high priority visitors. (Probably as a simple function)

Check if frozenSubgroup is not null (if it isn't throw an error cause things went wrong really badly), and then copy the entire current processingGroup property into frozenSubgroup (change the internal counter back to zero on this step maybe)

Set processingGroup to null and proceed to prioritize the currently waiting people.

Once a multi-subgroup gets created, check if frozenSubgroup exists. If it does, copy it back into processingGroup, null out frozenSubgroup, and proceed execution