aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PendingConnection.cpp
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-06 02:11:18 +0700
committerGitHub <noreply@github.com>2026-03-06 02:11:18 +0700
commit55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch)
tree953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.Client/PendingConnection.cpp
parent7d6658fe5b3095f35093701b5ab669ffc291e875 (diff)
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.Client/PendingConnection.cpp')
-rw-r--r--Minecraft.Client/PendingConnection.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/Minecraft.Client/PendingConnection.cpp b/Minecraft.Client/PendingConnection.cpp
index 8034dff2..b50669e5 100644
--- a/Minecraft.Client/PendingConnection.cpp
+++ b/Minecraft.Client/PendingConnection.cpp
@@ -105,15 +105,14 @@ void PendingConnection::sendPreLoginResponse()
StorageManager.GetSaveUniqueFilename(szUniqueMapName);
PlayerList *playerList = MinecraftServer::getInstance()->getPlayers();
- for(AUTO_VAR(it, playerList->players.begin()); it != playerList->players.end(); ++it)
+ for(auto& player : playerList->players)
{
- shared_ptr<ServerPlayer> player = *it;
// If the offline Xuid is invalid but the online one is not then that's guest which we should ignore
// If the online Xuid is invalid but the offline one is not then we are definitely an offline game so dont care about UGC
// PADDY - this is failing when a local player with chat restrictions joins an online game
- if( player != NULL && player->connection->m_offlineXUID != INVALID_XUID && player->connection->m_onlineXUID != INVALID_XUID )
+ if( player != nullptr && player->connection->m_offlineXUID != INVALID_XUID && player->connection->m_onlineXUID != INVALID_XUID )
{
if( player->connection->m_friendsOnlyUGC )
{
@@ -175,9 +174,9 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
{
bool nameTaken = false;
vector<shared_ptr<ServerPlayer> >& pl = server->getPlayers()->players;
- for (unsigned int i = 0; i < pl.size(); i++)
+ for (const auto& i : pl)
{
- if (pl[i] != NULL && pl[i]->name == name)
+ if (i != NULL && i->name == name)
{
nameTaken = true;
break;
@@ -201,7 +200,7 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
//else
{
//4J - removed
-#if 0
+#if 0
new Thread() {
public void run() {
try {
@@ -258,7 +257,7 @@ void PendingConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
void PendingConnection::handleGetInfo(shared_ptr<GetInfoPacket> packet)
{
//try {
- //String message = server->motd + "§" + server->players->getPlayerCount() + "§" + server->players->getMaxPlayers();
+ //String message = server->motd + "�" + server->players->getPlayerCount() + "�" + server->players->getMaxPlayers();
//connection->send(new DisconnectPacket(message));
connection->send(shared_ptr<DisconnectPacket>(new DisconnectPacket(DisconnectPacket::eDisconnect_ServerFull) ) );
connection->sendAndQuit();