]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/tcpclient.cpp
Cleaned up the aClient.cpp code
[irc/gameservirc.git] / gameserv / tcpclient.cpp
index 48e7823371ba1ec40f001774ab3b11b775d6c9b2..b6d417562d1b24d8a3def8dc7de84d0c59450714 100644 (file)
@@ -17,6 +17,8 @@
 #include "aClient.h"
 #include "extern.h"
 #include "flags.h"
+#include "item.h"
+#include "toplist.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
@@ -33,7 +35,7 @@
 using namespace std;
 
 char *PACKAGE = "GameServ";
-char *VERSION = "1.3.3 +devel";
+char *VERSION = "1.3.4 +devel";
 
 int sock;
 long lastrefresh;
@@ -191,45 +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);
+#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);
 #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
@@ -240,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
@@ -346,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");
                                }
                        }
                  
@@ -382,7 +394,11 @@ int main(int argc, char *argv[])
                        }
                  // Code indenting is clean up until here!
 #if !defined(P10)
-                 else if (strncmp(cmd, "NICK", 4) == 0)
+                 else if (strncmp(cmd, "NICK", 4) == 0
+                                  #ifdef VLIFE
+                                  || strncmp(cmd, "NNICK", 5) == 0
+                                  #endif
+                                  )
                        {
                          if (buffer[0] == ':')
                                {
@@ -527,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, "");
@@ -581,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 == ':')
@@ -607,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, " ");
            }