Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Makefile.am13
-rw-r--r--src/server/application.cc14
-rw-r--r--src/server/application.h3
-rw-r--r--src/server/console.h4
-rw-r--r--src/server/main.cc14
-rw-r--r--src/server/server.cc2
-rw-r--r--src/server/server.h2
7 files changed, 26 insertions, 26 deletions
diff --git a/src/server/Makefile.am b/src/server/Makefile.am
index 729fabf..6875dbf 100644
--- a/src/server/Makefile.am
+++ b/src/server/Makefile.am
@@ -1,10 +1,9 @@
METASOURCES = AUTO
-bin_PROGRAMS = osiriond
-osiriond_SOURCES = application.cc console.cc main.cc server.cc timer.cc
-osiriond_LDADD = $(top_builddir)/src/math/libmath.la \
- $(top_builddir)/src/common/libcommon.la $(top_builddir)/src/sys/libsys.la \
- $(top_builddir)/src/filesystem/libfilesystem.la $(top_builddir)/src/core/libcore.la $(top_builddir)/src/game/libgame.la
+libserver_la_SOURCES = application.cc console.cc server.cc timer.cc
noinst_HEADERS = application.h console.h server.h timer.h
-
+noinst_LTLIBRARIES = libserver.la
INCLUDES = -I$(top_srcdir)/src
-
+libserver_la_LDFLAGS = -avoid-version -no-undefined
+libserver_la_LIBADD = $(top_builddir)/src/math/libmath.la \
+ $(top_builddir)/src/sys/libsys.la $(top_builddir)/src/filesystem/libfilesystem.la \
+ $(top_builddir)/src/core/libcore.la $(top_builddir)/src/game/libgame.la
diff --git a/src/server/application.cc b/src/server/application.cc
index b6cd91f..0d3fe4b 100644
--- a/src/server/application.cc
+++ b/src/server/application.cc
@@ -14,6 +14,10 @@ namespace server {
void Application::init()
{
+ // FIXME core should be able to load game.so
+ // force initialization of the game object
+ server::game = new game::Game();
+
// initialize core
core::ApplicationInterface::init();
@@ -44,7 +48,15 @@ void Application::shutdown()
core::ApplicationInterface::shutdown();
- exit(0);
+ quit(0);
+}
+
+void Application::quit(int status)
+{
+ // FIXME core should be able to unload game.so
+ delete server::game;
+
+ core::ApplicationInterface::quit(status);
}
}
diff --git a/src/server/application.h b/src/server/application.h
index c12a608..b081726 100644
--- a/src/server/application.h
+++ b/src/server/application.h
@@ -22,6 +22,9 @@ public:
/// shutdown the server Application
virtual void shutdown();
+
+ /// quit the server Application
+ virtual void quit(int status);
};
}
diff --git a/src/server/console.h b/src/server/console.h
index 188d2b6..34166be 100644
--- a/src/server/console.h
+++ b/src/server/console.h
@@ -7,12 +7,12 @@
#ifndef __INCLUDED_SERVER_CONSOLE_H__
#define __INCLUDED_SERVER_CONSOLE_H__
-#include "common/consoleinterface.h"
+#include "sys/consoleinterface.h"
namespace server {
/// server console implementation
-class Console : public common::ConsoleInterface {
+class Console : public sys::ConsoleInterface {
public:
/// stream to send normal messages too
virtual std::ostream & messagestream();
diff --git a/src/server/main.cc b/src/server/main.cc
deleted file mode 100644
index 052c68d..0000000
--- a/src/server/main.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- server/main.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 "server/server.h"
-
-int main( int argc, char *argv[] )
-{
- server::application.init();
- server::application.run();
- server::application.shutdown();
-}
diff --git a/src/server/server.cc b/src/server/server.cc
index ad8960e..fc37aa6 100644
--- a/src/server/server.cc
+++ b/src/server/server.cc
@@ -14,7 +14,7 @@ namespace server {
Application application;
Console console;
-game::Game Game;
+game::Game *game;
}
diff --git a/src/server/server.h b/src/server/server.h
index 14d1d4b..7871c5f 100644
--- a/src/server/server.h
+++ b/src/server/server.h
@@ -21,7 +21,7 @@ extern Application application;
extern Console console;
/// global Game instance
-extern game::Game game;
+extern game::Game *game;
} // namespace server