From 119bff351450ea16ffda550b6e0f67379b29f708 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:37:16 +0700 Subject: Revert "shared_ptr -> std::shared_ptr" This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5. --- Minecraft.Client/ServerConnection.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'Minecraft.Client/ServerConnection.cpp') diff --git a/Minecraft.Client/ServerConnection.cpp b/Minecraft.Client/ServerConnection.cpp index 064c7b51..9880a8c6 100644 --- a/Minecraft.Client/ServerConnection.cpp +++ b/Minecraft.Client/ServerConnection.cpp @@ -26,16 +26,16 @@ ServerConnection::~ServerConnection() // 4J - added to handle incoming connections, to replace thread that original used to have void ServerConnection::NewIncomingSocket(Socket *socket) { - std::shared_ptr unconnectedClient = std::shared_ptr(new PendingConnection(server, socket, L"Connection #" + _toString(connectionCounter++))); - handleConnection(unconnectedClient); + shared_ptr unconnectedClient = shared_ptr(new PendingConnection(server, socket, L"Connection #" + _toString(connectionCounter++))); + handleConnection(unconnectedClient); } -void ServerConnection::addPlayerConnection(std::shared_ptr uc) +void ServerConnection::addPlayerConnection(shared_ptr uc) { players.push_back(uc); } -void ServerConnection::handleConnection(std::shared_ptr uc) +void ServerConnection::handleConnection(shared_ptr uc) { EnterCriticalSection(&pending_cs); pending.push_back(uc); @@ -47,14 +47,14 @@ void ServerConnection::stop() EnterCriticalSection(&pending_cs); for (unsigned int i = 0; i < pending.size(); i++) { - std::shared_ptr uc = pending[i]; + shared_ptr uc = pending[i]; uc->connection->close(DisconnectPacket::eDisconnect_Closed); } LeaveCriticalSection(&pending_cs); for (unsigned int i = 0; i < players.size(); i++) { - std::shared_ptr player = players[i]; + shared_ptr player = players[i]; player->connection->close(DisconnectPacket::eDisconnect_Closed); } } @@ -64,12 +64,12 @@ void ServerConnection::tick() { // MGH - changed this so that the the CS lock doesn't cover the tick (was causing a lockup when 2 players tried to join) EnterCriticalSection(&pending_cs); - vector< std::shared_ptr > tempPending = pending; + vector< shared_ptr > tempPending = pending; LeaveCriticalSection(&pending_cs); for (unsigned int i = 0; i < tempPending.size(); i++) { - std::shared_ptr uc = tempPending[i]; + shared_ptr uc = tempPending[i]; // try { // 4J - removed try/catch uc->tick(); // } catch (Exception e) { @@ -92,8 +92,8 @@ void ServerConnection::tick() for (unsigned int i = 0; i < players.size(); i++) { - std::shared_ptr player = players[i]; - std::shared_ptr serverPlayer = player->getPlayer(); + shared_ptr player = players[i]; + shared_ptr serverPlayer = player->getPlayer(); if( serverPlayer ) { serverPlayer->doChunkSendingTick(false); @@ -138,7 +138,7 @@ void ServerConnection::handleTextureReceived(const wstring &textureName) } for (unsigned int i = 0; i < players.size(); i++) { - std::shared_ptr player = players[i]; + shared_ptr player = players[i]; if (!player->done) { player->handleTextureReceived(textureName); @@ -155,7 +155,7 @@ void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureNa } for (unsigned int i = 0; i < players.size(); i++) { - std::shared_ptr player = players[i]; + shared_ptr player = players[i]; if (!player->done) { player->handleTextureAndGeometryReceived(textureName); @@ -163,7 +163,7 @@ void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureNa } } -void ServerConnection::handleServerSettingsChanged(std::shared_ptr packet) +void ServerConnection::handleServerSettingsChanged(shared_ptr packet) { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -176,7 +176,7 @@ void ServerConnection::handleServerSettingsChanged(std::shared_ptrdata); pMinecraft->levels[i]->difficulty = packet->data; } - } + } } // else if(packet->action==ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS)// options // { @@ -194,11 +194,11 @@ void ServerConnection::handleServerSettingsChanged(std::shared_ptroptions->SetGamertagSetting(false); // } -// +// // for (unsigned int i = 0; i < players.size(); i++) // { -// std::shared_ptr playerconnection = players[i]; -// playerconnection->setShowOnMaps(pMinecraft->options->GetGamertagSetting()); +// shared_ptr playerconnection = players[i]; +// playerconnection->setShowOnMaps(pMinecraft->options->GetGamertagSetting()); // } // } } \ No newline at end of file -- cgit v1.2.3