mirror of
https://github.com/Minecraft-Community-Edition/client.git
synced 2026-05-23 09:34:42 +00:00
update PlayerList class to account for additional dimension (aether)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
int sendAllPlayerInfoIn;
|
||||
|
||||
// 4J Added to maintain which players in which dimensions can receive all packet types
|
||||
vector<shared_ptr<ServerPlayer> > receiveAllPlayers[3];
|
||||
vector<shared_ptr<ServerPlayer> > receiveAllPlayers[4];
|
||||
private:
|
||||
shared_ptr<ServerPlayer> findAlivePlayerOnSystem(shared_ptr<ServerPlayer> currentPlayer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user