summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-09-22 00:13:39 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-09-22 00:13:39 +0200
commit3b119b08539224b70a0fc7e5807f620dee286cad (patch)
tree3857846bf3f2fb653f13df386ed6cd8f36c9750d /src
parent4b0892691729e5efba27c796e29002b1e1d54166 (diff)
downloadmanaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.gz
manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.bz2
manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.xz
manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.zip
Added options to disable the server log to standard output to the minimum.
Also made some small cleanups. Resolves: Mana-Mantis #241 Reviewed-by: Jaxad0127.
Diffstat (limited to 'src')
-rw-r--r--src/account-server/main-account.cpp23
-rw-r--r--src/game-server/main-game.cpp22
2 files changed, 26 insertions, 19 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp
index 0be05abe..23332362 100644
--- a/src/account-server/main-account.cpp
+++ b/src/account-server/main-account.cpp
@@ -148,9 +148,10 @@ static void initialize()
// Initialize the logger.
Logger::setLogFile(logFile);
- // write the messages to both the screen and the log file.
- Logger::setTeeMode(true);
-
+ // Write the messages to both the screen and the log file.
+ Logger::setTeeMode(
+ Configuration::getBoolValue("log_accountToStandardOutput",
+ true));
LOG_INFO("Using log file: " << logFile);
// Indicate in which file the statistics are put.
@@ -336,16 +337,21 @@ static void parseOptions(int argc, char *argv[], CommandLineOptions &options)
*/
int main(int argc, char *argv[])
{
-#ifdef PACKAGE_VERSION
- LOG_INFO("The Mana Account+Chat Server v" << PACKAGE_VERSION);
-#endif
-
// Parse command line options
CommandLineOptions options;
parseOptions(argc, argv, options);
initializeConfiguration(options.configPath);
+ // General initialization
+ initialize();
+
+#ifdef PACKAGE_VERSION
+ LOG_INFO("The Mana Account+Chat Server v" << PACKAGE_VERSION);
+#else
+ LOG_INFO("The Mana Account+Chat Server (unknown version)");
+#endif
+
if (!options.verbosityChanged)
options.verbosity = static_cast<Logger::Level>(
Configuration::getValue("log_accountServerLogLevel",
@@ -356,9 +362,6 @@ int main(int argc, char *argv[])
options.port = Configuration::getValue("net_accountServerPort",
options.port);
- // General initialization
- initialize();
-
std::string host = Configuration::getValue("net_listenHost", std::string());
if (!AccountClientHandler::initialize(DEFAULT_ATTRIBUTEDB_FILE,
options.port, host) ||
diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp
index db118325..14e47112 100644
--- a/src/game-server/main-game.cpp
+++ b/src/game-server/main-game.cpp
@@ -168,7 +168,9 @@ static void initializeServer()
Logger::setLogFile(logFile);
// Write the messages to both the screen and the log file.
- Logger::setTeeMode(true);
+ Logger::setTeeMode(Configuration::getBoolValue("log_gameToStandardOutput",
+ true));
+
LOG_INFO("Using log file: " << logFile);
// --- Initialize the managers
@@ -341,17 +343,21 @@ static void parseOptions(int argc, char *argv[], CommandLineOptions &options)
*/
int main(int argc, char *argv[])
{
- int elapsedWorldTicks;
-#ifdef PACKAGE_VERSION
- LOG_INFO("The Mana Game Server v" << PACKAGE_VERSION);
-#endif
-
// Parse command line options
CommandLineOptions options;
parseOptions(argc, argv, options);
initializeConfiguration(options.configPath);
+ // General initialization
+ initializeServer();
+
+#ifdef PACKAGE_VERSION
+ LOG_INFO("The Mana Game Server v" << PACKAGE_VERSION);
+#else
+ LOG_INFO("The Mana Game Server (unknown version)");
+#endif
+
if (!options.verbosityChanged)
options.verbosity = static_cast<Logger::Level>(
Configuration::getValue("log_gameServerLogLevel",
@@ -362,9 +368,6 @@ int main(int argc, char *argv[])
options.port = Configuration::getValue("net_gameServerPort",
options.port);
- // General initialization
- initializeServer();
-
// Make an initial attempt to connect to the account server
// Try again after longer and longer intervals when connection fails.
bool isConnected = false;
@@ -391,6 +394,7 @@ int main(int argc, char *argv[])
// Account connection lost flag
bool accountServerLost = false;
+ int elapsedWorldTicks = 0;
while (running)
{