mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-03 04:19:20 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -31,7 +31,7 @@ const CommandParser::CmdInfo cmds[] =
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
ConsoleCommandParser::ConsoleCommandParser() :
|
||||
CommandParser ("", 0, "...", "console commands", NULL)
|
||||
CommandParser ("", 0, "...", "console commands", nullptr)
|
||||
{
|
||||
createDelegateCommands(cmds);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace ConsoleManagerNamespace
|
||||
{
|
||||
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
|
||||
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
|
||||
}
|
||||
|
||||
using namespace ConsoleManagerNamespace;
|
||||
|
||||
@@ -27,7 +27,7 @@ GameServerData::GameServerData(GameServerConnection *connection) :
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
GameServerData::GameServerData(const GameServerData &rhs) :
|
||||
m_connection(NULL), // connection pointer is not copied when we copy GameServerDatas
|
||||
m_connection(nullptr), // connection pointer is not copied when we copy GameServerDatas
|
||||
m_objectCount(rhs.m_objectCount),
|
||||
m_interestObjectCount(rhs.m_interestObjectCount),
|
||||
m_interestCreatureObjectCount(rhs.m_interestCreatureObjectCount),
|
||||
@@ -38,7 +38,7 @@ GameServerData::GameServerData(const GameServerData &rhs) :
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
GameServerData::GameServerData() :
|
||||
m_connection(NULL),
|
||||
m_connection(nullptr),
|
||||
m_objectCount(0),
|
||||
m_interestObjectCount(0),
|
||||
m_interestCreatureObjectCount(0),
|
||||
@@ -53,7 +53,7 @@ GameServerData &GameServerData::operator=(const GameServerData &rhs)
|
||||
if (&rhs == this)
|
||||
return *this;
|
||||
|
||||
m_connection=NULL; // connection pointer is not copied when we copy GameServerDatas
|
||||
m_connection=nullptr; // connection pointer is not copied when we copy GameServerDatas
|
||||
m_objectCount=rhs.m_objectCount;
|
||||
m_interestObjectCount=rhs.m_interestObjectCount;
|
||||
m_interestCreatureObjectCount=rhs.m_interestCreatureObjectCount;
|
||||
|
||||
@@ -41,9 +41,9 @@ PlanetProxyObject::PlanetProxyObject (const NetworkId &objectId) :
|
||||
m_authoritativeServer(0),
|
||||
m_lastReportedServer(0),
|
||||
m_interestRadius(0),
|
||||
m_quadtreeNode(NULL),
|
||||
m_quadtreeNode(nullptr),
|
||||
m_authTransferTimeMs(Clock::timeMs()),
|
||||
m_contents(NULL),
|
||||
m_contents(nullptr),
|
||||
m_level(0),
|
||||
m_hibernating(false),
|
||||
m_templateCrc(0),
|
||||
@@ -137,9 +137,9 @@ void PlanetProxyObject::update(int x, int y, int z, NetworkId containedBy, uint3
|
||||
if (ConfigPlanetServer::getEnableContentsChecking() && (m_containedBy!=containedBy))
|
||||
updateContentsTracking(containedBy);
|
||||
|
||||
bool const firstUpdate = (m_quadtreeNode == NULL);
|
||||
bool const firstUpdate = (m_quadtreeNode == nullptr);
|
||||
|
||||
if (m_quadtreeNode!=NULL) // if this is the first update for this object, m_quadtreeNode will be NULL because it hasn't been placed anywhere yet
|
||||
if (m_quadtreeNode!=nullptr) // if this is the first update for this object, m_quadtreeNode will be nullptr because it hasn't been placed anywhere yet
|
||||
{
|
||||
removeServerStatistics();
|
||||
|
||||
|
||||
@@ -102,12 +102,12 @@ using namespace PlanetServerNamespace;
|
||||
PlanetServer::PlanetServer() :
|
||||
Singleton<PlanetServer>(),
|
||||
MessageDispatch::Receiver(),
|
||||
m_pendingCentralServerConnection(NULL),
|
||||
m_centralServerConnection(NULL),
|
||||
m_gameService(NULL),
|
||||
m_watcherService(NULL),
|
||||
m_pendingCentralServerConnection(nullptr),
|
||||
m_centralServerConnection(nullptr),
|
||||
m_gameService(nullptr),
|
||||
m_watcherService(nullptr),
|
||||
m_gameServers(),
|
||||
m_taskConnection(NULL),
|
||||
m_taskConnection(nullptr),
|
||||
m_done(false),
|
||||
m_roundRobinGameServer(0),
|
||||
m_pendingServerStarts(new std::map<PreloadServerId, GameServerSpawnDelaySeconds>()),
|
||||
@@ -117,7 +117,7 @@ PlanetServer::PlanetServer() :
|
||||
m_spaceMode(false),
|
||||
m_messagesWaitingForGameServer(),
|
||||
m_metricsData(0),
|
||||
m_taskManagerConnection(NULL),
|
||||
m_taskManagerConnection(nullptr),
|
||||
m_sceneTransferChunkLoads(new std::list<const RequestSceneTransfer*>),
|
||||
m_pendingCharacterSaves(new std::map<NetworkId, uint32>),
|
||||
m_watchers(),
|
||||
@@ -433,7 +433,7 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
GameServerConnection *gameServer=const_cast<GameServerConnection *>(dynamic_cast<const GameServerConnection*>(&source));
|
||||
std::set<GameServerConnection *>::iterator f = m_pendingGameServerDisconnects.find(gameServer);
|
||||
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was NULL or source was not a GameServerConnection."));
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was nullptr or source was not a GameServerConnection."));
|
||||
DEBUG_REPORT_LOG(true, ("removing crashed gameserver\n"));
|
||||
uint32 id = gameServer->getProcessId();
|
||||
GameServerMapType::iterator i=m_gameServers.find(id);
|
||||
@@ -688,7 +688,7 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
UnloadedPlayerMessage msg(ri);
|
||||
|
||||
GameServerConnection *gameServer=const_cast<GameServerConnection *>(dynamic_cast<const GameServerConnection*>(&source));
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was NULL or source was not a GameServerConnection."));
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was nullptr or source was not a GameServerConnection."));
|
||||
uint32 gameServerId = gameServer->getProcessId();
|
||||
|
||||
(*m_pendingCharacterSaves)[msg.getPlayerId()]=gameServerId;
|
||||
@@ -766,19 +766,19 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
GameServerData * fromServer = PlanetServer::getGameServerData(msg.getFromProcess());
|
||||
GameServerData * toServer = PlanetServer::getGameServerData(msg.getToProcess());
|
||||
PlanetProxyObject * object = Scene::getInstance().findObjectByID(msg.getId());
|
||||
if (fromServer == NULL || toServer == NULL || object == NULL)
|
||||
if (fromServer == nullptr || toServer == nullptr || object == nullptr)
|
||||
{
|
||||
if (fromServer == NULL)
|
||||
if (fromServer == nullptr)
|
||||
{
|
||||
WARNING(true, ("Message GameServerForceChangeAuthorityMessage: no "
|
||||
"from server %lu", msg.getFromProcess()));
|
||||
}
|
||||
if (toServer == NULL)
|
||||
if (toServer == nullptr)
|
||||
{
|
||||
WARNING(true, ("Message GameServerForceChangeAuthorityMessage: no "
|
||||
"to server %lu", msg.getToProcess()));
|
||||
}
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
{
|
||||
WARNING(true, ("Message GameServerForceChangeAuthorityMessage: no "
|
||||
"object for id %s", msg.getId().getValueString().c_str()));
|
||||
@@ -914,7 +914,7 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
{
|
||||
// if it's been "awhile" since we requested to restart the GameServer,
|
||||
// then assume that something has gone wrong, and try the restart again
|
||||
time_t const timeNow = ::time(NULL);
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
|
||||
for (std::map<int, std::pair<std::string, time_t> >::iterator iter = m_startingGameServers->begin(); iter != m_startingGameServers->end(); ++iter)
|
||||
{
|
||||
@@ -1005,7 +1005,7 @@ GameServerConnection *PlanetServer::getGameServerConnection(uint32 serverId)
|
||||
if (i!=m_gameServers.end())
|
||||
return (*i).second->getConnection();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1290,7 +1290,7 @@ void PlanetServer::startGameServer(const std::set<PreloadServerId> & preloadServ
|
||||
TaskSpawnProcess spawn("any", "SwgGameServer", options, i->second);
|
||||
if (m_centralServerConnection)
|
||||
{
|
||||
(*m_startingGameServers)[cookie] = std::make_pair(options, ::time(NULL));
|
||||
(*m_startingGameServers)[cookie] = std::make_pair(options, ::time(nullptr));
|
||||
++cookie;
|
||||
m_centralServerConnection->send(spawn,true);
|
||||
DEBUG_REPORT_LOG(true, ("Sent start gameserver request for scene %s\n", ConfigPlanetServer::getSceneID()));
|
||||
@@ -1321,7 +1321,7 @@ GameServerData *PlanetServer::getGameServerData(uint32 serverId) const
|
||||
if (i!=m_gameServers.end())
|
||||
return i->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -146,7 +146,7 @@ inline int PlanetServer::getNumberOfGameServers() const
|
||||
|
||||
inline void PlanetServer::onCentralConnected(CentralServerConnection *connection)
|
||||
{
|
||||
m_pendingCentralServerConnection=NULL;
|
||||
m_pendingCentralServerConnection=nullptr;
|
||||
m_centralServerConnection=connection;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void PreloadManager::handlePreloadList()
|
||||
if (PlanetServer::getInstance().getEnablePreload())
|
||||
{
|
||||
DataTable * data = DataTableManager::getTable(ConfigPlanetServer::getPreloadDataTableName(),true);
|
||||
FATAL(data==NULL,("Could not find data table %s, needed for preload",ConfigPlanetServer::getPreloadDataTableName()));
|
||||
FATAL(data==nullptr,("Could not find data table %s, needed for preload",ConfigPlanetServer::getPreloadDataTableName()));
|
||||
|
||||
int numRows = data->getNumRows();
|
||||
for (int row=0; row<numRows; ++row)
|
||||
|
||||
@@ -77,7 +77,7 @@ PlanetProxyObject *Scene::findObjectByID(const NetworkId &objectID) const
|
||||
{
|
||||
ObjectMapType::const_iterator i=m_objects.find(objectID);
|
||||
if (i==m_objects.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
else
|
||||
return ((*i).second);
|
||||
}
|
||||
@@ -94,7 +94,7 @@ bool Scene::isObjectLoaded(const NetworkId &networkId) const
|
||||
void Scene::receiveMessage(const MessageDispatch::Emitter & source, const MessageDispatch::MessageBase & message)
|
||||
{
|
||||
const GameServerConnection *gameServer=dynamic_cast<const GameServerConnection*>(&source);
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was NULL or source was not a GameServerConnection."));
|
||||
WARNING_DEBUG_FATAL(gameServer==0,("Source was nullptr or source was not a GameServerConnection."));
|
||||
|
||||
if (message.isType("GameConnectionClosed"))
|
||||
{
|
||||
@@ -216,7 +216,7 @@ Node *Scene::findNodeByPosition(int x, int z)
|
||||
|
||||
/**
|
||||
* Given coordinates, return a const pointer to the node that encloses
|
||||
* those coordinates. Will not create new nodes, so it may return NULL.
|
||||
* those coordinates. Will not create new nodes, so it may return nullptr.
|
||||
*/
|
||||
const Node *Scene::findNodeByPositionConst(int x, int z) const
|
||||
{
|
||||
@@ -245,7 +245,7 @@ Node *Scene::findNodeByRoundedPosition(int x, int z)
|
||||
|
||||
/**
|
||||
* Given coordinates that are known to be a node boundary, return a const pointer
|
||||
* to the node. Does not create new nodes, so may return NULL.
|
||||
* to the node. Does not create new nodes, so may return nullptr.
|
||||
*/
|
||||
const Node *Scene::findNodeByRoundedPositionConst(int x, int z) const
|
||||
{
|
||||
@@ -254,7 +254,7 @@ const Node *Scene::findNodeByRoundedPositionConst(int x, int z) const
|
||||
if (i!=m_nodeMap.end())
|
||||
return (*i).second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user