]> jfr.im git - irc/gameservirc.git/commitdiff
I am rewriting the notice() printf type functions to use vsnprintf() so that all...
authorkainazzzo <redacted>
Sat, 13 Jan 2007 07:30:55 +0000 (07:30 +0000)
committerkainazzzo <redacted>
Sat, 13 Jan 2007 07:30:55 +0000 (07:30 +0000)
get parsed, like %20s  for a string with 20 spaces. This should help with some memory leaks.

git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@467 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/c_forest.cpp
gameserv/do_attack.cpp
gameserv/gameserv.cpp
gameserv/tcpclient.cpp
gameserv/toplist.cpp
gameserv/toplist.h

index c20cfb43fa2aa33372b1ae82cde147457e3cf5dd..2b159895295eb445ffe330621895bff632f9a967 100644 (file)
@@ -39,7 +39,7 @@ void do_forest(char *u)
   
   if (!(source = find(u)))
     {
-         notice(s_GameServ, u, "Fatal Error in do_forest. Contact a %S admin for help.");
+         notice(s_GameServ, u, "Fatal Error in do_forest. Contact a <S admin for help.");
          return;
     }
   else if (!is_playing(source))
index be2f14e3a28d0c29abe35b6597b7ccee0291ff4a..023bd3800c986fba081a86483fc9362e8585689b 100644 (file)
@@ -14,7 +14,7 @@ void do_attack(char *u)
   
   if (!(ni = find(u)))
     {
-      notice(s_GameServ, u, "Fatal error in do_attack. Contact a(n) %S admin for help.");
+      notice(s_GameServ, u, "Fatal error in do_attack. Contact a(n) <S admin for help.");
       return;
     }
   else if (isIgnore(ni))
index 30145320c24a00329d4e9d62fa19c0b6805cb674..e3f63395f97fe7e5e8b15c2622e7a1ec7879a76d 100644 (file)
@@ -186,7 +186,7 @@ void gameserv(char *source, char *buf)
          cmd = strtok(NULL, " ");
          
          if (!cmd)
-           notice(s_GameServ, source, "SYNTAX: /msg %S SEARCH FOREST");
+           notice(s_GameServ, source, "SYNTAX: /msg <S SEARCH FOREST");
          else
            do_forest(source);
          
