respond to pong always, re-register only in intermissions or if >1 hour since last
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5554 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -162,11 +162,12 @@ void flushmasterinput()
|
||||
}
|
||||
|
||||
extern char *global_name;
|
||||
extern int interm
|
||||
|
||||
// send alive signal to masterserver every hour of uptime
|
||||
// send alive signal to masterserver after 40 minutes of uptime and during an intermission (so theoretically <= 1 hour) - after 1 hour at the latest.
|
||||
static inline void updatemasterserver(int millis, int port)
|
||||
{
|
||||
if(!lastupdatemaster || millis-lastupdatemaster>40*60*1000)
|
||||
if(!lastupdatemaster || (millis-lastupdatemaster>40*60*1000 && interm) || millis-lastupdatemaster>60*60*1000)
|
||||
{
|
||||
char servername[30]; memset(servername,'\0',30); filtertext(servername,global_name,-1,20);
|
||||
if(mastername[0]) requestmasterf("regserv %d %s %d\n", port, servername[0] ? servername : "noname", AC_VERSION);
|
||||
|
||||
Reference in New Issue
Block a user