mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 07:53:44 +00:00
refactor(Core): replace NULL with nullptr (#4593)
This commit is contained in:
@@ -1333,9 +1333,9 @@ enum Opcodes
|
||||
/// Player state
|
||||
enum SessionStatus
|
||||
{
|
||||
STATUS_AUTHED = 0, // Player authenticated (_player == NULL, m_GUID has garbage)
|
||||
STATUS_LOGGEDIN, // Player in game (_player != NULL, m_GUID == _player->GetGUID(), inWorld())
|
||||
STATUS_TRANSFER, // Player transferring to another map (_player != NULL, m_GUID == _player->GetGUID(), !inWorld())
|
||||
STATUS_AUTHED = 0, // Player authenticated (_player == nullptr, m_GUID has garbage)
|
||||
STATUS_LOGGEDIN, // Player in game (_player != nullptr, m_GUID == _player->GetGUID(), inWorld())
|
||||
STATUS_TRANSFER, // Player transferring to another map (_player != nullptr, m_GUID == _player->GetGUID(), !inWorld())
|
||||
STATUS_NEVER, // Opcode not accepted from client (deprecated or server side only)
|
||||
STATUS_UNHANDLED, // Opcode not handled yet
|
||||
};
|
||||
|
||||
@@ -171,7 +171,7 @@ WorldSession::~WorldSession()
|
||||
|
||||
std::string const& WorldSession::GetPlayerName() const
|
||||
{
|
||||
return _player != NULL ? _player->GetName() : DefaultPlayerName;
|
||||
return _player != nullptr ? _player->GetName() : DefaultPlayerName;
|
||||
}
|
||||
|
||||
std::string WorldSession::GetPlayerInfo() const
|
||||
@@ -179,7 +179,7 @@ std::string WorldSession::GetPlayerInfo() const
|
||||
std::ostringstream ss;
|
||||
|
||||
ss << "[Player: " << GetPlayerName()
|
||||
<< " (Guid: " << (_player != NULL ? _player->GetGUID() : 0)
|
||||
<< " (Guid: " << (_player != nullptr ? _player->GetGUID() : 0)
|
||||
<< ", Account: " << GetAccountId() << ")]";
|
||||
|
||||
return ss.str();
|
||||
@@ -765,7 +765,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
|
||||
}
|
||||
else
|
||||
{
|
||||
// _player can be NULL and packet received after logout but m_GUID still store correct guid
|
||||
// _player can be nullptr and packet received after logout but m_GUID still store correct guid
|
||||
if (!m_GUIDLow)
|
||||
return;
|
||||
|
||||
@@ -1160,7 +1160,7 @@ void WorldSession::SetPlayer(Player* player)
|
||||
void WorldSession::InitializeQueryCallbackParameters()
|
||||
{
|
||||
// Callback parameters that have pointers in them should be properly
|
||||
// initialized to NULL here.
|
||||
// initialized to nullptr here.
|
||||
_charCreateCallback.SetParam(nullptr);
|
||||
_loadPetFromDBFirstCallback.SetFirstParam(0);
|
||||
_loadPetFromDBFirstCallback.SetSecondParam(nullptr);
|
||||
|
||||
@@ -1018,7 +1018,7 @@ private:
|
||||
typedef std::list<AddonInfo> AddonsList;
|
||||
|
||||
// Warden
|
||||
Warden* _warden; // Remains NULL if Warden system is not enabled by config
|
||||
Warden* _warden; // Remains nullptr if Warden system is not enabled by config
|
||||
|
||||
time_t _logoutTime;
|
||||
bool m_inQueue; // session wait in auth.queue
|
||||
|
||||
@@ -582,7 +582,7 @@ int WorldSocket::handle_input_missing_data(void)
|
||||
// hope this is not hack, as proper m_RecvWPct is asserted around
|
||||
if (!m_RecvWPct)
|
||||
{
|
||||
sLog->outError("Forcing close on input m_RecvWPct = NULL");
|
||||
sLog->outError("Forcing close on input m_RecvWPct = nullptr");
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ protected:
|
||||
{
|
||||
sLog->outError("Out of file descriptors, suspending incoming connections for 10 seconds");
|
||||
reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
|
||||
reactor()->schedule_timer(this, NULL, ACE_Time_Value(10));
|
||||
reactor()->schedule_timer(this, nullptr, ACE_Time_Value(10));
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user