]> jfr.im git - irc/gameservirc.git/commitdiff
added items to the tavern.dat, added the filename option to the config file
authorkainazzzo <redacted>
Sat, 10 Sep 2005 03:42:28 +0000 (03:42 +0000)
committerkainazzzo <redacted>
Sat, 10 Sep 2005 03:42:28 +0000 (03:42 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@356 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/config.cpp
gameserv/data/items/tavern.dat
gameserv/gameserv.example.conf

index 16d968d009dd2fd3e4effb204ce41c457219b748..7fce944b4c894675b9d424c0a5e1730d02200f9f 100644 (file)
@@ -44,6 +44,7 @@ char *remoteserver;           // Server to connect to
 char *remoteport;              // Port to connect to on remoteserver
 char *remotepass;              // Password for the server link
 
+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 *dragondata;              // File to store current dragon data in
@@ -77,6 +78,8 @@ void unload_config_file()
        delete [] remotepass;
     if (playerdata)
        delete [] playerdata;
+    if (tavernitemdata)
+        delete [] tavernitemdata;
     if (itemdata)
         delete [] itemdata;
     if (dragondata)
@@ -105,7 +108,7 @@ int load_config_file(char *config)
 {
     char *buf, *directive, *value;
 
-    #define numdirectives 31
+    #define numdirectives 32
 
     unload_config_file();
 
@@ -162,6 +165,7 @@ int load_config_file(char *config)
                        "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";
 
     configflags = 0;
 
@@ -412,6 +416,13 @@ int load_config_file(char *config)
          strcpy(itemdata, value);
          directives[30].done = true;
        }
+       else if (stricmp(directive, "TAVERNITEMDATA") == 0)
+         {
+           value = strtok(NULL, "");
+           itemdata = new char[strlen(value) + 1];
+           strcpy(itemdata, value);
+           directives[31].done = true;
+         }
        else if (stricmp(directive, "WELCOMEMSG") == 0)
        {
            // This directive is optional
index ba4c76190346ad92cb386aa2a9fa8b37f0f6858b..96796120a535ab7c02fa3664fe47cccaefc055ed 100644 (file)
@@ -6,3 +6,6 @@
 6002~2
 6003~4
 6004~10
+6005~6
+6006~6
+6007~6
index 9c8b5a05823ffdf7684c2a70726936c3332ef43d..47c4f163e985ec20686b35212b65b9e6ba92ff1c 100644 (file)
@@ -99,6 +99,9 @@ playerdata players.dat
 # Filename to store the items in
 itemdata data/items/masteritems.dat
 
+# Filename to store the items that are available in the tavern
+tavernitemdata data/items/tavern.dat
+
 # Filename to store the master stats in
 masterdata data/masters.dat