@@ -293,12 +293,12 @@ void gameserv(char *source, char *buf)
          
          if (!(user = find(source)))
                {
-                 notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+                 notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
                  log("Error: aClient not found: %s", source);
                }
          else if (!isAdmin(user))
                {
-                 notice(s_GameServ, source, "You must be a %S admin to use this command!");
+                 notice(s_GameServ, source, "You must be a <S admin to use this command!");
                }
          else
                {
@@ -317,12 +317,12 @@ void gameserv(char *source, char *buf)
          
          if (!(user = find(source)))
                {
-                 notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+                 notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
                  log("Error: aClient not found: %s", source);
                }
          else if (!isAdmin(user))
                {
-                 notice(s_GameServ, source, "You must be a %S admin to use this command!");
+                 notice(s_GameServ, source, "You must be a <S admin to use this command!");
                }
          else
         {
@@ -335,12 +335,12 @@ void gameserv(char *source, char *buf)
          
          if (!(user = find(source)))
                {
-                 notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+                 notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
                  log("Error: aClient not found: %s", source);
                }
          else if (!isAdmin(user))
                {
-                 notice(s_GameServ, source, "You must be a %S admin to use this command!");
+                 notice(s_GameServ, source, "You must be a <S admin to use this command!");
                }
          else
         {
@@ -377,12 +377,12 @@ void gameserv(char *source, char *buf)
          
          if (!(user = find(source)))
                {
-                 notice(s_GameServ, source, "Error: aClient not found. Contact a %S admin");
+                 notice(s_GameServ, source, "Error: aClient not found. Contact a <S admin");
                  log("Error: aClient not found: %s", source);
                }
          else if (!isAdmin(user))
                {
-                 notice(s_GameServ, source, "You must be a %S admin to use this command!");
+                 notice(s_GameServ, source, "You must be a <S admin to use this command!");
                }
          else
         {
@@ -411,7 +411,7 @@ void gameserv(char *source, char *buf)
                        }
                  else
                        {
-                         notice(s_GameServ, source, "Unknown command \002%s\002. Type /msg %S \002HELP\002 to get a list of commands.", cmd);
+                         notice(s_GameServ, source, "Unknown command \002%s\002. Type /msg <S \002HELP\002 to get a list of commands.", cmd);
                        }
                }
     }
@@ -510,22 +510,21 @@ char *spaces(int len, char *seperator)
 void raw(const char *fmt, ...)
 {
     va_list args;
-    char *input;
+    char *input, *buffer;
     const char *t = fmt;
-    input = new char[1024];
+    input = new char[2048];
+    buffer = new char[1024];
     va_start(args, fmt);
+    vsnprintf(buffer, 1024, fmt, args);
+    va_end(args);
+
     memset(input, 0, sizeof(input)); // Initialize to NULL
-    for (; *t; t++)
+    for (t = buffer; *t; t++)
     {
-       if (*t == '%')
+       if (*t == '<')
        {
            switch(*++t) {
-               case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break;
-               case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break;
-               case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
-               case 'l':
-                  if (*++t == 'd')
-                         sprintf(input, "%s%ld", input, va_arg(args, long int)); break;
+            case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
            }
        }
        else
@@ -541,85 +540,84 @@ void raw(const char *fmt, ...)
     sprintf(input, "%s%s", input, "\r\n");
     sock_puts(sock, input);
     delete [] input;
-    va_end(args);
+    delete [] buffer;
 }
 /* Send a NOTICE from the given source to the given nick. */
 
 void notice(const char *source, const char *dest, const char *fmt, ...)
 {
     if (fmt[0] == '\0')
-       return;
+        return;
 
     char *commanduse;
     commanduse = new char[16];
 
     #ifdef P10
-       if (isUsePrivmsg())
-           strcpy(commanduse, "P");
-       else
-           strcpy(commanduse, "O");
+        if (isUsePrivmsg())
+            strcpy(commanduse, "P");
+        else
+            strcpy(commanduse, "O");
     #else
 
-       if (isUsePrivmsg())
-           strcpy(commanduse, "PRIVMSG");
-       else
-           strcpy(commanduse, "NOTICE");
+        if (isUsePrivmsg())
+            strcpy(commanduse, "PRIVMSG");
+        else
+            strcpy(commanduse, "NOTICE");
     #endif
 
     va_list args;
-    char *input;
+    char *input, *buffer;
     const char *t = fmt;
-    input = new char[1024];
+    input = new char[2048];
+    buffer = new char[1024];
     va_start(args, fmt);
+    vsnprintf(buffer, 1024, fmt, args);
+    va_end(args);
+
     if (dest[0] == ':')
     {
-       dest++;
+        dest++;
 
       #if !defined(P10)
-       sprintf(input, ":%s %s %s :", source, commanduse, dest);
+        sprintf(input, ":%s %s %s :", source, commanduse, dest);
       #else
-       sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
+        sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
       #endif
 
-       dest--;
+        dest--;
     }
     else
     {
       #if !defined(P10)
-       sprintf(input, ":%s %s %s :", source, commanduse, dest);
+        sprintf(input, ":%s %s %s :", source, commanduse, dest);
       #else
-       sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
+        sprintf(input, "%s %s %s :", gsnum, commanduse, dest);
       #endif
     }
-
-    for (; *t; t++)
+    log("buffer: %s", buffer);
+    for (t = buffer; *t; t++)
     {
-       if (*t == '%')
-       {
-           switch(*++t) {
-               case 'd': sprintf(input, "%s%d", input, va_arg(args, int)); break; 
-               case 's': sprintf(input, "%s%s", input, va_arg(args, char *)); break;
-               case 'S': sprintf(input, "%s%s", input, s_GameServ); break;
-               case 'c': sprintf(input, "%s%c", input, va_arg(args, int)); break;
-               case 'l':
-                  if (*++t == 'd')
-                         sprintf(input, "%s%ld", input, va_arg(args, long int)); break;
-           }
-       }
-       else
-       {
-           sprintf(input, "%s%c", input, *t);
-       }
+        if (*t == '<')
+        {
+            if(*(++t) == 'S')
+            {
+             sprintf(input, "%s%s", input, s_GameServ);
+            }
+        }
+        else
+        {
+            sprintf(input, "%s%c", input, *t);
+        }
 
     }
     #ifdef DEBUGMODE
-       log("Input: %s", input);
+        log("Input: %s", input);
     #endif
     sprintf(input, "%s%s", input, "\r\n");
     sock_puts(sock, input);
     delete [] commanduse;
     delete [] input;
-va_end(args);
+    delete [] buffer;
 }
 
 
@@ -707,40 +705,66 @@ void do_list(char *u)
          return;
     }
   
-  list<Player*>::iterator iter;
-  bool header = false;
+  if (stricmp(cmd, "TOP") == 0)
+  {
+     list<Player>::iterator iter;
+     bool header = false;
+     
+     iter = myToplist.begin();
+     
+     while (iter != myToplist.end())
+     {
+        
+        p = &(*iter);
+        if (!header)
+        {
+           notice(s_GameServ, u, "Top Players");
+           header = true;
 
-  for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
-       {
-         iter = players[x].begin();
-         if (!players[x].empty())
-               {
-                 while(iter != players[x].end())
-                       {
-                         p = (*iter);
-                         if (cmd || is_playing(p->getClient()))
-                               {
-                                 if (!header)
-                                       {
-                                         notice(s_GameServ, u, "Players:");
-                                         header = true;
-                                       }
-#ifdef P10
-                                 notice(s_GameServ, u, "IRC: %s     Game: %s", (p->getClient() ? p->getClient()->getRealNick() : "Not Playing"), 
-                                                p->getName().c_str());
-#else
-                                 notice(s_GameServ, u, "IRC: %s     Game: %s", (p->getClient() ? p->getClient()->getNick() : "Not Playing"), 
-                                                p->getName().c_str());
-#endif
-                               }
-                         iter++;
-                       }
-               }
-       }
-  if (!header)
-       notice(s_GameServ, u, "No one is playing");
+        }
+        notice(s_GameServ, u, "Name: %s  Level: %d", 
+        p->getName().c_str(), p->getLevel());
+        iter++;
+     }
+  }
   else
-       notice(s_GameServ, u, "End of List"); 
+  {
+        
+     list<Player*>::iterator iter;
+     bool header = false;
+   
+     for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
+      {
+        iter = players[x].begin();
+        if (!players[x].empty())
+         {
+           while(iter != players[x].end())
+            {
+              p = (*iter);
+              if (cmd || is_playing(p->getClient()))
+               {
+                 if (!header)
+                  {
+                    notice(s_GameServ, u, "Players:");
+                    header = true;
+                  }
+      #ifdef P10
+                 notice(s_GameServ, u, "IRC: %s     Game: %s", (p->getClient() ? p->getClient()->getRealNick() : "Not Playing"), 
+                      p->getName().c_str());
+      #else
+                 notice(s_GameServ, u, "IRC: %s     Game: %s", (p->getClient() ? p->getClient()->getNick() : "Not Playing"), 
+                      p->getName().c_str());
+      #endif
+               }
+              iter++;
+            }
+         }
+      }
+     if (!header)
+      notice(s_GameServ, u, "No one is playing");
+     else
+      notice(s_GameServ, u, "End of List"); 
+   }
 }
 
 void do_set(char *u)
