Initial handshake and network game start. Works with multiple clients. Not yet stable, because it is not thread-safe. GUI callbacks not complete yet (server dialog not updated).

This commit is contained in:
lotodore
2007-03-20 02:20:50 +00:00
parent 5f7ff8ca54
commit ef10602d5c
33 changed files with 731 additions and 113 deletions
+7 -1
View File
@@ -24,6 +24,7 @@
#include <core/thread.h>
#include <string>
#include <memory>
#include <net/servercallback.h>
class ServerContext;
class ServerRecvThread;
@@ -33,11 +34,14 @@ class SenderThread;
class ServerThread : public Thread
{
public:
ServerThread(/*ServerCallback &gui*/);
ServerThread(ServerCallback &gui);
virtual ~ServerThread();
// Set the parameters.
void Init(unsigned serverPort, bool ipv6, const std::string &pwd);
void StartGame();
ServerCallback &GetCallback();
protected:
@@ -55,6 +59,8 @@ protected:
private:
std::auto_ptr<ServerContext> m_context;
std::auto_ptr<ServerRecvThread> m_recvThread;
ServerCallback &m_callback;
};
#endif