I was looking on 0.4 sources, and looks like thats not how it is done (can't find how it is), it must have a better way to do this![]()
C++ Date and Time
The C++ standard library does not provide a proper date type. C++ inherits the structs and functions for date and time manipulation from C. To access date and time related functions and structures, you would need to include <ctime> header file inwww.tutorialspoint.com
on all "couts" and similar funcs (.cpp files)
it might be have done differently because that was the GUI version, not console oneI was looking on 0.4 sources, and looks like thats not how it is done (can't find how it is), it must have a better way to do this
ts for this, it's in moreutils package:sudo apt install moreutils
./tfs 2>&1 | ts '[%Y-%m-%d %H:%M:%.S]'
#!/bin/bash
ulimit -c unlimited
while true; do
echo SERVER START
./tfs 2>&1 | ts '[%Y-%m-%d %H:%M:%.S]'
echo RESTART, CTRL+C TO CLOSE RESTARTER
sleep 3
done
[2022-03-29 11:04:03.823248] The Forgotten Server - Version v1.4.1-1-gc016ac44
[2022-03-29 11:04:03.823284] Git SHA1 c016ac44 dated 2022-01-25T18:15:10-05:00
[2022-03-29 11:04:03.823312] *** DIRTY - NOT OFFICIAL RELEASE ***
[2022-03-29 11:04:03.823320]
[2022-03-29 11:04:03.823327] Compiled with GNU C++ version 8.4.0
[2022-03-29 11:04:03.823334] Compiled on Mar 28 2022 17:18:12 for platform x64
[2022-03-29 11:04:03.823340] Linked with LuaJIT 2.1.0-beta3 for Lua support
[2022-03-29 11:04:03.823347]
[2022-03-29 11:04:03.823354] A server developed by Mark Samman
[2022-03-29 11:04:03.823361] Visit our forum for updates, support, and resources: https://otland.net/.
[2022-03-29 11:04:03.823368]
[2022-03-29 11:04:03.823376] >> Loading config
[2022-03-29 11:04:03.823383] >> Establishing database connection... MySQL 8.0.28
[2022-03-29 11:04:03.823390] >> Running database manager