@@ -766,7 +790,7 @@ void do_set(char *u)
     }
   else if (!name || !cmd)
     {
-      notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+      notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
       return;
     }
   else if (!(p = findplayer(name)))
@@ -788,7 +812,7 @@ void do_set(char *u)
     }
   if (!cmd2)
        {
-         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
          return;
        }
   
@@ -805,7 +829,7 @@ void do_set(char *u)
                }
       else if (user != p->getClient() && !isAdmin(user))
                {
-                 notice(s_GameServ, u, "You must be a %S admin to set other peoples' passwords.");
+                 notice(s_GameServ, u, "You must be a <S admin to set other peoples' passwords.");
                  return;
                }
     }
@@ -822,7 +846,7 @@ void do_set(char *u)
                }
          if (!cmd2)
                {
-                 notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] [BANK] BALANCE <NUMBER>");
+                 notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] [BANK] BALANCE <NUMBER>");
                  return;
                }
          
@@ -839,7 +863,7 @@ void do_set(char *u)
                }
       else if (stricmp(cmd2, "FIGHTS") != 0)
                {
-                 notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
+                 notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] PLAYER FIGHTS <NUMBER>");
                  return;
                }
       else
@@ -847,7 +871,7 @@ void do_set(char *u)
                  cmd2 = strtok(NULL, " ");
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] PLAYER FIGHTS <NUMBER>");
                          return;
                        }
                  p->setPlayerFights(stringtoint(cmd2));
@@ -864,7 +888,7 @@ void do_set(char *u)
                }
       else if (stricmp(cmd2, "FIGHTS") != 0)
                {
-                 notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] FOREST FIGHTS <number>");
+                 notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] FOREST FIGHTS <number>");
                  return;
                }
       else
@@ -872,7 +896,7 @@ void do_set(char *u)
                  cmd2 = strtok(NULL, " ");
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] FOREST FIGHTS <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] FOREST FIGHTS <NUMBER>");
                          return;
                        }
                  
@@ -892,7 +916,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] GOLD <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] GOLD <NUMBER>");
                          return;
                        }
                  p->setGold(stringtoint(cmd2));
@@ -912,7 +936,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] STRENGTH <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] STRENGTH <NUMBER>");
                          return;
                        }
                  
@@ -933,7 +957,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] DEFENSE <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] DEFENSE <NUMBER>");
                          return;
                        }
                  
@@ -954,7 +978,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] HP <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] HP <NUMBER>");
                          return;
                        }
 
@@ -979,7 +1003,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] MAXHP <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] MAXHP <NUMBER>");
                          return;
                        }
                  p->setMaxHP(stringtoint(cmd2));
@@ -999,7 +1023,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {EXPERIENCE|EXP} <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {EXPERIENCE|EXP} <NUMBER>");
                          return;
                        }
                  
@@ -1020,7 +1044,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] LEVEL <NUMBER>");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] LEVEL <NUMBER>");
                          return;
                        }
                  p->setLevel(stringtoint(cmd2));
@@ -1040,7 +1064,7 @@ void do_set(char *u)
                {
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] ALIVE TRUE|FALSE");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] ALIVE TRUE|FALSE");
                          return;
                        }
                  else if (stricmp(cmd2, "TRUE") == 0)
@@ -1064,7 +1088,7 @@ void do_set(char *u)
                }
       else if (stricmp(cmd2, "MASTER") != 0)
                {
-                 notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] SEEN MASTER {TRUE|FALSE}");
+                 notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] SEEN MASTER {TRUE|FALSE}");
                  return;
                }
       else
@@ -1072,7 +1096,7 @@ void do_set(char *u)
                  cmd2 = strtok(NULL, " ");
                  if (!cmd2)
                        {
-                         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NICK] SEEN MASTER {TRUE|FALSE}");
+                         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NICK] SEEN MASTER {TRUE|FALSE}");
                          return;
                        }
                  else if (stricmp(cmd2, "TRUE") == 0)
