mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-05-31 09:16:22 +00:00
Some code updates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user