]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/tcpclient.cpp
Fixed a couple bugs, and added Change history and TODO stuff
[irc/gameservirc.git] / gameserv / tcpclient.cpp
index 1c00bbddf2e08680a8b610a6e430af00e8a48712..c06f667533373adeb513973f25c0e48e4a608490 100644 (file)
@@ -36,7 +36,7 @@ using std::cerr;
 using std::endl;
 
 char *PACKAGE = "GameServ";
-char *VERSION = "1.1.8";
+char *VERSION = "1.2.0 +devel";
 
 int sock;
 int day;
@@ -60,6 +60,11 @@ int main(int argc, char *argv[])
   char *cmd, *source = NULL, *conf = "gameserv.conf";
   srand(time(NULL));
 
+  /*
+   * This needs to be fixed to work for any number of arguments in any
+   * order
+   *
+   */
   if (argc > 1)
   {
        if ( argc > 2 || stricmp(argv[1], "--help") == 0)
@@ -146,6 +151,15 @@ int main(int argc, char *argv[])
       log("Server: %s",buffer);
   #endif
 
+  strcpy(boss.name, "Red Dragon");
+  strcpy(boss.weapon, "Breath of Unholy Fire");
+  boss.strength = 6667;
+  boss.gold = 2000000000;
+  boss.exp = 2000000000;
+  strcpy(boss.death, "You finally snuff out the deadly murderous "\
+    "dragon's dark flames. You have freed the land of its terror "\
+    "filled reign from above!");
+
   init_masters();
   load_gs_dbase();
   load_day();
@@ -294,6 +308,19 @@ int main(int argc, char *argv[])
                clients.remove(quitter);
            if ((quitter = findIRCplayer(source)))
            {
+               if (player_fight(quitter))
+               {
+                   // Stop the fight on the other client
+                   aClient *otherplayer = quitter->stats->battle;
+                   otherplayer->stats->battle = NULL;
+                   notice(s_GameServ, otherplayer->getNick(), "%s "\
+                          "has quit IRC. The fight stops here.",
+                          quitter->stats->name);
+               }
+               quitter->stats->battle = NULL;
+               quitter->stats->fight = NULL;
+               quitter->stats->master = NULL;
+
                quitter->setNick("!NULL!");
                quitter->stats->user = NULL; // Unidentify them
            }
@@ -582,9 +609,9 @@ int daemon(int nochdir, int noclose)
         case -1: return -1;
         default: 
                ofstream outfile;
-               outfile.open("gameserv.pid");
+               outfile.open(pidfile);
                if (outfile.fail())
-                   cerr << "Unable to open gameserv.pid" << endl;
+                   cerr << "Unable to open " << pidfile << endl;
                outfile << pid << endl;
                outfile.close();