@@ -1090,7 +1114,7 @@ void do_set(char *u)
   else
        {
          notice(s_GameServ, u, "Unknown command: SET %s", cmd);
-         notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
+         notice(s_GameServ, u, "SYNTAX: /msg <S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
          return;
        }
 }
@@ -1121,7 +1145,7 @@ void do_logout(char *u)
     {
          if (!isAdmin(user))
                {
-                 notice(s_GameServ, u, "You must be a %S admin to use this command!");
+                 notice(s_GameServ, u, "You must be a <S admin to use this command!");
                }
          else if (!(p = findplayer(name)))
                {
@@ -1165,7 +1189,7 @@ void logout(aClient *user)
                  if (iter == players[hv].end())
                        {
                          notice(s_GameServ, user->getNick(), "Fatal error. Contact "\
-                                        "%S Admin. Cannot find you in the players list. This should NEVER happen");
+                                        "<S Admin. Cannot find you in the players list. This should NEVER happen");
                          log("Error on logout(). Can't find %s in the players list",
 #ifdef P10 
                                  user->getRealNick()
@@ -1218,15 +1242,15 @@ void do_register(char *u)
   
   if (!name)
     {
-         notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER NAME PASSWORD");
+         notice(s_GameServ, u, "SYNTAX: /msg <S REGISTER NAME PASSWORD");
     }
   else if (stricmp(name, s_GameServ) == 0)
     {
-         notice(s_GameServ, u, "You can't use %S as a name!");
+         notice(s_GameServ, u, "You can't use <S as a name!");
     }
   else if (!password)
     {
-         notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER NAME PASSWORD");
+         notice(s_GameServ, u, "SYNTAX: /msg <S REGISTER NAME PASSWORD");
     }
   else if (strlen(name) > maxnicklen)
        {
@@ -1303,7 +1327,7 @@ void do_register(char *u)
                }
          else
                {
-                 notice(s_GameServ, u, "Already registered. Contact a %S admin for help.");
+                 notice(s_GameServ, u, "Already registered. Contact a <S admin for help.");
                }
     }
 }
@@ -1317,7 +1341,7 @@ void do_identify(char *u)
   password = strtok(NULL, " ");
   if (!password || !name)
     {
-         notice(s_GameServ, u, "SYNTAX: /msg %S IDENTIFY NAME PASSWORD");
+         notice(s_GameServ, u, "SYNTAX: /msg <S IDENTIFY NAME PASSWORD");
     }
   else if (!(user = find(u)))
     {
@@ -1356,7 +1380,7 @@ void do_identify(char *u)
 
          if (iter == players[hv].end())
                {
-                 notice(s_GameServ, u, "Fatal error. Contact %S Admin. Buf: %s", 
+                 notice(s_GameServ, u, "Fatal error. Contact <S Admin. Buf: %s", 
                                 strtok(NULL, ""));
                  return;
                }
@@ -1497,8 +1521,8 @@ void display_monster(char *u)
          notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", ni->getHP());
          notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", ni->getMonster()->name.c_str(), ni->getMonster()->hp);
          notice(s_GameServ, u, "Here are your commands:");
-         notice(s_GameServ, u, "/msg %S attack");
-         notice(s_GameServ, u, "/msg %S run");
+         notice(s_GameServ, u, "/msg <S attack");
+         notice(s_GameServ, u, "/msg <S run");
          notice(s_GameServ, u, "What will you do?");
     }
 }
@@ -1523,8 +1547,8 @@ void display_players(aClient *user)
          notice(s_GameServ, u, "Your Hitpoints: \ 2%d\ 2", user->stats->getHP());
          notice(s_GameServ, u, "%s's Hitpoints: \ 2%d\ 2", battle->stats->getName().c_str(), battle->stats->getHP());
          notice(s_GameServ, u, "Here are your commands:");
-         notice(s_GameServ, u, "/msg %S attack");
-         notice(s_GameServ, u, "/msg %S run");
+         notice(s_GameServ, u, "/msg <S attack");
+         notice(s_GameServ, u, "/msg <S run");
          notice(s_GameServ, u, "What will you do?");
     }
 }
@@ -1655,12 +1679,12 @@ void do_fight(char *u)
   
   if (!nick)
     {
-         notice(s_GameServ, u, "SYNTAX: /msg %S FIGHT PLAYER");
+         notice(s_GameServ, u, "SYNTAX: /msg <S FIGHT PLAYER");
          return;
     }
   else if (!(ni = find(u)))
     {
-         notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+         notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
          return;
     }
   else if (isIgnore(ni))
@@ -1788,12 +1812,12 @@ void do_equip(char *u)
   if (!item || int(item[0]) < 48 || int(item[0] > 57))
     {
       notice(s_GameServ, u, "SYNTAX: EQUIP ####");
-      notice(s_GameServ, u, "Type /msg %S HELP EQUIP for more information.");
+      notice(s_GameServ, u, "Type /msg <S HELP EQUIP for more information.");
       return;
     }
   else if (!(user = find(u)))
     {
-      notice(s_GameServ, u, "Fatal error in do_equip. Contact a(n) %S Admin");
+      notice(s_GameServ, u, "Fatal error in do_equip. Contact a(n) <S Admin");
       return;
     }
   else if (isIgnore(user))
