]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/gameserv.cpp
P10 is now functional. The game is playable, but it does not display text nicknames...
[irc/gameservirc.git] / gameserv / gameserv.cpp
index 960371b2d8f269f39d28729111f3a5c726b7672c..b711e28696e3b0feccbb5d95c65749a9a0cf1234 100644 (file)
@@ -22,6 +22,7 @@ using std::ofstream;
 #endif
 
 List<aClient> players;
+
 Monster *monsters[LEVELS][MONSTERS];   // Monsters per level. Total = MONSTERS * LEVELS
 
 Monster *masters[LEVELS];              // A master for each level
@@ -136,8 +137,12 @@ void gameserv(char *source, char *buf)
     char *cmd;
     cmd = strtok(buf, " ");
 
-    source++; // Get rid of that : at the beginning of a :Nick privmsg Gameserv :text
-    cmd++;    // Get rid of that : at the beginning of the :text  (command)
+    #ifndef P10
+        source++; // Get rid of that : at the beginning of a :Nick privmsg Gameserv :text
+    #endif
+
+    if (cmd[0] == ':')
+        cmd++;    // Get rid of that : at the beginning of the :text  (command)
 
     #ifdef DEBUGMODE
        log("Source: %s  Command: %s", source, cmd);
@@ -195,6 +200,13 @@ void gameserv(char *source, char *buf)
        do_tavern(source);
     } else if (stricmp(cmd, "LIST") == 0) {
        do_list(source);
+    #ifdef DEBUGMODE
+    } else if (stricmp(cmd, "PRINT") == 0) {
+       cout << "Printing the clients list:" << endl;
+       clients.print();
+       cout << "\nPrinting the players list:" << endl;
+       players.print();
+    #endif
     } else if (stricmp(cmd, "REGISTER") == 0) {
        do_register(source);
     } else if (stricmp(cmd, "IDENTIFY") == 0) {
@@ -420,11 +432,23 @@ void notice(const char *source, const char *dest, const char *fmt, ...)
     if (dest[0] == ':')
     {
        dest++;
+
+      #if !defined(P10)
        sprintf(input, ":%s NOTICE %s :", source, dest);
+      #else
+       sprintf(input, "%s O %s :", gsnum, dest);
+      #endif
+
        dest--;
     }
     else
+    {
+      #if !defined(P10)
        sprintf(input, ":%s NOTICE %s :", source, dest);
+      #else
+       sprintf(input, "%s O %s :", gsnum, dest);
+      #endif
+    }
 
     for (; *t; t++)
     {