From 1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 11 May 2011 14:48:17 +0000 Subject: Review of the main loop timer, converted timers from float to unsigned long, corrected a number of timing bugs, improved client framerate stability. --- src/core/gameserver.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/core/gameserver.h') diff --git a/src/core/gameserver.h b/src/core/gameserver.h index ab2bf92..2e1aa2a 100644 --- a/src/core/gameserver.h +++ b/src/core/gameserver.h @@ -7,6 +7,7 @@ #ifndef __INCLUDED_CORE_GAMESERVER_H__ #define __INCLUDED_CORE_GAMESERVER_H__ +#include "sys/timer.h" #include "core/gameinterface.h" #include "core/message.h" #include "core/module.h" @@ -41,7 +42,12 @@ public: void player_disconnect(Player *player); /// run a game server time frame - void frame(unsigned long timestamp); + virtual void frame(const unsigned long timestamp); + + /// server timer + inline const sys::Timer & timer() { + return server_timer; + } /// a player sends a chat message to the global chat channel void shout(Player *player, std::string const &args); @@ -70,11 +76,6 @@ public: /// a player sends a command to the game server void exec(Player *player, std::string const &cmdline); - /// time the server was started - inline const unsigned long startup() const { - return server_startup; - } - /// request info record with id virtual Info *request_info(const unsigned int id); @@ -99,7 +100,7 @@ private: unsigned int server_maxplayerid; unsigned long server_previoustime; - unsigned long server_startup; + sys::Timer server_timer; }; inline GameServer *server() -- cgit v1.2.3