@@ -1824,7 +1848,7 @@ void do_equip(char *u)
       }
     else if (equip->getItem()->getType() != ARMOR && equip->getItem()->getType() != WEAPON)
       {
-               notice(s_GameServ, u, "You can't use %s like that. Try /msg %S use", equip->getItem()->getName().c_str());
+               notice(s_GameServ, u, "You can't use %s like that. Try /msg <S use", equip->getItem()->getName().c_str());
       }
     else
       {
@@ -1847,12 +1871,12 @@ void do_use(char *u)
   if (!item || int(item[0]) < 48 || int(item[0]) > 57 || (numuse && (int(numuse[0]) < 48 || int(numuse[0]) > 57)))
     {
          notice(s_GameServ, u, "SYNTAX: USE ####");
-         notice(s_GameServ, u, "Type /msg %S HELP USE for more information.");
+         notice(s_GameServ, u, "Type /msg <S HELP USE for more information.");
          return;
     }
   else if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal Error in do_use. Contact a(n) %S Admin");
+         notice(s_GameServ, u, "Fatal Error in do_use. Contact a(n) <S Admin");
          return;
     }
   else if (isIgnore(user))
@@ -1892,7 +1916,7 @@ void do_use(char *u)
        }
   else if (used->getItem()->getType() != POTION)
        {
-         notice(s_GameServ, u, "You can't use %s like that. Try /msg %S equip", used->getItem()->getName().c_str());
+         notice(s_GameServ, u, "You can't use %s like that. Try /msg <S equip", used->getItem()->getName().c_str());
        }
   else
        {
@@ -1937,7 +1961,7 @@ void do_run(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Couldn't find you. Error. Contact a %S admin");
+         notice(s_GameServ, u, "Couldn't find you. Error. Contact a <S admin");
          return;
     }
   else if (isIgnore(user))
@@ -2076,12 +2100,12 @@ void do_heal(char *u)
   
   if (!amount)
     {
-         notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}");
+         notice(s_GameServ, u, "SYNTAX: /msg <S HEAL {ALL | #}");
          return;
     }
   else if (!(ni = find(u)))
     {
-       notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+       notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
        return;
     }
     else if (isIgnore(ni))
@@ -2163,7 +2187,7 @@ void do_heal(char *u)
     else if (amount[0] == '-')
         notice(s_GameServ, u, "You trying to cheat?");
     else
-       notice(s_GameServ, u, "SYNTAX: /msg %S HEAL {ALL | #}");
+       notice(s_GameServ, u, "SYNTAX: /msg <S HEAL {ALL | #}");
 }
 
 int isstringnum(char *num)
@@ -2564,6 +2588,7 @@ int load_gs_dbase()
                        }
                }
          p->inventory->sort();
+     myToplist.insertPlayer(p);
          players[hv].push_back(p);
        }
 
@@ -2665,11 +2690,12 @@ void do_store(char *u)
                          if ((*item_iterator)->getType() == WEAPON)
                                {
                                  space = spaces(strlen((*item_iterator)->getName().c_str()), ".");
-                                 notice(s_GameServ, u, "%s%ld. %s%s%ld", ((*item_iterator)->getID() < 10 ? " " : ""), (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), space, (*item_iterator)->price());
-                                 free(space);
+                                 notice(s_GameServ, u, "%s%ld. %20s..........%ld", 
+              ((*item_iterator)->getID() < 10 ? " " : ""), 
+              (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), (*item_iterator)->price());
                                }
                        }
-                 notice(s_GameServ, u, "To purchase a weapon, type /msg %S STORE BUY \ 2#\ 2.");
+                 notice(s_GameServ, u, "To purchase a weapon, type /msg <S STORE BUY \ 2#\ 2.");
                  notice(s_GameServ, u, "Where # is the weapon number from the menu above.");
                  
                }
@@ -2681,13 +2707,14 @@ void do_store(char *u)
             {
                          if ((*item_iterator)->getType() == ARMOR)
                                {
-                                 space = spaces(strlen((*item_iterator)->getName().c_str()), ".");
-                                 notice(s_GameServ, u, "%s%ld. %s%s%d",((*item_iterator)->getID() < 10 ? " " : ""), (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), space, (*item_iterator)->price());
-                                 free(space);
+                                 notice(s_GameServ, u, "%s%ld. %20s..........%d",
+              ((*item_iterator)->getID() < 10 ? " " : ""), 
+               (*item_iterator)->getID(), (*item_iterator)->getName().c_str(), 
+               (*item_iterator)->price());
                                }
             }
                  
-                 notice(s_GameServ, u, "To purchase armor, type /msg %S store buy #");
+                 notice(s_GameServ, u, "To purchase armor, type /msg <S store buy #");
                  notice(s_GameServ, u, "Where # is the armor number from the menu above.");
                }
       
