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: Sun, 23 Nov 2003 00:51:50 -0500

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Hankin Chick <address@hidden>   03/11/23 00:51:49

Modified files:
        src/NetPanzer/IRCLobby: IRCLobby.cpp IRCLobby.hpp 
                                ProxyServer.cpp ProxyServer.hpp 
                                irc_test.cpp_ 
        src/NetPanzer/Network: ClientSocket.cpp ClientSocket.hpp 
        src/NetPanzer/Views/MainMenu/Multi: IRCLobbyView.cpp 
                                            IRCLobbyView.hpp 
Added files:
        src/NetPanzer/Views/MainMenu/Multi: IRCLobbyServer.cpp 
                                            IRCLobbyServer.hpp 

Log message:
        Moved server related lobby things that need netpanzer to IRCLobbyServer.
        Changed ping/pong to use time() instead of SDL_GetTicks because 
SDL_GetTicks
        resets after 2 days.

Patches:
Index: netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp
diff -u netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.1 
netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.2
--- netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp:1.1   Sat Nov 22 10:43:33 2003
+++ netpanzer/src/NetPanzer/IRCLobby/IRCLobby.cpp       Sun Nov 23 00:51:49 2003
@@ -16,14 +16,16 @@
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// can be used independantly of netpanzer, see sample program
+// can be used independantly of netpanzer
+//  define WITHOUT_NETPANZER to compile outside of netpanzer
 
 #include <SDL_net.h>
 #include <sstream>
 
-#ifndef WITHOUT_NETPANZER
 #include <config.h>
 
+#ifndef WITHOUT_NETPANZER
+
 #include <SDLNet.hpp>
 #include "Util/Log.hpp"
 #include "IRCLobbyView.hpp"
@@ -34,10 +36,12 @@
 #include "Util/UtilInterface.hpp"
 #include "PlayerNameView.hpp"
 #include "GameControlRulesDaemon.hpp"
-#include "ProxyServer.hpp"
 
 #else
 
+// this is here so that we can compile without netpanzer or it's common libs
+//  Can be used by game browsers, etc. See irc_test.cpp for an example.
+
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -60,6 +64,29 @@
     }
 }
 
+
+#ifndef LOG
+#define LOG(x) printf x
+#endif
+
+#ifndef Exception
+class Exception : public std::exception {
+    char* message;
+public:
+    Exception(const char* msg, ...) throw() {
+        va_list args;
+        va_start(args, msg);
+
+        message = new char[255];
+        vsnprintf(message, 255, msg, args);
+
+        va_end(args);
+    }
+    ~Exception() throw() { delete[] message; }
+    const char* what() const throw() { return message; }
+};
+
+#endif
 #endif
 
 #include "IRCLobby.hpp"
@@ -84,8 +111,6 @@
     expected_ping=0;
 
     setNickName(nick);
-
-    startMessagesThread();
 }
 
 IRCLobby::~IRCLobby()
@@ -97,7 +122,7 @@
 void IRCLobby::restartThread()
 {
     stopThread();
-    startMessagesThread();
+    startThread();
 }
 
 void IRCLobby::setNickName(const std::string &nick)
@@ -150,23 +175,6 @@
     game_servers=0;
 }
 
-#ifndef WITHOUT_NETPANZER
-// send server info to someone
-void IRCLobby::sendServerInfo(const std::string& dest)
-{
-    std::stringstream buffer;
-
-    buffer << "-" << server_running_mess << " "
-           << PlayerInterface::countPlayers()
-           << "/" << PlayerInterface::getMaxPlayers()
-           << " port:" << gameconfig->serverport
-           << " map:" << gameconfig->map;
-
-    return sendIRCMessageLine(buffer.str(), dest);
-}
-
-
-#endif
 
 
 void IRCLobby::connectToServer()
@@ -174,12 +182,7 @@
     IPaddress addr;
     expected_ping=0;
     
-#ifndef WITHOUT_NETPANZER
-    const std::string &proxyserver=gameconfig->proxyserver;
-#else
-    const std::string proxyserver;
-#endif
-    const std::string &server=proxyserver.size()>0 ? proxyserver: 
serveraddress;
+    const std::string &server=proxy.proxyserver.size()>0 ? proxy.proxyserver: 
serveraddress;
 
     int sport=6667;
 #ifndef WITHOUT_NETPANZER
