From a255dbc032d15a4f5024bc60baa19c45ebceecc6 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 9 Feb 2011 16:01:17 +0000 Subject: 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. --- src/dedicated/console.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/dedicated') 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()); } } -- cgit v1.2.3