@@ -2724,7 +2751,7 @@ void do_store(char *u)
                {
                  notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", tempItem->getName().c_str());
                  p->subtractGold(tempItem->price());
-                 notice(s_GameServ, u, "Don't forget to type /msg %S equip %ld", tempItem->getID());
+                 notice(s_GameServ, u, "Don't forget to type /msg <S equip %ld", tempItem->getID());
                }
          else
                {
@@ -2738,7 +2765,7 @@ void do_store(char *u)
       id = stringtoint(num);
       if (!isstringnum(num))
                {
-                 notice(s_GameServ, u, "SYNTAX: /msg %S store sell #");
+                 notice(s_GameServ, u, "SYNTAX: /msg <S store sell #");
                  return;
                }
       else if (!(tempContainer = p->inventory->Find(id)))
@@ -2785,7 +2812,7 @@ void do_inventory(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal Error. Contact a %S admin!");
+         notice(s_GameServ, u, "Fatal Error. Contact a <S admin!");
          return;
     }
   else if (isIgnore(user))
@@ -2859,7 +2886,7 @@ void do_tavern(char *u)
   
   if (!(user = find(u)))
     {
-      notice(s_GameServ, u, "Fatal Error. See a %S admin for help");
+      notice(s_GameServ, u, "Fatal Error. See a <S admin for help");
       return;
     }
   else if (isIgnore(user))
@@ -2887,14 +2914,14 @@ void do_tavern(char *u)
     {
       notice(s_GameServ, u, "Welcome to Boot Liquors Mystic Apothecary and General Store");
       notice(s_GameServ, u, "Your commands:");
-      notice(s_GameServ, u, "/msg %S TAVERN {LIST | BUY} [NUMBER]");
+      notice(s_GameServ, u, "/msg <S TAVERN {LIST | BUY} [NUMBER]");
       notice(s_GameServ, u, "What'll it be?");
     }
   else if (stricmp(cmd, "LIST") == 0)
     {
       notice(s_GameServ, u, "Here is a list of what we have to offer:");
       showTavern(user);
-      notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+      notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
     }
   else if (stricmp(cmd, "BUY") == 0)
     {
@@ -2908,8 +2935,8 @@ void do_tavern(char *u)
       if (!chid)
                {
                  notice(s_GameServ, u, "SYNTAX: TAVERN BUY # [#]");
-                 notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 6001");
-                 notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 6001 10");
+                 notice(s_GameServ, u, "Example: /msg <S TAVERN BUY 6001");
+                 notice(s_GameServ, u, "Example: /msg <S TAVERN BUY 6001 10");
                  return;
                }
       long id = stringtoint(chid);
@@ -2920,7 +2947,7 @@ void do_tavern(char *u)
                  notice(s_GameServ, u, "Invalid Choice!");
                  notice(s_GameServ, u, "Here is a list of what we have to offer:");
                  showTavern(user);
-                 notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+                 notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
                  return;
                }
       else if (!amount && user->stats->getGold() < tempItem->getItem()->price())
@@ -2928,14 +2955,14 @@ void do_tavern(char *u)
                  notice(s_GameServ, u, "You don't have enough gold!");
                  notice(s_GameServ, u, "Here is a list of what we have to offer:");
                  showTavern(user);
-                 notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY #");
+                 notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY #");
                }
          else if (user->stats->getGold() < amt * tempItem->getItem()->price())
                {
                  notice(s_GameServ, u, "You don't have enough gold!");
                  notice(s_GameServ, u, "Here is a list of what we have to offer:");
                  showTavern(user);
-                 notice(s_GameServ, u, "To buy an item, type /msg %S TAVERN BUY # [#]");
+                 notice(s_GameServ, u, "To buy an item, type /msg <S TAVERN BUY # [#]");
                }
          else
                {
@@ -2973,7 +3000,7 @@ void do_tavern(char *u)
   else
     {
       notice(s_GameServ, u, "Improper Syntax.");
-      notice(s_GameServ, u, "Type /msg %S HELP TAVERN for help");
+      notice(s_GameServ, u, "Type /msg <S HELP TAVERN for help");
     }
   return;
 }
@@ -2995,7 +3022,7 @@ void do_bank(char *u)
     }
   else if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal Error. Couldn't find your aClient. Contact a(n) %S "\
+         notice(s_GameServ, u, "Fatal Error. Couldn't find your aClient. Contact a(n) <S "\
                         " admin for help");
          log("Fatal Error. Couldn't find %s while executing do_bank()", u);
          return; 
@@ -3151,7 +3178,7 @@ void do_dragon(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+         notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
          return;
     }
   else if (isIgnore(user))
@@ -3218,7 +3245,7 @@ void do_master(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+         notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
          return;
     }
   else if (isIgnore(user))
@@ -3345,7 +3372,7 @@ void see_master(char *u)
 
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
+         notice(s_GameServ, u, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL, ""));
          return;       
     }
   
@@ -3464,7 +3491,7 @@ void do_refresh(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Error: aClient not found. Contact a %S admin");
+         notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
          log("Error: aClient not found: %s", u);
          return;
     }
@@ -3477,7 +3504,7 @@ void do_refresh(char *u)
     }
   else if (!isAdmin(user))
     {
-         notice(s_GameServ, u, "You must be a %S admin to use this command!");
+         notice(s_GameServ, u, "You must be a <S admin to use this command!");
          return;
     }
   if (!name)
@@ -3664,13 +3691,13 @@ void do_reset(char *u)
   
   if (!(user = find(u)))
     {
-         notice(s_GameServ, u, "Error: aClient not found. Contact a %S admin");
+         notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
          log("Error: aClient not found: %s", u);
          return;
     }
   else if (!isAdmin(user))
     {
-         notice(s_GameServ, u, "You must be a %S admin to use this command!");
+         notice(s_GameServ, u, "You must be a <S admin to use this command!");
          return;
     }
   
