char *adminpass; // Administrator password
char *welcomemsg; // Welcome Message
char *ignoreserverslist; // Servernames to ignore
+char *nsname; // NickServ's name
+char *nspass; // GameServ's NickServ Password
+
int welcomedelay; // Welcome Message Delay
int updateperiod; // Seconds until another player database update
int forestfights; // Forest fights per day
int idlecheckperiod; // Period for checking every player's idle time
int level1expire; // Days for level 1 players to expire
int defaultexpire; // Days for other levels to expire
+int maxitems; // Maximum amount of items a player can carry
long refreshperiod; // Period for refreshing players
long configflags; // Holds the bit representation of some boolean values
// Remote server stuff. This is used for the outgoing connection gameserv needs to make
// to a real ircd.
char *remoteserver; // Server to connect to
-char *remoteport; // Port to connect to on remoteserver
+char *localhost; // Hostname of the local address to bind to
+int remoteport; // Port to connect to on remoteserver
char *remotepass; // Password for the server link
+char *storeitemdata; // File to store the items available in the store
+char *tavernitemdata; // File to store the items available in the tavern
+char *itemdata; // File to store the items in
char *playerdata; // File to store player data in
-char *monsterdata; // File to load monster data from
+char *dragondata; // File to store current dragon data in
+char *masterdata; // File to store the master data in
char *newsdata; // File to store news data in
char *pidfile; // Process ID file
void unload_config_file()
{
- if (s_GameServ)
- delete [] s_GameServ;
- if (gshost)
- delete [] gshost;
- if (gsident)
- delete [] gsident;
- if (servername)
- delete [] servername;
- if (c_Forest)
- delete [] c_Forest;
- if (c_ForestTopic)
- delete [] c_ForestTopic;
- if (remoteserver)
- delete [] remoteserver;
- if (remoteport)
- delete [] remoteport;
- if (remotepass)
- delete [] remotepass;
- if (playerdata)
- delete [] playerdata;
- if (monsterdata)
- delete [] monsterdata;
- if (adminpass)
- delete [] adminpass;
- if (welcomemsg)
- delete [] welcomemsg;
- if (pidfile)
- delete [] pidfile;
- if (ignoreserverslist)
- delete [] ignoreserverslist;
- if (newsdata)
- delete [] newsdata;
+ if (s_GameServ)
+ delete [] s_GameServ;
+ if (gshost)
+ delete [] gshost;
+ if (gsident)
+ delete [] gsident;
+ if (servername)
+ delete [] servername;
+ if (c_Forest)
+ delete [] c_Forest;
+ if (c_ForestTopic)
+ delete [] c_ForestTopic;
+ if (remoteserver)
+ delete [] remoteserver;
+ if (localhost)
+ delete [] localhost;
+ if (remotepass)
+ delete [] remotepass;
+ if (playerdata)
+ delete [] playerdata;
+ if (storeitemdata)
+ delete [] storeitemdata;
+ if (tavernitemdata)
+ delete [] tavernitemdata;
+ if (itemdata)
+ delete [] itemdata;
+ if (dragondata)
+ delete [] dragondata;
+ if (masterdata)
+ delete [] masterdata;
+ if (adminpass)
+ delete [] adminpass;
+ if (welcomemsg)
+ delete [] welcomemsg;
+ if (pidfile)
+ delete [] pidfile;
+ if (ignoreserverslist)
+ delete [] ignoreserverslist;
+ if (newsdata)
+ delete [] newsdata;
+ if (nsname)
+ delete [] nsname;
+ if (nspass)
+ delete [] nspass;
- configflags = 0;
+ configflags = 0;
}
int load_config_file(char *config)
{
char *buf, *directive, *value;
- #define numdirectives 26
+ #define numdirectives 35
unload_config_file();
directives[7].desc = "REMOTEPORT - Port on the remote server to connect to";
directives[8].desc = "REMOTEPASS - Password on the remote server";
directives[9].desc = "PLAYERDATA - File to store the player saves in";
- directives[10].desc = "MONSTERDATA - File to load the monsters from";
+ directives[10].desc = "SAVEDNOTICE - True/False as to wether or not to tell the forest "\
+ "channel that the player database has been saved";
directives[11].desc = "ADMINPASS - Password to identify as an admin with";
directives[12].desc = "WELCOMEDELAY - Delay (in seconds) to wait before welcoming new users to the network";
directives[13].desc = "FORESTFIGHTS - Number of forest fights players get every day";
directives[24].desc = "DEFAULTEXPIRE - Amount of days until a "\
"level 2 and above player's account is "\
"deleted due to inactivity";
- directives[25].desc = "SAVEDNOTICE - True/False as to "\
- "whether or not the c_Forest channel "\
- "will be notified every time the player "\
- "data is saved";
+ directives[25].desc = "USENICKSERV - True/False as to wether or not "\
+ "GameServ should identify with NickServ";
+ directives[26].desc = "NSNAME - Your network's NickServ nickname";
+ directives[27].desc = "NSPASS - GameServ's NickServ Password";
+ directives[28].desc = "DRAGONDATA - File to store the current "\
+ "dragon's stats in";
+ directives[29].desc = "MASTERDATA - File to store the level master stats in";
+ directives[30].desc = "ITEMDATA - File to store the items in";
+ directives[31].desc = "TAVERNITEMDATA - File in which to store the items that are available in the tavern";
+ directives[32].desc = "MAXITEMS - Maximum number of items a player can carry";
+ directives[33].desc = "STOREITEMDATA - File in which to store the items that are available in the store";
+ directives[34].desc = "LOCALHOST - Local hostname or IP to bind to when connecting to the remote server";
configflags = 0;
else if (stricmp(directive, "REMOTEPORT") == 0)
{
value = strtok(NULL, " ");
- remoteport = new char[strlen(value) + 1];
- strcpy(remoteport, value);
+ remoteport = stringtoint(value);
directives[7].done = true;
}
else if (stricmp(directive, "REMOTEPASS") == 0)
strcpy(playerdata, value);
directives[9].done = true;
}
- else if (stricmp(directive, "MONSTERDATA") == 0)
+ else if (stricmp(directive, "SAVEDNOTICE") == 0)
{
value = strtok(NULL, "");
- monsterdata = new char[strlen(value) + 1];
- strcpy(monsterdata, value);
+ if (stricmp(value, "TRUE") == 0)
+ setSavedNotice();
directives[10].done = true;
}
else if (stricmp(directive, "ADMINPASS") == 0)
defaultexpire = stringtoint(value);
directives[24].done = true;
}
+ else if (stricmp(directive, "USENICKSERV") == 0)
+ {
+ value = strtok(NULL, " ");
+ if (stricmp(value, "TRUE") == 0)
+ {
+ setUseNickServ();
+ }
+
+ directives[25].done = true;
+ }
+ else if (stricmp(directive, "NSNAME") == 0)
+ {
+ value = strtok(NULL, "");
+ nsname = new char[strlen(value) + 1];
+ strcpy(nsname, value);
+ directives[26].done = true;
+ }
+ else if (stricmp(directive, "NSPASS") == 0)
+ {
+ value = strtok(NULL, "");
+ nspass = new char[strlen(value) + 1];
+ strcpy(nspass, value);
+ directives[27].done = true;
+ }
+ else if (stricmp(directive, "DRAGONDATA") == 0)
+ {
+ value = strtok(NULL, "");
+ dragondata = new char[strlen(value) + 1];
+ strcpy(dragondata, value);
+ directives[28].done = true;
+ }
+ else if (stricmp(directive, "MASTERDATA") == 0)
+ {
+ value = strtok(NULL, "");
+ masterdata = new char[strlen(value) + 1];
+ strcpy(masterdata, value);
+ directives[29].done = true;
+ }
+ else if (stricmp(directive, "ITEMDATA") == 0)
+ {
+ value = strtok(NULL, "");
+ itemdata = new char[strlen(value) + 1];
+ strcpy(itemdata, value);
+ directives[30].done = true;
+ }
+ else if (stricmp(directive, "TAVERNITEMDATA") == 0)
+ {
+ value = strtok(NULL, "");
+ tavernitemdata = new char[strlen(value) + 1];
+ strcpy(tavernitemdata, value);
+ directives[31].done = true;
+ }
+ else if (stricmp(directive, "MAXITEMS") == 0)
+ {
+ value = strtok(NULL, "");
+ maxitems = stringtoint(value);
+ directives[32].done = true;
+ }
+ else if (stricmp(directive, "STOREITEMDATA") == 0)
+ {
+ value = strtok(NULL, "");
+ storeitemdata = new char[strlen(value) + 1];
+ strcpy(storeitemdata, value);
+ directives[33].done = true;
+ }
+ else if (stricmp(directive, "LOCALHOST") == 0)
+ {
+ value = strtok(NULL, "");
+ localhost = new char[strlen(value) + 1];
+ strcpy(localhost, value);
+ directives[34].done = true;
+ }
else if (stricmp(directive, "WELCOMEMSG") == 0)
{
// This directive is optional
ignoreserverslist = new char[strlen(value) + 1];
strcpy(ignoreserverslist, value);
}
- else if (stricmp(directive, "SAVEDNOTICE") == 0)
- {
- value = strtok(NULL, " ");
- if (stricmp(value, "TRUE") == 0)
- setSavedNotice();
-
- directives[25].done = true;
- }
else
{
#ifdef DEBUGMODE