netpanzer-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netPanzer-CVS] netpanzer/src/NetPanzer IRCLobby/IRCLobby.cpp I...


From: Hankin Chick
Subject: [netPanzer-CVS] netpanzer/src/NetPanzer IRCLobby/IRCLobby.cpp I...
Date: Tue, 25 Nov 2003 18:43:49 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/25 18:43:49

Modified files:
        src/NetPanzer/IRCLobby: IRCLobby.cpp 
        src/NetPanzer/Interfaces: GameConfig.cpp 

Log message:
        get ping/pong to work with irc.quakenet.eu.org
        change default irc to irc.quakenet.eu.org whom allow bots...
        http://www.quakenet.org/faq/faq.php?c=136&f=150&l=0

Patches:
Index: netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp
diff -u netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.6 
netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.7
--- netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.6   Tue Nov 25 07:07:28 2003
+++ netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp       Tue Nov 25 18:43:49 2003
@@ -357,17 +357,18 @@
     assert(irc_server_socket != 0);
     
     char buf[1024];
-    char *host, *mess, *host_end, *user_end, *code,*irc_user,*real_user;
+    char *host, *mess, *host_end, *user_end, *code,*irc_user,*real_user,
+        *buf_start;
 
     readIRCLine(buf, sizeof(buf));
 #ifndef WITHOUT_NETPANZER
     LOGGER.debug("recv irc:%s",buf);
 #endif
     
-    if(buf[0]!=':')
-        return;
+    buf_start=buf;
+    if(buf[0]==':')  { buf_start++; }
 
-    real_user=irc_user=buf+1;
+    real_user=irc_user=buf_start;
     if(strncmp(real_user,nickname_prefix,sizeof(nickname_prefix)-1)==0) {
         real_user+=sizeof(nickname_prefix)-1;
     }
@@ -376,16 +377,18 @@
     // skip 1 word and spaces behind it
     while(*code && !isspace(*code)) { code++; }
     while(*code && isspace(*code)) { code++; }
-    char *code_end=code;
-    while(*code_end && !isspace(*code_end)) code_end++;
-    *code_end=0;
 
-    int code_i=atoi(code);
-    if((mess=strchr(code_end+1,':'))==NULL) {
+    if((mess=strchr(code,':'))==NULL) {
         return;
     }
     mess++;
 
+    char *code_end=code;
+    while(*code_end && !isspace(*code_end)) code_end++;
+    *code_end=0;
+    int code_i=atoi(code);
+
+
     if(code_i == 433) {
         // wrong user name, change the number at the end
         char newplayer[256];
@@ -433,9 +436,9 @@
         expected_ping=0;
         return;
     }
-    if(strcmp(code,"PING")==0) {
+    if(strcmp(code,"PING")==0 || strncmp(buf,"PING",4)==0) {
         std::stringstream pong;  
-        pong << "PONG " <<(code+5);
+        pong << "PONG " <<mess;
         sendIRCLine(pong.str());
         return;
     }
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.23 
netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.24
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.23      Sat Nov 22 
10:43:34 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp   Tue Nov 25 18:43:49 2003
@@ -32,7 +32,7 @@
     // VariableName("Name", value [, minimum, maximum])
     : hostorjoin("hostorjoin", _game_session_join, 0, _game_session_last-1),
       playername("name", "Player"),
-      lobbyserver("lobbyserver", "irc.freenode.net:6667"),
+      lobbyserver("lobbyserver", "irc.quakenet.eu.org:6667"),
       serverport("serverport",_NETPANZER_DEFAULT_PORT_TCP,0,65535),
       proxyserver("proxyserver",""),
       proxyserveruser("proxyserveruser",""),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]