differentiating masterserver real states
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5805 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -9,6 +9,8 @@ ENetHost *clienthost = NULL;
|
||||
ENetPeer *curpeer = NULL, *connpeer = NULL;
|
||||
int connmillis = 0, connattempts = 0, discmillis = 0;
|
||||
bool watchingdemo = false;
|
||||
extern bool clfail, cllock;
|
||||
extern int searchlan;
|
||||
|
||||
int getclientnum() { return player1 ? player1->clientnum : -1; }
|
||||
|
||||
@@ -65,6 +67,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c
|
||||
if (!serverport) serverport = defaultport;
|
||||
extern void enddemoplayback();
|
||||
if(watchingdemo) enddemoplayback();
|
||||
if(!clfail && cllock && searchlan<2) return;
|
||||
|
||||
if(connpeer)
|
||||
{
|
||||
|
||||
@@ -1268,12 +1268,18 @@ void clearservers()
|
||||
|
||||
#define RETRIEVELIMIT 20000
|
||||
extern char *global_name;
|
||||
bool cllock = true;
|
||||
bool cllock = true, clfail = false;
|
||||
|
||||
void retrieveservers(vector<char> &data)
|
||||
{
|
||||
ENetSocket sock = connectmaster();
|
||||
if(sock == ENET_SOCKET_NULL) return;
|
||||
if(sock == ENET_SOCKET_NULL)
|
||||
{
|
||||
conoutf("Master server is not replying.");
|
||||
clfail = true;
|
||||
return;
|
||||
}
|
||||
clfail = false;
|
||||
|
||||
extern string mastername;
|
||||
defformatstring(text)("retrieving servers from %s... (esc to abort)", mastername);
|
||||
@@ -1336,8 +1342,10 @@ void updatefrommaster(int force)
|
||||
vector<char> data;
|
||||
retrieveservers(data);
|
||||
|
||||
if(data.empty()) {
|
||||
conoutf("Master server not replying. \f1Get more information at http://masterserver.cubers.net/");
|
||||
if(data.empty())
|
||||
{
|
||||
if (!clfail) conoutf("Master server is not replying. \f1Get more information at http://masterserver.cubers.net/");
|
||||
cllock = !clfail;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1358,7 +1366,6 @@ void updatefrommaster(int force)
|
||||
execute(data.getbuf());
|
||||
if(curserver) addserver(curname, curport, curweight);
|
||||
}
|
||||
|
||||
lastupdate = totalmillis;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user