make map sending a bit more lazy, that way it's always instant to login in the game, even if some chunks are missing

This commit is contained in:
Romain Beaumont 2015-10-12 18:08:20 +02:00
parent 86b83e4e8d
commit 0c738d1b74

View file

@ -88,7 +88,11 @@ function inject(serv,player)
function sendMap()
{
var initialChunks=sendChunksAroundPlayer(2);
return sendChunksAroundPlayer(3);
}
function sendRestMap()
{
player.sendingChunks=true;
sendChunksAroundPlayer(player.view).then(() => player.sendingChunks=false);
@ -99,7 +103,6 @@ function inject(serv,player)
sendChunksAroundPlayer(player.view).then(() => player.sendingChunks=false);
}
});
return initialChunks;
}
@ -247,6 +250,8 @@ function inject(serv,player)
spawn();
announceJoin();
setTimeout(sendRestMap,100);
}
player.setGameMode=setGameMode;