Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-05-11 14:48:17 +0000
committerStijn Buys <ingar@osirion.org>2011-05-11 14:48:17 +0000
commit1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 (patch)
treec2d0ff7cc4a8a264657abd0ac99017a5b664ecd2 /src/core/gameserver.h
parentbb0f860989f84b901f80017ae0139a3fc0446dc1 (diff)
Review of the main loop timer, converted timers from float to unsigned long,
corrected a number of timing bugs, improved client framerate stability.
Diffstat (limited to 'src/core/gameserver.h')
-rw-r--r--src/core/gameserver.h15
1 files changed, 8 insertions, 7 deletions
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()