-
Notifications
You must be signed in to change notification settings - Fork 38
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
Start games automatically #523
base: master
Are you sure you want to change the base?
Conversation
todo:
|
ccf2b42
to
41869b1
Compare
most of the important todos are done. there's a couple nice-to-haves as well:
|
44a5a89
to
6161944
Compare
now rebased on the django_update / django 4.2 branch. will get to your comments tomorrow/the day after. |
scheduled_time__lt=timezone.now() + timedelta(minutes=5, seconds=30), | ||
scheduled_time__gt=timezone.now() + timedelta(seconds=30), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I just check these times are correct? we are looking for games starting in the range now + 30s to now + 5m30s. would it also not be a good idea to pick up games in the past as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I just check these times are correct?
tl;dr: yes, i did break my pretty little head about those times, and i picked those on purpose. no, i do not think i necessarily picked the best choice.
would it also not be a good idea to pick up games in the past as well?
i thought about it, but i am honestly not sure. there is a lot of weird stuff that could happen i think. for example, players play a game that is not picked up for some reason and before the mods can add the gamelink, heltour starts a new game for them. that wouldn't be the end of the world of course. but if the game is ongoing, it might distract them.
or maybe players manage to somehow schedule a game for a time that already happened by accident. i think chesster would not allow this, but mods can manually schedule games, and there's less checking there. would still not be the end of the world of course.
at the same time, i do not really see the point in automatically starting games that should have happened a while ago. if the game did not start, or heltour thinks the game did not start, there might be a reason for that, and it might be better to not start it automatically.
anyway, the logic about all time points is definitely debatable. some people might be pissed about games starting 5 minutes early, prohibiting them to play some last minute blitz. same with the question of when exactly to start the clock. currently it's 6 minutes after the game was started, which will be 1 minute after the game was scheduled for most people.
i am absolutely happy to discuss these times, i am not at all confident that i picked the best options. very glad you looked at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all sounds reasonable, and it can all be adjusted later if needed.
at this point everything i was able to think of is implemented on the heltour side. the only "nice to have" that isn't implemented is logging users out if the token is not valid anymore. but the more i think about that, the less i think it's necessary. a chesster command for confirming game times is indeed missing, but i do not consider that to be "on the heltour side". also, i am sure others will have ideas about parts of this feature that might be missing. |
closes #491, rebased from #527
with this pull request, we try to use the lichess bulk pairing api to create games and start clocks automatically at the scheduled time. here is how it is supposed to work:
start_games
. if this is set to true,at least the following things are potential problems:
if we do not have a valid token for a player, or the account is closed, lichess returns an error and lists the token(s) in question, without starting any games. i try to handle this, but it is rather not elegant. i assume there should be a better way than to use regexp on the error message. should work better now.after 20 minutes, we used to check whether games have started by simply checking for a game id. this is not enough anymore, i now try to check in the move list whether more than one move was made.at this point i have tested this a lot of times, and everything seems to be working as expected.i tried to test a lot of stuff, but it is difficult to get it anywhere close to what it would look like in prod.