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 ulx uptime to check server's uptime #18

Merged
merged 6 commits into from
Jan 1, 2024

Conversation

adamnejm
Copy link
Contributor

Fixes: #12
image

@adamnejm
Copy link
Contributor Author

adamnejm commented Dec 16, 2023

Great... I installed the same linter and it didn't work... fucking hell this repo is cursed
NVM... had it set to GLua file not Lua

@adamnejm
Copy link
Contributor Author

Also, using SysTime() because CurTime() supposedly freezes when all players disconnect. We don't want that.

@Derpius
Copy link
Member

Derpius commented Dec 22, 2023

Also, using SysTime() because CurTime() supposedly freezes when all players disconnect. We don't want that.

This is when sv_hibernate_think is disabled (can't remember if we have it disabled or not). If the use-case for this command is to determine how unstable the server is getting due to imprecision, then CurTime() is definitely the right choice here.

Copy link
Member

@Derpius Derpius left a comment

Choose a reason for hiding this comment

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

Looks good, couple of minor code quality things and one question on the category

Also might want to reconsider SysTime vs CurTime based on my previous comment

lua/ulx/modules/sh/uptime.lua Show resolved Hide resolved
lua/ulx/modules/sh/uptime.lua Outdated Show resolved Hide resolved
lua/ulx/modules/sh/uptime.lua Outdated Show resolved Hide resolved
@adamnejm
Copy link
Contributor Author

Now the uptime command will fluctuate based on lag, will be inaccurate if server has been running for over 6 hours and possibly be totally wrong if sv_hibernate_think is 1. As per your request :P

@adamnejm adamnejm requested a review from Derpius December 28, 2023 01:05
@Derpius Derpius merged commit d5b9b2a into TAServers:master Jan 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Add uptime
2 participants