autodownload: find best server after 100 gamestarts

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7544 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2013-09-21 08:10:41 +00:00
parent de8df9e2ed
commit 1f9fae3779
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -888,6 +888,7 @@ static int clockrealbase = 0, clockvirtbase = 0;
static void clockreset() { clockrealbase = SDL_GetTicks(); clockvirtbase = totalmillis; }
VARFP(clockerror, 990000, 1000000, 1010000, clockreset());
VARFP(clockfix, 0, 0, 1, clockreset());
VARP(gamestarts, 0, 0, INT_MAX);
const char *rndmapname()
{
@@ -1232,6 +1233,9 @@ int main(int argc, char **argv)
if(initscript) execute(initscript);
gamestarts = max(1, gamestarts+1);
if(autodownload && (gamestarts % 100 == 1)) sortpckservers();
initlog("mainloop");
inputgrab(grabinput = true);