@@ -198,11 +201,12 @@
         throw Exception("Couldn't connect to irc server '%s': %s",
                 server.c_str(),  SDLNet_GetError());
 
-#ifndef WITHOUT_NETPANZER
-    if(proxyserver.size()>0) {
-        ProxyServer::sendProxyConnect(irc_server_socket,serveraddress);
+    if(proxy.proxyserver.size()>0) {
+        if(!proxy.sendProxyConnect(irc_server_socket,serveraddress)) {
+            throw Exception("Couldn't connect via proxy server '%s'",
+                    server.c_str());
+        }
     }
-#endif
 
     std::stringstream buffer;
     buffer.str("");
@@ -233,17 +237,7 @@
     buffer << "JOIN " << channel_name;
     sendIRCLine(buffer.str());
 
-#ifndef WITHOUT_NETPANZER
-    if(gameconfig->hostorjoin== _game_session_host) {
-        // tell everyone the server just started
-        sendServerInfo(channel_name);
-    }
-    else if(gameconfig->hostorjoin== _game_session_join) {
-        refreshServerList();
-    }
-#else
-    refreshServerList();
-#endif
+    notifyStartup();
 }
 
 void IRCLobby::refreshServerList()
@@ -268,7 +262,10 @@
     std::stringstream ping;  
     ping << "PING " << server_host;
     sendIRCLine(ping.str());
-    expected_ping=SDL_GetTicks()+15000;
+    expected_ping=time(NULL)+15;
+#ifndef WITHOUT_NETPANZER
+    LOGGER.debug("sending ping to %s expecting pong 
at:%i",server_host.c_str(),expected_ping);
+#endif
 }
 
 int IRCLobby::messagesThreadEntry(void* data)
@@ -279,7 +276,7 @@
         // this is here so that the thread is started before we connect 
         // to the irc server otherwise the main thread will halt 
         // if we don't have access to the irc server.
