diplicity icon indicating copy to clipboard operation
diplicity copied to clipboard

Added server side grace period support.

Open zond opened this issue 3 years ago • 4 comments

  • Added two fields to Game: GracePeriodMinutes and GracePeriodsPerPlayer.
  • Added one field to GameMember: GracePeriodsUsed.
  • Added one field to PhaseMeta (present both anonymously in Phase and as Game.NewestPhaseMeta): GraceUsed.
  • Made phase resolution check grace period settings, and if GracePeriodMinutes > 0, GracePeriodsPerPlayer > 0, latest phase !GraceUsed, and at least one player with no orders, and not ready to resolve has GracePeriodsUsed < GracePeriodsPerPlayer they will have their GracePeriodsUsed bumped, the current phase will have GraceUsed set to true, be postponed, and the late players will be named and shamed in a message to the conference channel.

@JorenC, @tttppp, @johnpooch PTAL

zond avatar Sep 15 '21 19:09 zond

Also, this is not yet tested - I wanted to get a sanity check by visual inspection first.

zond avatar Sep 15 '21 19:09 zond

The logic looks right to me. This will allow a player to use all their grace periods on the same phase, but I think that's ok.

tttppp avatar Sep 15 '21 21:09 tttppp

We should have a way to know in the client whether we're in a grace period.

I think we keep the current phase, so it would be "Spring 1902 (grace)". I think we keep the current deadline (it has just been extended), so the deadline is fine.

We do need:

  • A token that we're currently in Grace.
  • A way to know which of the players is in Grace (especially me)

JorenC avatar Sep 15 '21 21:09 JorenC

We should have a way to know in the client whether we're in a grace period.

I added Phase.GraceUsed which will show this.

I think we keep the current phase, so it would be "Spring 1902 (grace)".

I don't understand - when grace period is used the current phase will just be extended.

I think we keep the current deadline (it has just been extended), so the deadline is fine.

Yes, exactly.

We do need:

  • A token that we're currently in Grace.

This is in the PR now.

  • A way to know which of the players is in Grace (especially me)

Why? You are not committed and need to commit, isn't that enough?

zond avatar Sep 16 '21 09:09 zond