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: 'getsysdate' console command #7658
Conversation
I'm not opposed as-such to this, but together with #6193 it might be worth having a way to prevent information leakage through RCON. (Configuration flag that can't be changed via console, or similar.) |
I don't quite follow what use this would have. What point would accessing the system time be? |
My guess is for dedicated server console logging. |
src/console_cmds.cpp
Outdated
@@ -9,6 +9,7 @@ | |||
|
|||
/** @file console_cmds.cpp Implementation of the console hooks. */ | |||
|
|||
#include <time.h> |
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.
There's no hard-and-fast rule for this, but standard headers are generally put at the bottom of the list on their own (but before safeguards.h)
src/console_cmds.cpp
Outdated
} | ||
|
||
time_t t; | ||
struct tm * timeinfo; |
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.
No need for declare-before-use in C++ (or indeed C in the last 20 years)
@LordAro Thanks for comments, please check whether I've done right. |
Add `getsysdate` console command to display system's local time, which is might be useful to check current time in script logging.
Add
getsysdate
console command to display system's local time, which is might be useful to check current time in script logging.I have been felt that there is no command to match game date and system time, it might be helpful.
Please let me aware if something is wrong.