diff options
author | Stijn Buys <ingar@osirion.org> | 2011-02-09 16:01:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-02-09 16:01:17 +0000 |
commit | a255dbc032d15a4f5024bc60baa19c45ebceecc6 (patch) | |
tree | ca5517aae243957b824767169674248c70f7b1d3 /src/dedicated | |
parent | 38eb51c26ab0d9dbebc974c7a21f96a429ce3098 (diff) |
added sv_collisionmargin Cvar and applied the value to mesh collisions,
added seconds parameter to sys::get_datetime(),
added con_timestamps Cvar,
enabled console timestamps on the dedicated server by default.
Diffstat (limited to 'src/dedicated')
-rw-r--r-- | src/dedicated/console.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/dedicated/console.cc b/src/dedicated/console.cc index c2b71c0..b1629fd 100644 --- a/src/dedicated/console.cc +++ b/src/dedicated/console.cc @@ -206,10 +206,26 @@ void Console::draw_status() if (core::game()) { attroff(A_BOLD); color_set(2, NULL); - int minutes = (int) floorf(core::game()->time() / 60.0f); - int seconds = (int) floorf(core::game()->time() - (float) minutes * 60.0f); + std::stringstream status; - status << "time " << std::setfill(' ') << std::setw(3) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds; + + // system time + int year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0; + sys::get_datetime(year, month, day, hour, min, sec); + + status << std::setw(4) << std::setfill('0') << year << "-" + << std::setw(2) << std::setfill('0') << month << "-" + << std::setw(2) << std::setfill('0') << day << " " + << std::setw(2) << hour << ":" + << std::setw(2) << min << ":" + << std::setw(2) << sec << " " + << std::setw(2) << " "; + + // uptime + int uptime_minutes = (int) floorf(core::game()->time() / 60.0f); + int uptime_seconds = (int) floorf(core::game()->time() - (float) uptime_minutes * 60.0f); + status << "uptime " << std::setfill(' ') << std::setw(3) << uptime_minutes << ":" << std::setfill('0') << std::setw(2) << uptime_seconds; + mvaddnstr(0, 1, status.str().c_str(), status.str().size()); } } |