From 107ed6e6af67ff81708db22603f626a54c9cb198 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jan 2008 17:36:33 +0000 Subject: accomodate the new modules --- src/server/Makefile.am | 5 ++++- src/server/console.cc | 8 ++++---- src/server/console.h | 16 ++++++++-------- src/server/main.cc | 9 +++++---- src/server/timer.h | 14 ++++++++------ 5 files changed, 29 insertions(+), 23 deletions(-) (limited to 'src/server') diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 7532f1c..9e99900 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -2,5 +2,8 @@ INCLUDES = -I$(top_srcdir)/src METASOURCES = AUTO bin_PROGRAMS = osiriond osiriond_SOURCES = console.cc main.cc timer.cc -osiriond_LDADD = $(top_builddir)/src/game/libgame.la +osiriond_LDADD = $(top_builddir)/src/math/libmath.la \ + $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/filesystem/libfilesystem.la \ + $(top_builddir)/src/game/libgame.la noinst_HEADERS = console.h timer.h diff --git a/src/server/console.cc b/src/server/console.cc index 40b752d..7a2d82d 100644 --- a/src/server/console.cc +++ b/src/server/console.cc @@ -4,21 +4,21 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "console.h" +#include "server/console.h" #include namespace server { -std::ostream & Console::message() +std::ostream & Console::messagestream() { return std::cout; } -std::ostream & Console::warning() +std::ostream & Console::warningstream() { return std::cerr; } -std::ostream & Console::debug() +std::ostream & Console::debugstream() { return std::cout; } diff --git a/src/server/console.h b/src/server/console.h index 69f2ea8..45563a4 100644 --- a/src/server/console.h +++ b/src/server/console.h @@ -4,28 +4,28 @@ the terms of the GNU General Public License version 2 */ -#ifndef __INCLUDED_SERVERCONSOLE_H__ -#define __INCLUDED_SERVERCONSOLE_H__ +#ifndef __INCLUDED_SERVER_CONSOLE_H__ +#define __INCLUDED_SERVER_CONSOLE_H__ #include "common/console.h" namespace server { -/// Interface for a console object that writes messages on the screen +/// the server console class Console : public common::Console { public: /// stream to send normal messages too - virtual std::ostream & message(); + virtual std::ostream & messagestream(); /// stream to send warning messages too - virtual std::ostream & warning(); + virtual std::ostream & warningstream(); /// stream to send debug messages too - virtual std::ostream & debug(); + virtual std::ostream & debugstream(); -}; // class Console +}; } // namespace server -#endif // __INCLUDED_SERVERCONSOLE_H__ +#endif // __INCLUDED_SERVER_CONSOLE_H__ diff --git a/src/server/main.cc b/src/server/main.cc index f49dbc2..ae74471 100644 --- a/src/server/main.cc +++ b/src/server/main.cc @@ -4,10 +4,12 @@ the terms and conditions of the GNU General Public License version 2 */ -#include "console.h" -#include "timer.h" +// project headers +#include "common/common.h" #include "game/game.h" -#include "osirion.h" + +#include "timer.h" +#include "console.h" #include @@ -20,7 +22,6 @@ int main( int argc, char *argv[] ) { // initialize system console; server::Console serverconsole; - common::Console::instance = &serverconsole; const float server_framerate = 1.0f / 20.0f; server::Timer timer; diff --git a/src/server/timer.h b/src/server/timer.h index f38806c..a96fa0e 100644 --- a/src/server/timer.h +++ b/src/server/timer.h @@ -5,7 +5,7 @@ namespace server { -/// a timer measures that intervals in seconds +/// a timer measures intervals in seconds /*! A timer class measures the time elapsed * between the last two calls to its mark() function. */ @@ -18,19 +18,20 @@ public: /// mark the current time as zero /*! Reset the timer, all subsequent calls too elapsed() will - * use now as a reference - * that must be timed. - */ + * use the current timestamp as reference + */ void mark(); /*! return the time elapsed since the last mark - * @see mark() - */ + * @see mark() + */ 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; @@ -40,3 +41,4 @@ private: } // namespace server #endif // __INCLUDED_TIMER_H__ + -- cgit v1.2.3