update lcemp networking

This commit is contained in:
2026-08-14 07:02:50 +03:00
parent 125819419f
commit 6853eab85f
51 changed files with 629 additions and 183 deletions
+10 -1
View File
@@ -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;
}
}
}