Skip to content

Added time utilities, TC time functions, and fixed up Lua sphinx docs - #2977

Open
XHawk87 wants to merge 5 commits into
longturn:masterfrom
XHawk87:feature/2796
Open

Added time utilities, TC time functions, and fixed up Lua sphinx docs#2977
XHawk87 wants to merge 5 commits into
longturn:masterfrom
XHawk87:feature/2796

Conversation

@XHawk87

@XHawk87 XHawk87 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #2796

common tests:

lua cmd log.debug("%s", time.now())
lua cmd log.debug("%s", time.to_iso8601_datetime(time.now()))
lua cmd log.debug("%s", time.to_iso8601_duration(99999))
lua cmd log.debug("%s", game.next_turn_change())
lua cmd log.debug("%s", game.last_turn_change())

server-side tests:

lua cmd log.debug("%s", game.seconds_since_turn_change())
lua cmd log.debug("%s", game.seconds_to_turn_change())

client-side tests:

chat.msg("%s", game.seconds_since_turn_change())
chat.msg("%s", game.seconds_to_turn_change())

@XHawk87
XHawk87 requested review from jwrober and lmoureaux August 26, 2026 19:36

@jwrober jwrober left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things I noticed at first glance.

You can use clang-tidy to check the header includes. Compile with the clang preset and then run clang-tidy path/to/.h,.cpp -p build-clang/ --checks="-*,misc-include-cleaner"

Comment thread common/scriptcore/api_common_utilities.cpp Outdated
Comment thread utility/timing.cpp Outdated
@jwrober

jwrober commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Not related to this PR specifically, but I think I may have broken OBS integration. The CI didn't run here. @XHawk87 I assume you created this branch from recent master at least after commit hash 73c0d80453e59904adefc3da48344daf34135ad2?

@XHawk87

XHawk87 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Some things I noticed at first glance.

You can use clang-tidy to check the header includes. Compile with the clang preset and then run clang-tidy path/to/.h,.cpp -p build-clang/ --checks="-*,misc-include-cleaner"

How would I do this using the nix flake or docker? I can't build it directly on my OS.

@XHawk87

XHawk87 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Not related to this PR specifically, but I think I may have broken OBS integration. The CI didn't run here. @XHawk87 I assume you created this branch from recent master at least after commit hash 73c0d80453e59904adefc3da48344daf34135ad2?

It was rebased just before the PR.

@XHawk87
XHawk87 requested a review from jwrober August 27, 2026 15:47
@jwrober

jwrober commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Some things I noticed at first glance.
You can use clang-tidy to check the header includes. Compile with the clang preset and then run clang-tidy path/to/.h,.cpp -p build-clang/ --checks="-*,misc-include-cleaner"

How would I do this using the nix flake or docker? I can't build it directly on my OS.

Ok. I'll do a clang-tidy check this evening on my local to double check.

@XHawk87

XHawk87 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

I suspect that this fix to the ruleset and cli tests won't work cross platform because there won't be a runuser command to switch to the freeciv21 user. Might have to roll back those until we can think of a better way to do it.

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.

Lua support time-based features

2 participants