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>2008-08-15 16:07:58 +0000
committerStijn Buys <ingar@osirion.org>2008-08-15 16:07:58 +0000
commitfa589fafa7f094bc1bf07642b55f3d824814adba (patch)
treedc1b96685c4d92cd838551ee14ce02a7f81eb5bf
parentb780874cf4ab23cf9e48aa23da2394169da24887 (diff)
moved Timer to core::
-rw-r--r--src/core/Makefile.am5
-rw-r--r--src/core/timer.cc (renamed from src/server/timer.cc)6
-rw-r--r--src/core/timer.h (renamed from src/server/timer.h)16
-rw-r--r--src/server/Makefile.am4
-rw-r--r--src/server/server.cc4
5 files changed, 21 insertions, 14 deletions
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index 3badbd9..802234e 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -3,7 +3,8 @@ INCLUDES = -I$(top_srcdir)/src
libcore_la_SOURCES = application.cc clientstate.cc commandbuffer.cc core.cc \
cvar.cc entity.cc func.cc gameconnection.cc gameinterface.cc gameserver.cc \
- module.cc netclient.cc netconnection.cc netserver.cc player.cc stats.cc zone.cc
+ module.cc netclient.cc netconnection.cc netserver.cc player.cc stats.cc timer.cc \
+ zone.cc
libcore_la_LDFLAGS = -avoid-version -no-undefined
libcore_la_LIBADD = $(top_builddir)/src/model/libmodel.la \
$(top_builddir)/src/filesystem/libfilesystem.la $(top_builddir)/src/math/libmath.la $(top_builddir)/src/sys/libsys.la \
@@ -12,5 +13,5 @@ libcore_la_LIBADD = $(top_builddir)/src/model/libmodel.la \
noinst_LTLIBRARIES = libcore.la
noinst_HEADERS = application.h clientstate.h commandbuffer.h core.h cvar.h \
entity.h func.h gameconnection.h gameinterface.h gameserver.h module.h net.h \
- netclient.h netconnection.h netserver.h player.h range.h stats.h
+ netclient.h netconnection.h netserver.h player.h range.h stats.h timer.h
diff --git a/src/server/timer.cc b/src/core/timer.cc
index 56075c7..e5a808e 100644
--- a/src/server/timer.cc
+++ b/src/core/timer.cc
@@ -1,15 +1,15 @@
/*
- server/timer.cc
+ core/timer.cc
This file is part of the Osirion project and is distributed under
the terms and conditions of the GNU General Public License version 2
*/
-#include "timer.h"
+#include "core/timer.h"
#include <unistd.h>
#include <iostream>
-namespace server {
+namespace core {
Timer::Timer()
{
diff --git a/src/server/timer.h b/src/core/timer.h
index 496d698..9e172bf 100644
--- a/src/server/timer.h
+++ b/src/core/timer.h
@@ -1,9 +1,15 @@
-#ifndef __INCLUDED_TIMER_H__
-#define __INCLUDED_TIMER_H__
+/*
+ core/timer.h
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_CORE_TIMER_H__
+#define __INCLUDED_CORE_TIMER_H__
#include <sys/time.h>
-namespace server {
+namespace core {
/// a timer measures intervals in seconds
/*! A timer class measures the time elapsed
@@ -33,7 +39,7 @@ private:
struct timeval timer_tick;
}; // class Timer
-} // namespace server
+} // namespace core
-#endif // __INCLUDED_TIMER_H__
+#endif // __INCLUDED_CORE_TIMER_H__
diff --git a/src/server/Makefile.am b/src/server/Makefile.am
index ed43cd7..bc2f741 100644
--- a/src/server/Makefile.am
+++ b/src/server/Makefile.am
@@ -1,6 +1,6 @@
METASOURCES = AUTO
-libserver_la_SOURCES = console.cc server.cc timer.cc
-noinst_HEADERS = console.h server.h timer.h
+libserver_la_SOURCES = console.cc server.cc
+noinst_HEADERS = console.h server.h
noinst_LTLIBRARIES = libserver.la
INCLUDES = -I$(top_srcdir)/src
libserver_la_LDFLAGS = -avoid-version -no-undefined
diff --git a/src/server/server.cc b/src/server/server.cc
index fce2181..27cf6bd 100644
--- a/src/server/server.cc
+++ b/src/server/server.cc
@@ -9,9 +9,9 @@
#include "core/core.h"
#include "core/stats.h"
+#include "core/timer.h"
#include "server/console.h"
#include "server/server.h"
-#include "server/timer.h"
namespace server {
@@ -77,7 +77,7 @@ void Server::run()
if (core::Cvar::sv_framerate->value())
server_framerate = 1.0f / core::Cvar::sv_framerate->value();
- server::Timer timer;
+ core::Timer timer;
float elapsed = 0;
while(connected()) {