@@ -3718,7 +3745,7 @@ void display_help(char *u, char *file)
          buf = new char[1024];
          while(infile.getline(buf, 1024))
                {
-                 // Written this way, it will process %S in the helpfiles
+                 // Written this way, it will process <S in the helpfiles
                  // Instead of notice(s_GameServ, u, "%s", buf);
                  notice(s_GameServ, u, buf);
                }
@@ -3748,7 +3775,7 @@ void display_help(char *u, char *file)
          buf = new char[1024];
          while(infile.getline(buf, 1024))
                {
-                 // Written this way, it will process %S in the helpfiles
+                 // Written this way, it will process <S in the helpfiles
                  // Instead of notice(s_GameServ, u, "%s", buf);
                  notice(s_GameServ, u, buf);
                }
@@ -3765,7 +3792,7 @@ void do_admin(char *u)
   if (!(user = find(u)))
     {
          log("Error: aClient not found: %s", u);
-         notice(s_GameServ, u, "Error: aClient not found. Contact %S admin.");
+         notice(s_GameServ, u, "Error: aClient not found. Contact <S admin.");
          return;
     }
   
index 098b939c6cb7ebe8842d120b6f4f20b35e5fd51f..b6d417562d1b24d8a3def8dc7de84d0c59450714 100644 (file)
@@ -193,55 +193,55 @@ int main(int argc, char *argv[])
                  unload_config_file();
                  return -1;
                }
-         log("%S socket connected.");
+         log("<S socket connected.");
          
 #ifdef UNREAL
          raw("PASS :%s", remotepass);
          raw("SERVER %s 1 :%s", servername, servername);
