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

Add commands to control the timeout #1272

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

lmoureaux
Copy link
Contributor

Add three new timeout-related server commands:

  • timeoutshow displays the current timeout
  • timeoutadd adds time to the current turn
  • timeoutset sets the remaining time for the current turn

They are named timeoutsomething for three reasons:

  • timeoutincrease already exists
  • it's easier to find them if they're together in /help commands
  • sub-commands like "timeout show" are not feasible with the current
    implementation

This is heavily inspired from an earlier patch used by LT with 2.6,
41cc12b401fe4a9db8d22b78039561710fff59e3. The syntax is however more flexible,
allowing for hours or minutes to be passed directly without doing any
calculation.

Closes #1151.

Add three new timeout-related server commands:

- timeoutshow displays the current timeout
- timeoutadd adds time to the current turn
- timeoutset sets the remaining time for the current turn

They are named timeoutsomething for three reasons:

- timeoutincrease already exists
- it's easier to find them if they're together in /help commands
- sub-commands like "timeout show" are not feasible with the current
  implementation

This is heavily inspired from an earlier patch used by LT with 2.6,
41cc12b401fe4a9db8d22b78039561710fff59e3. The syntax is however more flexible,
allowing for hours or minutes to be passed directly without doing any
calculation.

Closes longturn#1151.
@lmoureaux lmoureaux force-pushed the feature/timeout-control branch from 2e5d3a0 to 2df77a3 Compare August 14, 2022 22:48
@psampathkumar
Copy link
Contributor

Works! It interprets negative values too, to reduce timeout, (we can even do stuff like 1:-1 to increase by 59 secs). I think this needs to be documented in the help.

You can either create a issue to document server commands in RTD in general and then merge it, or add some help here for the ingame version.

Both timeoutset and timeoutadd accept negative value for each part of their
time argument (hours, minutes, seconds). I think using this feature shouln't be
encouraged as it makes the time less intuitive, but I see no reason to add more
code to prevent it.

Still, documenting that timeoutadd can be used to reduce the timeout is
important, so mention that it accepts negative values. Creative users may
discover that 1:-10 is 50 seconds by themselves.

See longturn#1272.
@lmoureaux
Copy link
Contributor Author

New commit:

Both timeoutset and timeoutadd accept negative value for each part of their time argument (hours, minutes, seconds). I think using this feature shouln't be encouraged as it makes the time less intuitive, but I see no reason to add more code to prevent it.

Still, documenting that timeoutadd can be used to reduce the timeout is important, so mention that it accepts negative values. Creative users may discover that 1:-10 is 50 seconds by themselves.

@psampathkumar psampathkumar enabled auto-merge (rebase) August 15, 2022 12:30
@psampathkumar psampathkumar merged commit 4659b57 into longturn:master Aug 15, 2022
@psampathkumar psampathkumar deleted the feature/timeout-control branch August 15, 2022 12:58
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

Successfully merging this pull request may close these issues.

Port Longturn patches - commands
2 participants