Added a new menu item in join menu and added a threaded callback system for clients when searching for servers so that the UI doesn't wait for responses

This commit is contained in:
Mark Vejvoda
2010-04-02 02:33:32 +00:00
parent d4e645424a
commit bc725454fd
7 changed files with 475 additions and 148 deletions

View File

@@ -560,14 +560,19 @@ void ClientInterface::close()
clientSocket= NULL;
}
std::vector<string> ClientInterface::discoverServers() {
void ClientInterface::discoverServers(DiscoveredServersInterface *cb) {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
std::vector<string> serverList = ClientSocket::discoverServers();
ClientSocket::discoverServers(cb);
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
void ClientInterface::stopServerDiscovery() {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
return serverList;
ClientSocket::stopBroadCastClientThread();
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
/*