update PlayerList class to account for additional dimension (aether)

This commit is contained in:
Bonnie
2026-03-03 16:56:43 -06:00
parent 438f4df089
commit 5a2fbe20f3
2 changed files with 7 additions and 2 deletions

View File

@@ -934,7 +934,7 @@ void PlayerList::tick()
LeaveCriticalSection(&m_kickPlayersCS);
// Check our receiving players, and if they are dead see if we can replace them
for(unsigned int dim = 0; dim < 2; ++dim)
for(unsigned int dim = 0; dim < 4; ++dim)
{
for(unsigned int i = 0; i < receiveAllPlayers[dim].size(); ++i)
{
@@ -1269,6 +1269,7 @@ shared_ptr<ServerPlayer> PlayerList::findAlivePlayerOnSystem(shared_ptr<ServerPl
dimIndex = playerDim = player->dimension;
if( dimIndex == -1 ) dimIndex = 1;
else if( dimIndex == 1) dimIndex = 2;
else if( dimIndex == 2) dimIndex = 3;
INetworkPlayer *thisPlayer = player->connection->getNetworkPlayer();
if( thisPlayer != NULL )
@@ -1300,6 +1301,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr<ServerPlayer> player, bool
dimIndex = playerDim = usePlayerDimension ? player->dimension : dimension;
if( dimIndex == -1 ) dimIndex = 1;
else if( dimIndex == 1) dimIndex = 2;
else if( dimIndex == 2) dimIndex = 3;
#ifndef _CONTENT_PACKAGE
app.DebugPrintf("Requesting remove player %ls as primary in dimension %d\n", player->name.c_str(), dimIndex);
@@ -1356,6 +1358,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr<ServerPlayer> player, bool
int newPlayerDim = 0;
if( newPlayer->dimension == -1 ) newPlayerDim = 1;
else if( newPlayer->dimension == 1) newPlayerDim = 2;
else if( newPlayer->dimension == 2) newPlayerDim = 3;
bool foundPrimary = false;
for(AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin()); it != receiveAllPlayers[newPlayerDim].end(); ++it)
{
@@ -1384,6 +1387,7 @@ void PlayerList::addPlayerToReceiving(shared_ptr<ServerPlayer> player)
int playerDim = 0;
if( player->dimension == -1 ) playerDim = 1;
else if( player->dimension == 1) playerDim = 2;
else if( player->dimension == 2) playerDim = 3;
#ifndef _CONTENT_PACKAGE
app.DebugPrintf("Requesting add player %ls as primary in dimension %d\n", player->name.c_str(), playerDim);
@@ -1428,6 +1432,7 @@ bool PlayerList::canReceiveAllPackets(shared_ptr<ServerPlayer> player)
int playerDim = 0;
if( player->dimension == -1 ) playerDim = 1;
else if( player->dimension == 1) playerDim = 2;
else if( player->dimension == 2) playerDim = 3;
for(AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); it != receiveAllPlayers[playerDim].end(); ++it)
{
shared_ptr<ServerPlayer> newPlayer = *it;