diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-23 12:34:07 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-23 12:34:07 +0000 |
commit | 583ec3285c41e9d253c4aaabd2af4dadac75f3a7 (patch) | |
tree | 5ec345e44af9d3699a95f493d8358ee766e23330 /src/core/gameserver.cc | |
parent | 44158ccfbe943b832c0e0bf9ce547212aa6c2b8b (diff) |
clean module consturction/destruction
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r-- | src/core/gameserver.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index b8f8730..f614fa9 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -12,6 +12,7 @@ #include "core/cvar.h" #include "core/func.h" #include "core/gameserver.h" +#include "core/loader.h" #include "core/netserver.h" #include "filesystem/filesystem.h" #include "sys/sys.h" @@ -125,26 +126,28 @@ GameServer::GameServer() : GameInterface() server_maxplayerid = 1; server_startup = application()->timestamp(); - server_module = Module::loaded(); + server_module = Loader::init(); if (!server_module) { con_error << "No module loaded.\n"; abort(); return; } - if (server_module->interactive()) - load_config(); //FIXME interferes with command line because of cmd.exec - - // set the name of the game - core::Cvar::set("g_name", server_module->name().c_str(), core::Cvar::Game | core::Cvar::ReadOnly); - - server_module->run(); if (!server_module->running()) { con_error << "Could not initialize module '" << server_module->name() << "'\n"; abort(); return; } + if (server_module->interactive()) { + //FIXME interferes with command line because of cmd.exec + load_config(); + } + + // set the name of the game + core::Cvar::set("g_name", server_module->name().c_str(), core::Cvar::Game | core::Cvar::ReadOnly); + + con_print << " module '^B" << server_module->name() << "^N'\n"; if (server_module->interactive() && (Cvar::sv_dedicated->value() || Cvar::sv_private->value())) { @@ -205,7 +208,8 @@ GameServer::~GameServer() if (server_module->running() && !Cvar::sv_dedicated->value()) player_disconnect(localplayer()); - server_module->terminate(); + delete server_module; + server_module = 0; } Func::remove("kick"); |