diff options
| author | click <none@none> | 2010-06-05 22:44:53 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-06-05 22:44:53 +0200 |
| commit | fd28bc6aff6fe356262b5ac20e152c6ec8569c43 (patch) | |
| tree | 79cdf14a40d1fcbb3ded952e67831a8fb0ecdb46 /src/server/trinitycore/Main.cpp | |
| parent | 1f87b6d34aee1e98981763adb017a79dfc211b67 (diff) | |
rename world server directory (trinitycore) to worldserver, rename authserver directory (trinityrealm) to authserver to reflect their real purposes
--HG--
branch : trunk
rename : src/server/trinityrealm/AuthCodes.cpp => src/server/authserver/AuthCodes.cpp
rename : src/server/trinityrealm/AuthCodes.h => src/server/authserver/AuthCodes.h
rename : src/server/trinityrealm/AuthSocket.cpp => src/server/authserver/AuthSocket.cpp
rename : src/server/trinityrealm/AuthSocket.h => src/server/authserver/AuthSocket.h
rename : src/server/trinityrealm/CMakeLists.txt => src/server/authserver/CMakeLists.txt
rename : src/server/trinityrealm/Main.cpp => src/server/authserver/Main.cpp
rename : src/server/trinityrealm/RealmAcceptor.h => src/server/authserver/RealmAcceptor.h
rename : src/server/trinityrealm/RealmList.cpp => src/server/authserver/RealmList.cpp
rename : src/server/trinityrealm/RealmList.h => src/server/authserver/RealmList.h
rename : src/server/trinityrealm/RealmSocket.cpp => src/server/authserver/RealmSocket.cpp
rename : src/server/trinityrealm/RealmSocket.h => src/server/authserver/RealmSocket.h
rename : src/server/trinityrealm/TrinityRealm.ico => src/server/authserver/TrinityRealm.ico
rename : src/server/trinityrealm/TrinityRealm.rc => src/server/authserver/TrinityRealm.rc
rename : src/server/trinityrealm/resource.h => src/server/authserver/resource.h
rename : src/server/trinityrealm/trinityrealm.conf.dist => src/server/authserver/trinityrealm.conf.dist
rename : src/server/trinitycore/CMakeLists.txt => src/server/worldserver/CMakeLists.txt
rename : src/server/trinitycore/CliRunnable.cpp => src/server/worldserver/CliRunnable.cpp
rename : src/server/trinitycore/CliRunnable.h => src/server/worldserver/CliRunnable.h
rename : src/server/trinitycore/Main.cpp => src/server/worldserver/Main.cpp
rename : src/server/trinitycore/Master.cpp => src/server/worldserver/Master.cpp
rename : src/server/trinitycore/Master.h => src/server/worldserver/Master.h
rename : src/server/trinitycore/RASocket.cpp => src/server/worldserver/RASocket.cpp
rename : src/server/trinitycore/RASocket.h => src/server/worldserver/RASocket.h
rename : src/server/trinitycore/TrinityCore.ico => src/server/worldserver/TrinityCore.ico
rename : src/server/trinitycore/TrinityCore.rc => src/server/worldserver/TrinityCore.rc
rename : src/server/trinitycore/WorldRunnable.cpp => src/server/worldserver/WorldRunnable.cpp
rename : src/server/trinitycore/WorldRunnable.h => src/server/worldserver/WorldRunnable.h
rename : src/server/trinitycore/resource.h => src/server/worldserver/resource.h
rename : src/server/trinitycore/trinitycore.conf.dist => src/server/worldserver/trinitycore.conf.dist
Diffstat (limited to 'src/server/trinitycore/Main.cpp')
| -rw-r--r-- | src/server/trinitycore/Main.cpp | 154 |
1 files changed, 0 insertions, 154 deletions
diff --git a/src/server/trinitycore/Main.cpp b/src/server/trinitycore/Main.cpp deleted file mode 100644 index 95bb39eca91..00000000000 --- a/src/server/trinitycore/Main.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> - * - * Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/// \addtogroup Trinityd Trinity Daemon -/// @{ -/// \file - -#include <openssl/opensslv.h> -#include <openssl/crypto.h> -#include <ace/Version.h> - -#include "Common.h" -#include "Database/DatabaseEnv.h" -#include "Config/ConfigEnv.h" - -#include "Log.h" -#include "Master.h" - -#ifndef _TRINITY_CORE_CONFIG -# define _TRINITY_CORE_CONFIG "TrinityCore.conf" -#endif //_TRINITY_CORE_CONFIG - -#ifdef WIN32 -#include "ServiceWin32.h" -char serviceName[] = "TrinityCore"; -char serviceLongName[] = "Trinity core service"; -char serviceDescription[] = "Massive Network Game Object Server"; -/* - * -1 - not in service mode - * 0 - stopped - * 1 - running - * 2 - paused - */ -int m_ServiceStatus = -1; -#endif - -DatabaseType WorldDatabase; ///< Accessor to the world database -DatabaseType CharacterDatabase; ///< Accessor to the character database -DatabaseType LoginDatabase; ///< Accessor to the realm/login database - -uint32 realmID; ///< Id of the realm - -/// Print out the usage string for this program on the console. -void usage(const char *prog) -{ - sLog.outString("Usage: \n %s [<options>]\n" - " -c config_file use config_file as configuration file\n\r" - #ifdef WIN32 - " Running as service functions:\n\r" - " --service run as service\n\r" - " -s install install service\n\r" - " -s uninstall uninstall service\n\r" - #endif - ,prog); -} - -/// Launch the Trinity server -extern int main(int argc, char **argv) -{ - ///- Command line parsing to get the configuration file name - char const* cfg_file = _TRINITY_CORE_CONFIG; - int c=1; - while( c < argc ) - { - if( strcmp(argv[c],"-c") == 0) - { - if( ++c >= argc ) - { - sLog.outError("Runtime-Error: -c option requires an input argument"); - usage(argv[0]); - return 1; - } - else - cfg_file = argv[c]; - } - - #ifdef WIN32 - //////////// - //Services// - //////////// - if( strcmp(argv[c],"-s") == 0) - { - if( ++c >= argc ) - { - sLog.outError("Runtime-Error: -s option requires an input argument"); - usage(argv[0]); - return 1; - } - if( strcmp(argv[c],"install") == 0) - { - if (WinServiceInstall()) - sLog.outString("Installing service"); - return 1; - } - else if( strcmp(argv[c],"uninstall") == 0) - { - if(WinServiceUninstall()) - sLog.outString("Uninstalling service"); - return 1; - } - else - { - sLog.outError("Runtime-Error: unsupported option %s",argv[c]); - usage(argv[0]); - return 1; - } - } - if( strcmp(argv[c],"--service") == 0) - { - WinServiceRun(); - } - //// - #endif - ++c; - } - - if (!sConfig.SetSource(cfg_file)) - { - sLog.outError("Could not find configuration file %s.", cfg_file); - return 1; - } - sLog.outString("Using configuration file %s.", cfg_file); - - sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); - sLog.outDetail("Using ACE: %s", ACE_VERSION); - - ///- and run the 'Master' - /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? - return sMaster.Run(); - - // at sMaster return function exist with codes - // 0 - normal shutdown - // 1 - shutdown at error - // 2 - restart command used, this code can be used by restarter for restart Trinityd -} - -/// @} |
