Some code updates

This commit is contained in:
GabsPuNs
2026-04-09 00:57:05 -04:00
parent fb12bc0860
commit abd2d848cf
59 changed files with 241 additions and 257 deletions

View File

@@ -86,7 +86,7 @@ PlayerConnection::PlayerConnection(MinecraftServer *server, Connection *connecti
m_logSmallId = 0;
// Cache the first valid transport smallId because disconnect teardown can clear it before the server logger runs.
if (this->connection != NULL && this->connection->getSocket() != NULL)
if (this->connection != nullptr && this->connection->getSocket() != nullptr)
{
m_logSmallId = this->connection->getSocket()->getSmallId();
}
@@ -103,7 +103,7 @@ PlayerConnection::~PlayerConnection()
unsigned char PlayerConnection::getLogSmallId()
{
// Fall back to the live socket only while the cached value is still empty.
if (m_logSmallId == 0 && connection != NULL && connection->getSocket() != NULL)
if (m_logSmallId == 0 && connection != nullptr && connection->getSocket() != nullptr)
{
m_logSmallId = connection->getSocket()->getSmallId();
}
@@ -156,7 +156,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason)
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
ServerRuntime::ServerLogManager::OnPlayerDisconnected(
getLogSmallId(),
(player != NULL) ? player->name : std::wstring(),
(player != nullptr) ? player->name : std::wstring(),
reason,
true);
#endif
@@ -591,7 +591,7 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
ServerRuntime::ServerLogManager::OnPlayerDisconnected(
getLogSmallId(),
(player != NULL) ? player->name : std::wstring(),
(player != nullptr) ? player->name : std::wstring(),
reason,
false);
#endif