-         raw("NICK %S 1 %d %s %s %s %d :%s v%s", time(NULL), gsident, gshost, 
+         raw("NICK <S 1 %d %s %s %s %d :%s v%s", time(NULL), gsident, gshost, 
                  servername, time(NULL), PACKAGE, VERSION);
-         raw(":%S JOIN %s", c_Forest);
-         raw(":%S MODE %s +tn", c_Forest);
+         raw(":<S JOIN %s", c_Forest);
+         raw(":<S MODE %s +tn", c_Forest);
 #elif defined(BAHAMUT)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s 1 :%s", servername, servername);
-         raw("NICK %S 1 %d +w%s %s %s %s 0 :GameServ", time(NULL), (isBOper() ? "o" : ""), 
+         raw("NICK <S 1 %d +w%s %s %s %s 0 :GameServ", time(NULL), (isBOper() ? "o" : ""), 
                  gsident, gshost, servername);
-         raw(":%s SJOIN %d %d %s +nt :@%S", servername, time(NULL), time(NULL), c_Forest);
+         raw(":%s SJOIN %d %d %s +nt :@<S", servername, time(NULL), time(NULL), c_Forest);
 #elif defined(HYBRID)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s 1 :%s", servername, servername);
-         raw("NICK %S 1 %d +w%s %s %s %s :GameServ", time(NULL), (isBOper() ? "o" : ""), 
+         raw("NICK <S 1 %d +w%s %s %s %s :GameServ", time(NULL), (isBOper() ? "o" : ""), 
                  gsident, gshost, servername);
-         raw(":%s SJOIN %ld %s +nt :@%S", servername, time(NULL), c_Forest);
+         raw(":%s SJOIN %ld %s +nt :@<S", servername, time(NULL), c_Forest);
 #elif defined(ULTIMATE2)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s 1 :%s", servername, servername);
-         raw("NICK %S 1 %d %s %s %s 0 :GameServ", 
+         raw("NICK <S 1 %d %s %s %s 0 :GameServ", 
                  time(NULL), gsident, gshost, servername);
          if (isBOper())
-           raw(":%S mode %S +o");
-         raw(":%S JOIN %s", c_Forest);
+           raw(":<S mode <S +o");
+         raw(":<S JOIN %s", c_Forest);
 #elif defined(PTLINK)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s 1 :%s", servername, servername);
-         raw("NICK %S 1 %d %s%s %s %s %s :GameServ", time(NULL), (isBOper() ? "+iow " : ""), gsident, gshost, gshost, servername);
-         raw(":%s SJOIN %d %s +nt :@%S", servername, time(NULL), c_Forest);
+         raw("NICK <S 1 %d %s%s %s %s %s :GameServ", time(NULL), (isBOper() ? "+iow " : ""), gsident, gshost, gshost, servername);
+         raw(":%s SJOIN %d %s +nt :@<S", servername, time(NULL), c_Forest);
 #elif defined(VLIFE)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s 1 %d :%s", servername, time(NULL), servername);
-         raw("NNICK %S 1 %d +w%s %s %s %s %s :GameServ", time(NULL),(isBOper() ? "o" : ""), gsident, gshost, gshost, servername);
-         raw(":%s SJOIN %d %s +nt :@%S", servername, time(NULL), c_Forest);
+         raw("NNICK <S 1 %d +w%s %s %s %s %s :GameServ", time(NULL),(isBOper() ? "o" : ""), gsident, gshost, gshost, servername);
+         raw(":%s SJOIN %d %s +nt :@<S", servername, time(NULL), c_Forest);
 #elif defined(BAHAMUT8)
          raw("PASS %s :TS", remotepass);
          raw("SERVER %s %d :%s", servername, time(NULL), servername);
-         raw("NICK %S 1 %d +w%s %s %s %s 0 %d :GameServ", time(NULL), (isBOper() ? "o" : ""), gsident, gshost, servername, time(NULL));
-         raw(":%s SJOIN %d %d %s +nt :@%S", servername, time(NULL), time(NULL), c_Forest);
+         raw("NICK <S 1 %d +w%s %s %s %s 0 %d :GameServ", time(NULL), (isBOper() ? "o" : ""), gsident, gshost, servername, time(NULL));
+         raw(":%s SJOIN %d %d %s +nt :@<S", servername, time(NULL), time(NULL), c_Forest);
 #elif defined(P10)
          // Server numeric is: []  <-- must be unique
          raw("PASS :%s", remotepass);
          raw("SERVER %s 1 %d %d P10 []AAF :%s", servername, time(NULL), time(NULL), servername);
-         raw("[] N %S 1 %d %s %s %s DAqAoB %s :%S", time(NULL), gsident, gshost,
+         raw("[] N <S 1 %d %s %s %s DAqAoB %s :<S", time(NULL), gsident, gshost,
                  (isBOper() ? "+o" : ""), gsnum);
          raw("[] B %s %d +tn %s:o", c_Forest, time(NULL) - 864000, gsnum);
 #endif
@@ -252,19 +252,19 @@ int main(int argc, char *argv[])
 #else 
 #ifndef HYBRID
 #if defined(ULTIMATE2)
-         raw(":%s MODE %s +o %S %ld", servername, c_Forest, 
+         raw(":%s MODE %s +o <S %ld", servername, c_Forest, 
                  time(NULL));
 #else
-         raw(":%S MODE %s +o %S", c_Forest);
+         raw(":<S MODE %s +o <S", c_Forest);
 #endif
 #endif
-         raw(":%S TOPIC %s :%s", c_Forest, c_ForestTopic);
+         raw(":<S TOPIC %s :%s", c_Forest, c_ForestTopic);
 #endif
          
 #ifndef P10
          if (isUseNickServ())
                {
-                 raw(":%S PRIVMSG %s :IDENTIFY %s", nsname, nspass);
+                 raw(":<S PRIVMSG %s :IDENTIFY %s", nsname, nspass);
                }
 #endif
          sock_gets(sock,buffer,sizeof(buffer)-1); /* -1 added thanks to
@@ -358,7 +358,7 @@ int main(int argc, char *argv[])
                          if (isSavedNotice())
                                {
                                  // Send notice to the channel of the update
-                                 notice(s_GameServ, c_Forest, "%S player data saved");
+                                 notice(s_GameServ, c_Forest, "<S player data saved");
                                }
                        }
                  
@@ -543,7 +543,7 @@ int main(int argc, char *argv[])
                char *longname;
                longname = new char[strlen(s_GameServ) + strlen(servername) + 2];
                
-               sprintf(longname, "%S@%s", servername);
+               sprintf(longname, "<S@%s", servername);
                
                dest = strtok(NULL, " ");
                rest = strtok(NULL, "");
@@ -597,7 +597,7 @@ int main(int argc, char *argv[])
 #endif
                          c_Forest);
 #endif
-                 raw(":%S MODE %s +v %s", c_Forest, (source));
+                 raw(":<S MODE %s +v %s", c_Forest, (source));
            }
 
            if (z == ':')
@@ -623,7 +623,7 @@ int main(int argc, char *argv[])
                    nick++; // Assume for users set op and voice, they
                             // are never passed as +@nick
                if (stricmp(channel, c_Forest) == 0 && is_playing(nick))
-                   raw(":%S MODE %s +v %s", channel, nick);
+                   raw(":<S MODE %s +v %s", channel, nick);
 
                nick = strtok(NULL, " ");
            }
index d982f53dc761c365e5962ab2bb1ec028a13dc1fd..3f4cd194d29a78d9615a0ca953fd310a5d06d185 100644 (file)
@@ -25,11 +25,11 @@ toplist::~toplist()
 void toplist::insertPlayer(Player *p)
 {
   myList.push_front(*p);
-  sort();
+//  sort();
 
   // Reverse the list since list::sort() uses the < operator
   myList.reverse();
-  prune();
+  //prune();
 }
 
 void toplist::setCount(int c)
@@ -57,7 +57,13 @@ void toplist::prune()
        }
 }
 
-list<Player>::iterator toplist::top()
+list<Player>::iterator toplist::begin()
 {
   return myList.begin();
 }
+\r
+\r
+list<Player>::iterator toplist::end()\r
+{\r
+  return myList.end();\r
+}\r
index acd5aa94e441a749d5971c4961c4705e44fcdb68..15d865bae6b99dea4d62229c6d7e9a2e0f940aed 100644 (file)
@@ -32,7 +32,8 @@ public:
   // Prune the list so it's not larger than the count
   void prune();
 
-  list<Player>::iterator top();
+  list<Player>::iterator begin();\r
+  list<Player>::iterator end();
 
 private: