diff options
Diffstat (limited to 'src/account-server/main-account.cpp')
-rw-r--r-- | src/account-server/main-account.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index 733369d7..0be05abe 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -39,6 +39,7 @@ #include "utils/processorutils.hpp" #include "utils/stringfilter.h" #include "utils/timer.h" +#include "defines.h" #include <cstdlib> #include <getopt.h> @@ -106,7 +107,7 @@ static void initializeConfiguration(std::string configPath = std::string()) { LOG_FATAL("Refusing to run without configuration!" << std::endl << "Invalid config path: " << configPath << "."); - exit(1); + exit(EXIT_CONFIG_NOT_FOUND); } } @@ -116,7 +117,7 @@ static void initializeConfiguration(std::string configPath = std::string()) if (Configuration::getValue("net_password", "") == "") { LOG_FATAL("SECURITY WARNING: 'net_password' not set!"); - exit(3); + exit(EXIT_BAD_CONFIG_PARAMETER); } } @@ -169,7 +170,7 @@ static void initialize() catch (std::string &error) { LOG_FATAL("Error opening the database: " << error); - exit(1); + exit(EXIT_DB_EXCEPTION); } // --- Initialize the managers @@ -188,7 +189,7 @@ static void initialize() if (enet_initialize() != 0) { LOG_FATAL("An error occurred while initializing ENet"); - exit(2); + exit(EXIT_NET_EXCEPTION); } // Initialize the processor utility functions @@ -257,7 +258,7 @@ static void printHelp() << " - 3. Plus standard information." << std::endl << " - 4. Plus debugging information." << std::endl << " --port <n> : Set the default port to listen on" << std::endl; - exit(0); + exit(EXIT_NORMAL); } struct CommandLineOptions @@ -365,7 +366,7 @@ int main(int argc, char *argv[]) !chatHandler->startListen(options.port + 2, host)) { LOG_FATAL("Unable to create an ENet server host."); - return 3; + return EXIT_NET_EXCEPTION; } // Dump statistics every 10 seconds. @@ -402,5 +403,5 @@ int main(int argc, char *argv[]) chatHandler->stopListen(); deinitializeServer(); - return 0; + return EXIT_NORMAL; } |