-        Uint32 start_tick=SDL_GetTicks();
+        int start_tick=time(NULL);
         try {
             t->connectToServer();
             t->processMessages();
@@ -287,13 +284,19 @@
             LOG(("Exception in IRC Thread: %s, restarting in %i secs", 
e.what(),(restart_delay/1000) ));
             t->addChatMessage("Error",e.what());
 
-            Uint32 run_length=SDL_GetTicks()-start_tick;
+            int run_length=time(NULL)-start_tick;
             SDL_Delay(restart_delay);
-            if(run_length>(15*60*1000)) {
+            if(run_length>(15*60)) {
                 // we managed to run for 15mins, reset the delay
                 restart_delay=5000;
             }
-            else { restart_delay*=2; }
+            else {
+                static const int max_restart_delay=60*15*1000;
+                restart_delay*=2; 
+                if(restart_delay>=max_restart_delay) {
+                    restart_delay=max_restart_delay; 
+                }
+            }
             // ... wait a while and try to reconnect
             continue;
         } catch(...) {
@@ -304,7 +307,7 @@
     return 0;
 }
 
-void IRCLobby::startMessagesThread()
+void IRCLobby::startThread()
 {
     assert(running_thread==0);
 
@@ -358,7 +361,7 @@
 
     readIRCLine(buf, sizeof(buf));
 #ifndef WITHOUT_NETPANZER
-    LOGGER.debug("irc:%s",buf);
+    LOGGER.debug("recv irc:%s",buf);
 #endif
     
     if(buf[0]!=':')
@@ -451,22 +454,12 @@
         std::string joined(real_user);
         joined+=" has arrived in lobby";
         addChatMessage("",joined);
-#ifndef WITHOUT_NETPANZER
-        if(gameconfig->hostorjoin== _game_session_host) {
-            LOG(("%s",joined.c_str()));
-        }
-#endif
         return;
     }
     if(strcmp(code,"PART")==0 || strcmp(code,"QUIT")==0) {
         std::string leave(real_user);
         leave+=" has left the lobby";
         addChatMessage("",leave);
-#ifndef WITHOUT_NETPANZER
-        if(gameconfig->hostorjoin== _game_session_host) {
-            LOG(("%s",leave.c_str()));
-        }
-#endif
         return;
     }
 
@@ -483,26 +476,17 @@
     if(mess[0]=='#') {
         // this is a chat message
         addChatMessage(real_user, mess+1);
-#ifndef WITHOUT_NETPANZER
-        if(gameconfig->hostorjoin== _game_session_host) {
-            LOG(("IRC message:%s:%s",real_user,mess+1));
-        }
-#endif
 
         return;
     }
     if(mess[0]=='-') {
         // this is an internal message
 
-#ifndef WITHOUT_NETPANZER
         if(strcmp(mess+1, ask_server_running_mess)==0) {
-            if(gameconfig->hostorjoin== _game_session_host) {
-                // reply with server details
-                sendServerInfo(irc_user);
-            }
+            // reply with server details
+            sendServerInfo(irc_user);
         }
         else 
-#endif
         
if(strncmp(mess+1,server_running_mess,sizeof(server_running_mess)-1)==0) {
             // add a server to the list
             const char *p=mess+strlen(server_running_mess)+1;
@@ -583,10 +567,12 @@
                 line.size()) != (int) line.size())
         throw Exception("Error when sending irc message '%s': %s",
                 line.c_str(), SDLNet_GetError());
-    
+#ifndef WITHOUT_NETPANZER
+    LOGGER.debug("sending irc:%s",line.c_str());
+#endif
     static char lf[]="\n";
     if(SDLNet_TCP_Send(irc_server_socket,lf,1) != 1)
-        throw Exception("Error when senging irc lf: %s",
+        throw Exception("Error when sending irc lf: %s",
                 SDLNet_GetError());
 }
 
@@ -604,10 +590,10 @@
         while(buf_upto < buf_end) {
             SDLNet_CheckSockets(sock_set, 1000);
             if(!SDLNet_SocketReady(irc_server_socket)) {
-                if(++no_activity>=(60*2) && !expected_ping) {
+                if(++no_activity>=(60*1) && !expected_ping) {
                     sendPingMessage();
                 }
-                if(expected_ping && expected_ping<SDL_GetTicks()) {
+                if(expected_ping && expected_ping<time(NULL)) {
                     throw Exception("no pong received after ping");
                 }
                 continue;
@@ -633,6 +619,14 @@
     *buf_upto=0;
 }
 
+
+
+void IRCLobby::sendServerRunningMess(const std::string& dest,const 
std::string& str)
+{
+        std::stringstream buffer;
+        buffer << "-" << server_running_mess << " " << str;
+        return sendIRCMessageLine(buffer.str(), dest);
+}
 
 
 
Index: netpanzer/src/NetPanzer/IRCLobby/IRCLobby.hpp
diff -u netpanzer/src/NetPanzer/IRCLobby/IRCLobby.hpp:1.1 
netpanzer/src/NetPanzer/IRCLobby/IRCLobby.hpp:1.2
--- netpanzer/src/NetPanzer/IRCLobby/IRCLobby.hpp:1.1   Sat Nov 22 10:43:33 2003
+++ netpanzer/src/NetPanzer/IRCLobby/IRCLobby.hpp       Sun Nov 23 00:51:49 2003
@@ -27,6 +27,7 @@
 #include "GameServer.hpp"
 #include "GameServerList.hpp"
 #include "IRCChatMessage.hpp"
+#include "ProxyServer.hpp"
 
 class IRCLobby;
 class IRCLobbyView;
@@ -45,42 +46,51 @@
     IRCLobby(const std::string& servername,
              const std::string& nickname,
              const std::string& channel);
-    ~IRCLobby();
+    virtual ~IRCLobby();
 
     void sendChatMessage(const std::string& user, const std::string& line);
     void sendIRCMessageLine(const std::string& line);
+    void sendIRCMessageLine(const std::string& line, const std::string& to);
+    void sendServerRunningMess(const std::string& dest,const std::string& str);
     void refreshServerList();
     void refreshUserList();
 
+
+
     bool isConnected() const
     { return irc_server_socket != 0; }
     void changeNickName(const std::string &nick);
     void restartThread();   // restart thread & reconnect irc
     void stopThread();
+    void startThread();
+    std::string& getChannelName() { return channel_name; }
 
+    ProxyServer proxy;
     GameServerList* game_servers;
     NotifyIRCChangeName* change_name;
+    SDL_mutex *game_servers_mutex;   
+
+protected:
+    virtual void sendServerInfo(const std::string& dest) { return; }
+    virtual void notifyStartup() { refreshServerList(); }
+    virtual void addChatMessage(const std::string& user, const std::string& 
message);
 
 private:
-    void startMessagesThread();
 
     void processMessages();
     static int messagesThreadEntry(void* t);
 
-    void sendServerInfo(const std::string& dest);
+
     // read any messages that need to be processed
     void processMessage();
     void sendIRCLine(const std::string& line);
-    void sendIRCMessageLine(const std::string& line, const std::string& to);
     void readIRCLine(char *buf, size_t buf_len);
     void connectToServer();
     void sendLoginInfo();
     void setNickName(const std::string &nick);
     void sendNickName();
     void sendPingMessage();
-    void addChatMessage(const std::string& user, const std::string& message);
 
-    SDL_mutex *game_servers_mutex;   
 
     friend class IRCLobbyView;
     TCPsocket irc_server_socket;
@@ -90,7 +100,7 @@
     std::string serveraddress;
     std::string server_host;
     std::list<IRCChatMessage> chat_messages;
-    unsigned int expected_ping;
+    int expected_ping;
     
     SDL_Thread *running_thread;
 };
Index: netpanzer/src/NetPanzer/IRCLobby/ProxyServer.cpp
diff -u netpanzer/src/NetPanzer/IRCLobby/ProxyServer.cpp:1.1 
netpanzer/src/NetPanzer/IRCLobby/ProxyServer.cpp:1.2
--- netpanzer/src/NetPanzer/IRCLobby/ProxyServer.cpp:1.1        Sat Nov 22 
10:43:33 2003
+++ netpanzer/src/NetPanzer/IRCLobby/ProxyServer.cpp    Sun Nov 23 00:51:49 2003
@@ -18,8 +18,8 @@
 #include <config.h>
 
 #include <string>
+#include <ctype.h>
 
-#include "GameConfig.hpp"
 #include "ProxyServer.hpp"
 
 void ProxyServer::makeBase64(std::string &base64, const std::string &str)
@@ -47,33 +47,49 @@
 }
 
 void ProxyServer::getProxyConnect(std::stringstream &buffer,const std::string 
&serveraddress) {
-    if(((const std::string &)gameconfig->proxyserver).size()>0) {
+    if(((const std::string &)proxyserver).size()>0) {
         buffer << "CONNECT " << serveraddress << " HTTP/1.0\r\n";
-        if(((const std::string &)gameconfig->proxyserveruser).size()>0) {
+        if(((const std::string &)proxyserveruser).size()>0) {
             std::string base64;
-            std::string userpass( ((const std::string 
&)gameconfig->proxyserveruser) +":"+((const std::string 
&)gameconfig->proxyserverpass) );
-            ProxyServer::makeBase64(base64, userpass);
+            std::string userpass( ((const std::string &)proxyserveruser) 
+":"+((const std::string &)proxyserverpass) );
+            makeBase64(base64, userpass);
             buffer << "Authorization: Basic " << base64 << "\r\n";
         }
         buffer << "\r\n";
     }
 }
 
-void ProxyServer::sendProxyConnect(TCPsocket socket,const std::string 
&serveraddress)
+bool ProxyServer::sendProxyConnect(TCPsocket socket,const std::string 
&serveraddress)
 {
     std::stringstream buffer;
-                                                                               
 
+
     getProxyConnect(buffer,serveraddress);
                                                                                
 
     SDLNet_TCP_Send(socket,const_cast<char*> 
(buffer.str().c_str()),buffer.str().size());
     int lfs=0;
-// XXX grab any http error messages
+    char buf[1024];
+    char *b=buf;
+    int line=0;
     while(1) {
         char ch;
         if(SDLNet_TCP_Recv(socket,&ch,1)!=1) { break; }
+        *b++=ch;
         if(ch=='\r') { continue; }
-        if(ch=='\n') { lfs++; }
+        if(ch=='\n') {
+            *b=0;
+            lfs++;
+            b=buf; 
+            if(line==0) {
+                while(!isspace(*b) && *b) b++;
+                while(isspace(*b)) b++;
+                if(atoi(b)!=200) {
+                    return false;
+                }
+            }
+            line++;
+        }
         else { lfs=0; }
         if(lfs>=2) { break; }
     }
+    return true;
 }
Index: netpanzer/src/NetPanzer/IRCLobby/ProxyServer.hpp
diff -u netpanzer/src/NetPanzer/IRCLobby/ProxyServer.hpp:1.1 
netpanzer/src/NetPanzer/IRCLobby/ProxyServer.hpp:1.2
--- netpanzer/src/NetPanzer/IRCLobby/ProxyServer.hpp:1.1        Sat Nov 22 
10:43:33 2003
+++ netpanzer/src/NetPanzer/IRCLobby/ProxyServer.hpp    Sun Nov 23 00:51:49 2003
@@ -26,10 +26,17 @@
 class ProxyServer
 {
 public:
+    std::string proxyserver;
+    std::string proxyserveruser;
+    std::string proxyserverpass;
+
+    void setProxy(const std::string& p,const std::string& u="",const 
std::string& pass="") {
+        proxyserver=p; proxyserveruser=u; proxyserverpass=pass; 
+    }
     static void makeBase64(std::string& base64, const std::string& str);
-    static void getProxyConnect(std::stringstream& buffer,
+    void getProxyConnect(std::stringstream& buffer,
             const std::string& serveraddress);
-    static void sendProxyConnect(TCPsocket socket, const std::string& 
serveraddress);
+    bool sendProxyConnect(TCPsocket socket, const std::string& serveraddress);
 };
 
 #endif
Index: netpanzer/src/NetPanzer/IRCLobby/irc_test.cpp_
diff -u netpanzer/src/NetPanzer/IRCLobby/irc_test.cpp_:1.1 
netpanzer/src/NetPanzer/IRCLobby/irc_test.cpp_:1.2
--- netpanzer/src/NetPanzer/IRCLobby/irc_test.cpp_:1.1  Sat Nov 22 10:43:33 2003
+++ netpanzer/src/NetPanzer/IRCLobby/irc_test.cpp_      Sun Nov 23 00:51:49 2003
@@ -1,24 +1,27 @@
 
-
 // sample program to use this class...
 
+// to compile by itself...
+// touch config.h
+// g++ -DWITHOUT_NETPANZER -I. -I/usr/local/include/SDL -lSDL_net irc_test.cpp 
IRCLobby.cpp ProxyServer.cpp
+
 #include <unistd.h>
-#define WITHOUT_NETPANZER
-#include "IRCLobby.cpp"
+#include "IRCLobby.hpp"
 
 
 int main()
 {
-    IRCLobby *lobby=new 
IRCLobby("irc.freenode.net","testnpsrv","#netpanzerlob");
+    IRCLobby *lobby=new 
IRCLobby("irc.freenode.net:6667","testnpclient","#netpanzerlob");
+    lobby->startThread();
+    // wait 30 secs for the server list to fill up
     sleep(30);
 
     SDL_mutexP(lobby->game_servers_mutex);
     GameServerList::iterator i;
     GameServerList* serverlist = lobby->game_servers;
     for(i=serverlist->begin(); i!=serverlist->end(); i++) {
-        const GameServer* server = &(*i);
         printf("%s is running %s (%i/%i) on %s:%i\n",
-            i->user.c_str(),i->map.c_str(),
+            i->real_user.c_str(),i->map.c_str(),
             i->playercount,i->max_players,
             i->host.c_str(),i->port
             );
Index: netpanzer/src/NetPanzer/Network/ClientSocket.cpp
diff -u netpanzer/src/NetPanzer/Network/ClientSocket.cpp:1.1 
netpanzer/src/NetPanzer/Network/ClientSocket.cpp:1.2
--- netpanzer/src/NetPanzer/Network/ClientSocket.cpp:1.1        Sat Nov 22 
10:43:40 2003
+++ netpanzer/src/NetPanzer/Network/ClientSocket.cpp    Sun Nov 23 00:51:49 2003
@@ -27,7 +27,6 @@
 #include "NetworkGlobals.hpp"
 #include "ClientSocket.hpp"
 #include "Util/UtilInterface.hpp"
-#include "ProxyServer.hpp"
 #include "GameConfig.hpp"
 
 ClientSocket::ClientSocket(const char* whole_servername)
@@ -35,10 +34,12 @@
     SDLNet::initialise();
     int port=_NETPANZER_DEFAULT_PORT_TCP;
     std::string servername;
-    
+
+    
proxy.setProxy(gameconfig->proxyserver,gameconfig->proxyserveruser,gameconfig->proxyserverpass);
+
     // resolve server name
     IPaddress serverip;
-    const char *server=(((const std::string 
&)gameconfig->proxyserver).size()>0?gameconfig->proxyserver.c_str():whole_servername);
+    const char *server=(((const std::string 
&)proxy.proxyserver).size()>0?proxy.proxyserver.c_str():whole_servername);
     UtilInterface::splitServerPort(server,servername,&port);
     // some old version of SDL_net take a char* instead of a const char*
 
@@ -53,9 +54,12 @@
                         servername.c_str(), port);
     }
 
-    if( ((const std::string &)gameconfig->proxyserver).size()>0) {
-        ProxyServer::sendProxyConnect(tcpsocket,whole_servername);
-        LOGGER.info("%s connected via proxy 
%s",whole_servername,gameconfig->proxyserver.c_str());
+    if( ((const std::string &)proxy.proxyserver).size()>0) {
+        if(!proxy.sendProxyConnect(tcpsocket,whole_servername)) {
+            throw Exception("couldn't connect via proxy server '%s'.",
+                            server);
+        }
+        LOGGER.info("%s connected via proxy 
%s",whole_servername,proxy.proxyserver.c_str());
     }
 
     socketset = SDLNet_AllocSocketSet(1);
Index: netpanzer/src/NetPanzer/Network/ClientSocket.hpp
diff -u netpanzer/src/NetPanzer/Network/ClientSocket.hpp:1.1 
netpanzer/src/NetPanzer/Network/ClientSocket.hpp:1.2
--- netpanzer/src/NetPanzer/Network/ClientSocket.hpp:1.1        Sat Nov 22 
10:43:40 2003
+++ netpanzer/src/NetPanzer/Network/ClientSocket.hpp    Sun Nov 23 00:51:49 2003
@@ -20,6 +20,8 @@
 
 #include <SDL_net.h>
 
+#include "ProxyServer.hpp"
+
 class ClientSocket
 {
 public:
@@ -28,6 +30,7 @@
 
     void read();
     void sendMessage(char* data, size_t datasize, bool realiable = true);
+    ProxyServer proxy;
 
 private:
     void readTCP();
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.cpp:1.15 
netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.cpp:1.16
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.cpp:1.15  Sat Nov 
22 10:43:48 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.cpp       Sun Nov 
23 00:51:49 2003
@@ -236,9 +236,14 @@
 
     try {
         stopIRC();
-        lobby_connection=new IRCLobby(gameconfig->lobbyserver,
+        lobby_connection=new IRCLobbyServer(gameconfig->lobbyserver,
                 gameconfig->playername, "#netpanzerlob");
         lobby_connection->change_name=change_name;
+        lobby_connection->proxy.setProxy(
+            gameconfig->proxyserver,
+            gameconfig->proxyserveruser,
+            gameconfig->proxyserverpass);
+        lobby_connection->startThread();
     } catch(std::exception& e) {
         LOG(("Couldn't connect to irc lobby: %s", e.what()));
         error_message = e.what();
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.hpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.hpp:1.12 
netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.hpp:1.13
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.hpp:1.12  Sat Nov 
22 10:43:48 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/IRCLobbyView.hpp       Sun Nov 
23 00:51:49 2003
@@ -20,7 +20,7 @@
 
 #include <string>
 
-#include "IRCLobby.hpp"
+#include "IRCLobbyServer.hpp"
 #include "View.hpp"
 #include "2D/Surface.hpp"
 #include "GameServer.hpp"
@@ -63,7 +63,7 @@
 
     std::string error_message;
     cInputFieldString szChat;
-    IRCLobby *lobby_connection;
+    IRCLobbyServer *lobby_connection;
     int skipChatLines;
 
     Button serverUpButton;




reply via email to

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