X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/9f8c2accae45b8dcb8c4e26009230c5e87ed53b5..33ac4371df8917180a54eb3f79dfc5c1e2744156:/gameserv/config.cpp diff --git a/gameserv/config.cpp b/gameserv/config.cpp index 3426a67..c43f014 100644 --- a/gameserv/config.cpp +++ b/gameserv/config.cpp @@ -1,9 +1,13 @@ -#include +#include #include #include #include #include "extern.h" +using std::ifstream; +using std::cerr; +using std::endl; + void load_config_file(char *config); void unload_config_file(); @@ -30,6 +34,10 @@ char *remotepass; // Password for the server link char *playerdata; // File to store player data in char *monsterdata; // File to load monster data from +#if defined(P10) + char *gsnum = "[]AAA"; // GameServ Numeric +#endif + void unload_config_file() { if (s_GameServ) @@ -71,6 +79,7 @@ void load_config_file(char *config) infile.open(config); if (infile.fail()) { + log("Error opening %s", config); cerr << "Error opening " << config << endl; return; } @@ -78,7 +87,7 @@ void load_config_file(char *config) while (infile.getline(buf, 1024, '\n')) { #ifdef DEBUGMODE - log("Buf: %s", buf); + log("Config file entry buf: %s", buf); #endif if (buf[0] == '#' || buf[0] == ' ' || buf[0] == '\0' || buf[0] == '\n' || buf[0] == '\r') @@ -89,7 +98,9 @@ void load_config_file(char *config) if (stricmp(directive, "DIE") == 0) { value = strtok(NULL, ""); - cerr << value << endl; + log("You should read the entire %s file!", config); + cerr << "You should read the entire " << config << " file!" + << endl; exit(0); } if (stricmp(directive, "S_GAMESERV") == 0) @@ -189,6 +200,8 @@ void load_config_file(char *config) { #ifdef DEBUGMODE log("Unknown Directive. Buffer: %s", buf); + cerr << "Unknown " << config << " directive. Buffer: " + << buf << endl; #endif continue; }