diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-04 00:54:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-04 00:54:30 +0000 |
commit | 840f9b8678f607aecc15d47bc77248c4ac8b8574 (patch) | |
tree | f90688ca7afabb8e4123e1a811dd168a86717a3c /src/server | |
parent | 43b994017a560a2fa97894ebfe121375d6614b6f (diff) |
tweaked console
client status with timer and fps
core connect/disconnect
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/application.cc | 9 | ||||
-rw-r--r-- | src/server/timer.cc | 8 | ||||
-rw-r--r-- | src/server/timer.h | 5 |
3 files changed, 8 insertions, 14 deletions
diff --git a/src/server/application.cc b/src/server/application.cc index ee5f32f..8ea0808 100644 --- a/src/server/application.cc +++ b/src/server/application.cc @@ -19,10 +19,13 @@ void Application::init() // force initialization of the game object server::game = new game::Game(); + con_print << "Initializing server..." << std::endl; + // initialize core - core::ApplicationInterface::init(); + core::ApplicationInterface::init(); - con_debug << "Initializing server..." << std::endl; + // connect to the game module + core::ApplicationInterface::connect(); } void Application::run() @@ -37,7 +40,7 @@ void Application::run() frame(elapsed); - timer.sleep(server_framerate - elapsed); + sys::sleep(server_framerate - elapsed); timer.mark(); } diff --git a/src/server/timer.cc b/src/server/timer.cc index c184659..946da2c 100644 --- a/src/server/timer.cc +++ b/src/server/timer.cc @@ -25,7 +25,8 @@ void Timer::mark() } float Timer::elapsed() -{ timeval tick; +{ + timeval tick; gettimeofday(&tick, &timer_tz); @@ -34,9 +35,4 @@ float Timer::elapsed() return( (float) delta / 1000000); } -void Timer::sleep(float seconds) -{ - usleep((useconds_t) seconds * (useconds_t) 1000000.0 ); -} - } diff --git a/src/server/timer.h b/src/server/timer.h index a96fa0e..496d698 100644 --- a/src/server/timer.h +++ b/src/server/timer.h @@ -27,11 +27,6 @@ public: */ float elapsed(); - /// suspend calling process for a number of seconds - void sleep(float seconds); - - /// TODO add inspectors for current timestamp and last mark - private: float timer_elapsed; struct timezone timer_tz; |