forked from cafeberry/cafeberry
update lcemp networking
This commit is contained in:
@@ -539,7 +539,12 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr<ServerPlay
|
||||
// 4J - added - actually create & add player to a playerchunk, if there is one queued for this player.
|
||||
void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
|
||||
{
|
||||
if( addRequests.size() )
|
||||
#ifdef _WINDOWS64
|
||||
const int maxPerTick = 10;
|
||||
#else
|
||||
const int maxPerTick = 1;
|
||||
#endif
|
||||
for (int _processed = 0; _processed < maxPerTick && addRequests.size(); _processed++)
|
||||
{
|
||||
// Find the nearest chunk request to the player
|
||||
int px = (int)player->x;
|
||||
@@ -569,6 +574,10 @@ void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
|
||||
getChunk(itNearest->x, itNearest->z, true)->add(itNearest->player);
|
||||
addRequests.erase(itNearest);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user