newer standards prefer nullptr over NULL - this is most of them but there are others too

This commit is contained in:
DarthArgus
2016-02-11 15:16:14 -06:00
parent a7f2d0ea6a
commit 3e4cc36e7e
937 changed files with 14983 additions and 14983 deletions
@@ -124,7 +124,7 @@ int InputFileHandler::deleteFile(
if (deleteHandleFlag && file)
{
delete file;
file = NULL;
file = nullptr;
}
return(unlink(filename));
}
@@ -20,7 +20,7 @@
OutputFileHandler::OutputFileHandler(const char *filename)
{
outputIFF = new Iff(MAXIFFDATASIZE);
outFilename = NULL;
outFilename = nullptr;
setCurrentFilename(filename);
}
@@ -45,7 +45,7 @@ OutputFileHandler::~OutputFileHandler(void)
delete [] outFilename;
}
outputIFF = NULL;
outputIFF = nullptr;
}
@@ -55,7 +55,7 @@
//================================================= static vars assignment ==
const int entryPointVersion = 1; // constantly check DataEntryPoint.h to see if this value has changed
OutputFileHandler *outfileHandler = NULL;
OutputFileHandler *outfileHandler = nullptr;
const int bufferSize = 16 * 1024 * 1024;
const int maxStringSize = 256;
const char version[] = "1.3 September 18, 2000";
@@ -242,7 +242,7 @@ int main( int argc, // number of args in commandline
//
static void callbackFunction(void)
{
outfileHandler = NULL;
outfileHandler = nullptr;
#ifdef WIN32
@@ -392,13 +392,13 @@ static errorType evaluateArgs(void)
// get default values from DOS
char currentDir[maxStringSize];
if (NULL == getcwd(currentDir, maxStringSize)) // get current working directory
if (nullptr == getcwd(currentDir, maxStringSize)) // get current working directory
{
retVal = ERR_UNKNOWNDIR;
return(retVal);
}
drive[0] = currentDir[0]; // drive letter
drive[1] = 0; // and null terminate it
drive[1] = 0; // and nullptr terminate it
strcpy(extension, "IFF"); // default to uppercase .IFF
strcpy(directory, &currentDir[2]); // get everything after the Drive: including the first backslash
filename[0] = 0;
@@ -619,7 +619,7 @@ static errorType loadInputToBuffer(
// we've successfully read the file, now close it...
delete inFileHandler;
}
else // inFileName is NULL
else // inFileName is nullptr
{
retVal = ERR_FILENOTFOUND;
}
@@ -746,7 +746,7 @@ static void handleError(errorType error)
// Revisions and History:
// 1/07/99 [] - created
//
extern "C" void MIFFMessage(char *message, // null terminated string to be displayed
extern "C" void MIFFMessage(char *message, // nullptr terminated string to be displayed
int forceOutput) // if non-zero, it will print out even in quiet mode (for ERRORs)
{
if (forceOutput)
@@ -35,7 +35,7 @@ void AuctionTransferClient::addCoinToAuction( const ExchangeListCreditsMessage&
// 2bi. if user connected: send VeAuctionCoinReply (with result code) to user's ES
// 2bii. if user not connected: send immediate abort back to auction service
const unsigned uTrack = getNewTransactionID( NULL );
const unsigned uTrack = getNewTransactionID( nullptr );
AuctionAssetDetails &details = m_mPendingRequestDetails[ uTrack ];
details.u8Type = AuctionAssetDetails::TYPE_COIN;
@@ -119,7 +119,7 @@ unsigned GenericAPICore::submitRequest(GenericRequest *req, GenericResponse *res
}
req->setTrack(m_currTrack);
res->setTrack(m_currTrack);
time_t timeout = time(NULL) + m_requestTimeout;
time_t timeout = time(nullptr) + m_requestTimeout;
req->setTimeout(timeout);
res->setTimeout(timeout);
@@ -138,7 +138,7 @@ void GenericAPICore::process()
if (!m_suspended)
{
// Process timeout on pending requests
while((m_outCount > 0) && ((req = m_outboundQueue.front().first)->getTimeout() <= time(NULL)))
while((m_outCount > 0) && ((req = m_outboundQueue.front().first)->getTimeout() <= time(nullptr)))
{
--m_outCount;
res = m_outboundQueue.front().second;
@@ -150,7 +150,7 @@ void GenericAPICore::process()
}
// Process timeout on pending responses
while((m_pendingCount > 0) && ((res = (*m_pending.begin()).second)->getTimeout() <= time(NULL)))
while((m_pendingCount > 0) && ((res = (*m_pending.begin()).second)->getTimeout() <= time(nullptr)))
{
--m_pendingCount;
m_pending.erase(m_pending.begin());
@@ -163,7 +163,7 @@ void GenericAPICore::process()
pair<GenericRequest *, GenericResponse *> out_pair = m_outboundQueue.front();
req = out_pair.first;
res = out_pair.second;
GenericConnection *con = NULL;
GenericConnection *con = nullptr;
if (req->getMappedServerTrack() == 0) // request has no originating "owner" server
{
con = getNextActiveConnection(); // it does not matter which server we send this to
@@ -180,7 +180,7 @@ void GenericAPICore::process()
}
}
if (con != NULL)
if (con != nullptr)
{
Base::ByteStream msg;
req->pack(msg);
@@ -215,7 +215,7 @@ GenericConnection *GenericAPICore::getNextActiveConnection()
unsigned startIndex = m_nextConnectionIndex;
unsigned maxIndex = m_serverConnections.size() - 1;
GenericConnection *con = NULL;
GenericConnection *con = nullptr;
//loop until we find an active connection, or until we get back
// to where we started
@@ -235,7 +235,7 @@ GenericConnection *GenericAPICore::getNextActiveConnection()
//went past end of vector, start back at 0
m_nextConnectionIndex = 0;
}
}while (con == NULL && m_nextConnectionIndex != startIndex);
}while (con == nullptr && m_nextConnectionIndex != startIndex);
return con;
}
@@ -261,7 +261,7 @@ ServerTrackObject *GenericAPICore::findServer(unsigned server_track)
{
std::map<unsigned, ServerTrackObject *>::iterator iter = m_serverTracks.find(server_track);
if (iter == m_serverTracks.end())
return NULL;
return nullptr;
ServerTrackObject *stobj = (*iter).second;
m_serverTracks.erase(server_track);
return stobj;
@@ -25,7 +25,7 @@ using namespace Base;
GenericConnection::GenericConnection(const char *host, short port, GenericAPICore *apiCore, unsigned reconnectTimeout, unsigned noDataTimeoutSecs, unsigned, unsigned incomingBufSizeInKB, unsigned outgoingBufSizeInKB, unsigned keepAlive, unsigned maxRecvMessageSizeInKB)
: m_bConnected(CON_NONE),
m_apiCore(apiCore),
m_con(NULL),
m_con(nullptr),
m_host(host),
m_port(port),
m_lastTrack(123455), //random choice != 1
@@ -50,8 +50,8 @@ GenericConnection::~GenericConnection()
{
if(m_con)
{
m_con->SetHandler(NULL);
m_con->Disconnect();//don't worry about onterminated being called, we've set it's handler to null, so it wont
m_con->SetHandler(nullptr);
m_con->Disconnect();//don't worry about onterminated being called, we've set it's handler to nullptr, so it wont
m_con->Release();
}
@@ -64,7 +64,7 @@ void GenericConnection::disconnect()
{
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
}
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
@@ -77,7 +77,7 @@ void GenericConnection::OnTerminated(TcpConnection *)
if(m_con)
{
m_con->Release();
m_con = NULL;
m_con = nullptr;
}
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
@@ -93,7 +93,7 @@ void GenericConnection::OnRoutePacket(TcpConnection *, const unsigned char *data
get(iter, type);
get(iter, track);
GenericResponse *res = NULL;
GenericResponse *res = nullptr;
// the following if block is a temporary fix that prevents
// a crash with a game team in which they occasionally find
@@ -152,7 +152,7 @@ void GenericConnection::process()
{
m_con->SetHandler(this);
m_conState = CON_NEGOTIATE;
m_conTimeout = time(NULL) + m_reconnectTimeout;
m_conTimeout = time(nullptr) + m_reconnectTimeout;
}
break;
case CON_NEGOTIATE:
@@ -178,12 +178,12 @@ void GenericConnection::process()
put(msg, std::string(m_apiCore->m_gameIdentifiers[index]));
Send(msg);
}
else if(time(NULL) > m_conTimeout)
else if(time(nullptr) > m_conTimeout)
{
// we did not connect
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
}
@@ -199,7 +199,7 @@ void GenericConnection::process()
{
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
}
}
m_manager->GiveTime();
@@ -25,9 +25,9 @@ AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identi
std::vector<short> portArray;
char hostConfig[4096];
char identifierConfig[4096];
if (hostNames == NULL)
if (hostNames == nullptr)
hostNames = DEFAULT_HOST;
if(identifiers == NULL)
if(identifiers == nullptr)
identifiers = DEFAULT_IDENTIFIER;
// parse the hosts and ports out :
@@ -52,7 +52,7 @@ AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identi
portArray.push_back(port);
}
}
while ((ptr = strtok(NULL, " ")) != NULL);
while ((ptr = strtok(nullptr, " ")) != nullptr);
}
strncpy(identifierConfig, identifiers, 4096); identifierConfig[4095] = 0;
@@ -67,7 +67,7 @@ AuctionTransferAPI::AuctionTransferAPI(const char *hostNames, const char *identi
identifierArray.push_back(identifier);
}
}
while ((ptr = strtok(NULL, ";")) != NULL);
while ((ptr = strtok(nullptr, ";")) != nullptr);
}
if (hostArray.empty())
@@ -134,7 +134,7 @@ unsigned AuctionTransferAPI::sendCommitTransaction(long long transactionID, void
unsigned AuctionTransferAPI::sendPrepareTransaction(const char *serverIdentifier, long long transactionID, unsigned stationID, unsigned characterID, long long assetID, const char *xmlAsset, void *user, bool compress)
{
RequestTypes requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION;
GenericRequest *req = NULL;
GenericRequest *req = nullptr;
if( compress )
{
requestEnum = GAME_REQUEST_SEND_PREPARE_TRANSACTION_COMPRESSED;
@@ -91,7 +91,7 @@ namespace Base
ByteStream::ByteStream() :
allocatedSize(0),
beginReadIterator(),
data(NULL),
data(nullptr),
size(0),
lastPutSize(0)
{
@@ -208,7 +208,7 @@ namespace Base
if(data->size < allocatedSize)
{
unsigned char * tmp = new unsigned char[newSize];
if(data->buffer != NULL)
if(data->buffer != nullptr)
memcpy(tmp, data->buffer, size);
delete[] data->buffer;
data->buffer = tmp;
@@ -7,7 +7,7 @@ void put(Base::ByteStream &msg, const Blob &source);
//////////////////////////////////////////////////////////////////////////////////////
Blob::Blob(const unsigned char *data, unsigned len)
: m_data(NULL),
: m_data(nullptr),
m_len(len)
{
if (m_len > 0)
@@ -20,7 +20,7 @@ void put(Base::ByteStream &msg, const Blob &source);
//////////////////////////////////////////////////////////////////////////////////////
Blob::Blob(const Blob &cpy)
: m_data(NULL),
: m_data(nullptr),
m_len(cpy.m_len)
{
if (m_len > 0)
@@ -45,7 +45,7 @@ void put(Base::ByteStream &msg, const Blob &source);
if (m_data)
{
delete [] m_data;
m_data = NULL;
m_data = nullptr;
}
m_len = cpy.m_len;
@@ -32,7 +32,7 @@ public:
* @brief Used to retreive the the dot-notation represenatatiion of this address.
*
* @param buffer A pointer to the buffer to place the ip address into.
* Must be at least 17 characters long, will be null terminated.
* Must be at least 17 characters long, will be nullptr terminated.
*
* @return A pointer to the buffer the address was placed into.
*/
@@ -6,7 +6,7 @@ namespace NAMESPACE
#endif
TcpBlockAllocator::TcpBlockAllocator(const unsigned initSize, const unsigned initCount)
: m_freeHead(NULL), m_blockCount(initCount), m_blockSize(initSize), m_numAvailBlocks(0)
: m_freeHead(nullptr), m_blockCount(initCount), m_blockSize(initSize), m_numAvailBlocks(0)
{
realloc();
}
@@ -33,7 +33,7 @@ data_block *TcpBlockAllocator::getBlock()
tmp = m_freeHead;
m_freeHead = m_freeHead->m_next;
tmp->m_next = NULL;
tmp->m_next = nullptr;
m_numAvailBlocks--;
return(tmp);
}
@@ -56,7 +56,7 @@ void TcpBlockAllocator::returnBlock(data_block *b)
void TcpBlockAllocator::realloc()
{
data_block *tmp = NULL, *cursor = NULL;
data_block *tmp = nullptr, *cursor = nullptr;
tmp = new data_block; m_numAvailBlocks++;
cursor = tmp;
@@ -11,28 +11,28 @@ namespace NAMESPACE
//used when want to open new connection with this socket
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams &params, const IPAddress &destIP, short destPort, unsigned timeout)
: m_nextConnection(NULL),
m_prevConnection(NULL),
: m_nextConnection(nullptr),
m_prevConnection(nullptr),
m_socket(INVALID_SOCKET),
m_nextKeepAliveConnection(NULL),
m_prevKeepAliveConnection(NULL),
m_nextKeepAliveConnection(nullptr),
m_prevKeepAliveConnection(nullptr),
m_aliveListId(tcpManager->m_aliveList.m_listID),
m_nextRecvDataConnection(NULL),
m_prevRecvDataConnection(NULL),
m_nextRecvDataConnection(nullptr),
m_prevRecvDataConnection(nullptr),
m_recvDataListId(tcpManager->m_dataList.m_listID),
m_manager(tcpManager),
m_status(StatusNegotiating),
m_handler(NULL),
m_handler(nullptr),
m_destIP(destIP),
m_destPort(destPort),
m_refCount(0),
m_sendAllocator(sendAlloc),
m_head(NULL),
m_tail(NULL),
m_head(nullptr),
m_tail(nullptr),
m_bytesRead(0),
m_bytesNeeded(0),
m_params(params),
m_recvBuff(NULL),
m_recvBuff(nullptr),
m_connectTimeout(timeout),
m_connectTimer(),
m_wasConRemovedFromMgr(false)
@@ -94,28 +94,28 @@ TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAllo
//used when server mode creates new connection object representing a connect request
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams &params, SOCKET socket, const IPAddress &destIP, short destPort)
: m_nextConnection(NULL),
m_prevConnection(NULL),
: m_nextConnection(nullptr),
m_prevConnection(nullptr),
m_socket(socket),
m_nextKeepAliveConnection(NULL),
m_prevKeepAliveConnection(NULL),
m_nextKeepAliveConnection(nullptr),
m_prevKeepAliveConnection(nullptr),
m_aliveListId(tcpManager->m_aliveList.m_listID),
m_nextRecvDataConnection(NULL),
m_prevRecvDataConnection(NULL),
m_nextRecvDataConnection(nullptr),
m_prevRecvDataConnection(nullptr),
m_recvDataListId(tcpManager->m_dataList.m_listID),
m_manager(tcpManager),
m_status(StatusConnected),
m_handler(NULL),
m_handler(nullptr),
m_destIP(destIP),
m_destPort(destPort),
m_refCount(0),
m_sendAllocator(sendAlloc),
m_head(NULL),
m_tail(NULL),
m_head(nullptr),
m_tail(nullptr),
m_bytesRead(0),
m_bytesNeeded(0),
m_params(params),
m_recvBuff(NULL),
m_recvBuff(nullptr),
m_connectTimeout(0),
m_connectTimer(),
m_wasConRemovedFromMgr(false)
@@ -208,7 +208,7 @@ int TcpConnection::finishConnect()
t.tv_sec = 0;
t.tv_usec = 0;
int err = select(m_socket + 1, NULL, &wrSet, NULL, &t);
int err = select(m_socket + 1, nullptr, &wrSet, nullptr, &t);
if (err == 0)
{
@@ -303,7 +303,7 @@ TcpConnection::~TcpConnection()
{
delete [] m_recvBuff;
while(m_head != NULL)
while(m_head != nullptr)
{
data_block *tmp = m_head;
m_head = m_head->m_next;
@@ -327,22 +327,22 @@ void TcpConnection::Send(const char *data, unsigned int dataLen)
{
m_aliveListId = m_manager->m_keepAliveList.m_listID;
if (m_prevKeepAliveConnection != NULL)
if (m_prevKeepAliveConnection != nullptr)
m_prevKeepAliveConnection->m_nextKeepAliveConnection = m_nextKeepAliveConnection;
if (m_nextKeepAliveConnection != NULL)
if (m_nextKeepAliveConnection != nullptr)
m_nextKeepAliveConnection->m_prevKeepAliveConnection = m_prevKeepAliveConnection;
if (m_manager->m_keepAliveList.m_beginList == this)
m_manager->m_keepAliveList.m_beginList = m_nextKeepAliveConnection;
m_nextKeepAliveConnection = m_manager->m_aliveList.m_beginList;
m_prevKeepAliveConnection = NULL;
if (m_manager->m_aliveList.m_beginList != NULL)
m_prevKeepAliveConnection = nullptr;
if (m_manager->m_aliveList.m_beginList != nullptr)
m_manager->m_aliveList.m_beginList->m_prevKeepAliveConnection = this;
m_manager->m_aliveList.m_beginList = this;
}
data_block *work = NULL;
data_block *work = nullptr;
// this connection has no send buffer. Get a block
if(!m_tail)
@@ -467,16 +467,16 @@ int TcpConnection::processIncoming()
{
m_recvDataListId = m_manager->m_noDataList.m_listID;
if (m_prevRecvDataConnection != NULL)
if (m_prevRecvDataConnection != nullptr)
m_prevRecvDataConnection->m_nextRecvDataConnection = m_nextRecvDataConnection;
if (m_nextRecvDataConnection != NULL)
if (m_nextRecvDataConnection != nullptr)
m_nextRecvDataConnection->m_prevRecvDataConnection = m_prevRecvDataConnection;
if (m_manager->m_noDataList.m_beginList == this)
m_manager->m_noDataList.m_beginList = m_nextRecvDataConnection;
m_nextRecvDataConnection = m_manager->m_dataList.m_beginList;
m_prevRecvDataConnection = NULL;
if (m_manager->m_dataList.m_beginList != NULL)
m_prevRecvDataConnection = nullptr;
if (m_manager->m_dataList.m_beginList != nullptr)
m_manager->m_dataList.m_beginList->m_prevRecvDataConnection = this;
m_manager->m_dataList.m_beginList = this;
}
@@ -622,7 +622,7 @@ int TcpConnection::processOutgoing()
int sendError = 1;
// If m_head is not null, then this connection has something to send
// If m_head is not nullptr, then this connection has something to send
if(m_head)
@@ -50,7 +50,7 @@ public:
* connection is disconnected, you simply need to derive your class
* (multiply if necessary) from TcpConnectionHandler, then you can use
* this method to set the object the TcpConnection will call as appropriate.
* default = NULL (no callbacks made)
* default = nullptr (no callbacks made)
*
* @param handler The object which will be called for notifications.
*/
@@ -41,14 +41,14 @@ TcpManager::TcpParams::TcpParams(const TcpParams &cpy)
}
TcpManager::TcpManager(const TcpParams &params)
: m_handler(NULL),
m_keepAliveList(NULL, 1),
m_aliveList(NULL, 2),
m_noDataList(NULL, 1),
m_dataList(NULL, 2),
: m_handler(nullptr),
m_keepAliveList(nullptr, 1),
m_aliveList(nullptr, 2),
m_noDataList(nullptr, 1),
m_dataList(nullptr, 2),
m_params(params),
m_refCount(1),
m_connectionList(NULL),
m_connectionList(nullptr),
m_connectionListCount(0),
m_socket(INVALID_SOCKET),
m_boundAsServer(false),
@@ -86,7 +86,7 @@ TcpManager::~TcpManager()
close(m_socket);
#endif
}
while (m_connectionList != NULL)
while (m_connectionList != nullptr)
{
TcpConnection *con = m_connectionList;
m_connectionList = m_connectionList->m_nextConnection;
@@ -166,7 +166,7 @@ bool TcpManager::BindAsServer()
{
struct hostent * lphp;
lphp = gethostbyname(m_params.bindAddress);
if (lphp != NULL)
if (lphp != nullptr)
addr_loc.sin_addr.s_addr = ((struct in_addr *)(lphp->h_addr))->s_addr;
}
else
@@ -191,7 +191,7 @@ bool TcpManager::BindAsServer()
TcpConnection *TcpManager::acceptClient()
{
TcpConnection *newConn = NULL;
TcpConnection *newConn = nullptr;
if (m_boundAsServer && m_connectionListCount < m_params.maxConnections)
{
@@ -205,7 +205,7 @@ TcpConnection *TcpManager::acceptClient()
{
newConn = new TcpConnection(this, &m_allocator, m_params, sock, IPAddress(addr.sin_addr.s_addr), ntohs(addr.sin_port));
addNewConnection(newConn);
if (m_handler != NULL)
if (m_handler != nullptr)
{
m_handler->OnConnectRequest(newConn);
}
@@ -230,8 +230,8 @@ SOCKET TcpManager::getMaxFD()
if (m_boundAsServer)
maxfd = m_socket+1;
TcpConnection *next = NULL;
for (TcpConnection *con = m_connectionList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_connectionList ; con != nullptr ; con = next)
{
next = con->m_nextConnection;
if (con->GetStatus() != TcpConnection::StatusDisconnected && con->m_socket > maxfd)
@@ -245,8 +245,8 @@ SOCKET TcpManager::getMaxFD()
TcpConnection *TcpManager::getConnection(SOCKET fd)
{
TcpConnection *next = NULL;
for (TcpConnection *con = m_connectionList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_connectionList ; con != nullptr ; con = next)
{
next = con->m_nextConnection;
if (con->m_socket == fd)
@@ -255,7 +255,7 @@ TcpConnection *TcpManager::getConnection(SOCKET fd)
}
}
//if get here ,couldn't find it
return NULL;
return nullptr;
}
bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendTimePerConnection, unsigned maxRecvTimePerConnection)
@@ -277,8 +277,8 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
{
// Send output from last heartbeat
TcpConnection *next = NULL;
for (TcpConnection *con = m_connectionList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_connectionList ; con != nullptr ; con = next)
{
con->AddRef();
if (next) next->Release();
@@ -345,7 +345,7 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
tmpfds = m_permfds;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
int cnt = select(maxfd, &tmpfds, NULL, NULL, &timeout); // blocks for timeout
int cnt = select(maxfd, &tmpfds, nullptr, nullptr, &timeout); // blocks for timeout
if (cnt > 0)
@@ -371,8 +371,8 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
//process incoming client messages
if (maxRecvTimePerConnection != 0)
{
TcpConnection *next = NULL;
for (TcpConnection *con = m_connectionList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_connectionList ; con != nullptr ; con = next)
{
con->AddRef();
if (next) next->Release();
@@ -437,8 +437,8 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
pollfds[0].events |= POLLIN;
}
TcpConnection *next = NULL;
for (TcpConnection *con = m_connectionList ; con != NULL ; con = next, idx++)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_connectionList ; con != nullptr ; con = next, idx++)
{
next = con->m_nextConnection;
pollfds[idx].fd = con->m_socket;
@@ -478,7 +478,7 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
}
//process regular msg(s)
if (con == NULL)
if (con == nullptr)
{
close(pollfds[idx].fd);
continue;
@@ -510,7 +510,7 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
}//if(pollfds[...
else if (pollfds[idx].revents & POLLHUP)
{
if (con == NULL)
if (con == nullptr)
{
close(pollfds[idx].fd);
continue;
@@ -528,21 +528,21 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
//now process any keepalives, if time to do that
if (m_params.keepAliveDelay > 0 && m_keepAliveTimer.isDone(m_params.keepAliveDelay))
{
TcpConnection *next = NULL;
for (TcpConnection *con = m_keepAliveList.m_beginList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_keepAliveList.m_beginList ; con != nullptr ; con = next)
{
con->AddRef();
if (next) next->Release();
next = con->m_nextKeepAliveConnection;
if (next) next->AddRef();
con->Send(NULL, 0); //note: this request will move the connection from the keepAliveList to the aliveList
con->Send(nullptr, 0); //note: this request will move the connection from the keepAliveList to the aliveList
con->Release();
}
//now move the complete alive list over to the keepalive list to reset those timers
m_keepAliveList.m_beginList = m_aliveList.m_beginList;
m_aliveList.m_beginList = NULL;
m_aliveList.m_beginList = nullptr;
//switch id's for those connections that were in the alive list last go - around
int tmpID = m_aliveList.m_listID;
@@ -556,8 +556,8 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
//now process any noDataCons, if time to do that
if (m_params.noDataTimeout > 0 && m_noDataTimer.isDone(m_params.noDataTimeout))
{
TcpConnection *next = NULL;
for (TcpConnection *con = m_noDataList.m_beginList ; con != NULL ; con = next)
TcpConnection *next = nullptr;
for (TcpConnection *con = m_noDataList.m_beginList ; con != nullptr ; con = next)
{
con->AddRef();
if (next) next->Release();
@@ -571,7 +571,7 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
//now move the complete data list over to the nodata list to reset those timers
m_noDataList.m_beginList = m_dataList.m_beginList;
m_dataList.m_beginList = NULL;
m_dataList.m_beginList = nullptr;
//switch id's for those connections that were in the data list last go - around
int tmpID = m_dataList.m_listID;
@@ -593,11 +593,11 @@ TcpConnection *TcpManager::EstablishConnection(const char *serverAddress, unsign
{
//can't open outgoing connections when in server mode
// use a different TcpManager to do that
return NULL;
return nullptr;
}
if (m_connectionListCount >= m_params.maxConnections)
return(NULL);
return(nullptr);
// get server address
unsigned long address = inet_addr(serverAddress);
@@ -605,8 +605,8 @@ TcpConnection *TcpManager::EstablishConnection(const char *serverAddress, unsign
{
struct hostent * lphp;
lphp = gethostbyname(serverAddress);
if (lphp == NULL)
return(NULL);
if (lphp == nullptr)
return(nullptr);
address = ((struct in_addr *)(lphp->h_addr))->s_addr;
}
IPAddress destIP(address);
@@ -631,22 +631,22 @@ void TcpManager::addNewConnection(TcpConnection *con)
}
#endif
con->m_nextConnection = m_connectionList;
con->m_prevConnection = NULL;
if (m_connectionList != NULL)
con->m_prevConnection = nullptr;
if (m_connectionList != nullptr)
m_connectionList->m_prevConnection = con;
m_connectionList = con;
m_connectionListCount++;
con->m_nextKeepAliveConnection = m_aliveList.m_beginList;
con->m_prevKeepAliveConnection = NULL;
if (m_aliveList.m_beginList != NULL)
con->m_prevKeepAliveConnection = nullptr;
if (m_aliveList.m_beginList != nullptr)
m_aliveList.m_beginList->m_prevKeepAliveConnection = con;
m_aliveList.m_beginList = con;
con->m_aliveListId = m_keepAliveList.m_listID;//start it out thinking it's already in the alive list, since it is
con->m_nextRecvDataConnection = m_dataList.m_beginList;
con->m_prevRecvDataConnection = NULL;
if (m_dataList.m_beginList != NULL)
con->m_prevRecvDataConnection = nullptr;
if (m_dataList.m_beginList != nullptr)
m_dataList.m_beginList->m_prevRecvDataConnection = con;
m_dataList.m_beginList = con;
con->m_recvDataListId = m_noDataList.m_listID;//start it out thinking it's already in the data list, since it is
@@ -667,40 +667,40 @@ void TcpManager::removeConnection(TcpConnection *con)
#pragma warning(pop)
}
#endif
if (con->m_prevConnection != NULL)
if (con->m_prevConnection != nullptr)
con->m_prevConnection->m_nextConnection = con->m_nextConnection;
if (con->m_nextConnection != NULL)
if (con->m_nextConnection != nullptr)
con->m_nextConnection->m_prevConnection = con->m_prevConnection;
if (m_connectionList == con)
m_connectionList = con->m_nextConnection;
con->m_nextConnection = NULL;
con->m_prevConnection = NULL;
con->m_nextConnection = nullptr;
con->m_prevConnection = nullptr;
if (con->m_prevKeepAliveConnection != NULL)
if (con->m_prevKeepAliveConnection != nullptr)
con->m_prevKeepAliveConnection->m_nextKeepAliveConnection = con->m_nextKeepAliveConnection;
if (con->m_nextKeepAliveConnection != NULL)
if (con->m_nextKeepAliveConnection != nullptr)
con->m_nextKeepAliveConnection->m_prevKeepAliveConnection = con->m_prevKeepAliveConnection;
if (m_aliveList.m_beginList == con)
m_aliveList.m_beginList = con->m_nextKeepAliveConnection;
else if (m_keepAliveList.m_beginList == con)
m_keepAliveList.m_beginList = con->m_nextKeepAliveConnection;
con->m_nextKeepAliveConnection = NULL;
con->m_prevKeepAliveConnection = NULL;
con->m_nextKeepAliveConnection = nullptr;
con->m_prevKeepAliveConnection = nullptr;
if (con->m_prevRecvDataConnection != NULL)
if (con->m_prevRecvDataConnection != nullptr)
con->m_prevRecvDataConnection->m_nextRecvDataConnection = con->m_nextRecvDataConnection;
if (con->m_nextRecvDataConnection != NULL)
if (con->m_nextRecvDataConnection != nullptr)
con->m_nextRecvDataConnection->m_prevRecvDataConnection = con->m_prevRecvDataConnection;
if (m_dataList.m_beginList == con)
m_dataList.m_beginList = con->m_nextRecvDataConnection;
else if (m_noDataList.m_beginList == con)
m_noDataList.m_beginList = con->m_nextRecvDataConnection;
con->m_nextRecvDataConnection = NULL;
con->m_prevRecvDataConnection = NULL;
con->m_nextRecvDataConnection = nullptr;
con->m_prevRecvDataConnection = nullptr;
@@ -156,7 +156,7 @@ public:
* simply need to derive your class (multiply if necessary) from TcpManagerHandler, then you can use
* this method to set the object the TcpManager will call as appropriate. The TcpConnection object
* also has a handler mechanism that replaces the other callback functions below, see TcpConnection::SetHandler
* default = NULL (no callbacks made)
* default = nullptr (no callbacks made)
*
* @param handler The object which will be called for manager related notifications.
*/
@@ -211,7 +211,7 @@ public:
* the connect-complete callback to be called if the connection is succesfull.
*
* @return A pointer to a TcpConnection object.
* NULL if the manager object has exceeded its maximum number of connections
* nullptr if the manager object has exceeded its maximum number of connections
* or if the serverAddress cannot be resolved to an IP address.
*/
TcpConnection *EstablishConnection(const char *serverAddress, unsigned short serverPort, unsigned timeout = 0);
@@ -187,7 +187,7 @@ class CA2GZIPT
int destroy()
{
int err = Z_OK;
if (m_zstream.state != NULL) {
if (m_zstream.state != nullptr) {
err = deflateEnd(&(m_zstream));
}
if (m_z_err < 0) err = m_z_err;
@@ -459,7 +459,7 @@ class CGZIP2AT
int destroy()
{
int err = Z_OK;
if (m_zstream.state != NULL) {
if (m_zstream.state != nullptr) {
err = inflateEnd(&(m_zstream));
}
if (m_z_err < 0) err = m_z_err;
@@ -74,7 +74,7 @@ typedef struct z_stream_s {
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
char *msg; /* last error message, nullptr if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
@@ -193,7 +193,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
enough memory, Z_STREAM_ERROR if level is not a valid compression level,
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
with the version assumed by the caller (ZLIB_VERSION).
msg is set to null if there is no error message. deflateInit does not
msg is set to nullptr if there is no error message. deflateInit does not
perform any compression: this will be done by deflate().
*/
@@ -271,7 +271,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
if next_in or next_out was nullptr), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero).
*/
@@ -304,7 +304,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller. msg is set to null if there is no error
version assumed by the caller. msg is set to nullptr if there is no error
message. inflateInit does not perform any decompression apart from reading
the zlib header if present: this will be done by inflate(). (So next_in and
avail_in may be modified, but next_out and avail_out are unchanged.)
@@ -372,7 +372,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect
adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
(for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
(for example if next_in or next_out was nullptr), Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if no progress is possible or if there was not
enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
case, the application may then call inflateSync to look for a good
@@ -437,7 +437,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
method). msg is set to null if there is no error message. deflateInit2 does
method). msg is set to nullptr if there is no error message. deflateInit2 does
not perform any compression: this will be done by deflate().
*/
@@ -471,7 +471,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
actually used by the compressor.)
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
parameter is invalid (such as nullptr dictionary) or the stream state is
inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
@@ -491,7 +491,7 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being NULL). msg is left unchanged in both source and
(such as zalloc being nullptr). msg is left unchanged in both source and
destination.
*/
@@ -503,7 +503,7 @@ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
that may have been set by deflateInit2.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
stream state was inconsistent (such as zalloc or state being nullptr).
*/
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
@@ -544,7 +544,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
memLevel). msg is set to null if there is no error message. inflateInit2
memLevel). msg is set to nullptr if there is no error message. inflateInit2
does not perform any decompression apart from reading the zlib header if
present: this will be done by inflate(). (So next_in and avail_in may be
modified, but next_out and avail_out are unchanged.)
@@ -562,7 +562,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
dictionary (see deflateSetDictionary).
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
parameter is invalid (such as nullptr dictionary) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect Adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
@@ -591,7 +591,7 @@ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
The stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
stream state was inconsistent (such as zalloc or state being nullptr).
*/
@@ -667,7 +667,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
gzopen returns NULL if the file could not be opened or if there was
gzopen returns nullptr if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
@@ -681,7 +681,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
The next call of gzclose on the returned gzFile will also close the
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
gzdopen returns NULL if there was insufficient memory to allocate
gzdopen returns nullptr if there was insufficient memory to allocate
the (de)compression state.
*/
@@ -718,8 +718,8 @@ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
Writes the given nullptr-terminated string to the compressed file, excluding
the terminating nullptr character.
gzputs returns the number of characters written, or -1 in case of error.
*/
@@ -727,7 +727,7 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
condition is encountered. The string is then terminated with a null
condition is encountered. The string is then terminated with a nullptr
character.
gzgets returns buf, or Z_NULL in case of error.
*/
@@ -822,7 +822,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is NULL, this function returns
return the updated checksum. If buf is nullptr, this function returns
the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster. Usage example:
@@ -838,7 +838,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
crc. If buf is nullptr, this function returns the required initial value
for the crc. Pre- and post-conditioning (one's complement) is performed
within this function so it shouldn't be done by the application.
Usage example:
@@ -116,7 +116,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# define fdopen(fd,mode) nullptr /* No fdopen() */
# endif
# endif
#endif
@@ -130,7 +130,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
# define fdopen(fd,mode) nullptr /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600))
@@ -69,7 +69,7 @@ protected:
std::string name;
EntryType type;
CentralCSHandlerFunc func; // will be null unless it's of TYPE_CENTRAL.
CentralCSHandlerFunc func; // will be nullptr unless it's of TYPE_CENTRAL.
};
@@ -587,7 +587,7 @@ void CentralServer::getReadyGameServers(std::vector<uint32> &theList)
GameServerConnection * CentralServer::getRandomGameServer(void)
{
if (m_gameServerConnectionsList.empty())
return NULL;
return nullptr;
// m_gameServerConnectionsList ***DOES NOT*** contain the DB server so
// we don't have to worry about checking for and excluding the DB server
@@ -611,7 +611,7 @@ GameServerConnection * CentralServer::getRandomGameServer(void)
indexNextGameServer = 0;
}
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -696,7 +696,7 @@ void CentralServer::launchStartingProcesses() const
if (!m_taskManager || !m_taskManager->isConnected() || (m_clusterId == 0))
{
if (!m_taskManager)
REPORT_LOG(true, ("CentralServer not launching starting processes because m_taskManager is NULL\n"));
REPORT_LOG(true, ("CentralServer not launching starting processes because m_taskManager is nullptr\n"));
else if (!m_taskManager->isConnected())
REPORT_LOG(true, ("CentralServer not launching starting processes because m_taskManager->isConnected() is false\n"));
@@ -820,7 +820,7 @@ void CentralServer::launchStartingPlanetServers()
char const * const p = ConfigCentralServer::getStartPlanet(i);
if (p)
{
FATAL(!*p, ("CentralServer::launchStartingPlanetServers: ConfigCentralServer::getStartPlanet(%d) specified a non-null but empty planet name", i));
FATAL(!*p, ("CentralServer::launchStartingPlanetServers: ConfigCentralServer::getStartPlanet(%d) specified a non-nullptr but empty planet name", i));
std::string planetName;
std::string hostName;
@@ -1495,7 +1495,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
{
ConnectionServerConnection * c = (*ci);
if ( (c != NULL)
if ( (c != nullptr)
&& !c->getChatServiceAddress().empty()
&& (c->getChatServicePort() != 0))
{
@@ -1537,13 +1537,13 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
{
ChatServerConnection *connection = (*iterChatServerConnections);
if (connection != NULL)
if (connection != nullptr)
{
connection->send(address, true);
}
else
{
REPORT_LOG(true, ("Trying to send the customer service server: chat server service address to a NULL chat server\n"));
REPORT_LOG(true, ("Trying to send the customer service server: chat server service address to a nullptr chat server\n"));
}
}
}
@@ -1556,7 +1556,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
{
ConnectionServerConnection * c = (*ci);
if ( (c != NULL)
if ( (c != nullptr)
&& !c->getCustomerServiceAddress().empty()
&& (c->getCustomerServicePort() != 0))
{
@@ -1631,7 +1631,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
const RequestGameServerForLoginMessage msg(ri);
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
PlayerSceneMapType::const_iterator i = m_playerSceneMap.find(msg.getCharacterId());
if ((i != m_playerSceneMap.end()) && (i->second.second > timeNow))
{
@@ -1892,14 +1892,14 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
}
else
{
if(getInstance().m_transferServerConnection != NULL)
if(getInstance().m_transferServerConnection != nullptr)
{
getInstance().m_transferServerConnection->disconnect();
getInstance().m_transferServerConnection = 0;
s_retryTransferServerConnection = false;
}
if(getInstance().m_stationPlayersCollectorConnection != NULL)
if(getInstance().m_stationPlayersCollectorConnection != nullptr)
{
getInstance().m_stationPlayersCollectorConnection->disconnect();
getInstance().m_stationPlayersCollectorConnection = 0;
@@ -1947,11 +1947,11 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
if (iterFind != s_pendingRenameCharacter.end())
{
++(iterFind->second.second);
iterFind->second.first = ::time(NULL) + 3600; // 1 hour timeout
iterFind->second.first = ::time(nullptr) + 3600; // 1 hour timeout
}
else
{
s_pendingRenameCharacter.insert(std::make_pair(msg.getValue().second.first, std::make_pair((::time(NULL) + 3600), 1))); // 1 hour timeout
s_pendingRenameCharacter.insert(std::make_pair(msg.getValue().second.first, std::make_pair((::time(nullptr) + 3600), 1))); // 1 hour timeout
}
// tell the chat server to destroy any avatar with the new name, but only if the first name changed
@@ -2099,11 +2099,11 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
{
i->second.first = ssfp.getValue().second.first;
if (ssfp.getValue().second.second)
i->second.second = ::time(NULL) + static_cast<time_t>(ConfigCentralServer::getCtsDenyLoginThresholdSeconds());
i->second.second = ::time(nullptr) + static_cast<time_t>(ConfigCentralServer::getCtsDenyLoginThresholdSeconds());
}
else
{
m_playerSceneMap[ssfp.getValue().first]=std::make_pair(ssfp.getValue().second.first, (ssfp.getValue().second.second ? (::time(NULL) + static_cast<time_t>(ConfigCentralServer::getCtsDenyLoginThresholdSeconds())) : 0));
m_playerSceneMap[ssfp.getValue().first]=std::make_pair(ssfp.getValue().second.first, (ssfp.getValue().second.second ? (::time(nullptr) + static_cast<time_t>(ConfigCentralServer::getCtsDenyLoginThresholdSeconds())) : 0));
}
}
}
@@ -2250,7 +2250,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
GenericValueTypeMessage<std::map<std::string, int> > const msg(ri);
m_timePopulationStatisticsRefresh = ::time(NULL);
m_timePopulationStatisticsRefresh = ::time(nullptr);
m_populationStatistics = msg.getValue();
}
else if (message.isType("GcwScoreStatRsp"))
@@ -2258,7 +2258,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
GenericValueTypeMessage<std::pair<std::map<std::string, int>, std::pair<std::map<std::string, std::pair<int64, int64> >, std::map<std::string, std::pair<int64, int64> > > > > const msg(ri);
m_timeGcwScoreStatisticsRefresh = ::time(NULL);
m_timeGcwScoreStatisticsRefresh = ::time(nullptr);
std::string const timeGcwScoreStatisticsRefreshStr = CalendarTime::convertEpochToTimeStringLocal(m_timeGcwScoreStatisticsRefresh);
std::map<std::string, int> const & gcwImperialScorePercentile = msg.getValue().first;
@@ -2330,7 +2330,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
GenericValueTypeMessage<std::pair<std::map<int, std::pair<std::string, int> >, std::map<int, std::pair<std::string, int> > > > const msg(ri);
m_timeLastLoginTimeStatisticsRefresh = ::time(NULL);
m_timeLastLoginTimeStatisticsRefresh = ::time(nullptr);
m_lastLoginTimeStatistics = msg.getValue().first;
m_createTimeStatistics = msg.getValue().second;
}
@@ -2606,7 +2606,7 @@ void CentralServer::removeGameServer(GameServerConnection const *gameServer)
}
else
{
DEBUG_WARNING(true, ("A game server crashed but our process ID ptr is null."));
DEBUG_WARNING(true, ("A game server crashed but our process ID ptr is nullptr."));
}
}
@@ -2828,7 +2828,7 @@ void CentralServer::update()
if ( ConfigCentralServer::getAuctionEnabled() ) // allow auctions?
{
if ( m_pAuctionTransferClient == NULL )
if ( m_pAuctionTransferClient == nullptr )
{
const char* hostName[1] = { ConfigCentralServer::getAuctionServer() };
const short port[1] = { (short)ConfigCentralServer::getAuctionPort() };
@@ -2975,7 +2975,7 @@ void CentralServer::sendToPlanetServer(const std::string &sceneId, const GameNet
// ----------------------------------------------------------------------
void CentralServer::sendToAllConnectionServers(const GameNetworkMessage & message, const bool reliable, Connection const * exclude /*= NULL*/)
void CentralServer::sendToAllConnectionServers(const GameNetworkMessage & message, const bool reliable, Connection const * exclude /*= nullptr*/)
{
// send to all connection servers
for (ConnectionServerConnectionList::const_iterator i = m_connectionServerConnections.begin(); i != m_connectionServerConnections.end(); ++i)
@@ -3005,7 +3005,7 @@ void CentralServer::sendToDBProcess(const GameNetworkMessage & message, const bo
bool CentralServer::hasDBConnection() const
{
const GameServerConnection * g = getGameServer(getDbProcessServerProcessId());
return (g != NULL);
return (g != nullptr);
}
//-----------------------------------------------------------------------
@@ -3110,7 +3110,7 @@ void CentralServer::startPlanetServer(const std::string & host, const std::strin
TaskSpawnProcess spawn(host.empty() ? std::string("any") : host, "PlanetServer", options, spawnDelay);
CentralServer::getInstance().sendTaskMessage(spawn);
m_pendingPlanetServers[sceneId] = std::make_pair(std::make_pair(host, options), ::time(NULL));
m_pendingPlanetServers[sceneId] = std::make_pair(std::make_pair(host, options), ::time(nullptr));
IGNORE_RETURN(m_planetsWaitingForPreload.insert(sceneId));
bool const preloadFinished = isPreloadFinished();
@@ -3119,14 +3119,14 @@ void CentralServer::startPlanetServer(const std::string & host, const std::strin
else if (m_timeClusterWentIntoLoadingState <= 0)
m_timeClusterWentIntoLoadingState = time(0);
if(getInstance().m_transferServerConnection != NULL && !preloadFinished)
if(getInstance().m_transferServerConnection != nullptr && !preloadFinished)
{
getInstance().m_transferServerConnection->disconnect();
getInstance().m_transferServerConnection = 0;
s_retryTransferServerConnection = false;
}
if(getInstance().m_stationPlayersCollectorConnection != NULL && ! isPreloadFinished())
if(getInstance().m_stationPlayersCollectorConnection != nullptr && ! isPreloadFinished())
{
getInstance().m_stationPlayersCollectorConnection->disconnect();
getInstance().m_stationPlayersCollectorConnection = 0;
@@ -3263,7 +3263,7 @@ void CentralServer::handleGameServerForLoginMessage(const GameServerForLoginMess
void CentralServer::handleExchangeListCreditsMessage(const ExchangeListCreditsMessage &msg)
{
LOG("Exchange", ("Central Server got exchange list credits %d.",msg.getCredits()));
if ( m_pAuctionTransferClient == NULL )
if ( m_pAuctionTransferClient == nullptr )
{
// send failure packet
}
@@ -3299,7 +3299,7 @@ ConnectionServerConnection * CentralServer::getAnyConnectionServer()
ConnectionServerConnection * CentralServer::getConnectionServerForAccount(StationId suid)
{
ConnectionServerConnection * result = NULL;
ConnectionServerConnection * result = nullptr;
ConnectionServerSUIDMap::iterator i=m_accountConnectionMap.find(suid);
if (i!=m_accountConnectionMap.end())
{
@@ -3707,7 +3707,7 @@ void CentralServer::checkShutdownProcess()
{
// if it's been "awhile" since we requested to restart the PlanetServer,
// then assume that something has gone wrong, and try the restart again
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if ((iterPendingPlanetServer->second.second + static_cast<time_t>(ConfigCentralServer::getMaxTimeToWaitForPlanetServerStartSeconds())) < timeNow)
{
@@ -3982,7 +3982,7 @@ int CentralServer::getSecondsClusterHasBeenInLoadingState() const
const std::map<std::string, int> & CentralServer::getPopulationStatistics(time_t & refreshTime)
{
// periodically request updated statistics from the game server
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if (m_timePopulationStatisticsNextRefresh <= timeNow)
{
GameServerConnection * universeGameServerConnection = getGameServer(UniverseManager::getInstance().getUniverseProcess());
@@ -4004,7 +4004,7 @@ const std::map<std::string, int> & CentralServer::getPopulationStatistics(time_t
const std::map<std::string, std::pair<int, std::pair<std::string, std::string> > > & CentralServer::getGcwScoreStatistics(time_t & refreshTime)
{
// periodically request updated statistics from the game server
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if (m_timeGcwScoreStatisticsNextRefresh <= timeNow)
{
GameServerConnection * universeGameServerConnection = getGameServer(UniverseManager::getInstance().getUniverseProcess());
@@ -4026,7 +4026,7 @@ const std::map<std::string, std::pair<int, std::pair<std::string, std::string> >
std::pair<std::map<int, std::pair<std::string, int> > const *, std::map<int, std::pair<std::string, int> > const *> CentralServer::getLastLoginTimeStatistics(time_t & refreshTime)
{
// periodically request updated statistics from the game server
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if (m_timeLastLoginTimeStatisticsNextRefresh <= timeNow)
{
GameServerConnection * universeGameServerConnection = getGameServer(UniverseManager::getInstance().getUniverseProcess());
@@ -4049,7 +4049,7 @@ std::pair<std::map<int, std::pair<std::string, int> > const *, std::map<int, std
void CentralServer::getCharacterMatchStatistics(int & numberOfCharacterMatchRequests, int & numberOfCharacterMatchResultsPerRequest, int & timeSpentPerCharacterMatchRequestMs)
{
// periodically request updated statistics from the game server
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if (m_timeCharacterMatchStatisticsNextRefresh <= timeNow)
{
const GenericValueTypeMessage<uint8> characterMatchStatisticsRequest("LfgStatReq", 0);
@@ -121,7 +121,7 @@ public:
void sendToAllGameServersExceptDBProcess(const GameNetworkMessage & message, const bool reliable);
void sendToAllPlanetServers(const GameNetworkMessage & message, const bool reliable);
void sendToPlanetServer(const std::string &sceneId, const GameNetworkMessage & message, const bool reliable);
void sendToAllConnectionServers(const GameNetworkMessage & message, const bool reliable, Connection const * exclude = NULL);
void sendToAllConnectionServers(const GameNetworkMessage & message, const bool reliable, Connection const * exclude = nullptr);
void sendToConnectionServerForAccount(StationId account, const GameNetworkMessage & message, const bool reliable);
void sendToDBProcess(const GameNetworkMessage & message, const bool reliable) const;
void sendToLoginServer(uint32 loginServerId, const GameNetworkMessage &message);
@@ -148,7 +148,7 @@ void CentralServerMetricsData::updateData()
// appear yellow to draw attention) for some amount of time
// after detecting a system time mismatch issue
#ifndef WIN32
if ((lastTimeSystemTimeMismatchNotification + ConfigCentralServer::getSystemTimeMismatchAlertIntervalSeconds()) > ::time(NULL))
if ((lastTimeSystemTimeMismatchNotification + ConfigCentralServer::getSystemTimeMismatchAlertIntervalSeconds()) > ::time(nullptr))
m_data[m_systemTimeMismatch].m_value = STATUS_LOADING;
else
m_data[m_systemTimeMismatch].m_value = 1;
@@ -202,7 +202,7 @@ void CentralServerMetricsData::updateData()
std::string label("population.");
label += iter->first;
m_mapPopulationStatisticsIndex[iter->first] = addMetric(label.c_str(), 0, NULL, false, false);
m_mapPopulationStatisticsIndex[iter->first] = addMetric(label.c_str(), 0, nullptr, false, false);
}
}
}
@@ -235,7 +235,7 @@ void CentralServerMetricsData::updateData()
}
else
{
gcwScoreStatisticsIndex = addMetric(iter->first.c_str(), 0, NULL, false, false);
gcwScoreStatisticsIndex = addMetric(iter->first.c_str(), 0, nullptr, false, false);
IGNORE_RETURN(m_mapGcwScoreStatisticsIndex.insert(std::make_pair(iter->first, gcwScoreStatisticsIndex)));
}
@@ -263,7 +263,7 @@ void CentralServerMetricsData::updateData()
std::string label("population.");
label += secondIter.first;
m_mapLastLoginTimeStatisticsIndex[secondIter.first] = addMetric(label.c_str(), 0, NULL, false, false);
m_mapLastLoginTimeStatisticsIndex[secondIter.first] = addMetric(label.c_str(), 0, nullptr, false, false);
}
}
}
@@ -288,7 +288,7 @@ void CentralServerMetricsData::updateData()
std::string label("population.");
label += iter->second.first;
m_mapCreateTimeStatisticsIndex[iter->second.first] = addMetric(label.c_str(), 0, NULL, false, false);
m_mapCreateTimeStatisticsIndex[iter->second.first] = addMetric(label.c_str(), 0, nullptr, false, false);
}
}
}
@@ -26,13 +26,13 @@
// ======================================================================
CharacterCreationTracker * CharacterCreationTracker::ms_instance = NULL;
CharacterCreationTracker * CharacterCreationTracker::ms_instance = nullptr;
// ======================================================================
void CharacterCreationTracker::install()
{
DEBUG_FATAL(ms_instance != NULL,("Called install() twice.\n"));
DEBUG_FATAL(ms_instance != nullptr,("Called install() twice.\n"));
ms_instance = new CharacterCreationTracker;
ExitChain::add(CharacterCreationTracker::remove,"CharacterCreationTracker::remove");
}
@@ -354,8 +354,8 @@ void CharacterCreationTracker::setFastCreationLock(StationId account)
CharacterCreationTracker::CreationRecord::CreationRecord() :
m_stage(S_queuedForGameServer),
m_gameCreationRequest(NULL),
m_loginCreationRequest(NULL),
m_gameCreationRequest(nullptr),
m_loginCreationRequest(nullptr),
m_creationTime(ServerClock::getInstance().getGameTimeSeconds()),
m_gameServerId(0),
m_loginServerId(0),
@@ -117,8 +117,8 @@ bool ConsoleCommandParserGame::performParsing(const NetworkId & track, const Str
if( argv.size() > 4 )
{
LOG("ServerConsole", ("Received command to shutdown the cluster."));
uint32 timeToShutdown = strtoul(Unicode::wideToNarrow(argv[2]).c_str(), NULL, 10);
uint32 maxTime = strtoul(Unicode::wideToNarrow(argv[3]).c_str(), NULL, 10);
uint32 timeToShutdown = strtoul(Unicode::wideToNarrow(argv[2]).c_str(), nullptr, 10);
uint32 maxTime = strtoul(Unicode::wideToNarrow(argv[3]).c_str(), nullptr, 10);
Unicode::String systemMessage = Unicode::narrowToWide("");
for(unsigned int i = 4; i < argv.size(); ++i)
{
@@ -141,7 +141,7 @@ bool ConsoleCommandParserGame::performParsing(const NetworkId & track, const Str
{
if(argv.size() > 1)
{
unsigned int stationId = strtoul(Unicode::wideToNarrow(argv[2]).c_str(), NULL, 10);
unsigned int stationId = strtoul(Unicode::wideToNarrow(argv[2]).c_str(), nullptr, 10);
if(stationId > 0)
{
GenericValueTypeMessage<unsigned int> auth("AuthorizeDownload", stationId);
@@ -16,7 +16,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -138,7 +138,7 @@ PlanetServerConnection *PlanetManager::getPlanetServerForScene(const std::string
if (i!=instance().m_servers.end())
return (*i).second.m_connection;
else
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -29,7 +29,7 @@ int main(int argc, char ** argv)
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
Os::setProgramName("ChatServer");
//setup the server
@@ -98,7 +98,7 @@ void CentralServerConnection::onReceive(const Archive::ByteStream & message)
std::string const newNameNormalized(newName, 0, newName.find(' '));
ChatAvatarId const newAvatar("SWG", ConfigChatServer::getClusterName(), newNameNormalized);
IGNORE_RETURN(ChatServer::getChatInterface()->RequestTransferAvatar(msg.getStationId(), oldAvatar.getName(), oldAvatar.getAPIAddress(), msg.getStationId(), newAvatar.getName(), newAvatar.getAPIAddress(), true, NULL));
IGNORE_RETURN(ChatServer::getChatInterface()->RequestTransferAvatar(msg.getStationId(), oldAvatar.getName(), oldAvatar.getAPIAddress(), msg.getStationId(), newAvatar.getName(), newAvatar.getAPIAddress(), true, nullptr));
}
}
else if (m.isType("ChatDestroyAvatar"))
@@ -350,7 +350,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r
if (room)
makeRoomName(room, roomName);
//printf("!!!!!!!!!!!!got room %s\n", roomName.c_str());
if (strstr(roomName.c_str(), "group") == NULL)
if (strstr(roomName.c_str(), "group") == nullptr)
{
ChatServer::putSystemAvatarInRoom(roomName);
}
@@ -373,7 +373,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r
}
}
ChatServerRoomOwner *owner = NULL;
ChatServerRoomOwner *owner = nullptr;
if (room)
owner = getRoomOwner(room->getRoomID());
@@ -709,12 +709,12 @@ std::string makeCanonicalName(const std::string &characterName)
{
retVal = toUpper(tmp);
}
tmp = strtok(NULL, ".");
tmp = strtok(nullptr, ".");
if (tmp)
{
retVal += (dot + tmp);
}
tmp = strtok(NULL, ".");
tmp = strtok(nullptr, ".");
if (tmp)
{
retVal += (dot + tmp);
@@ -796,7 +796,7 @@ void ChatInterface::DestroyAvatar(const std::string & characterName)
// track how many times we have called RequestGetAnyAvatar() for this particular DestroyAvatar
// operation, so that we can stop if we somehow get stuck in an infinite loop
unsigned const trackID = RequestGetAnyAvatar(ChatUnicodeString(avatar.getName()), ChatUnicodeString(avatar.getAPIAddress()), NULL);
unsigned const trackID = RequestGetAnyAvatar(ChatUnicodeString(avatar.getName()), ChatUnicodeString(avatar.getAPIAddress()), nullptr);
trackingRequestGetAnyAvatarForDestroy[trackID] = std::make_pair(std::make_pair(ChatUnicodeString(avatar.getName()), ChatUnicodeString(avatar.getAPIAddress())), 1);
}
@@ -848,7 +848,7 @@ void ChatInterface::sendQueuedHeadersToClient()
const unsigned long queuedHeadersSendTime = currentTime + static_cast<unsigned long>(s_intervalToSendHeadersToClientSeconds);
int numberHeadersSent = 0;
const ChatPersistentMessageToClient * header = NULL;
const ChatPersistentMessageToClient * header = nullptr;
for (std::map<ChatAvatarId, std::pair<unsigned long, std::deque<const ChatPersistentMessageToClient *> > >::iterator iter = queuedHeaders.begin(); iter != queuedHeaders.end();)
{
@@ -900,7 +900,7 @@ void ChatInterface::clearQueuedHeadersForAvatar(const ChatAvatarId & avatarId)
void ChatInterface::addQueuedHeaderForAvatar(const ChatAvatarId & avatarId, const ChatPersistentMessageToClient * header, unsigned long sendTime)
{
if (header == NULL)
if (header == nullptr)
return;
std::pair<unsigned long, std::deque<const ChatPersistentMessageToClient *> > & queuedHeader = queuedHeaders[avatarId];
@@ -923,7 +923,7 @@ ChatServerAvatarOwner *ChatInterface::getAvatarOwner(const ChatAvatar *avatar)
return (*f).second;
}
}
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -944,7 +944,7 @@ void ChatInterface::OnAddModerator(unsigned track, unsigned result, const ChatAv
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
ChatAvatarId srcId;
@@ -1057,7 +1057,7 @@ void ChatInterface::OnRemoveModerator(unsigned track, unsigned result, const Cha
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
ChatAvatarId srcId;
@@ -1178,7 +1178,7 @@ void ChatInterface::OnAddFriend(unsigned track, unsigned result, const ChatAvata
ChatAvatarId d;
makeAvatarId(destName, destAddress, d);
ChatServerAvatarOwner * mo = NULL;
ChatServerAvatarOwner * mo = nullptr;
if (srcAvatar)
mo = getAvatarOwner(srcAvatar);
@@ -1206,7 +1206,7 @@ void ChatInterface::OnRemoveFriend(unsigned track, unsigned result, const ChatAv
ChatAvatarId d;
makeAvatarId(destName, destAddress, d);
ChatServerAvatarOwner * mo = NULL;
ChatServerAvatarOwner * mo = nullptr;
if (srcAvatar)
mo = getAvatarOwner(srcAvatar);
@@ -1245,7 +1245,7 @@ void ChatInterface::OnIgnoreStatus(unsigned track, unsigned result, const ChatAv
}
}
ChatServerAvatarOwner * mo = NULL;
ChatServerAvatarOwner * mo = nullptr;
if (srcAvatar)
mo = getAvatarOwner(srcAvatar);
if(mo)
@@ -1281,7 +1281,7 @@ void ChatInterface::OnFriendStatus(unsigned track, unsigned result, const ChatAv
idList.push_back(id);
}
}
ChatServerAvatarOwner * mo = NULL;
ChatServerAvatarOwner * mo = nullptr;
if (srcAvatar)
mo = getAvatarOwner(srcAvatar);
if(mo)
@@ -1304,7 +1304,7 @@ void ChatInterface::OnReceiveFriendLogin(const ChatAvatar *srcAvatar, const Chat
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveFriendLogin");
UNREF(srcAddress);
ChatServerAvatarOwner * owner = NULL;
ChatServerAvatarOwner * owner = nullptr;
if (destAvatar)
owner = getAvatarOwner(destAvatar);
if(owner)
@@ -1332,7 +1332,7 @@ void ChatInterface::OnReceiveFriendLogout(const ChatAvatar *srcAvatar, const Cha
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveFriendLogout");
UNREF(srcAddress);
ChatServerAvatarOwner * owner = NULL;
ChatServerAvatarOwner * owner = nullptr;
if (destAvatar)
owner = getAvatarOwner(destAvatar);
if(owner)
@@ -1395,7 +1395,7 @@ void ChatInterface::OnRemoveIgnore(unsigned track, unsigned result, const ChatAv
ChatAvatarId d;
makeAvatarId(destName, destAddress, d);
ChatServerAvatarOwner * mo = NULL;
ChatServerAvatarOwner * mo = nullptr;
if (srcAvatar)
mo = getAvatarOwner(srcAvatar);
if(mo)
@@ -1435,7 +1435,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
if ((result == CHATRESULT_SUCCESS) && newAvatar)
{
// destroy chat avatar
unsigned const trackID = RequestDestroyAvatar(newAvatar, NULL);
unsigned const trackID = RequestDestroyAvatar(newAvatar, nullptr);
trackingRequestGetAnyAvatarForDestroy[trackID] = iterFind->second;
}
@@ -1504,7 +1504,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
static Unicode::String wideFilter = Unicode::narrowToWide("");
static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size());
static ChatUnicodeString filter(wideFilter.data(), wideFilter.size());
IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, NULL));
IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, nullptr));
}
}
else
@@ -1525,11 +1525,11 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
if(ChatServer::isGod(f->second))
{
RequestSetAvatarAttributes(newAvatar, AVATARATTR_GM, NULL);
RequestSetAvatarAttributes(newAvatar, AVATARATTR_GM, nullptr);
}
else
{
RequestSetAvatarAttributes(newAvatar, 0, NULL);
RequestSetAvatarAttributes(newAvatar, 0, nullptr);
}
ChatServer::chatConnectedAvatar((*f).second, *newAvatar);
@@ -1549,7 +1549,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
//ChatServer::getFriendsList(id);
clearQueuedHeadersForAvatar(avId);
IGNORE_RETURN(RequestGetPersistentHeaders(newAvatar, NULL));
IGNORE_RETURN(RequestGetPersistentHeaders(newAvatar, nullptr));
//REPORT_LOG(true, ("Connection to chat system for %s.%s.%s confirmed\n", avatar.GetGameCode().c_str(), avatar.GetGameServerName().c_str(), avatar.GetCharacterName().c_str()));
}//lint !e429 Custodial pointer 'owner' has not been freed or returned // jrandall avatar owns it
pendingAvatars.erase(f);
@@ -1560,7 +1560,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
// the time they connected to the connection server and the time
// this message arrived from the chat backend.
if (newAvatar)
IGNORE_RETURN(RequestLogoutAvatar(newAvatar, NULL));
IGNORE_RETURN(RequestLogoutAvatar(newAvatar, nullptr));
}
}
ChatOnConnectAvatar const connect;
@@ -1585,7 +1585,7 @@ void ChatInterface::OnCreateRoom(unsigned track,unsigned result, const ChatRoom
static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size());
static ChatUnicodeString filter(wideFilter.data(), wideFilter.size());
//printf("!!!!Calling GetRoomSummaries from OnCreateRoom\n");
//IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, NULL));
//IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, nullptr));
ChatRoomData roomData;
@@ -1598,7 +1598,7 @@ void ChatInterface::OnCreateRoom(unsigned track,unsigned result, const ChatRoom
//Unicode::String wideRoomName(newRoom->getRoomName().string_data, newRoom->getRoomName().string_length);
std::string roomName;
makeRoomName(newRoom, roomName);
if (strstr(roomName.c_str(), "group") == NULL)
if (strstr(roomName.c_str(), "group") == nullptr)
{
ChatServer::putSystemAvatarInRoom(roomName);
}
@@ -1644,7 +1644,7 @@ void ChatInterface::OnGetRoomSummaries(unsigned track, unsigned result, unsigned
std::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerRoomName);
if(f == roomList.end())
{
RequestGetRoom(foundRooms[i].getRoomAddress(), NULL);
RequestGetRoom(foundRooms[i].getRoomAddress(), nullptr);
//ChatServerRoomOwner * o = new ChatServerRoomOwner((*i));
//(*i)->SetRoomOwnerPtr(o);
//IGNORE_RETURN(roomList.insert(std::make_pair(lowerRoomName, *o)));
@@ -1664,7 +1664,7 @@ const ChatServerRoomOwner *ChatInterface::getRoomOwner(const std::string & roomN
{
return &((*f).second);
}
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -1680,7 +1680,7 @@ ChatServerRoomOwner *ChatInterface::getRoomOwner(unsigned roomId)
}
++f;
}
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -1727,13 +1727,13 @@ void ChatInterface::OnDestroyRoom(unsigned track, unsigned result, void *user)
static Unicode::String wideFilter = Unicode::narrowToWide("");
static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size());
static ChatUnicodeString filter(wideFilter.data(), wideFilter.size());
//IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, NULL));
//IGNORE_RETURN(RequestGetRoomSummaries(swgNode, filter, nullptr));
ChatAvatarId destroyer;
RoomOwnerSequencePair *pair = (RoomOwnerSequencePair *)user;
const ChatServerRoomOwner * owner = NULL;
const ChatServerRoomOwner * owner = nullptr;
unsigned sequence = 0;
if (pair)
{
@@ -1805,7 +1805,7 @@ void ChatInterface::OnDestroyAvatar(unsigned track, unsigned result, const ChatA
// stop if it looks like we're in an infinite loop
if (iterFind->second.second <= 25)
{
unsigned const trackID = RequestGetAnyAvatar(iterFind->second.first.first, iterFind->second.first.second, NULL);
unsigned const trackID = RequestGetAnyAvatar(iterFind->second.first.first, iterFind->second.first.second, nullptr);
trackingRequestGetAnyAvatarForDestroy[trackID] = std::make_pair(iterFind->second.first, (iterFind->second.second + 1));
}
}
@@ -1828,13 +1828,13 @@ void ChatInterface::OnGetAnyAvatar(unsigned track, unsigned result, const ChatAv
// can only destroy the avatar if he is logged in
if (loggedIn)
{
unsigned const trackID = RequestDestroyAvatar(foundAvatar, NULL);
unsigned const trackID = RequestDestroyAvatar(foundAvatar, nullptr);
trackingRequestGetAnyAvatarForDestroy[trackID] = iterFind->second;
}
// log in the chat avatar so we can destroy him
else
{
unsigned const trackID = RequestLoginAvatar(foundAvatar->getUserID(), foundAvatar->getName(), foundAvatar->getAddress(), NULL);
unsigned const trackID = RequestLoginAvatar(foundAvatar->getUserID(), foundAvatar->getName(), foundAvatar->getAddress(), nullptr);
trackingRequestGetAnyAvatarForDestroy[trackID] = iterFind->second;
}
}
@@ -1850,9 +1850,9 @@ void ChatInterface::OnReceiveForcedLogout(const ChatAvatar *oldAvatar)
ChatServer::fileLog(false, "ChatInterface", "OnReceiveForcedLogout() oldAvatar(%s)", ChatServer::getFullChatAvatarName(oldAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveForcedLogout");
if (oldAvatar == NULL)
if (oldAvatar == nullptr)
{
DEBUG_WARNING(true, ("We received an OnReceiveForcedLogout with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnReceiveForcedLogout with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
ChatAvatarId id;
@@ -1876,9 +1876,9 @@ void ChatInterface::OnEnterRoom(unsigned track, unsigned result, const ChatAvata
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnEnterRoom");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnEnterRoom with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnEnterRoom with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2097,9 +2097,9 @@ void ChatInterface::OnAddBan(unsigned track, unsigned result, const ChatAvatar *
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnAddBan");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnAddBan with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnAddBan with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2113,7 +2113,7 @@ void ChatInterface::OnAddBan(unsigned track, unsigned result, const ChatAvatar *
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
ChatAvatarId srcId;
@@ -2218,9 +2218,9 @@ void ChatInterface::OnRemoveBan(unsigned track, unsigned result, const ChatAvata
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnRemoveBan");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnRemoveBan with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnRemoveBan with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2234,7 +2234,7 @@ void ChatInterface::OnRemoveBan(unsigned track, unsigned result, const ChatAvata
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
ChatAvatarId srcId;
@@ -2337,9 +2337,9 @@ void ChatInterface::OnAddInvite(unsigned track, unsigned result, const ChatAvata
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnAddInvite");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnAddInvite with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnAddInvite with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2353,7 +2353,7 @@ void ChatInterface::OnAddInvite(unsigned track, unsigned result, const ChatAvata
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
ChatAvatarId srcId;
@@ -2378,7 +2378,7 @@ void ChatInterface::OnAddInvite(unsigned track, unsigned result, const ChatAvata
{
// Calling this on a room will cause the API to cache the room
// and to receive room updates for the room.
RequestGetRoom(destRoom->getAddress(), NULL);
RequestGetRoom(destRoom->getAddress(), nullptr);
// Send the room data for the room the avatar was invited to join
// since the room may be private and may be unknown to the player
@@ -2455,9 +2455,9 @@ void ChatInterface::OnRemoveInvite(unsigned track, unsigned result, const ChatAv
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnRemoveInvite");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnRemoveInvite with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnRemoveInvite with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2471,7 +2471,7 @@ void ChatInterface::OnRemoveInvite(unsigned track, unsigned result, const ChatAv
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
std::string roomName;
@@ -2555,9 +2555,9 @@ void ChatInterface::OnLeaveRoom(unsigned track, unsigned result, const ChatAvata
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnLeaveRoom");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnLeaveRoom with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnLeaveRoom with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2653,7 +2653,7 @@ void ChatInterface::OnKickAvatar(unsigned track, unsigned result, const ChatAvat
sequence = pair->sequence;
delete pair;
pair = NULL;
pair = nullptr;
}
std::string roomName;
@@ -2755,9 +2755,9 @@ void ChatInterface::OnGetPersistentMessage(unsigned track, unsigned result, Chat
ChatServer::fileLog(false, "ChatInterface", "OnGetPersistentMessage() track(%u) result(%u) destAvatar(%s)", track, result, ChatServer::getFullChatAvatarName(destAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnGetPersistentMessage");
if (result == CHATRESULT_SUCCESS && (destAvatar == NULL))
if (result == CHATRESULT_SUCCESS && (destAvatar == nullptr))
{
DEBUG_WARNING(true, ("We received an OnGetPersistentMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnGetPersistentMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
UNREF(user);
@@ -2807,9 +2807,9 @@ void ChatInterface::OnGetPersistentHeaders(unsigned track, unsigned result, Chat
ChatServer::fileLog(false, "ChatInterface", "OnGetPersistentHeaders() track(%u) result(%u) destAvatar(%s)", track, result, ChatServer::getFullChatAvatarName(destAvatar).c_str(), listLength);
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnGetPersistentHeaders");
if (result == CHATRESULT_SUCCESS && (destAvatar == NULL))
if (result == CHATRESULT_SUCCESS && (destAvatar == nullptr))
{
DEBUG_WARNING(true, ("We received an OnGetPersistentHeaders with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnGetPersistentHeaders with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
UNREF(track);
@@ -2876,9 +2876,9 @@ void ChatInterface::OnReceivePersistentMessage(const ChatAvatar *destAvatar, con
ChatServer::fileLog(false, "ChatInterface", "OnReceivePersistentMessage() destAvatar(%s)", ChatServer::getFullChatAvatarName(destAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceivePersistentMessage");
if (destAvatar == NULL)
if (destAvatar == nullptr)
{
DEBUG_WARNING(true, ("We received an OnREceivePersistentMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnREceivePersistentMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
if (!header)
@@ -2910,9 +2910,9 @@ void ChatInterface::OnSendRoomMessage(unsigned track, unsigned result, const Cha
ChatServer::fileLog(false, "ChatInterface", "OnSendRoomMessage() track(%u) result(%u) srcAvatar(%s) destRoom(%s)", track, result, ChatServer::getFullChatAvatarName(srcAvatar).c_str(), ChatServer::getChatRoomNameNarrow(destRoom).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnSendRoomMessage");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL || destRoom == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr || destRoom == nullptr))
{
DEBUG_WARNING(true, ("We received an OnsendRoomMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnsendRoomMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
UNREF(srcAvatar);
@@ -2931,7 +2931,7 @@ void ChatInterface::OnReceiveRoomMessage(const ChatAvatar *srcAvatar, const Chat
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveRoomMessage");
if(! srcAvatar || ! destAvatar || ! destRoom)
{
DEBUG_WARNING(true, ("We received an OnREceiveRoomMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnREceiveRoomMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
@@ -2995,9 +2995,9 @@ void ChatInterface::OnSendInstantMessage(unsigned track, unsigned result, const
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnSendInstantMessage");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr))
{
DEBUG_WARNING(true, ("We received an OnSendInstantMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnSendInstantMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
UNREF(srcAvatar);
@@ -3015,9 +3015,9 @@ void ChatInterface::OnReceiveInstantMessage(const ChatAvatar *srcAvatar, const C
ChatServer::fileLog(false, "ChatInterface", "OnReceiveInstantMessage() srcAvatar(%s) destAvatar(%s)", ChatServer::getFullChatAvatarName(srcAvatar).c_str(), ChatServer::getFullChatAvatarName(destAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveInstantMessage");
if ((srcAvatar == NULL || destAvatar == NULL))
if ((srcAvatar == nullptr || destAvatar == nullptr))
{
DEBUG_WARNING(true, ("We received an OnReceiveInstantMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnReceiveInstantMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
ChatAvatarId fromId;
@@ -3052,9 +3052,9 @@ void ChatInterface::OnSendPersistentMessage(unsigned track, unsigned result, con
ChatServer::fileLog(false, "ChatInterface", "OnSendPersistentMessage() track(%u) result(%u) srcAvatar(%s)", track, result, ChatServer::getFullChatAvatarName(srcAvatar).c_str());
PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnSendPersistentMessage");
if (result == CHATRESULT_SUCCESS && (srcAvatar == NULL))
if (result == CHATRESULT_SUCCESS && (srcAvatar == nullptr))
{
DEBUG_WARNING(true, ("We received an OnSendPersistentMessage with a success result code but NULL data. This is an error that the API should never give."));
DEBUG_WARNING(true, ("We received an OnSendPersistentMessage with a success result code but nullptr data. This is an error that the API should never give."));
return;
}
unsigned sequence = (unsigned)user;
@@ -3120,7 +3120,7 @@ void ChatInterface::OnUpdatePersistentMessages(unsigned track, unsigned result,
ChatAvatarId targetChatAvatarId;
if (targetAvatar != NULL)
if (targetAvatar != nullptr)
{
makeAvatarId(*targetAvatar, targetChatAvatarId);
}
@@ -3130,17 +3130,17 @@ void ChatInterface::OnUpdatePersistentMessages(unsigned track, unsigned result,
ChatAvatarId sourceChatAvatarId;
NetworkId const *tmpNetworkId = reinterpret_cast<NetworkId const *>(user);
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
ChatAvatar const *sourceAvatar = ChatServer::getAvatarByNetworkId(*tmpNetworkId);
if (sourceAvatar != NULL)
if (sourceAvatar != nullptr)
{
makeAvatarId(*sourceAvatar, sourceChatAvatarId);
}
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
ChatServer::fileLog(false, "ChatInterface", "OnUpdatePersistentMessage() track(%u) result(%u) sourceAvatar(%s) targetAvatar(%s)", track, result, sourceChatAvatarId.getFullName().c_str(), targetChatAvatarId.getFullName().c_str());
@@ -162,7 +162,7 @@ void ChatServerNamespace::cleanChatLog()
//-----------------------------------------------------------------------
ChatServer *ChatServer::m_instance = NULL;
ChatServer *ChatServer::m_instance = nullptr;
#include <stdio.h>
@@ -250,7 +250,7 @@ if ((t3 - t2) > (1000 * 5))
static Unicode::String wideFilter = Unicode::narrowToWide("");
static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size());
static ChatUnicodeString filter(wideFilter.data(), wideFilter.size());
instance().chatInterface->RequestGetRoomSummaries(swgNode, filter, NULL);
instance().chatInterface->RequestGetRoomSummaries(swgNode, filter, nullptr);
}
++i;
@@ -286,7 +286,7 @@ gameService(0),
planetService(),
ownerSystem(0),
systemAvatarId("SWG", ConfigChatServer::getClusterName(), "SYSTEM"),
customerServiceServerConnection(NULL),
customerServiceServerConnection(nullptr),
m_gameServerConnectionRegistry(),
m_voiceChatIdMap()
{
@@ -452,7 +452,7 @@ void ChatServer::setOwnerSystem(const ChatAvatar * o)
Connection *connection = safe_cast<Connection *>(instance().centralServerConnection);
if (connection != NULL)
if (connection != nullptr)
{
connection->send(bs, true);
}
@@ -618,7 +618,7 @@ const ChatAvatar * ChatServer::getAvatarByNetworkId(const NetworkId & id)
{
if (id.getValue() == 0)
{
return NULL;
return nullptr;
}
const ChatAvatar * result = 0;
ChatAvatarList::const_iterator f = instance().chatAvatars.find(id);
@@ -635,7 +635,7 @@ ChatServer::AvatarExtendedData * ChatServer::getAvatarExtendedDataByNetworkId(co
{
if (id.getValue() == 0)
{
return NULL;
return nullptr;
}
ChatServer::AvatarExtendedData * result = 0;
ChatAvatarList::iterator f = instance().chatAvatars.find(id);
@@ -783,7 +783,7 @@ void ChatServer::addFriend(const NetworkId & id, const unsigned int sequence, co
unsigned track = instance().chatInterface->RequestAddFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
ChatUnicodeString(friendAddress.data(), friendAddress.length()),
false, NULL);
false, nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -810,7 +810,7 @@ void ChatServer::removeFriend(const NetworkId & id, const unsigned int sequence,
splitChatAvatarId(friendId, friendName, friendAddress);
unsigned track = instance().chatInterface->RequestRemoveFriend(from, ChatUnicodeString(friendName.data(), friendName.length()),
ChatUnicodeString(friendAddress.data(), friendAddress.length()), NULL);
ChatUnicodeString(friendAddress.data(), friendAddress.length()), nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -829,7 +829,7 @@ void ChatServer::getFriendsList(const ChatAvatarId &characterName)
const ChatAvatar *avatar = getAvatarByNetworkId(id);
if (avatar)
{
unsigned track = instance().chatInterface->RequestFriendStatus(avatar, NULL);
unsigned track = instance().chatInterface->RequestFriendStatus(avatar, nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -857,7 +857,7 @@ void ChatServer::addIgnore(const NetworkId & id, const unsigned int sequence, co
unsigned track = instance().chatInterface->RequestAddIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
ChatUnicodeString(ignoreAddress.data(), ignoreAddress.length()),
NULL);
nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -884,7 +884,7 @@ void ChatServer::removeIgnore(const NetworkId & id, const unsigned int sequence,
splitChatAvatarId(ignoreId, ignoreName, ignoreAddress);
unsigned track = instance().chatInterface->RequestRemoveIgnore(from, ChatUnicodeString(ignoreName.data(), ignoreName.length()),
ChatUnicodeString(ignoreAddress.data(), ignoreAddress.length()), NULL);
ChatUnicodeString(ignoreAddress.data(), ignoreAddress.length()), nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -905,7 +905,7 @@ void ChatServer::getIgnoreList(const ChatAvatarId &characterName)
if (avatar)
{
unsigned track = instance().chatInterface->RequestIgnoreStatus(avatar, NULL);
unsigned track = instance().chatInterface->RequestIgnoreStatus(avatar, nullptr);
instance().pendingRequests[track] = id;
}
else
@@ -1160,7 +1160,7 @@ void ChatServer::createRoom(const NetworkId & id, const unsigned int sequence, c
{
roomAttr |= ROOMATTR_PRIVATE;
}
if (isSystemOwner && (strstr(roomName.c_str(), "system") != NULL))
if (isSystemOwner && (strstr(roomName.c_str(), "system") != nullptr))
{
roomAttr |= ROOMATTR_PERSISTENT;
}
@@ -1193,7 +1193,7 @@ void ChatServer::deleteAllPersistentMessages(const NetworkId &sourceNetworkId, c
ChatAvatar const *avatar = getAvatarByNetworkId(targetNetworkId);
if (avatar != NULL)
if (avatar != nullptr)
{
{
NetworkId *tmpNetworkId = new NetworkId(sourceNetworkId);
@@ -1225,7 +1225,7 @@ void ChatServer::deletePersistentMessage(const NetworkId &id, const unsigned int
const ChatAvatar *avatar = getAvatarByNetworkId(id);
if (avatar)
{
instance().chatInterface->RequestUpdatePersistentMessage(avatar, messageId, PERSISTENT_DELETED, NULL);
instance().chatInterface->RequestUpdatePersistentMessage(avatar, messageId, PERSISTENT_DELETED, nullptr);
}
}
@@ -1290,10 +1290,10 @@ void ChatServer::destroyRoom(const std::string & roomName)
{
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "destroyRoom() roomName(%s)", roomName.c_str());
if ((strstr(roomName.c_str(), ConfigChatServer::getClusterName()) != NULL) ||
if ((strstr(roomName.c_str(), ConfigChatServer::getClusterName()) != nullptr) ||
(strstr(roomName.c_str(), toLower(std::string(ConfigChatServer::getClusterName() ) ).c_str() ) ))
{
if ((strstr(roomName.c_str(), "GroupChat") != NULL) || (strstr(roomName.c_str(), "groupchat") != NULL))
if ((strstr(roomName.c_str(), "GroupChat") != nullptr) || (strstr(roomName.c_str(), "groupchat") != nullptr))
{
size_t pos = roomName.rfind(".");
if (pos != roomName.npos)
@@ -1311,7 +1311,7 @@ void ChatServer::destroyRoom(const std::string & roomName)
const ChatServerRoomOwner *owner = instance().chatInterface->getRoomOwner(roomName);
if (!instance().ownerSystem)
{
DEBUG_WARNING(true, ("Chat ownerSystem is NULL"));
DEBUG_WARNING(true, ("Chat ownerSystem is nullptr"));
return;
}
if (owner)
@@ -1331,7 +1331,7 @@ void ChatServer::disconnectAvatar(const ChatAvatar & avatar)
if (&avatar == instance().ownerSystem)
{
instance().ownerSystem = NULL;
instance().ownerSystem = nullptr;
}
ChatAvatarList::iterator i;
for(i = instance().chatAvatars.begin(); i != instance().chatAvatars.end(); ++i)
@@ -1423,7 +1423,7 @@ void ChatServer::enterRoom(const ChatAvatarId & id, const std::string & roomName
const ChatAvatar *avatar = getAvatarByNetworkId(getNetworkIdByAvatarId(id));
if (room && avatar)
{
instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), NULL);
instance().chatInterface->RequestEnterRoom(avatar, room->getAddress(), nullptr);
}
else
{
@@ -1450,7 +1450,7 @@ void ChatServer::putSystemAvatarInRoom(const std::string & roomName)
const ChatServerRoomOwner *room = instance().chatInterface->getRoomOwner(roomName);
if (room && instance().ownerSystem)
{
instance().chatInterface->RequestEnterRoom(instance().ownerSystem, room->getAddress(), NULL);
instance().chatInterface->RequestEnterRoom(instance().ownerSystem, room->getAddress(), nullptr);
}
}
@@ -1619,7 +1619,7 @@ void ChatServer::invite(const NetworkId & id, const ChatAvatarId & avatarId, con
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "invite() id(%s) avatar(%s) roomName(%s)", id.getValueString().c_str(), avatarId.getFullName().c_str(), roomName.c_str());
// Try to get an invitor
ChatAvatar const * invitor = NULL;
ChatAvatar const * invitor = nullptr;
if (id != NetworkId::cms_invalid)
{
invitor = getAvatarByNetworkId(id);
@@ -1738,7 +1738,7 @@ void ChatServer::inviteGroupMembers(const NetworkId & id, const ChatAvatarId & a
void ChatServer::removeSystemAvatarFromRoom(const ChatRoom *room)
{
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "removeSystemAvatarFromRoom() room(%s)", (room != NULL) ? toNarrowString(room->getRoomName()).c_str() : "NULL");
ChatServer::fileLog(s_enableChatRoomLogs, "ChatServer", "removeSystemAvatarFromRoom() room(%s)", (room != nullptr) ? toNarrowString(room->getRoomName()).c_str() : "nullptr");
if (!room || !instance().ownerSystem)
{
@@ -1754,7 +1754,7 @@ void ChatServer::removeSystemAvatarFromRoom(const ChatRoom *room)
}
}
instance().chatInterface->RequestLeaveRoom(instance().ownerSystem, room->getAddress(), NULL);
instance().chatInterface->RequestLeaveRoom(instance().ownerSystem, room->getAddress(), nullptr);
}
//-----------------------------------------------------------------------
@@ -1991,7 +1991,7 @@ void ChatServer::sendInstantMessage(const ChatAvatarId & from, const ChatAvatarI
const NetworkId &toNetworkId = getNetworkIdByAvatarId(to);
const ChatAvatar * toAvatar = getAvatarByNetworkId(toNetworkId);
if (toAvatar != NULL)
if (toAvatar != nullptr)
{
ChatServer::fileLog(false, "ChatServer", "sendInstantMessage() resolved tell locally");
@@ -2022,7 +2022,7 @@ void ChatServer::sendInstantMessage(const ChatAvatarId & from, const ChatAvatarI
IGNORE_RETURN(instance().chatInterface->RequestSendInstantMessage(fromAvatar,
ChatUnicodeString(friendName.data(), friendName.size()),
ChatUnicodeString(friendAddress.data(), friendAddress.size()),
ChatUnicodeString(message.data(), message.size()), ChatUnicodeString(outOfBand.data(), outOfBand.size()), NULL));
ChatUnicodeString(message.data(), message.size()), ChatUnicodeString(outOfBand.data(), outOfBand.size()), nullptr));
}
}
}
@@ -2054,7 +2054,7 @@ void ChatServer::sendInstantMessage(const NetworkId & fromId, const unsigned int
{
return;
}
else if (::time(NULL) < aed->unsquelchTime) // still in squelch period
else if (::time(nullptr) < aed->unsquelchTime) // still in squelch period
{
return;
}
@@ -2076,14 +2076,14 @@ void ChatServer::sendInstantMessage(const NetworkId & fromId, const unsigned int
Unicode::String wideFrom;
Unicode::String wideTo;
if (from != NULL)
if (from != nullptr)
{
makeAvatarId(*from, fromAvatarId);
wideFrom = (Unicode::narrowToWide(fromAvatarId.getFullName()));
}
ChatAvatarId toAvatarId;
if (toAvatar != NULL)
if (toAvatar != nullptr)
{
ChatServer::fileLog(false, "ChatServer", "sendInstantMessage() resolved tell locally");
@@ -2158,7 +2158,7 @@ void ChatServer::sendPersistentMessage(const ChatAvatarId & from, const ChatAvat
ChatUnicodeString(subject.data(), subject.size()),
ChatUnicodeString(message.data(), message.size()),
ChatUnicodeString(oob.data(), oob.size()),
NULL
nullptr
);
Unicode::String log;
@@ -2187,7 +2187,7 @@ void ChatServer::sendPersistentMessage(const NetworkId & fromId, const unsigned
// to.cluster.c_str(), to.name.c_str());
UNREF(sequenceId);
ChatServer::AvatarExtendedData * aed = getAvatarExtendedDataByNetworkId(fromId);
const ChatAvatar * from = (aed ? &(aed->chatAvatar) : NULL);
const ChatAvatar * from = (aed ? &(aed->chatAvatar) : nullptr);
if(from)
{
// see if player is squelched
@@ -2197,7 +2197,7 @@ void ChatServer::sendPersistentMessage(const NetworkId & fromId, const unsigned
{
return;
}
else if (::time(NULL) < aed->unsquelchTime) // still in squelch period
else if (::time(nullptr) < aed->unsquelchTime) // still in squelch period
{
return;
}
@@ -2225,7 +2225,7 @@ void ChatServer::sendPersistentMessage(const NetworkId & fromId, const unsigned
ChatAvatarId fromAvatarId;
if (from != NULL)
if (from != nullptr)
{
makeAvatarId(*from, fromAvatarId);
}
@@ -2255,7 +2255,7 @@ void ChatServer::sendRoomMessage(const ChatAvatarId &id, const std::string & roo
if (!instance().ownerSystem)
{
DEBUG_WARNING(true, ("Chat ownerSystem is NULL"));
DEBUG_WARNING(true, ("Chat ownerSystem is nullptr"));
return;
}
// get room id
@@ -2265,7 +2265,7 @@ void ChatServer::sendRoomMessage(const ChatAvatarId &id, const std::string & roo
{
const ChatAvatar *sender = instance().ownerSystem;
IGNORE_RETURN(instance().chatInterface->RequestSendRoomMessage(sender, (*f).second.getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), NULL));
IGNORE_RETURN(instance().chatInterface->RequestSendRoomMessage(sender, (*f).second.getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), nullptr));
}
}
}
@@ -2280,7 +2280,7 @@ void ChatServer::sendRoomMessage(const NetworkId & id, const unsigned int sequen
UNREF(sequence);
ChatServer::AvatarExtendedData * aed = getAvatarExtendedDataByNetworkId(id);
const ChatAvatar * sender = (aed ? &(aed->chatAvatar) : NULL);
const ChatAvatar * sender = (aed ? &(aed->chatAvatar) : nullptr);
const ChatServerRoomOwner *room = instance().chatInterface->getRoomOwner(roomId);
if(sender && room)
{
@@ -2296,7 +2296,7 @@ void ChatServer::sendRoomMessage(const NetworkId & id, const unsigned int sequen
aed->nonSpatialCharCount += msg.size();
// sync chat character count with game server
timeNow = ::time(NULL);
timeNow = ::time(nullptr);
if ((timeNow > aed->chatSpamNextTimeToSyncWithGameServer) || (timeNow > aed->chatSpamTimeEndInterval))
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, int>, std::pair<int, int> > > chatStatistics("ChatStatisticsCS", std::make_pair(std::make_pair(id, static_cast<int>(aed->chatSpamTimeEndInterval)), std::make_pair(aed->spatialCharCount, aed->nonSpatialCharCount)));
@@ -2322,7 +2322,7 @@ void ChatServer::sendRoomMessage(const NetworkId & id, const unsigned int sequen
allowToSpeak = false;
squelched = true;
}
else if (::time(NULL) < aed->unsquelchTime) // still in squelch period
else if (::time(nullptr) < aed->unsquelchTime) // still in squelch period
{
allowToSpeak = false;
squelched = true;
@@ -2393,7 +2393,7 @@ void ChatServer::sendStandardRoomMessage(const ChatAvatarId &senderId, const std
}
if (sender)
{
IGNORE_RETURN(instance().chatInterface->RequestSendRoomMessage(sender, (*f).second.getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), NULL));
IGNORE_RETURN(instance().chatInterface->RequestSendRoomMessage(sender, (*f).second.getAddress(), ChatUnicodeString(msg.data(), msg.size()), ChatUnicodeString(oob.data(), oob.size()), nullptr));
}
}
}
@@ -2505,7 +2505,7 @@ std::string ChatServer::getFullChatAvatarName(ChatAvatar const *chatAvatar)
{
std::string result;
if (chatAvatar != NULL)
if (chatAvatar != nullptr)
{
result += toNarrowString(chatAvatar->getName());
result += '.';
@@ -2513,7 +2513,7 @@ std::string ChatServer::getFullChatAvatarName(ChatAvatar const *chatAvatar)
}
else
{
result = "NULL";
result = "nullptr";
}
return result;
@@ -2539,7 +2539,7 @@ std::string ChatServer::getConnectionAddress(Connection const *connection)
{
std::string result;
if (connection != NULL)
if (connection != nullptr)
{
char text[256];
snprintf(text, sizeof(text), "%s:%d", connection->getRemoteAddress().c_str(), connection->getRemotePort());
@@ -2547,7 +2547,7 @@ std::string ChatServer::getConnectionAddress(Connection const *connection)
}
else
{
result = "NULL";
result = "nullptr";
}
return result;
@@ -2566,13 +2566,13 @@ Unicode::String ChatServer::getChatRoomName(ChatRoom const *chatRoom)
{
Unicode::String result;
if (chatRoom != NULL)
if (chatRoom != nullptr)
{
result = toUnicodeString(chatRoom->getRoomName());
}
else
{
result = Unicode::narrowToWide("NULL");
result = Unicode::narrowToWide("nullptr");
}
return result;
@@ -2582,12 +2582,12 @@ Unicode::String ChatServer::getChatRoomName(ChatRoom const *chatRoom)
void ChatServer::clearCustomerServiceServerConnection()
{
if (instance().customerServiceServerConnection != NULL)
if (instance().customerServiceServerConnection != nullptr)
{
instance().customerServiceServerConnection->disconnect();
}
instance().customerServiceServerConnection = NULL;
instance().customerServiceServerConnection = nullptr;
}
// ----------------------------------------------------------------------
@@ -2596,7 +2596,7 @@ void ChatServer::connectToCustomerServiceServer(const std::string &address, cons
{
//DEBUG_REPORT_LOG(true, ("***ChatServer::connectToCustomerServiceServer() address(%s) port(%d)\n", address.c_str(), port));
if (instance().customerServiceServerConnection != NULL)
if (instance().customerServiceServerConnection != nullptr)
{
instance().customerServiceServerConnection->disconnect();
}
@@ -2670,7 +2670,7 @@ bool ChatServer::isValidChatAvatarName(Unicode::String const &chatAvatarName)
void ChatServer::logChatMessage(Unicode::String const &logPlayer, Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &text, Unicode::String const &channel)
{
DEBUG_WARNING(toPlayer.empty(), ("toPlayer is NULL"));
DEBUG_WARNING(toPlayer.empty(), ("toPlayer is nullptr"));
Unicode::String lowerLogPlayer(Unicode::toLower(logPlayer));
Unicode::String lowerFromPlayer(Unicode::toLower(fromPlayer));
@@ -2760,7 +2760,7 @@ void ChatServer::requestTransferAvatar(const TransferCharacterData & request)
ChatAvatarId destinationAvatar("SWG", destination, request.getDestinationCharacterName());
instance().chatInterface->RequestTransferAvatar(request.getSourceStationId(), makeChatUnicodeString(sourceAvatar.getName()), makeChatUnicodeString(sourceAvatar.getAPIAddress()), request.getDestinationStationId(), makeChatUnicodeString(destinationAvatar.getName()), makeChatUnicodeString(destinationAvatar.getAPIAddress()), true, NULL);
instance().chatInterface->RequestTransferAvatar(request.getSourceStationId(), makeChatUnicodeString(sourceAvatar.getName()), makeChatUnicodeString(sourceAvatar.getAPIAddress()), request.getDestinationStationId(), makeChatUnicodeString(destinationAvatar.getName()), makeChatUnicodeString(destinationAvatar.getAPIAddress()), true, nullptr);
}
}
@@ -2845,7 +2845,7 @@ void ChatServer::handleChatStatisticsFromGameServer(NetworkId const & character,
// non-spatial chat to report to the game server
else if (aed->nonSpatialCharCount != nonSpatialNumCharacters)
{
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
if (timeNow > aed->chatSpamNextTimeToSyncWithGameServer)
{
GenericValueTypeMessage<std::pair<std::pair<NetworkId, int>, std::pair<int, int> > > chatStatistics("ChatStatisticsCS", std::make_pair(std::make_pair(character, static_cast<int>(aed->chatSpamTimeEndInterval)), std::make_pair(aed->spatialCharCount, aed->nonSpatialCharCount)));
@@ -2904,7 +2904,7 @@ void ChatServer::sendToGameServerById(unsigned const connectionId, GameNetworkMe
GameServerConnection *ChatServer::getGameServerConnectionFromId(unsigned int sequence)
{
GameServerConnection * result = NULL;
GameServerConnection * result = nullptr;
std::unordered_map<unsigned int, GameServerConnection *>::iterator f = m_gameServerConnectionRegistry.find(sequence);
if(f != m_gameServerConnectionRegistry.end())
{
@@ -86,7 +86,7 @@ const ChatRoom * ChatServerRoomOwner::getRoom() const
if (chatInterface)
return chatInterface->getRoom(roomID);
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -435,7 +435,7 @@ void VChatInterface::OnConnectionOpened( const char * address )
ChatServer::fileLog(ms_voiceLoggingEnabled, ms_logLable, "OnConnectionOpened: %s", address);
uint32 track = VChatAPI::GetAccount(ms_systemAvatarName, ConfigChatServer::getGameCode(), ConfigChatServer::getClusterName(), 0, 0, NULL);
uint32 track = VChatAPI::GetAccount(ms_systemAvatarName, ConfigChatServer::getGameCode(), ConfigChatServer::getClusterName(), 0, 0, nullptr);
ChatServer::fileLog(ms_voiceLoggingEnabled, ms_logLable, "Creating system avatar: %s track(%u)", getSystemLoginName().c_str(), track);
}
@@ -477,7 +477,7 @@ void VChatInterface::OnGetAccount(unsigned track, unsigned result, unsigned user
{
requestConnectPlayer(info->suid,info->avatarName,info->id, info->failedAttempts+1);
delete info;
info = NULL;
info = nullptr;
return;
}
}
@@ -501,7 +501,7 @@ void VChatInterface::OnGetAccount(unsigned track, unsigned result, unsigned user
}
delete info;
info = NULL;
info = nullptr;
}
void VChatInterface::OnGetChannelV2(unsigned track, unsigned result,
@@ -639,7 +639,7 @@ void VChatInterface::OnGetAllChannels(unsigned track, unsigned result, const VCh
if(shouldRetry)
{
GetAllChannels(NULL);
GetAllChannels(nullptr);
}
}
@@ -832,7 +832,7 @@ void VChatInterface::checkForCharacterChannelAdd(std::string const & name, std::
data.m_channelPassword,
data.m_channelURI,
"en_US",
NULL);
nullptr);
(*iter).second.push_back(playerOID);
@@ -877,7 +877,7 @@ void VChatInterface::checkForCharacterChannelRemove(std::string const & name, st
parseWorldName(std::string(avatar->getServer().c_str())),
"SWG",
"guild",
NULL);
nullptr);
}
iter = (*chanIter).second.erase(iter);
@@ -61,7 +61,7 @@ int main(int argc, char ** argv)
Unicode::UnicodeNarrowStringVector localeVector;
localeVector.push_back(defaultLocale);
LocalizationManager::install (new TreeFile::TreeFileFactory, localeVector, debugStringIds, NULL, displayBadStringIds);
LocalizationManager::install (new TreeFile::TreeFileFactory, localeVector, debugStringIds, nullptr, displayBadStringIds);
ExitChain::add(LocalizationManager::remove, "LocalizationManager::remove");
DataTableManager::install();
@@ -208,7 +208,7 @@ namespace AuctionNamespace
if (iterAttr != searchableAttributeString->end())
{
applicableSearchCondition = true;
return (NULL != strstr(iterAttr->second.c_str(), searchCondition.stringValue.c_str())); // lowercase is assumed (and required)
return (nullptr != strstr(iterAttr->second.c_str(), searchCondition.stringValue.c_str())); // lowercase is assumed (and required)
}
}
@@ -242,7 +242,7 @@ namespace AuctionNamespace
if (iterAttr != searchableAttributeString->end())
{
applicableSearchCondition = true;
return (NULL == strstr(iterAttr->second.c_str(), searchCondition.stringValue.c_str())); // lowercase is assumed (and required)
return (nullptr == strstr(iterAttr->second.c_str(), searchCondition.stringValue.c_str())); // lowercase is assumed (and required)
}
}
@@ -293,10 +293,10 @@ m_userDescription(userDescription),
m_oobLength(oobLength),
m_oobData(oobData),
m_attributes(),
m_searchableAttributeInt(NULL),
m_searchableAttributeFloat(NULL),
m_searchableAttributeString(NULL),
m_highBid(NULL),
m_searchableAttributeInt(nullptr),
m_searchableAttributeFloat(nullptr),
m_searchableAttributeString(nullptr),
m_highBid(nullptr),
m_item(new AuctionItem(itemId, itemType, itemTemplateId, itemTimer, itemNameLength, itemName, creatorId, itemSize)),
m_sold(false),
m_active(true),
@@ -395,10 +395,10 @@ m_userDescription(userDescription),
m_oobLength(oobLength),
m_oobData(oobData),
m_attributes(),
m_searchableAttributeInt(NULL),
m_searchableAttributeFloat(NULL),
m_searchableAttributeString(NULL),
m_highBid(NULL),
m_searchableAttributeInt(nullptr),
m_searchableAttributeFloat(nullptr),
m_searchableAttributeString(nullptr),
m_highBid(nullptr),
m_item(new AuctionItem(itemId, itemType, itemTemplateId, itemTimer, itemNameLength, itemName, creatorId, itemSize)),
m_sold(isSold),
m_active(isActive),
@@ -488,7 +488,7 @@ void Auction::Initialization()
#ifdef _DEBUG
for (int i = 0; i < static_cast<int>(AuctionQueryHeadersMessage::SCC_LAST); ++i)
{
s_searchConditionComparisonFn[i] = NULL;
s_searchConditionComparisonFn[i] = nullptr;
}
#endif
@@ -502,7 +502,7 @@ void Auction::Initialization()
#ifdef _DEBUG
for (int j = 0; j < static_cast<int>(AuctionQueryHeadersMessage::SCC_LAST); ++j)
{
DEBUG_FATAL((s_searchConditionComparisonFn[j] == NULL), ("s_searchConditionComparisonFn array is NULL at index (%d)", j));
DEBUG_FATAL((s_searchConditionComparisonFn[j] == nullptr), ("s_searchConditionComparisonFn array is nullptr at index (%d)", j));
}
#endif
@@ -659,7 +659,7 @@ const AuctionBid *Auction::GetPreviousBid() const
{
if (m_bids.size() <= 1)
{
return NULL;
return nullptr;
}
else
{
@@ -677,9 +677,9 @@ const AuctionBid *Auction::GetPreviousBid() const
*/
int Auction::GetActualBid(AuctionBid *bid)
{
assert(bid != NULL);
assert(bid != nullptr);
int bidNeeded = std::max(m_minBid, bid->GetBid());
if (m_highBid != NULL)
if (m_highBid != nullptr)
{
bidNeeded = m_highBid->GetBid();
if (*bid > *m_highBid)
@@ -765,7 +765,7 @@ AuctionResultCode Auction::AddBid(
AuctionBid *auctionBid = new AuctionBid(bidderId, bid, maxProxyBid);
int newBidForHighBidder = GetActualBid(auctionBid);
if (m_highBid != NULL)
if (m_highBid != nullptr)
{
if (*auctionBid <= *m_highBid)
{
@@ -810,7 +810,7 @@ const AuctionBid *Auction::GetPlayerBid(const NetworkId & playerId) const
}
++iter;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -826,7 +826,7 @@ bool Auction::Update(int gameTime)
//immediate sale
DEBUG_REPORT_LOG(true, ("[Commodities Server Auction::Update] : Expiring immediate sale - Auction is active and sold.\n"));
if ((m_trackId != -1) && (CommodityServer::getInstance().getGameServer(m_trackId) != NULL))
if ((m_trackId != -1) && (CommodityServer::getInstance().getGameServer(m_trackId) != nullptr))
{
Expire(true, false, m_trackId);
m_trackId = -1;
@@ -840,14 +840,14 @@ bool Auction::Update(int gameTime)
{
DEBUG_REPORT_LOG(true, ("[Commodities Server Auction::Update] : Auction expiring based on timer.\n"));
if ((m_trackId != -1) && (CommodityServer::getInstance().getGameServer(m_trackId) != NULL))
if ((m_trackId != -1) && (CommodityServer::getInstance().getGameServer(m_trackId) != nullptr))
{
Expire(m_highBid != NULL, true, m_trackId);
Expire(m_highBid != nullptr, true, m_trackId);
m_trackId = -1;
}
else
{
Expire(m_highBid != NULL, true);
Expire(m_highBid != nullptr, true);
}
}
@@ -862,7 +862,7 @@ void Auction::Expire(bool sold, bool expiredBasedOnTimer, int track_id)
m_auctionTimer = 0;
m_active = false;
if (sold && m_highBid != NULL)
if (sold && m_highBid != nullptr)
{
m_sold = true;
}
@@ -934,7 +934,7 @@ void Auction::Expire(bool sold, bool expiredBasedOnTimer, int track_id)
m_location.SetVendorFirstTimerExpiredAuctionDate(time(0));
}
DEBUG_REPORT_LOG(true, ("[Commodities Server Auction::Expire] : Sending OnAuctionExpired for non-sold auction and null high bid obj .\n"));
DEBUG_REPORT_LOG(true, ("[Commodities Server Auction::Expire] : Sending OnAuctionExpired for non-sold auction and nullptr high bid obj .\n"));
AuctionMarket::getInstance().OnAuctionExpired(
GetCreatorId(), m_sold, m_flags,
NetworkId::cms_invalid, 0, m_item->GetItemId(), 0,
@@ -1107,8 +1107,8 @@ void Auction::BuildSearchableAttributeList()
std::map<std::string, std::string> const & saAlias = CommoditiesAdvancedSearchAttribute::getSearchAttributeNameAliasesForGameObjectType(m_item->GetCategory());
// for factory crates, also include the attributes of the item inside the crate
std::map<std::string, CommoditiesAdvancedSearchAttribute::SearchAttribute const *> const * saItemInsideFactoryCrate = NULL;
std::map<std::string, std::string> const * saAliasItemInsideFactoryCrate = NULL;
std::map<std::string, CommoditiesAdvancedSearchAttribute::SearchAttribute const *> const * saItemInsideFactoryCrate = nullptr;
std::map<std::string, std::string> const * saAliasItemInsideFactoryCrate = nullptr;
int gotItemInsideFactoryCrate = 0;
if (m_item->GetCategory() == SharedObjectTemplate::GOT_misc_factory_crate)
@@ -1134,10 +1134,10 @@ void Auction::BuildSearchableAttributeList()
saAliasItemInsideFactoryCrate = &(CommoditiesAdvancedSearchAttribute::getSearchAttributeNameAliasesForGameObjectType(gotItemInsideFactoryCrate));
if (saItemInsideFactoryCrate->empty())
saItemInsideFactoryCrate = NULL;
saItemInsideFactoryCrate = nullptr;
if (saAliasItemInsideFactoryCrate->empty())
saAliasItemInsideFactoryCrate = NULL;
saAliasItemInsideFactoryCrate = nullptr;
}
}
@@ -137,7 +137,7 @@ AuctionLocation::~AuctionLocation()
bool AuctionLocation::AddAuction(Auction *auction)
{
assert(auction != NULL);
assert(auction != nullptr);
if (IsVendorMarket() &&
(!auction->IsActive() || !IsOwner(auction->GetCreatorId())))
{
@@ -189,7 +189,7 @@ void AuctionLocation::CancelVendorSale(Auction *auction)
bool AuctionLocation::RemoveAuction(Auction *auction)
{
assert(auction != NULL);
assert(auction != nullptr);
return RemoveAuction(auction->GetItem().GetItemId());
}
@@ -265,7 +265,7 @@ Auction *AuctionLocation::GetAuction(const NetworkId & itemId)
return((*i).second);
}
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -121,7 +121,7 @@ namespace AuctionMarketNamespace
Auction const * const auction,
int const type,
int const entranceCharge,
AuctionBid const * const playerBid = NULL
AuctionBid const * const playerBid = nullptr
)
{
AuctionDataHeader *header = new AuctionDataHeader;
@@ -301,7 +301,7 @@ namespace AuctionMarketNamespace
std::map<std::string, int> attributeValue;
};
GetItemAttributeDataRequest * getItemAttributeDataRequest = NULL;
GetItemAttributeDataRequest * getItemAttributeDataRequest = nullptr;
void processItemAttributeData(std::map<NetworkId, Auction *> const & auctions);
@@ -394,8 +394,8 @@ void AuctionMarketNamespace::processItemAttributeData(std::map<NetworkId, Auctio
if (proceed)
{
std::map<std::string, CommoditiesAdvancedSearchAttribute::SearchAttribute const *> const * skipAttribute = NULL;
std::map<std::string, std::string> const * skipAttributeAlias = NULL;
std::map<std::string, CommoditiesAdvancedSearchAttribute::SearchAttribute const *> const * skipAttribute = nullptr;
std::map<std::string, std::string> const * skipAttributeAlias = nullptr;
if (getItemAttributeDataRequest->ignoreSearchableAttribute)
{
std::map<std::string, CommoditiesAdvancedSearchAttribute::SearchAttribute const *> const & sa = CommoditiesAdvancedSearchAttribute::getSearchAttributeForGameObjectType(iterAuction->second->GetItem().GetCategory());
@@ -590,7 +590,7 @@ void AuctionMarketNamespace::processItemAttributeData(std::map<NetworkId, Auctio
}
delete getItemAttributeDataRequest;
getItemAttributeDataRequest = NULL;
getItemAttributeDataRequest = nullptr;
}
}
@@ -862,7 +862,7 @@ void AuctionMarket::RemoveAuctionLocationFromPriorityQueue(const AuctionLocation
void AuctionMarket::AddAuction(Auction *auction)
{
assert(auction != NULL);
assert(auction != nullptr);
AuctionLocation &location = auction->GetLocation();
if (!location.IsOwner(auction->GetItem().GetOwnerId()))
@@ -1979,7 +1979,7 @@ void AuctionMarket::AcceptHighBid(const AcceptHighBidMessage &message)
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server AcceptHighBidMessage] : ResponseId : %d.\n", message.GetResponseId()));
DEBUG_REPORT_LOG(m_showAllDebugInfo, ("[Commodities Server AcceptHighBidMessage] : TrackId : %d.\n", message.GetTrackId()));
Auction *auction = NULL;
Auction *auction = nullptr;
AuctionResultCode result = ARC_Success;
std::map<NetworkId, Auction *>::iterator iter = m_auctions.find(
message.GetAuctionId());
@@ -1994,7 +1994,7 @@ void AuctionMarket::AcceptHighBid(const AcceptHighBidMessage &message)
{
result = ARC_NotItemOwner;
}
else if (auction->GetHighBid() == NULL)
else if (auction->GetHighBid() == nullptr)
{
result = ARC_NoBids;
}
@@ -2525,19 +2525,19 @@ void AuctionMarket::QueryAuctionHeaders(
int debugNumberLocationsMatched = 0;
int debugNumberAuctionsTested = 0;
std::map<NetworkId, Auction *> *auctionsPtr = NULL;
std::map<NetworkId, Auction *> *auctionsPtr = nullptr;
int entranceCharge = 0;
AuctionLocation *locationPtr = NULL;
Auction *auctionPtr = NULL;
AuctionLocation *locationPtr = nullptr;
Auction *auctionPtr = nullptr;
std::map<NetworkId, Auction *>::const_iterator auctionIterator;
AuctionDataHeader *header = NULL;
AuctionDataHeader *header = nullptr;
bool checkItemTemplate;
while (locationIter != locationIterEnd)
{
++debugNumberLocationsTested;
checkItemTemplate = false;
auctionsPtr = NULL;
auctionsPtr = nullptr;
entranceCharge = 0;
locationPtr = (*locationIter).second;
@@ -2606,7 +2606,7 @@ void AuctionMarket::QueryAuctionHeaders(
auctionPtr = (*auctionIterator).second;
const AuctionItem &item = auctionPtr->GetItem();
header = NULL;
header = nullptr;
// Check to see if the item template matches
if (searchForResourceContainer && (itemTemplateId != 0))
@@ -4977,7 +4977,7 @@ void AuctionMarket::getAuctionLocationPriorityQueue(int requestingGameServerId,
{
std::string output;
char buffer[2048];
int const timeNow = static_cast<int>(::time(NULL));
int const timeNow = static_cast<int>(::time(nullptr));
for (std::set<std::pair<int, NetworkId> >::const_iterator iterPQ = m_priorityQueueAuctionLocation.begin(); iterPQ != m_priorityQueueAuctionLocation.end(); ++iterPQ)
{
if (count <= 0)
@@ -191,7 +191,7 @@ void CommodityServer::run()
s_commodityServerMetricsData = new CommodityServerMetricsData;
MetricsManager::install(s_commodityServerMetricsData, false, "CommoditiesServer", "", 0);
time_t timePrevious = ::time(NULL);
time_t timePrevious = ::time(nullptr);
time_t timeCurrent = timePrevious;
while (true)
@@ -202,7 +202,7 @@ void CommodityServer::run()
break;
NetworkHandler::update();
timeCurrent = ::time(NULL);
timeCurrent = ::time(nullptr);
MetricsManager::update(static_cast<float>((timeCurrent - timePrevious) * 1000));
timePrevious = timeCurrent;
@@ -229,18 +229,18 @@ void CommodityServer::run()
// this is not a high priority thing, so wait until
// the cluster has started and "stabilized" before
// doing this; 3 hours should be adequate
time_t timeToRequestExcludedType = ::time(NULL) + 10800;
time_t timeToRequestExcludedType = ::time(nullptr) + 10800;
// one time request from the game server (any game server)
// to receive the resource tree hierarchy to support
// searching for resource container
time_t timeToRequestResourceTree = ::time(NULL);
time_t timeToRequestResourceTree = ::time(nullptr);
while(true)
{
NetworkHandler::update();
timeCurrent = ::time(NULL);
timeCurrent = ::time(nullptr);
MetricsManager::update(static_cast<float>((timeCurrent - timePrevious) * 1000));
timePrevious = timeCurrent;
@@ -74,7 +74,7 @@ void CommodityServerMetricsData::updateData()
buffer[sizeof(buffer)-1] = '\0';
}
m_mapAuctionsCountByGameObjectTypeIndex[iterGameObjectType->first] = addMetric(buffer, 0, NULL, false, false);
m_mapAuctionsCountByGameObjectTypeIndex[iterGameObjectType->first] = addMetric(buffer, 0, nullptr, false, false);
}
}
}
@@ -37,7 +37,7 @@ int main(int argc, char ** argv)
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(time(NULL));
SetupSharedRandom::install(time(nullptr));
//setup the server
NetworkHandler::install();
@@ -82,7 +82,7 @@ m_canCreateRegularCharacter(false),
m_canCreateJediCharacter(false),
m_hasRequestedCharacterCreate(false),
m_hasCreatedCharacter(false),
m_pendingCharacterCreate(NULL),
m_pendingCharacterCreate(nullptr),
m_canSkipTutorial(false),
m_characterId(NetworkId::cms_invalid),
m_characterName(),
@@ -144,7 +144,7 @@ ClientConnection::~ClientConnection()
{
hasBeenKicked = m_client->hasBeenKicked();
delete m_client;
m_client = NULL;
m_client = nullptr;
}
// tell Session to stop recording play time for the character
@@ -177,7 +177,7 @@ ClientConnection::~ClientConnection()
m_pendingChatQueryRoomRequests.clear();
delete m_pendingCharacterCreate;
m_pendingCharacterCreate = NULL;
m_pendingCharacterCreate = nullptr;
}
@@ -202,7 +202,7 @@ std::string ClientConnection::getPlayTimeDuration() const
int playTimeDuration = 0;
if (m_startPlayTime > 0)
playTimeDuration = static_cast<int>(::time(NULL) - m_startPlayTime);
playTimeDuration = static_cast<int>(::time(nullptr) - m_startPlayTime);
return CalendarTime::convertSecondsToHMS(static_cast<unsigned int>(playTimeDuration));
}
@@ -214,7 +214,7 @@ std::string ClientConnection::getActivePlayTimeDuration() const
int activePlayTimeDuration = static_cast<int>(m_activePlayTimeDuration);
if (m_lastActiveTime > 0)
activePlayTimeDuration += static_cast<int>(::time(NULL) - m_lastActiveTime);
activePlayTimeDuration += static_cast<int>(::time(nullptr) - m_lastActiveTime);
return CalendarTime::convertSecondsToHMS(static_cast<unsigned int>(activePlayTimeDuration));
}
@@ -226,7 +226,7 @@ std::string ClientConnection::getCurrentActivePlayTimeDuration() const
int activePlayTimeDuration = 0;
if (m_lastActiveTime > 0)
activePlayTimeDuration = static_cast<int>(::time(NULL) - m_lastActiveTime);
activePlayTimeDuration = static_cast<int>(::time(nullptr) - m_lastActiveTime);
return CalendarTime::convertSecondsToHMS(static_cast<unsigned int>(activePlayTimeDuration));
}
@@ -400,7 +400,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg& msg)
std::hash<std::string> h;
m_suid = h(m_accountName.c_str());
}
onValidateClient(m_suid, m_accountName, m_isSecure, NULL, ConfigConnectionServer::getDefaultGameFeatures(), ConfigConnectionServer::getDefaultSubscriptionFeatures(), 0, 0, 0, 0, ConfigConnectionServer::getFakeBuddyPoints());
onValidateClient(m_suid, m_accountName, m_isSecure, nullptr, ConfigConnectionServer::getDefaultGameFeatures(), ConfigConnectionServer::getDefaultSubscriptionFeatures(), 0, 0, 0, 0, ConfigConnectionServer::getFakeBuddyPoints());
}
}
else
@@ -452,7 +452,7 @@ void ClientConnection::onIdValidated(bool canLogin, bool canCreateRegularCharact
}
delete m_pendingCharacterCreate;
m_pendingCharacterCreate = NULL;
m_pendingCharacterCreate = nullptr;
return;
}
@@ -683,7 +683,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
}
else
{
ConnectionServer::dropClient(this, "m_client is null while receiving a message!");
ConnectionServer::dropClient(this, "m_client is nullptr while receiving a message!");
disconnect();
}
}
@@ -796,7 +796,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
}
else
{
ConnectionServer::dropClient(this, "m_client is null while receiving a message!");
ConnectionServer::dropClient(this, "m_client is nullptr while receiving a message!");
disconnect();
}
}
@@ -839,7 +839,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
}
else
{
ConnectionServer::dropClient(this, "m_client is null while receiving a message!");
ConnectionServer::dropClient(this, "m_client is nullptr while receiving a message!");
disconnect();
}
}
@@ -865,7 +865,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
//DEBUG_REPORT_LOG(true, ("CONSRV::CS - suid: %i\n", getSUID()));
if (customerServiceConnection != NULL)
if (customerServiceConnection != nullptr)
{
static std::vector<NetworkId> v;
v.clear();
@@ -935,7 +935,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
}
else
{
ConnectionServer::dropClient(this, "m_client is null while receiving a message!");
ConnectionServer::dropClient(this, "m_client is nullptr while receiving a message!");
disconnect();
}
}
@@ -951,7 +951,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
if (m_lastActiveTime > 0)
{
// record the amount of active time
m_activePlayTimeDuration += static_cast<unsigned long>(::time(NULL) - m_lastActiveTime);
m_activePlayTimeDuration += static_cast<unsigned long>(::time(nullptr) - m_lastActiveTime);
// tell Session to stop recording play time for the character
if (ConnectionServer::getSessionApiClient() && ConfigConnectionServer::getSessionRecordPlayTime())
@@ -988,7 +988,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
if (m_lastActiveTime == 0)
{
// record the time client went active
m_lastActiveTime = ::time(NULL);
m_lastActiveTime = ::time(nullptr);
// tell Session to start recording play time for the character
if (ConnectionServer::getSessionApiClient() && ConfigConnectionServer::getSessionRecordPlayTime())
@@ -1616,7 +1616,7 @@ void ClientConnection::onValidateClient (uint32 suid, const std::string & userna
}
// tell client the server-side game and subscription feature bits and which ConnectionServer we are and the current server Epoch time
GenericValueTypeMessage<std::pair<std::pair<unsigned long, unsigned long>, std::pair<int, int32> > > const msgFeatureBits("AccountFeatureBits", std::make_pair(std::make_pair(gameFeatures, subscriptionFeatures), std::make_pair(ConfigConnectionServer::getConnectionServerNumber(), static_cast<int32>(::time(NULL)))));
GenericValueTypeMessage<std::pair<std::pair<unsigned long, unsigned long>, std::pair<int, int32> > > const msgFeatureBits("AccountFeatureBits", std::make_pair(std::make_pair(gameFeatures, subscriptionFeatures), std::make_pair(ConfigConnectionServer::getConnectionServerNumber(), static_cast<int32>(::time(nullptr)))));
send(msgFeatureBits, true);
std::string const gameFeaturesDescription = ClientGameFeature::getDescription(gameFeatures);
@@ -163,7 +163,7 @@ const CustomerServiceConnection * ConnectionServer::getCustomerServiceConnection
{
return (*(instance().customerServiceServers.begin()));
}
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -366,7 +366,7 @@ void ConnectionServer::addNewClient(ClientConnection* cconn, const NetworkId &oi
//send the game server a message about this client.
static const std::string loginTrace("TRACE_LOGIN");
LOG(loginTrace, ("NewClient(%d, %s, %s)", cconn->getSUID(), oid.getValueString().c_str(), cconn->getAccountName().c_str()));
NewClient m(oid, cconn->getAccountName(), cconn->getRemoteAddress(), cconn->getIsSecure(), false, cconn->getSUID(), NULL, cconn->getGameFeatures(), cconn->getSubscriptionFeatures(), cconn->getEntitlementTotalTime(), cconn->getEntitlementEntitledTime(), cconn->getEntitlementTotalTimeSinceLastLogin(), cconn->getEntitlementEntitledTimeSinceLastLogin(), cconn->getBuddyPoints(), cconn->getConsumedRewardEvents(), cconn->getClaimedRewardItems(), cconn->isUsingAdminLogin(), cconn->getCanSkipTutorial(), sendToStarport );
NewClient m(oid, cconn->getAccountName(), cconn->getRemoteAddress(), cconn->getIsSecure(), false, cconn->getSUID(), nullptr, cconn->getGameFeatures(), cconn->getSubscriptionFeatures(), cconn->getEntitlementTotalTime(), cconn->getEntitlementEntitledTime(), cconn->getEntitlementTotalTimeSinceLastLogin(), cconn->getEntitlementEntitledTimeSinceLastLogin(), cconn->getBuddyPoints(), cconn->getConsumedRewardEvents(), cconn->getClaimedRewardItems(), cconn->isUsingAdminLogin(), cconn->getCanSkipTutorial(), sendToStarport );
gconn->send(m, true);
//@todo move this to ClientConnection.cpp
}
@@ -375,7 +375,7 @@ void ConnectionServer::addNewClient(ClientConnection* cconn, const NetworkId &oi
void ConnectionServer::dropClient(ClientConnection * conn, const std::string& description)
{
DEBUG_FATAL(!conn, ("Cannot call dropClient with NULL connection"));
DEBUG_FATAL(!conn, ("Cannot call dropClient with nullptr connection"));
if (!conn) //lint !e774 // boolean within 'if' always evaluates to False //suppresed because this is only relevant in DEBUG builds
return;
@@ -466,7 +466,7 @@ GameConnection* ConnectionServer::getGameConnection(const std::string &sceneName
return (*i).second;
}
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -477,15 +477,15 @@ void ConnectionServer::handleConnectionServerIdMessage(const ConnectionServerId
const Service * const servicePrivate = getClientServicePrivate();
const Service * const servicePublic = getClientServicePublic();
FATAL(servicePrivate == NULL && servicePublic == NULL, ("No client service is active!"));
FATAL(servicePrivate == nullptr && servicePublic == nullptr, ("No client service is active!"));
const Service * const g = getGameService();
FATAL(g == NULL, ("No game service is active!"));
FATAL(g == nullptr, ("No game service is active!"));
const Service * const c = getChatService();
const Service * const cs = getCustomerService();
const uint16 pingPort = getPingPort ();
if((servicePrivate != NULL || servicePublic != NULL) && g != NULL) //lint !e774 // always evaluates to false // suppresed because the FATAL macro triggers this lint warning
if((servicePrivate != nullptr || servicePublic != nullptr) && g != nullptr) //lint !e774 // always evaluates to false // suppresed because the FATAL macro triggers this lint warning
{
uint16 chatPort = 0;
uint16 csPort = 0;
@@ -739,7 +739,7 @@ void ConnectionServer::receiveMessage(const MessageDispatch::Emitter & source, c
std::set<Client *>::const_iterator i;
for(i = clients.begin(); i != clients.end(); ++ i)
{
(*i)->setChatConnection(NULL);
(*i)->setChatConnection(nullptr);
}
}
}
@@ -782,7 +782,7 @@ void ConnectionServer::receiveMessage(const MessageDispatch::Emitter & source, c
std::set<Client *>::const_iterator i;
for(i = clients.begin(); i != clients.end(); ++ i)
{
(*i)->setCustomerServiceConnection(NULL);
(*i)->setCustomerServiceConnection(nullptr);
}
}
@@ -960,7 +960,7 @@ void ConnectionServer::remove()
// explicitly delete all connections that were setup from setupConnections rather than letting
// Connection::remove do it. There are connections that require a valid s_connectionServer which is deleted
// and set to NULL.
// and set to nullptr.
s_connectionServer->unsetupConnections();
SetupSharedLog::remove();
@@ -1316,7 +1316,7 @@ GameConnection* ConnectionServer::getGameConnection(uint32 gameServerId)
if (i != cs.gameServerMap.end())
return (*i).second;
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -1327,7 +1327,7 @@ GameConnection* ConnectionServer::getAnyGameConnection()
if (!cs.gameServerMap.empty())
return cs.gameServerMap.begin()->second;
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -157,7 +157,7 @@ void GameConnection::onReceive(const Archive::ByteStream & message)
ca.getStartYaw(),
ca.getTemplateName(),
ca.getTimeSeconds(),
static_cast<int32>(::time(NULL)),
static_cast<int32>(::time(nullptr)),
ConfigConnectionServer::getDisableWorldSnapshot());
client->getClientConnection()->send(startScene, true);
}
@@ -166,7 +166,7 @@ void GameConnection::onReceive(const Archive::ByteStream & message)
// record the time when play started for the character
if (client->getClientConnection()->getStartPlayTime() == 0)
{
client->getClientConnection()->setStartPlayTime(::time(NULL));
client->getClientConnection()->setStartPlayTime(::time(nullptr));
}
// update the play time info on the game server
@@ -246,9 +246,9 @@ void PseudoClientConnection::receiveMessage(const Archive::ByteStream & message)
characterId = m_transferCharacterData.getDestinationCharacterId();
}
std::vector<std::pair<NetworkId, std::string> > static const emptyStringVector;
NewClient m(characterId, "TransferServer", NetworkHandler::getHostName(), true, false, stationId, NULL, 0, 0, 0, 0, 0, 0, 0, emptyStringVector, emptyStringVector, m_transferCharacterData.getCSToolId() != 0, true);
NewClient m(characterId, "TransferServer", NetworkHandler::getHostName(), true, false, stationId, nullptr, 0, 0, 0, 0, 0, 0, 0, emptyStringVector, emptyStringVector, m_transferCharacterData.getCSToolId() != 0, true);
m_gameConnection->send(m, true);
LOG("CustomerService", ("CharacterTransfer: Sent NewClient(%s, \"TransferServer\", \"%s\", true, false, %d, NULL, 0, 0)\n", characterId.getValueString().c_str(), NetworkHandler::getHostName().c_str(), stationId));
LOG("CustomerService", ("CharacterTransfer: Sent NewClient(%s, \"TransferServer\", \"%s\", true, false, %d, nullptr, 0, 0)\n", characterId.getValueString().c_str(), NetworkHandler::getHostName().c_str(), stationId));
}
}
else if(msg.isType("TransferLoginCharacterToSourceServer"))
@@ -303,10 +303,10 @@ void SessionApiClient::OnGetFeatures(const apiTrackingNumber trackingNumber,
if (i != ms_getFeaturesTrackingNumberMap.end())
{
bool reuseMessage = false;
AccountFeatureIdRequest const * accountFeatureIdRequest = NULL;
AdjustAccountFeatureIdRequest const * adjustAccountFeatureIdRequest = NULL;
AdjustAccountFeatureIdResponse * adjustAccountFeatureIdResponse = NULL;
ClaimRewardsMessage * claimRewardsMessage = NULL;
AccountFeatureIdRequest const * accountFeatureIdRequest = nullptr;
AdjustAccountFeatureIdRequest const * adjustAccountFeatureIdRequest = nullptr;
AdjustAccountFeatureIdResponse * adjustAccountFeatureIdResponse = nullptr;
ClaimRewardsMessage * claimRewardsMessage = nullptr;
if (i->second->isType("AccountFeatureIdRequest"))
accountFeatureIdRequest = dynamic_cast<AccountFeatureIdRequest const *>(i->second);
@@ -319,7 +319,7 @@ void SessionApiClient::OnGetFeatures(const apiTrackingNumber trackingNumber,
if (result == RESULT_SUCCESS)
{
ClientConnection * clientConnection = NULL;
ClientConnection * clientConnection = nullptr;
if (accountFeatureIdRequest)
clientConnection = ConnectionServer::getClientConnection(accountFeatureIdRequest->getTargetStationId());
else if (adjustAccountFeatureIdRequest)
@@ -391,7 +391,7 @@ void SessionApiClient::OnGetFeatures(const apiTrackingNumber trackingNumber,
else
{
// if account already has the feature, adjust it, otherwise add the feature
LoginAPI::Feature const * existingFeature = NULL;
LoginAPI::Feature const * existingFeature = nullptr;
for (unsigned k = 0; k < featureCount; ++k)
{
@@ -444,7 +444,7 @@ void SessionApiClient::OnGetFeatures(const apiTrackingNumber trackingNumber,
}
else
{
LoginAPI::Feature const * newlyAddedFeature = NULL;
LoginAPI::Feature const * newlyAddedFeature = nullptr;
for (unsigned k = 0; k < featureCount; ++k)
{
@@ -506,7 +506,7 @@ void SessionApiClient::OnGetFeatures(const apiTrackingNumber trackingNumber,
else
{
// see if account already has the required feature
LoginAPI::Feature const * existingFeature = NULL;
LoginAPI::Feature const * existingFeature = nullptr;
for (unsigned k = 0; k < featureCount; ++k)
{
@@ -904,7 +904,7 @@ void SessionApiClient::validateClient (ClientConnection* client, const std::stri
void SessionApiClient::startPlay(const ClientConnection& client)
{
IGNORE_RETURN(SessionStartPlay(client.getSessionId().c_str(), ConfigConnectionServer::getClusterName(), client.getCharacterName().c_str(), NULL));
IGNORE_RETURN(SessionStartPlay(client.getSessionId().c_str(), ConfigConnectionServer::getClusterName(), client.getCharacterName().c_str(), nullptr));
}
//------------------------------------------------------------
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
SetupSharedRandom::install(static_cast<uint32>(time(nullptr)));
Os::setProgramName("CustomerServiceServer");
ConfigCustomerServiceServer::install();
NetworkHandler::install();
@@ -49,7 +49,7 @@ void CentralServerConnection::onConnectionOpened()
Service *chatServerService = CustomerServiceServer::getInstance().getChatServerService();
if (chatServerService != NULL)
if (chatServerService != nullptr)
{
const std::string address(chatServerService->getBindAddress());
const int port = chatServerService->getBindPort();
@@ -62,7 +62,7 @@ void CentralServerConnection::onConnectionOpened()
}
else
{
LOG("CentralServerConnection", ("onConnectionOpened() ERROR: ChatServerService is NULL"));
LOG("CentralServerConnection", ("onConnectionOpened() ERROR: ChatServerService is nullptr"));
}
}
@@ -71,7 +71,7 @@ void CentralServerConnection::onConnectionOpened()
Service *gameServerService = CustomerServiceServer::getInstance().getGameServerService();
if (gameServerService != NULL)
if (gameServerService != nullptr)
{
const std::string address(gameServerService->getBindAddress());
const int port = gameServerService->getBindPort();
@@ -84,7 +84,7 @@ void CentralServerConnection::onConnectionOpened()
}
else
{
LOG("CentralServerConnection", ("onConnectionOpened() ERROR: GameServerService is NULL"));
LOG("CentralServerConnection", ("onConnectionOpened() ERROR: GameServerService is nullptr"));
}
}
}
@@ -64,13 +64,13 @@ void ChatServerConnection::sendTo(GameNetworkMessage const &message)
{
LOG("ChatServerConnection", ("sendTo() message(%s)", message.getCmdName().c_str()));
if (s_connection != NULL)
if (s_connection != nullptr)
{
s_connection->send(message, true);
}
else
{
LOG("ChatServerConnection", ("sendTo() Unable to send, NULL ChatServerConnection"));
LOG("ChatServerConnection", ("sendTo() Unable to send, nullptr ChatServerConnection"));
}
}
@@ -12,19 +12,19 @@
namespace ConfigCustomerServiceServerNamespace
{
const char * s_clusterName = NULL;
const char * s_centralServerAddress = NULL;
const char * s_clusterName = nullptr;
const char * s_centralServerAddress = nullptr;
int s_centralServerPort = 0;
const char * s_gameCode = NULL;
const char * s_csServerAddress = NULL;
const char * s_gameCode = nullptr;
const char * s_csServerAddress = nullptr;
int s_csServerPort = 0;
int s_maxPacketsPerSecond = 50;
int s_requestTimeoutSeconds = 300;
int s_maxAllowedNumberOfTickets = 1;
int s_gameServicePort = 0;
int s_chatServicePort = 0;
const char* s_chatServiceBindInterface = NULL;
const char* s_gameServiceBindInterface = NULL;
const char* s_chatServiceBindInterface = nullptr;
const char* s_gameServiceBindInterface = nullptr;
bool s_writeTicketToBugLog = false;
};
@@ -38,7 +38,7 @@ using namespace CSAssist;
///////////////////////////////////////////////////////////////////////////////
CustomerServiceInterface::ClientInfo::ClientInfo()
: m_connection(NULL)
: m_connection(nullptr)
, m_stationUserId(0)
, m_ticketCount(-1)
, m_pendingTicketCount(0)
@@ -71,10 +71,10 @@ CustomerServiceInterface::~CustomerServiceInterface()
delete m_japaneseCategoryList;
delete m_clientConnectionMap;
m_clientConnectionMap = NULL;
m_clientConnectionMap = nullptr;
delete m_suidToNetworkIdMap;
m_suidToNetworkIdMap = NULL;
m_suidToNetworkIdMap = nullptr;
}
//-----------------------------------------------------------------------
@@ -97,8 +97,8 @@ void CustomerServiceInterface::OnConnectCSAssist(
}
m_connectionToBackEndEstablised = true;
m_englishCategoryTrack = requestGetIssueHierarchy(NULL, Unicode::narrowToWide("Default").data(), Unicode::narrowToWide("en").data());;
m_japaneseCategoryTrack = requestGetIssueHierarchy(NULL, Unicode::narrowToWide("Default").data(), Unicode::narrowToWide("ja").data());;
m_englishCategoryTrack = requestGetIssueHierarchy(nullptr, Unicode::narrowToWide("Default").data(), Unicode::narrowToWide("en").data());;
m_japaneseCategoryTrack = requestGetIssueHierarchy(nullptr, Unicode::narrowToWide("Default").data(), Unicode::narrowToWide("ja").data());;
}
}
@@ -117,7 +117,7 @@ void CustomerServiceInterface::OnConnectRejectedCSAssist(const CSAssistGameAPITr
void CustomerServiceInterface::parseIssueChild(CategoryList & categoryList, xmlNodePtr childPtr)
{
static CustomerServiceCategory *currentCategory = NULL;
static CustomerServiceCategory *currentCategory = nullptr;
xmlNodePtr child = childPtr->children;
//start element
@@ -142,19 +142,19 @@ void CustomerServiceInterface::parseIssueChild(CategoryList & categoryList, xmlN
val = reinterpret_cast<char *>(xmlGetProp(childPtr, (const unsigned char *)"isBugType"));
bool const isBugType = (val != NULL) && (strcmp(val, "true") == 0);
bool const isBugType = (val != nullptr) && (strcmp(val, "true") == 0);
// Check for service type
val = reinterpret_cast<char *>(xmlGetProp(childPtr, (const unsigned char *)"isServiceType"));
bool const isServiceType = (val != NULL) && (strcmp(val, "true") == 0);
bool const isServiceType = (val != nullptr) && (strcmp(val, "true") == 0);
// Check if valid
val = reinterpret_cast<char *>(xmlGetProp(childPtr, (const unsigned char *)"invalid"));
bool const invalid = (val != NULL) && (strcmp(val, "true") == 0);
bool const invalid = (val != nullptr) && (strcmp(val, "true") == 0);
if (!invalid)
{
@@ -187,9 +187,9 @@ void CustomerServiceInterface::parseIssueChild(CategoryList & categoryList, xmlN
}
}
while (child != NULL)
while (child != nullptr)
{
if (child->name != NULL)
if (child->name != nullptr)
{
parseIssueChild(categoryList, child);
}
@@ -204,7 +204,7 @@ void CustomerServiceInterface::parseIssueChild(CategoryList & categoryList, xmlN
if (currentCategory)
{
delete currentCategory;
currentCategory = NULL;
currentCategory = nullptr;
}
}
@@ -215,13 +215,13 @@ void CustomerServiceInterface::parseIssueChild(CategoryList & categoryList, xmlN
void CustomerServiceInterface::parseIssueHierarchy(CategoryList & categoryList, Unicode::String const & xmlData)
{
xmlDocPtr xmlInfo = NULL;
xmlDocPtr xmlInfo = nullptr;
Unicode::UTF8String xmlDataUtf8(Unicode::wideToUTF8(xmlData));
if ((xmlInfo = xmlParseMemory(xmlDataUtf8.c_str(), xmlDataUtf8.length())) != NULL)
if ((xmlInfo = xmlParseMemory(xmlDataUtf8.c_str(), xmlDataUtf8.length())) != nullptr)
{
xmlNodePtr xmlCurrent = xmlDocGetRootElement(xmlInfo);
if (xmlCurrent != NULL)
if (xmlCurrent != nullptr)
{
parseIssueChild(categoryList, xmlCurrent);
}
@@ -247,7 +247,7 @@ void CustomerServiceInterface::OnGetIssueHierarchy(
return;
}
if (hierarchyBody != NULL)
if (hierarchyBody != nullptr)
{
if (track == m_englishCategoryTrack)
{
@@ -266,7 +266,7 @@ void CustomerServiceInterface::OnGetIssueHierarchy(
}
else
{
LOG("CSServer", ("ERROR: NULL hierarchy returned from platform...why did this happen?", track, modifyData, result, getErrorString(result)));
LOG("CSServer", ("ERROR: nullptr hierarchy returned from platform...why did this happen?", track, modifyData, result, getErrorString(result)));
}
}
@@ -282,9 +282,9 @@ void CustomerServiceInterface::OnCreateTicket(
CreateTicketResponseMessage message(result, ticket);
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnCreateTicket() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
LOG("CSServer", ("OnCreateTicket() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
if (result == CSASSIST_RESULT_SUCCESS)
{
@@ -296,7 +296,7 @@ void CustomerServiceInterface::OnCreateTicket(
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -312,14 +312,14 @@ void CustomerServiceInterface::OnAppendTicketComment(
AppendCommentResponseMessage message(result, ticket);
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnAppendTicketComment() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
LOG("CSServer", ("OnAppendTicketComment() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -335,9 +335,9 @@ void CustomerServiceInterface::OnCancelTicket(
CancelTicketResponseMessage message(result, ticket);
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnCancelTicket() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
LOG("CSServer", ("OnCancelTicket() track(%i) result(%i) (%s) networkId(%s) ticketId(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", ticket));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
if (result == CSASSIST_RESULT_SUCCESS)
{
@@ -347,7 +347,7 @@ void CustomerServiceInterface::OnCancelTicket(
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -378,9 +378,9 @@ void CustomerServiceInterface::OnGetTicketByCharacter(
GetTicketsResponseMessage message(result, totalNumber, tickets);
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnGetTicketByCharacter() track(%i) result(%i) (%s) networkId(%s) totalNumber(%i) numberReturned(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", totalNumber, numberReturned));
LOG("CSServer", ("OnGetTicketByCharacter() track(%i) result(%i) (%s) networkId(%s) totalNumber(%i) numberReturned(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", totalNumber, numberReturned));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
// Save the number of tickets this player has
@@ -396,7 +396,7 @@ void CustomerServiceInterface::OnGetTicketByCharacter(
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -423,14 +423,14 @@ void CustomerServiceInterface::OnGetTicketComments(
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnGetTicketComments() track(%i) result(%i) (%s) networkId(%s) numberRead(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", numberRead));
LOG("CSServer", ("OnGetTicketComments() track(%i) result(%i) (%s) networkId(%s) numberRead(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", numberRead));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -455,14 +455,14 @@ void CustomerServiceInterface::OnSearchKB(
SearchKnowledgeBaseResponseMessage message(result, searchResultsVector);
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnSearchKB() track(%i) result(%i) (%s) networkId(%s) numberRead(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", numberRead));
LOG("CSServer", ("OnSearchKB() track(%i) result(%i) (%s) networkId(%s) numberRead(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", numberRead));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -482,12 +482,12 @@ void CustomerServiceInterface::OnGetKBArticle(
{
GetArticleResponseMessage message(result, Unicode::String(articleBody));
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
}
@@ -501,7 +501,7 @@ void CustomerServiceInterface::OnIssueHierarchyChanged(
{
LOG("CSServer", ("OnIssueHierarchyChanged()"));
requestGetIssueHierarchy(NULL, version, language);
requestGetIssueHierarchy(nullptr, version, language);
}
//-----------------------------------------------------------------------
@@ -512,9 +512,9 @@ void CustomerServiceInterface::OnNewTicketActivity(const CSAssistGameAPITrack tr
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnNewTicketActivity() track(%i) result(%i) (%s) networkId(%s) activity(%s) ticket count(%i)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA", NewActivityFlag ? "yes" : "no", HasTickets));
LOG("CSServer", ("OnNewTicketActivity() track(%i) result(%i) (%s) networkId(%s) activity(%s) ticket count(%i)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA", NewActivityFlag ? "yes" : "no", HasTickets));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
// Save the number of tickets this player has
@@ -530,7 +530,7 @@ void CustomerServiceInterface::OnNewTicketActivity(const CSAssistGameAPITrack tr
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -540,12 +540,12 @@ void CustomerServiceInterface::OnMarkTicketRead(const CSAssistGameAPITrack track
{
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnMarkTicketRead() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA"));
LOG("CSServer", ("OnMarkTicketRead() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA"));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -575,16 +575,16 @@ void CustomerServiceInterface::OnRegisterCharacter(const CSAssistGameAPITrack tr
{
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnRegisterCharacter() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA"));
LOG("CSServer", ("OnRegisterCharacter() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA"));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
ConnectPlayerResponseMessage message(result);
sendToClient(*tmpNetworkId, message);
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -594,9 +594,9 @@ void CustomerServiceInterface::OnUnRegisterCharacter(const CSAssistGameAPITrack
{
const NetworkId *tmpNetworkId = reinterpret_cast<const NetworkId *>(userData);
LOG("CSServer", ("OnUnRegisterCharacter() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != NULL) ? tmpNetworkId->getValueString().c_str() : "NA"));
LOG("CSServer", ("OnUnRegisterCharacter() track(%i) result(%i) (%s) networkId(%s)", track, result, getErrorString(result), (tmpNetworkId != nullptr) ? tmpNetworkId->getValueString().c_str() : "NA"));
if (tmpNetworkId != NULL)
if (tmpNetworkId != nullptr)
{
// If the player was successfully unregistered, remove the local cached reference
@@ -606,7 +606,7 @@ void CustomerServiceInterface::OnUnRegisterCharacter(const CSAssistGameAPITrack
}
delete tmpNetworkId;
tmpNetworkId = NULL;
tmpNetworkId = nullptr;
}
}
@@ -708,7 +708,7 @@ void CustomerServiceInterface::sendToClient(const NetworkId &player, const GameN
}
else
{
LOG("CSServer", ("sendToClient() Connection is NULL: networkId(%s) cmdName(%s)", player.getValueString().c_str(), message.getCmdName().c_str()));
LOG("CSServer", ("sendToClient() Connection is nullptr: networkId(%s) cmdName(%s)", player.getValueString().c_str(), message.getCmdName().c_str()));
}
}
else
@@ -779,7 +779,7 @@ void CustomerServiceInterface::requestUnRegisterCharacter(const NetworkId &reque
LOG("CSServer", ("requestUnRegisterCharacter() networkId(%s) suid(%i)", requester.getValueString().c_str(), suid));
NetworkId *tmpNetworkId = new NetworkId(requester);
CSAssistGameAPI::requestUnRegisterCharacter(reinterpret_cast<const void *>(tmpNetworkId), suid, NULL);
CSAssistGameAPI::requestUnRegisterCharacter(reinterpret_cast<const void *>(tmpNetworkId), suid, nullptr);
}
else
{
@@ -49,7 +49,7 @@ namespace CustomerServiceServerNamespace
using namespace CustomerServiceServerNamespace;
CustomerServiceServer *CustomerServiceServer::m_instance = NULL;
CustomerServiceServer *CustomerServiceServer::m_instance = nullptr;
///////////////////////////////////////////////////////////////////////////////
//
@@ -83,12 +83,12 @@ CustomerServiceServer::PendingTicket::PendingTicket()
CustomerServiceServer::CustomerServiceServer() :
m_callback(new MessageDispatch::Callback),
m_centralServerConnection(NULL),
m_centralServerConnection(nullptr),
m_connectionServerSet(new ConnectionServerSet),
m_done(false),
m_csInterface(ConfigCustomerServiceServer::getCustomerServiceServerAddress(), ConfigCustomerServiceServer::getCustomerServiceServerPort(), ConfigCustomerServiceServer::getRequestTimeoutSeconds()),
m_gameServerService(NULL),
m_chatServerService(NULL),
m_gameServerService(nullptr),
m_chatServerService(nullptr),
m_nextSequenceId(0),
m_pendingTicketList(new PendingTicketList)
{
@@ -113,7 +113,7 @@ m_pendingTicketList(new PendingTicketList)
m_csInterface.setMaxPacketsPerSecond(ConfigCustomerServiceServer::getMaxPacketsPerSecond());
m_csInterface.connectCSAssist(NULL,
m_csInterface.connectCSAssist(nullptr,
Unicode::narrowToWide(ConfigCustomerServiceServer::getGameCode()).data(),
Unicode::narrowToWide(ConfigCustomerServiceServer::getClusterName()).data());
@@ -148,19 +148,19 @@ CustomerServiceServer::~CustomerServiceServer()
m_centralServerConnection->disconnect();
delete m_callback;
m_callback = NULL;
m_callback = nullptr;
delete m_connectionServerSet;
m_connectionServerSet = NULL;
m_connectionServerSet = nullptr;
delete m_gameServerService;
m_gameServerService = NULL;
m_gameServerService = nullptr;
delete m_chatServerService;
m_chatServerService = NULL;
m_chatServerService = nullptr;
delete m_pendingTicketList;
m_pendingTicketList = NULL;
m_pendingTicketList = nullptr;
MetricsManager::remove();
delete s_customerServiceServerMetricsData;
@@ -233,7 +233,7 @@ void CustomerServiceServer::update()
CustomerServiceServer &CustomerServiceServer::getInstance()
{
if (m_instance == NULL)
if (m_instance == nullptr)
{
m_instance = new CustomerServiceServer;
}
@@ -405,7 +405,7 @@ void CustomerServiceServer::getTickets(
NetworkId *tmpNetworkId = new NetworkId(requester);
m_csInterface.requestGetTicketByCharacter(
reinterpret_cast<const void *>(tmpNetworkId), suid, NULL,
reinterpret_cast<const void *>(tmpNetworkId), suid, nullptr,
start, count, markAsRead);
}
@@ -475,7 +475,7 @@ void CustomerServiceServer::requestNewTicketActivity(const NetworkId &requester,
NetworkId *tmpNetworkId = new NetworkId(requester);
m_csInterface.requestNewTicketActivity(reinterpret_cast<const void *>(tmpNetworkId), suid, NULL);
m_csInterface.requestNewTicketActivity(reinterpret_cast<const void *>(tmpNetworkId), suid, nullptr);
}
//-----------------------------------------------------------------------
@@ -497,7 +497,7 @@ void CustomerServiceServer::requestRegisterCharacter(const NetworkId &requester,
LOG("CSServer", ("CustomerServiceInterface::requestRegisterCharacter() - networkId(%s) suid(%i)", requester.getValueString().c_str(), suid));
NetworkId *tmpNetworkId = new NetworkId(requester);
m_csInterface.requestRegisterCharacter(reinterpret_cast<const void *>(tmpNetworkId), suid, NULL, 0);
m_csInterface.requestRegisterCharacter(reinterpret_cast<const void *>(tmpNetworkId), suid, nullptr, 0);
}
}
@@ -23,16 +23,16 @@ LoggingServerApi::LoggingServerApi(LoggingServerHandler *handler, int queueSize)
mLoginName[0] = 0;
mPassword[0] = 0;
mDefaultDirectory[0] = 0;
mConnection = NULL;
mUdpManager = NULL;
mTransaction = NULL;
mSessionId = int(time(NULL));
mConnection = nullptr;
mUdpManager = nullptr;
mTransaction = nullptr;
mSessionId = int(time(nullptr));
mSessionSequence = 1;
}
LoggingServerApi::~LoggingServerApi()
{
if (mTransaction != NULL)
if (mTransaction != nullptr)
StopTransaction();
for (int i = 0; i < mQueueCount; i++)
@@ -77,7 +77,7 @@ void LoggingServerApi::Connect(const char *address, int port, const char *loginN
mUdpManager = new UdpManager(&params);
mConnection = mUdpManager->EstablishConnection(address, port, 30000);
if (mConnection != NULL)
if (mConnection != nullptr)
mConnection->SetHandler(this);
mLoginSent = false;
}
@@ -89,17 +89,17 @@ void LoggingServerApi::Disconnect()
mPassword[0] = 0;
mDefaultDirectory[0] = 0;
if (mConnection != NULL)
if (mConnection != nullptr)
{
mConnection->Disconnect();
mConnection->Release();
mConnection = NULL;
mConnection = nullptr;
}
if (mUdpManager != NULL)
if (mUdpManager != nullptr)
{
mUdpManager->Release();
mUdpManager = NULL;
mUdpManager = nullptr;
}
}
@@ -119,7 +119,7 @@ void LoggingServerApi::Flush(int timeout)
LoggingServerApi::Status LoggingServerApi::GetStatus() const
{
if (mConnection != NULL)
if (mConnection != nullptr)
{
switch (mConnection->GetStatus())
{
@@ -153,7 +153,7 @@ void LoggingServerApi::OnRoutePacket(UdpConnection *, const uchar *data, int)
FlushQueue();
}
if (mHandler != NULL)
if (mHandler != nullptr)
mHandler->LshOnLoginConfirm(mAuthenticated);
break;
}
@@ -171,13 +171,13 @@ void LoggingServerApi::OnRoutePacket(UdpConnection *, const uchar *data, int)
char *filename = ptr;
ptr += strlen(ptr) + 1;
char *message = ptr;
if (mHandler != NULL)
if (mHandler != nullptr)
mHandler->LshOnMonitor(sessionId, sequenceNumber, name, filename, typeCode, message);
break;
}
case cS2CPacketFileList:
{
if (mHandler != NULL)
if (mHandler != nullptr)
mHandler->LshOnFileList((char *)(data + 1));
break;
}
@@ -188,7 +188,7 @@ void LoggingServerApi::OnRoutePacket(UdpConnection *, const uchar *data, int)
void LoggingServerApi::OnTerminated(UdpConnection *con)
{
if(mHandler != NULL)
if(mHandler != nullptr)
{
mHandler->LshOnTerminated( con->GetDisconnectReason() );
}
@@ -196,7 +196,7 @@ void LoggingServerApi::OnTerminated(UdpConnection *con)
void LoggingServerApi::GiveTime()
{
if (mConnection != NULL && mConnection->GetStatus() == UdpConnection::cStatusConnected)
if (mConnection != nullptr && mConnection->GetStatus() == UdpConnection::cStatusConnected)
{
if (!mLoginSent)
{
@@ -225,7 +225,7 @@ void LoggingServerApi::GiveTime()
if (mQueue[spot].sentTime != 0 && UdpMisc::ClockElapsed(mQueue[spot].sentTime) > cSafetyQueueTime)
{
mQueue[spot].packet->Release();
mQueue[spot].packet = NULL;
mQueue[spot].packet = nullptr;
mQueuePosition++;
mQueueCount--;
}
@@ -235,7 +235,7 @@ void LoggingServerApi::GiveTime()
}
}
if (mUdpManager != NULL)
if (mUdpManager != nullptr)
{
mUdpManager->GiveTime();
}
@@ -243,17 +243,17 @@ void LoggingServerApi::GiveTime()
void LoggingServerApi::StartTransaction()
{
if (mTransaction == NULL)
if (mTransaction == nullptr)
mTransaction = new GroupLogicalPacket();
}
void LoggingServerApi::StopTransaction()
{
if (mTransaction != NULL)
if (mTransaction != nullptr)
{
PacketSend(mTransaction);
mTransaction->Release();
mTransaction = NULL;
mTransaction = nullptr;
}
}
@@ -264,7 +264,7 @@ void LoggingServerApi::PacketSend(LogicalPacket *lp)
{
int spot = mQueuePosition % mQueueSize;
mQueue[spot].packet->Release();
mQueue[spot].packet = NULL;
mQueue[spot].packet = nullptr;
mQueuePosition++;
mQueueCount--;
}
@@ -374,7 +374,7 @@ void LoggingServerApi::Log(const char *filename, int typeCode, const char *messa
void LoggingServerApi::LogPacket(char *data, int len)
{
if (mTransaction != NULL)
if (mTransaction != nullptr)
{
// add it to the transaction
mTransaction->AddPacket(data, len);
@@ -389,7 +389,7 @@ void LoggingServerApi::LogPacket(char *data, int len)
LogicalPacket *LoggingServerApi::CreatePacket(char *data, int dataLen)
{
if (mUdpManager != NULL)
if (mUdpManager != nullptr)
{
return(mUdpManager->CreatePacket(data, dataLen));
}
@@ -440,7 +440,7 @@ void LoggingServerApi::GetStatistics(LoggingServerApiStatistics *stats)
memset( stats, 0, sizeof( *stats) );
UdpConnectionStatistics udpConnectionStats;
memset( &udpConnectionStats, 0, sizeof( udpConnectionStats ) );
if( mConnection != NULL )
if( mConnection != nullptr )
{
mConnection->GetStats( &udpConnectionStats );
stats->applicationPacketsReceived = udpConnectionStats.applicationPacketsReceived;
@@ -454,7 +454,7 @@ void LoggingServerApi::GetStatistics(LoggingServerApiStatistics *stats)
}
UdpManagerStatistics managerStats;
if( mUdpManager != NULL )
if( mUdpManager != nullptr )
{
mUdpManager->GetStats( &managerStats );
udp_int64 iterations = managerStats.iterations;
@@ -35,7 +35,7 @@ int main(int argc, char ** argv)
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
Os::setProgramName("LoginServer");
//setup the server
@@ -51,7 +51,7 @@ void CSToolConnection::validateCSTool(uint32 toolId, apiResult result, const api
p_connection->m_bSecure = true;
}
// if we have a null session type, then we aren't connected to the
// if we have a nullptr session type, then we aren't connected to the
// Session Server and are in debug mode.
//
// if we *do* have a good session, then check the admin table for access level.
@@ -71,7 +71,7 @@ void CSToolConnection::validateCSTool(uint32 toolId, apiResult result, const api
bool canLogin = isInternal; // we always have to be internal.
if (sessionNull)
{
// null session means we can skip everything else.
// nullptr session means we can skip everything else.
canLogin = canLogin && true;
accessLevel = 100;
}
@@ -282,13 +282,13 @@ void CentralServerConnection::onReceive(const Archive::ByteStream & message)
else if(m.isType("GcwScoreStatRaw"))
{
GenericValueTypeMessage<std::pair<std::string, std::pair<std::map<std::string, std::pair<int64, int64> >, std::map<std::string, std::pair<int64, int64> > > > > const msg(ri);
LoginServer::getInstance().sendToAllClusters(msg, NULL, 0, msg.getValue().first.c_str());
LoginServer::getInstance().sendToAllClusters(msg, nullptr, 0, msg.getValue().first.c_str());
}
else if(m.isType("GcwScoreStatPct"))
{
GenericValueTypeMessage<std::pair<std::string, std::pair<std::map<std::string, int>, std::map<std::string, int> > > > const msg(ri);
LoginServer::getInstance().sendToAllClusters(msg, NULL, 0, msg.getValue().first.c_str());
LoginServer::getInstance().sendToAllClusters(msg, nullptr, 0, msg.getValue().first.c_str());
}
}
@@ -100,7 +100,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
// client has an idea of how much difference there is between
// the client's Epoch time and the server Epoch time
GenericValueTypeMessage<int32> const serverNowEpochTime(
"ServerNowEpochTime", static_cast<int32>(::time(NULL)));
"ServerNowEpochTime", static_cast<int32>(::time(nullptr)));
send(serverNowEpochTime, true);
LoginClientId id(ri);
@@ -202,7 +202,7 @@ void ClientConnection::validateClient(const std::string & id, const std::string
LOG("LoginClientConnection", ("validateClient() for stationId (%lu) at IP (%s), id (%s) key (%s), skipping validating session", m_stationId, getRemoteAddress().c_str(), id.c_str(), key.c_str()));
LoginServer::getInstance().onValidateClient(suid, id, this, true, NULL, 0xFFFFFFFF, 0xFFFFFFFF);
LoginServer::getInstance().onValidateClient(suid, id, this, true, nullptr, 0xFFFFFFFF, 0xFFFFFFFF);
}
}
@@ -14,7 +14,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -130,7 +130,7 @@ LoginServer::LoginServer() :
Singleton<LoginServer>(),
MessageDispatch::Receiver(),
done(false),
m_centralService(NULL),
m_centralService(nullptr),
clientService(0),
pingService(0),
keyServer(0),
@@ -391,7 +391,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
{
CentralServerConnection * connection = const_cast<CentralServerConnection*>(safe_cast<const CentralServerConnection *>(&source));
DEBUG_REPORT_LOG(true, ("Cluster connection %s opened\n", msg.getClusterName().c_str()));
ClusterListEntry *cle=NULL;
ClusterListEntry *cle=nullptr;
if (ConfigLoginServer::getDevelopmentMode())
{
// in this mode, we trust the name sent by the cluster and we dynamically add clusters we don't know about
@@ -410,7 +410,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
{
WARNING(true,("Server %i is named \"%s\" in the database. The server at the specified address (%s:%hu) reports its name as \"%s\". It will not be allowed in the service. Either the name in the database or the name in Central's config file should be corrected.\n",cle->m_clusterId, cle->m_clusterName.c_str(), connection->getRemoteAddress().c_str(), connection->getRemotePort(), msg.getClusterName().c_str()));
disconnectCluster(*cle,true,false);
cle=NULL;
cle=nullptr;
}
}
@@ -589,7 +589,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
// for testing purpose when not using session authentication, store
// the account feature Ids locally in memory, which will get cleared
// (obviously) when the LoginServer is restarted
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = NULL;
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = nullptr;
if (msg.getGameCode() == PlatformGameCode::SWG)
nonSessionTestingAccountFeatureIds = &s_nonSessionTestingAccountSwgFeatureIds;
else if (msg.getGameCode() == PlatformGameCode::SWGTCG)
@@ -648,7 +648,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
// for testing purpose when not using session authentication, store
// the account feature Ids locally in memory, which will get cleared
// (obviously) when the LoginServer is restarted
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = NULL;
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = nullptr;
if (msg.getGameCode() == PlatformGameCode::SWG)
nonSessionTestingAccountFeatureIds = &s_nonSessionTestingAccountSwgFeatureIds;
else if (msg.getGameCode() == PlatformGameCode::SWGTCG)
@@ -826,7 +826,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
const CentralServerConnection *conn = dynamic_cast<const CentralServerConnection *>(&source);
if (conn)
DatabaseConnection::getInstance().renameCharacter(conn->getClusterId(), msg.getCharacterId(), msg.getNewName(), NULL);
DatabaseConnection::getInstance().renameCharacter(conn->getClusterId(), msg.getCharacterId(), msg.getNewName(), nullptr);
else
WARNING_STRICT_FATAL(true,("Got RenameCharacterMessage from something other than CentralServerConnection.\n"));
}
@@ -1461,11 +1461,11 @@ LoginServer::ClusterListEntry *LoginServer::findClusterByName(const std::string
ClusterListType::iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_clusterName == clusterName)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1555,7 +1555,7 @@ void LoginServer::sendClusterStatus(ClientConnection &conn) const
// 5) Cluster has told us its ready for players
if (cle && cle->m_clusterId!=0 && cle->m_connected && !cle->m_connectionServers.empty() && (clientIsPrivate || !cle->m_secret))
{
DEBUG_FATAL(!cle->m_centralServerConnection,("Programmer bug: m_connected was true but m_centralServerConnection was NULL\n"));
DEBUG_FATAL(!cle->m_centralServerConnection,("Programmer bug: m_connected was true but m_centralServerConnection was nullptr\n"));
LoginClusterStatus::ClusterData item;
item.m_clusterId = cle->m_clusterId;
item.m_timeZone = cle->m_timeZone;
@@ -1840,12 +1840,12 @@ LoginServer::ClusterListEntry * LoginServer::findClusterById(uint32 clusterId)
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_clusterId == clusterId)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1859,12 +1859,12 @@ LoginServer::ClusterListEntry * LoginServer::findClusterByConnection(const Centr
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_centralServerConnection == connection)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1908,12 +1908,12 @@ void LoginServer::setDone(const bool isDone)
// ----------------------------------------------------------------------
void LoginServer::sendToAllClusters(GameNetworkMessage const & message, Connection const * excludeCentralConnection /*= NULL*/, uint32 excludeClusterId /*= 0*/, char const * excludeClusterName /*= NULL*/)
void LoginServer::sendToAllClusters(GameNetworkMessage const & message, Connection const * excludeCentralConnection /*= nullptr*/, uint32 excludeClusterId /*= 0*/, char const * excludeClusterName /*= nullptr*/)
{
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
if (NON_NULL(*i)->m_connected && (*i)->m_centralServerConnection && ((*i)->m_centralServerConnection != excludeCentralConnection) && ((*i)->m_clusterId != excludeClusterId) && ((excludeClusterName == NULL) || _stricmp(excludeClusterName, (*i)->m_centralServerConnection->getClusterName().c_str())))
if (NON_NULL(*i)->m_connected && (*i)->m_centralServerConnection && ((*i)->m_centralServerConnection != excludeCentralConnection) && ((*i)->m_clusterId != excludeClusterId) && ((excludeClusterName == nullptr) || _stricmp(excludeClusterName, (*i)->m_centralServerConnection->getClusterName().c_str())))
(*i)->m_centralServerConnection->send(message,true);
}
}
@@ -64,7 +64,7 @@ public:
void validateAccount (const StationId& stationId, uint32 clusterId, uint32 subscriptionBits, bool canCreateRegular, bool canCreateJedi, bool canSkipTutorial, unsigned int track, std::vector<std::pair<NetworkId, std::string> > const & consumedRewardEvents, std::vector<std::pair<NetworkId, std::string> > const & claimedRewardItems);
void validateAccountForTransfer(const TransferRequestMoveValidation & request, uint32 clusterId, uint32 sourceCharacterTemplateId, bool canCreateRegular, bool canCreateJedi);
void sendToCluster (uint32 clusterId, const GameNetworkMessage &message);
void sendToAllClusters (GameNetworkMessage const & message, Connection const * excludeCentralConnection = NULL, uint32 excludeClusterId = 0, char const * excludeClusterName = NULL);
void sendToAllClusters (GameNetworkMessage const & message, Connection const * excludeCentralConnection = nullptr, uint32 excludeClusterId = 0, char const * excludeClusterName = nullptr);
bool areAllClustersUp () const;
void getClusterIds (stdvector<uint32>::fwd result);
void performAccountTransfer (const AvatarList &avatars, TransferAccountData * transferAccountData);
@@ -435,7 +435,7 @@ void SessionApiClient::NotifySessionKick(const char ** sessionList,
void SessionApiClient::checkStatusForPurge(StationId account)
{
GetAccountSubscription(account, PlatformGameCode::SWG, NULL);
GetAccountSubscription(account, PlatformGameCode::SWG, nullptr);
}
//------------------------------------------------------------------------------------------
@@ -58,7 +58,7 @@ void TaskCreateCharacter::onComplete()
// let all other galaxies know that a new character has been created for the station account
GenericValueTypeMessage<StationId> const ncc("NewCharacterCreated", m_stationId);
LoginServer::getInstance().sendToAllClusters(ncc, NULL, m_clusterId);
LoginServer::getInstance().sendToAllClusters(ncc, nullptr, m_clusterId);
}
// ======================================================================
@@ -14,7 +14,7 @@
// ======================================================================
TaskGetCharactersForDelete::TaskGetCharactersForDelete (StationId stationId, int clusterGroupId) :
TaskGetAvatarList(stationId, clusterGroupId, NULL)
TaskGetAvatarList(stationId, clusterGroupId, nullptr)
{
}
@@ -40,7 +40,7 @@ int main(int argc, char ** argv)
SetupSharedNetwork::getDefaultServerSetupData(networkSetupData);
SetupSharedNetwork::install(networkSetupData);
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
Os::setProgramName("MetricsServer");
//setup the server
@@ -169,19 +169,19 @@ void MetricsGatheringConnection::update(const std::vector<MetricsPair> & data)
//note: we know that the "isSecret", and "isLocked" nodes will come after the "population" node in the list
// we are iterating over, so they will override the population setting
if (strstr((*dataIter).m_label.c_str(), "population") != NULL)
if (strstr((*dataIter).m_label.c_str(), "population") != nullptr)
{
// there are nodes under the population node, so don't interpret them as the population
if (strstr((*dataIter).m_label.c_str(), "population.") == NULL)
if (strstr((*dataIter).m_label.c_str(), "population.") == nullptr)
mon->set(MetricsServer::getWorldCountChannel(), std::max((*dataIter).m_value, 0));
}
else if (strstr((*dataIter).m_label.c_str(), "isSecret") != NULL
|| strstr((*dataIter).m_label.c_str(), "isLocked") != NULL)
else if (strstr((*dataIter).m_label.c_str(), "isSecret") != nullptr
|| strstr((*dataIter).m_label.c_str(), "isLocked") != nullptr)
{
if ((*dataIter).m_value == 1)
mon->set(MetricsServer::getWorldCountChannel(), STATUS_LOCKED);
}
else if (strstr((*dataIter).m_label.c_str(), "isLoading") != NULL)
else if (strstr((*dataIter).m_label.c_str(), "isLoading") != nullptr)
{
// include in the root node description how
// long the cluster has been loading
@@ -226,19 +226,19 @@ void MetricsGatheringConnection::update(const std::vector<MetricsPair> & data)
//note: we know that the "isSecret", and "isLocked" nodes will come after the "population" node in the list
// we are iterating over, so they will override the population setting
if (strstr((*dataIter).m_label.c_str(), "population") != NULL)
if (strstr((*dataIter).m_label.c_str(), "population") != nullptr)
{
// there are nodes under the population node, so don't interpret them as the population
if (strstr((*dataIter).m_label.c_str(), "population.") == NULL)
if (strstr((*dataIter).m_label.c_str(), "population.") == nullptr)
mon->set(MetricsServer::getWorldCountChannel(), std::max((*dataIter).m_value, 0));
}
else if (strstr((*dataIter).m_label.c_str(), "isSecret") != NULL
|| strstr((*dataIter).m_label.c_str(), "isLocked") != NULL)
else if (strstr((*dataIter).m_label.c_str(), "isSecret") != nullptr
|| strstr((*dataIter).m_label.c_str(), "isLocked") != nullptr)
{
if ((*dataIter).m_value == 1)
mon->set(MetricsServer::getWorldCountChannel(), STATUS_LOCKED);
}
else if (strstr((*dataIter).m_label.c_str(), "isLoading") != NULL)
else if (strstr((*dataIter).m_label.c_str(), "isLoading") != nullptr)
{
// include in the root node description how
// long the cluster has been loading
@@ -29,8 +29,8 @@ std::string MetricsServer::m_worldCountChannelDescription;
bool MetricsServer::m_done = false;
Service* MetricsServer::m_metricsService;
CMonitorAPI * MetricsServer::m_soeMonitor;
Service * MetricsServer::ms_service = NULL;
TaskConnection * MetricsServer::ms_taskConnection = NULL;
Service * MetricsServer::ms_service = nullptr;
TaskConnection * MetricsServer::ms_taskConnection = nullptr;
//----------------------------------------------------------------
@@ -46,7 +46,7 @@ int main(int argc, char ** argv)
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(time(NULL)); //lint !e732 loss of sign (of 0!)
SetupSharedRandom::install(time(nullptr)); //lint !e732 loss of sign (of 0!)
SetupSharedUtility::Data sharedUtilityData;
SetupSharedUtility::setupGameData (sharedUtilityData);
@@ -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;
}
// ----------------------------------------------------------------------
@@ -35,7 +35,7 @@ int main(int argc, char ** argv)
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
Os::setProgramName("StationPlayersCollector");
@@ -22,7 +22,7 @@ struct SetBufferMode
SetBufferMode::SetBufferMode()
{
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdin, nullptr, _IONBF, 0);
}
//-----------------------------------------------------------------------
@@ -92,7 +92,7 @@ void makeParameters(const std::vector<std::string> & parameters, std::vector<cha
strcpy(arg, (*i).c_str()); //lint !e64 !e534
p.push_back(arg);
}
p.push_back(NULL);
p.push_back(nullptr);
}
// ----------------------------------------------------------------------
@@ -29,7 +29,7 @@ int main(int argc, char ** argv)
SetupSharedCompression::install();
SetupSharedFile::install(false);
SetupSharedNetworkMessages::install();
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
Os::setProgramName("TaskManager");
//setup the server
@@ -89,7 +89,7 @@ void GameConnection::receive(const Archive::ByteStream & message)
char filename[30];
snprintf(filename, sizeof(filename)-1, "/proc/%lu/cmdline", m_pid);
// format of the cmdline file is a NULL separates every
// format of the cmdline file is a nullptr separates every
// parameter, so we'll have to replace the NULLs with spaces
FILE *inFile = fopen(filename,"rb");
if (inFile)
@@ -25,11 +25,11 @@ namespace LocatorNamespace
float getConfigSetting(const char *section, const char *key, const float defaultValue)
{
const ConfigFile::Section * sec = ConfigFile::getSection(section);
if (sec == NULL)
if (sec == nullptr)
return defaultValue;
const ConfigFile::Key * ky = sec->findKey(key);
if (ky == NULL)
if (ky == nullptr)
return defaultValue;
return ky->getAsFloat(ky->getCount()-1, defaultValue);
@@ -364,7 +364,7 @@ void Locator::opened(std::string const &label, ManagerConnection *newConnection)
TaskManager::runSpawnRequestQueue();
}
else
WARNING_STRICT_FATAL(true, ("Passed null connection to Locator::opened"));
WARNING_STRICT_FATAL(true, ("Passed nullptr connection to Locator::opened"));
}
// ----------------------------------------------------------------------
@@ -98,7 +98,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
r = message.begin();
if (m.isType("SystemTimeCheck"))
{
long const currentTime = static_cast<long>(::time(NULL));
long const currentTime = static_cast<long>(::time(nullptr));
GenericValueTypeMessage<std::pair<std::string, long > > msg(r);
if (TaskManager::getNodeLabel() == "node0")
@@ -117,7 +117,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
else if (m.isType("TaskConnectionIdMessage"))
{
static long const clockDriftFatalTimePeriod = static_cast<long>(TaskManager::getStartTime()) + ConfigTaskManager::getClockDriftFatalIntervalSeconds();
long const currentTime = static_cast<long>(::time(NULL));
long const currentTime = static_cast<long>(::time(nullptr));
TaskConnectionIdMessage t(r);
WARNING_STRICT_FATAL(t.getServerType() != TaskConnectionIdMessage::TaskManager,
("ManagerConnection received wrong type identifier"));
@@ -161,7 +161,7 @@ m_processEntries(),
m_localServers(),
m_remoteServers(),
m_nodeLabel(),
m_startTime(::time(NULL)),
m_startTime(::time(nullptr)),
m_nodeList(),
m_nodeNumber(-1),
m_nodeToConnectToList(),
@@ -362,7 +362,7 @@ void TaskManager::processRcFile()
void TaskManager::setupNodeList()
{
char buffer[64];
const char* result = NULL;
const char* result = nullptr;
int nodeIndex = 0;
bool found = true;
@@ -375,7 +375,7 @@ void TaskManager::setupNodeList()
{
found = false;
sprintf(buffer, "node%d", nodeIndex);
result = ConfigFile::getKeyString("TaskManager", buffer, NULL);
result = ConfigFile::getKeyString("TaskManager", buffer, nullptr);
if (result)
{
NodeEntry n(result, buffer, nodeIndex);
@@ -967,8 +967,8 @@ void TaskManager::update()
// of slave TaskManager that has disconnected but has not reconnected,
// so that an alert can be made in SOEMon so ops can see it and restart
// the disconnected TaskManager
static time_t timeSystemTimeCheck = ::time(NULL) + ConfigTaskManager::getSystemTimeCheckIntervalSeconds();
time_t const timeNow = ::time(NULL);
static time_t timeSystemTimeCheck = ::time(nullptr) + ConfigTaskManager::getSystemTimeCheckIntervalSeconds();
time_t const timeNow = ::time(nullptr);
if (timeSystemTimeCheck <= timeNow)
{
if (getNodeLabel() != "node0")
@@ -147,7 +147,7 @@ void CTSAPIClient::onRequestMove(const unsigned server_track, const char *langua
{
LOG("CTSAPI", ("Received a transfer request for station ID %d, but a transfer for that id is already in progress", uid));
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_SOFTERROR);
IGNORE_RETURN(replyMove(server_track, result, NULL, NULL));
IGNORE_RETURN(replyMove(server_track, result, nullptr, nullptr));
}
}
@@ -165,7 +165,7 @@ void CTSAPIClient::onRequestTransferAccount(const unsigned server_track, const u
{
LOG("CTSAPI", ("Received a transfer request for station ID %d, but a transfer for that id is already in progress", uid));
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_SOFTERROR);
IGNORE_RETURN(replyTransferAccount(server_track, result, NULL, NULL));
IGNORE_RETURN(replyTransferAccount(server_track, result, nullptr, nullptr));
}
}
@@ -197,12 +197,12 @@ void CTSAPIClient::onRequestServerList(const unsigned server_track, const char *
if(! servers.empty())
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_RESULT_SUCCESS);
IGNORE_RETURN(replyServerList(server_track, result, servers.size(), &servers[0], NULL));
IGNORE_RETURN(replyServerList(server_track, result, servers.size(), &servers[0], nullptr));
}
else
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_RESULT_FAILURE);
IGNORE_RETURN(replyServerList(server_track, result, servers.size(), NULL, NULL));
IGNORE_RETURN(replyServerList(server_track, result, servers.size(), nullptr, nullptr));
}
}
@@ -226,12 +226,12 @@ void CTSAPIClient::onRequestDestinationServerList(const unsigned server_track, c
if(! servers.empty())
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_RESULT_SUCCESS);
IGNORE_RETURN(replyDestinationServerList(server_track, result, servers.size(), &servers[0], NULL));
IGNORE_RETURN(replyDestinationServerList(server_track, result, servers.size(), &servers[0], nullptr));
}
else
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_RESULT_FAILURE);
IGNORE_RETURN(replyDestinationServerList(server_track, result, servers.size(), NULL, NULL));
IGNORE_RETURN(replyDestinationServerList(server_track, result, servers.size(), nullptr, nullptr));
}
}
@@ -260,7 +260,7 @@ void CTSAPIClient::moveStart(unsigned int stationId, unsigned int track, const C
std::map<unsigned int, int>::iterator f = s_completedTransfers.find(track);
if(f != s_completedTransfers.end())
{
IGNORE_RETURN(replyMove(track, f->second, NULL, NULL));
IGNORE_RETURN(replyMove(track, f->second, nullptr, nullptr));
}
else
{
@@ -284,7 +284,7 @@ void CTSAPIClient::lostCentralServerConnection(const CentralServerConnection * c
{
if(i->second.m_sourceCentralServerConnection == centralServerConnection || i->second.m_destinationCentralServerConnection == centralServerConnection)
{
IGNORE_RETURN(replyMove(i->second.m_track, result, NULL, NULL));
IGNORE_RETURN(replyMove(i->second.m_track, result, nullptr, nullptr));
s_activeTransfers.erase(i++);
}
else
@@ -14,7 +14,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -150,10 +150,10 @@ namespace TransferServerNamespace
if(s_apiClient)
{
const std::string resultString = resultToString(resultCode);
LOG("CustomerService", ("CharacterTransfer: transactionId=%u replyMove(%u, %s, NULL, NULL)", reply.getTransactionId(), reply.getTrack(), resultString.c_str()));
LOG("CustomerService", ("CharacterTransfer: transactionId=%u replyMove(%u, %s, nullptr, nullptr)", reply.getTransactionId(), reply.getTrack(), resultString.c_str()));
const unsigned int result = static_cast<unsigned int>(resultCode);
s_apiClient->moveComplete(reply.getSourceStationId(), reply.getTrack(), result);
IGNORE_RETURN(s_apiClient->replyMove(reply.getTrack(), result, Unicode::narrowToWide(resultString).c_str(), NULL));
IGNORE_RETURN(s_apiClient->replyMove(reply.getTrack(), result, Unicode::narrowToWide(resultString).c_str(), nullptr));
}
}
@@ -282,7 +282,7 @@ void TransferServer::requestCharacterList(unsigned int track, unsigned int stati
{
const unsigned int result = static_cast<int>(CTService::CT_RESULT_FAILURE);
IGNORE_RETURN(s_apiClient->replyCharacterList(track, result, 0, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyCharacterList(track, result, 0, nullptr, nullptr));
s_apiClient->moveComplete(stationId, track, result);
}
}
@@ -410,7 +410,7 @@ void TransferServer::requestTransferAccount(unsigned int track, unsigned int sou
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, NULL, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, nullptr, nullptr, nullptr));
s_apiClient->moveComplete(sourceStationId, track, result);
}
@@ -430,7 +430,7 @@ void TransferServer::requestTransferAccount(unsigned int track, unsigned int sou
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_SERVER_IS_DOWN);
IGNORE_RETURN(s_apiClient->replyTransferAccount(track, result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(track, result, nullptr, nullptr));
s_apiClient->moveComplete(sourceStationId, track, result);
}
@@ -442,12 +442,12 @@ void TransferServer::requestTransferAccount(unsigned int track, unsigned int sou
if(destinationStationId == 0 || sourceStationId == 0)
{
LOG("CustomerService", ("CharacterTransfer: Account move request made with a null destination station id: or source station id: %lu\n", sourceStationId));
LOG("CustomerService", ("CharacterTransfer: Account move request made with a nullptr destination station id: or source station id: %lu\n", sourceStationId));
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
IGNORE_RETURN(s_apiClient->replyTransferAccount(track, result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(track, result, nullptr, nullptr));
s_apiClient->moveComplete(sourceStationId, track, result);
}
@@ -488,7 +488,7 @@ void TransferServer::requestMoveValidation(unsigned int track, unsigned int sour
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, NULL, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, nullptr, nullptr, nullptr));
s_apiClient->moveComplete(sourceStationId, track, result);
}
}
@@ -516,7 +516,7 @@ void TransferServer::requestMoveValidation(unsigned int track, unsigned int sour
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_SERVER_IS_DOWN);
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, NULL, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyValidateMove(track, result, nullptr, nullptr, nullptr));
s_apiClient->moveComplete(sourceStationId, track, result);
}
}
@@ -651,8 +651,8 @@ void TransferServer::replyCharacterList(const TransferReplyCharacterList & reply
result = static_cast<unsigned int>(CTService::CT_RESULT_FAILURE);
s_apiClient->moveComplete(reply.getStationId(), reply.getTrack(), result);
}
LOG("CTSAPI", ("invoking CTServiceAPI::replyCharacterList(%d, %d, %d, characters, NULL)", reply.getTrack(), result, chars.size()));
IGNORE_RETURN(s_apiClient->replyCharacterList(reply.getTrack(), result, reply.getAvatarList().size(), characters, NULL));
LOG("CTSAPI", ("invoking CTServiceAPI::replyCharacterList(%d, %d, %d, characters, nullptr)", reply.getTrack(), result, chars.size()));
IGNORE_RETURN(s_apiClient->replyCharacterList(reply.getTrack(), result, reply.getAvatarList().size(), characters, nullptr));
}
// else use another interface if available
}
@@ -675,7 +675,7 @@ void TransferServer::replyValidateMove(const TransferCharacterData & reply)
{
LOG("CustomerService", ("CharacterTransfer: replyValidateMove passed name validation for %s", reply.toString().c_str()));
}
IGNORE_RETURN(s_apiClient->replyValidateMove(reply.getTrack(), result, NULL, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyValidateMove(reply.getTrack(), result, nullptr, nullptr, nullptr));
s_apiClient->moveComplete(reply.getSourceStationId(), reply.getTrack(), result);
}
}
@@ -736,7 +736,7 @@ void TransferServer::replyTransferAccountSuccess(const TransferAccountData & rep
LOG("CustomerService", ("CharacterTransfer: Could not transfer chat avatars for character %s on cluster %s from %lu to %lu: central connection does not exist in transferserver", i->second.c_str(), i->first.c_str(), reply.getSourceStationId(), reply.getDestinationStationId()));
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
s_apiClient->moveComplete(reply.getSourceStationId(), reply.getTrack(), result);
IGNORE_RETURN(s_apiClient->replyTransferAccount(reply.getTrack(), result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(reply.getTrack(), result, nullptr, nullptr));
}
}
}
@@ -748,7 +748,7 @@ void TransferServer::replyTransferAccountSuccess(const TransferAccountData & rep
if(s_apiClient)
{
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_SUCCESS);
IGNORE_RETURN(s_apiClient->replyTransferAccount(reply.getTrack(), result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(reply.getTrack(), result, nullptr, nullptr));
s_apiClient->moveComplete(reply.getSourceStationId(), reply.getTrack(), result);
}
}
@@ -808,7 +808,7 @@ void TransferServer::failedToTransferAccountNoCentralConnection(const TransferAc
LOG("CustomerService", ("CharacterTransfer: Transfer failed: Could not connect to central server to update game database. Sending HARD ERROR to CTS API. %s", failed.toString().c_str()));
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
s_apiClient->moveComplete(failed.getSourceStationId(), failed.getTrack(), result);
IGNORE_RETURN(s_apiClient->replyTransferAccount(failed.getTrack(), result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(failed.getTrack(), result, nullptr, nullptr));
}
}
@@ -821,7 +821,7 @@ void TransferServer::failedToTransferAccountDestinationNotEmpty (const TransferA
LOG("CustomerService", ("CharacterTransfer: Transfer failed: Destination stationId has avatars. Sending HARD ERROR to CTS API. %s", failed.toString().c_str()));
const unsigned int result = static_cast<unsigned int>(CTService::CT_GAMERESULT_HARDERROR);
s_apiClient->moveComplete(failed.getSourceStationId(), failed.getTrack(), result);
IGNORE_RETURN(s_apiClient->replyTransferAccount(failed.getTrack(), result, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyTransferAccount(failed.getTrack(), result, nullptr, nullptr));
}
}
@@ -860,7 +860,7 @@ void TransferServer::failedToValidateTransfer(const TransferReplyMoveValidation
{
const unsigned int result = ((reply.getResult() == TransferReplyMoveValidation::TRMVR_cannot_create_regular_character) ? static_cast<unsigned int>(CTService::CT_GAMERESULT_MAX_CHAR_ON_DEST_SERVER) : static_cast<unsigned int>(CTService::CT_GAMERESULT_SERVER_IS_DOWN));
IGNORE_RETURN(s_apiClient->replyValidateMove(reply.getTrack(), result, NULL, NULL, NULL));
IGNORE_RETURN(s_apiClient->replyValidateMove(reply.getTrack(), result, nullptr, nullptr, nullptr));
s_apiClient->moveComplete(reply.getSourceStationId(), reply.getTrack(), result);
// close pseudoclientconnections
@@ -14,7 +14,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -30,7 +30,7 @@
//-----------------------------------------------------------------------
DataLookup *DataLookup::ms_theInstance = NULL;
DataLookup *DataLookup::ms_theInstance = nullptr;
//-----------------------------------------------------------------------
@@ -524,7 +524,7 @@ void DataLookup::deleteReservationList(uint32 stationId)
reservationList * rl = rlIter->second;
if (!rl)
{
WARNING_STRICT_FATAL(true, ("Reservation list for stationID %lu is NULL", stationId));
WARNING_STRICT_FATAL(true, ("Reservation list for stationID %lu is nullptr", stationId));
return;
}
reservationList::iterator i;
@@ -46,7 +46,7 @@
// ----------------------------------------------------------------------
DatabaseProcess *DatabaseProcess::ms_theInstance = NULL;
DatabaseProcess *DatabaseProcess::ms_theInstance = nullptr;
// ----------------------------------------------------------------------
@@ -627,7 +627,7 @@ void DatabaseProcess::sendToCommoditiesServer(GameNetworkMessage const &message,
commoditiesConnection->send(message,reliable);
}
else
DEBUG_REPORT_LOG(true, ("commoditiesConnection is NULL\n"));
DEBUG_REPORT_LOG(true, ("commoditiesConnection is nullptr\n"));
}
// ----------------------------------------------------------------------
@@ -23,7 +23,7 @@ ImmediateDeleteCustomPersistStep::ImmediateDeleteCustomPersistStep() :
ImmediateDeleteCustomPersistStep::~ImmediateDeleteCustomPersistStep()
{
delete m_objects;
m_objects = NULL;
m_objects = nullptr;
}
// ----------------------------------------------------------------------
@@ -27,7 +27,7 @@
// ======================================================================
LazyDeleter * LazyDeleter::ms_instance=NULL;
LazyDeleter * LazyDeleter::ms_instance=nullptr;
// ======================================================================
@@ -80,13 +80,13 @@ void LazyDeleter::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
LazyDeleter::LazyDeleter() :
m_workerThread(NULL), // Avoid starting the worker thread until the other member variables are initialized
m_workerThread(nullptr), // Avoid starting the worker thread until the other member variables are initialized
m_incomingObjects(new std::vector<NetworkId>),
m_objectsToDelete(new std::deque<NetworkId>),
m_objectListLock(new Mutex),
@@ -113,11 +113,11 @@ LazyDeleter::~LazyDeleter()
delete m_objectsToDelete;
delete m_objectListLock;
m_workerThread = NULL;
m_incomingObjects = NULL;
m_objectsToDelete = NULL;
m_objectListLock = NULL;
m_session = NULL;
m_workerThread = nullptr;
m_incomingObjects = nullptr;
m_objectsToDelete = nullptr;
m_objectListLock = nullptr;
m_session = nullptr;
}
// ----------------------------------------------------------------------
@@ -55,7 +55,7 @@
// ======================================================================
Loader *Loader::ms_instance = NULL;
Loader *Loader::ms_instance = nullptr;
// ======================================================================
@@ -72,7 +72,7 @@ void Loader::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
@@ -442,7 +442,7 @@ void Loader::receiveMessage(const MessageDispatch::Emitter & source, const Messa
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ValidateCharacterForLoginMessage msg(ri);
verifyCharacter(msg.getSuid(), msg.getCharacterId(), NULL);
verifyCharacter(msg.getSuid(), msg.getCharacterId(), nullptr);
}
else if(message.isType("TransferGetLoginLocationData"))
{
@@ -647,7 +647,7 @@ void Loader::checkVersionNumber(int expectedVersion, bool fatalOnMismatch)
void Loader::requestChunk(uint32 processId,int nodeX, int nodeZ, const std::string &sceneId)
{
ObjectLocator * const regularLocator=new ChunkLocator(nodeX, nodeZ, sceneId, processId, true);
ObjectLocator * goldLocator=NULL;
ObjectLocator * goldLocator=nullptr;
if (ConfigServerDatabase::getEnableGoldDatabase())
goldLocator = new ChunkLocator(nodeX, nodeZ, sceneId, processId, false);
addLocatorsForServer(processId, regularLocator, goldLocator);
@@ -671,7 +671,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
i=m_multipleLoginLock.find(characterId);
if (i==m_multipleLoginLock.end())
{
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), NULL);
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), nullptr);
DEBUG_REPORT_LOG(true,("Adding multipleLoginLock for %s\n",characterId.getValueString().c_str()));
m_multipleLoginLock[characterId] = gameServerId;
@@ -684,7 +684,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
}
}
else
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), NULL);
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), nullptr);
}
// ----------------------------------------------------------------------
@@ -692,7 +692,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
void Loader::loadContainedObject(const NetworkId &containerId, const NetworkId &objectId, uint32 gameServerId)
{
LOG("AuctionRetrieval", ("Loader::received loadContainedObject for loading object %s for retrieval", objectId.getValueString().c_str()));
addLocatorsForServer(gameServerId, new ContainedObjectLocator(containerId,objectId), NULL);
addLocatorsForServer(gameServerId, new ContainedObjectLocator(containerId,objectId), nullptr);
}
@@ -700,7 +700,7 @@ void Loader::loadContainedObject(const NetworkId &containerId, const NetworkId &
void Loader::loadContents(const NetworkId &containerId, uint32 gameServerId)
{
addLocatorsForServer(gameServerId, new ContentsLocator(containerId), NULL);
addLocatorsForServer(gameServerId, new ContentsLocator(containerId), nullptr);
}
// ----------------------------------------------------------------------
@@ -820,7 +820,7 @@ void Loader::removeLoadLock(const NetworkId &characterId)
if (i->second!=0)
{
DEBUG_REPORT_LOG(true,("Now handling delayed login request for character %s\n",characterId.getValueString().c_str()));
addLocatorsForServer(i->second, new CharacterLocator(characterId), NULL);
addLocatorsForServer(i->second, new CharacterLocator(characterId), nullptr);
}
m_loadLock.erase(i);
@@ -16,7 +16,7 @@
// ======================================================================
MessageToManager *MessageToManager::ms_instance=NULL;
MessageToManager *MessageToManager::ms_instance=nullptr;
// ======================================================================
@@ -34,7 +34,7 @@ void MessageToManager::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
@@ -51,7 +51,7 @@ MessageToManager::~MessageToManager()
for (MessagesByObjectType::iterator i=m_messagesByObject.begin(); i!=m_messagesByObject.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -71,7 +71,7 @@ void MessageToManager::handleMessageTo(const MessageToPayload &data)
{
DEBUG_WARNING(true,("Received message %s twice.",data.getMessageId().getValueString().c_str()));
delete i->second;
i->second = NULL;
i->second = nullptr;
}
m_messagesByObject[theKey]=new MessageToPayload(data);
@@ -127,7 +127,7 @@ void MessageToManager::removeMessage(const MessageToId &messageId)
if (j!=m_messagesByObject.end())
{
delete j->second;
j->second=NULL;
j->second=nullptr;
m_messagesByObject.erase(j);
}
m_messageToObjectMap.erase(i);
@@ -70,7 +70,7 @@
// ======================================================================
Persister *Persister::ms_instance=NULL;
Persister *Persister::ms_instance=nullptr;
// ======================================================================
@@ -88,7 +88,7 @@ void Persister::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
//-----------------------------------------------------------------------
@@ -108,9 +108,9 @@ Persister::Persister() :
m_charactersToDeleteThisSaveCycle(new CharactersToDeleteType),
m_charactersToDeleteNextSaveCycle(new CharactersToDeleteType),
m_timeSinceLastSave(0),
m_messageSnapshot(NULL),
m_commoditiesSnapshot(NULL),
m_arbitraryGameDataSnapshot(NULL),
m_messageSnapshot(nullptr),
m_commoditiesSnapshot(nullptr),
m_arbitraryGameDataSnapshot(nullptr),
m_saveStartTime(0),
m_totalSaveTime(0),
m_maxSaveTime(0),
@@ -181,15 +181,15 @@ Persister::~Persister()
m_currentSnapshots.clear();
m_newObjectSnapshots.clear();
m_objectSnapshotMap.clear();
m_messageSnapshot = NULL;
m_commoditiesSnapshot = NULL;
m_arbitraryGameDataSnapshot = NULL;
m_messageSnapshot = nullptr;
m_commoditiesSnapshot = nullptr;
m_arbitraryGameDataSnapshot = nullptr;
delete m_charactersToDeleteThisSaveCycle;
m_charactersToDeleteThisSaveCycle = NULL;
m_charactersToDeleteThisSaveCycle = nullptr;
delete m_charactersToDeleteNextSaveCycle;
m_charactersToDeleteNextSaveCycle = NULL;
m_charactersToDeleteNextSaveCycle = nullptr;
}
// ----------------------------------------------------------------------
@@ -283,7 +283,7 @@ void Persister::onFrameBarrierReached()
/**
* Moves the current & new object snapshots onto the queue to be saved.
*
* Does nothing if these snapshots are null.
* Does nothing if these snapshots are nullptr.
*/
void Persister::startSave(void)
@@ -351,9 +351,9 @@ void Persister::startSave(void)
m_currentSnapshots.clear();
m_newObjectSnapshots.clear();
m_objectSnapshotMap.clear();
m_messageSnapshot = NULL;
m_commoditiesSnapshot = NULL;
m_arbitraryGameDataSnapshot = NULL;
m_messageSnapshot = nullptr;
m_commoditiesSnapshot = nullptr;
m_arbitraryGameDataSnapshot = nullptr;
// prepare the list of characters to delete during the next save cycle
if (m_charactersToDeleteNextSaveCycle && m_charactersToDeleteThisSaveCycle)
@@ -515,7 +515,7 @@ void Persister::newObject(uint32 serverId, const NetworkId &objectId, int templa
return;
}
Snapshot *snap=NULL;
Snapshot *snap=nullptr;
PendingCharactersType::iterator chardata=m_pendingCharacters.find(objectId);
if (chardata!=m_pendingCharacters.end())
@@ -543,7 +543,7 @@ void Persister::newObject(uint32 serverId, const NetworkId &objectId, int templa
else
{
// Add the object to the appropriate snapshot
snap=NULL;
snap=nullptr;
{
ObjectSnapshotMap::const_iterator j=m_objectSnapshotMap.find(container);
if (j!=m_objectSnapshotMap.end() && j->second->getMode() == DB::ModeQuery::mode_INSERT)
@@ -728,7 +728,7 @@ void Persister::receiveMessage(const MessageDispatch::Emitter & source, const Me
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
RenameCharacterMessageEx msg(ri);
renameCharacter(sourceGameServer, static_cast<int8>(msg.getRenameCharacterMessageSource()), msg.getStationId(), msg.getCharacterId(), msg.getNewName(), msg.getOldName(), msg.getLastNameChangeOnly(), msg.getRequestedBy(), NULL);
renameCharacter(sourceGameServer, static_cast<int8>(msg.getRenameCharacterMessageSource()), msg.getStationId(), msg.getCharacterId(), msg.getNewName(), msg.getOldName(), msg.getLastNameChangeOnly(), msg.getRequestedBy(), nullptr);
}
else if (message.isType("UnloadedPlayerMessage"))
{
@@ -19,7 +19,7 @@
TaskGetBiography::TaskGetBiography(const NetworkId &owner, uint32 requestingProcess) :
m_owner(owner),
m_requestingProcess(requestingProcess),
m_bio(NULL)
m_bio(nullptr)
{
}
@@ -28,7 +28,7 @@ TaskGetBiography::TaskGetBiography(const NetworkId &owner, uint32 requestingProc
TaskGetBiography::~TaskGetBiography()
{
delete m_bio;
m_bio=NULL;
m_bio=nullptr;
}
// ----------------------------------------------------------------------
@@ -53,7 +53,7 @@ bool TaskGetBiography::process(DB::Session *session)
void TaskGetBiography::onComplete()
{
WARNING_STRICT_FATAL(!m_bio,("In TaskGetBiography::onComplete, but m_bio is NULL\n"));
WARNING_STRICT_FATAL(!m_bio,("In TaskGetBiography::onComplete, but m_bio is nullptr\n"));
if (m_bio)
{
BiographyMessage msg(m_owner, *m_bio);
@@ -24,7 +24,7 @@ TaskSetBiography::TaskSetBiography(const NetworkId &owner, const Unicode::String
TaskSetBiography::~TaskSetBiography()
{
delete m_bio;
m_bio=NULL;
m_bio=nullptr;
}
// ----------------------------------------------------------------------
@@ -106,7 +106,7 @@ bool AggroListPropertyNamespace::isIncapacitated(TangibleObject const & target)
{
CreatureObject const * const targetCreatureObject = target.asCreatureObject();
return (targetCreatureObject != NULL) ? targetCreatureObject->isIncapacitated() : false;
return (targetCreatureObject != nullptr) ? targetCreatureObject->isIncapacitated() : false;
}
// ----------------------------------------------------------------------
@@ -114,7 +114,7 @@ bool AggroListPropertyNamespace::isDead(TangibleObject const & target)
{
CreatureObject const * const targetCreatureObject = target.asCreatureObject();
return (targetCreatureObject != NULL) ? targetCreatureObject->isDead() : false;
return (targetCreatureObject != nullptr) ? targetCreatureObject->isDead() : false;
}
// ----------------------------------------------------------------------
@@ -122,7 +122,7 @@ bool AggroListPropertyNamespace::isInvulnerable(TangibleObject const & target)
{
CreatureObject const * const targetCreatureObject = target.asCreatureObject();
return (targetCreatureObject != NULL) ? targetCreatureObject->isInvulnerable() : false;
return (targetCreatureObject != nullptr) ? targetCreatureObject->isInvulnerable() : false;
}
// ----------------------------------------------------------------------
@@ -138,7 +138,7 @@ bool AggroListPropertyNamespace::isFeigningDeath(TangibleObject const & target)
{
CreatureObject const * const targetCreatureObject = target.asCreatureObject();
return (targetCreatureObject != NULL) ? targetCreatureObject->getState(States::FeignDeath) : false;
return (targetCreatureObject != nullptr) ? targetCreatureObject->getState(States::FeignDeath) : false;
}
// ----------------------------------------------------------------------
@@ -146,7 +146,7 @@ bool AggroListPropertyNamespace::isInPlayerBuilding(TangibleObject const & targe
{
ServerObject const * const topMostServerObject = ServerObject::asServerObject(ContainerInterface::getTopmostContainer(target));
return (topMostServerObject != NULL) ? (topMostServerObject->getGameObjectType() == SharedObjectTemplate::GOT_building_player) : false;
return (topMostServerObject != nullptr) ? (topMostServerObject->getGameObjectType() == SharedObjectTemplate::GOT_building_player) : false;
}
// ----------------------------------------------------------------------
@@ -154,7 +154,7 @@ bool AggroListPropertyNamespace::isAggroImmune(TangibleObject const & target)
{
PlayerObject const * const playerObject = PlayerCreatureController::getPlayerObject(target.asCreatureObject());
return (playerObject != NULL) ? playerObject->isAggroImmune() : false;
return (playerObject != nullptr) ? playerObject->isAggroImmune() : false;
}
// ======================================================================
@@ -212,7 +212,7 @@ void AggroListProperty::alter()
// First, list things that invalidate this target in the aggro list
// Second, list the things that promote the target to the hate list
if (target.getObject() == NULL)
if (target.getObject() == nullptr)
{
purgeList.push_back(iterTargetList);
}
@@ -315,7 +315,7 @@ TangibleObject & AggroListProperty::getTangibleOwner()
AggroListProperty * AggroListProperty::getAggroListProperty(Object & object)
{
Property * const property = object.getProperty(getClassPropertyId());
AggroListProperty * const aggroProperty = (property != NULL) ? static_cast<AggroListProperty *>(property) : NULL;
AggroListProperty * const aggroProperty = (property != nullptr) ? static_cast<AggroListProperty *>(property) : nullptr;
return aggroProperty;
}
@@ -45,7 +45,7 @@ void AiCombatPulseQueue::remove()
void AiCombatPulseQueue::schedule(TangibleObject * const object, int waitTimeMs, unsigned long currentFrameTimeMs)
{
if (object == NULL)
if (object == nullptr)
return;
unsigned long desiredTime = Clock::getFrameStartTimeMs() + currentFrameTimeMs + waitTimeMs;
@@ -97,7 +97,7 @@ void AiCombatPulseQueue::alter(real time)
TangibleObject * const object = (j->second)->first;
if (object != NULL && object->isInCombat())
if (object != nullptr && object->isInCombat())
{
NetworkId const & id = object->getNetworkId();
@@ -107,7 +107,7 @@ void AiCombatPulseQueue::alter(real time)
GameScriptObject * const gameScriptObject = GameScriptObject::asGameScriptObject(object);
if (gameScriptObject != NULL)
if (gameScriptObject != nullptr)
{
ScriptParams scriptParams;
IGNORE_RETURN(gameScriptObject->trigAllScripts(Scripting::TRIG_AI_COMBAT_FRAME, scriptParams));
@@ -136,9 +136,9 @@ void AiCreatureCombatProfileNamespace::loadCombatProfileTable(DataTable const &
for (int i = 0; i < serverObjectCount; ++i)
{
ServerObject * const serverObject = ServerWorld::getObject(i);
CreatureObject * const creatureObject = (serverObject != NULL) ? serverObject->asCreatureObject() : NULL;
CreatureObject * const creatureObject = (serverObject != nullptr) ? serverObject->asCreatureObject() : nullptr;
if ( (creatureObject != NULL)
if ( (creatureObject != nullptr)
&& !creatureObject->isPlayerControlled())
{
creatureObject->makeDead(NetworkId::cms_invalid, NetworkId::cms_invalid);
@@ -228,7 +228,7 @@ void AiCreatureCombatProfileNamespace::grantActions(CreatureObject & owner, AiCr
// ----------------------------------------------------------------------
AiCreatureCombatProfile::AiCreatureCombatProfile()
: m_profileId(NULL)
: m_profileId(nullptr)
, m_singleUseActionList()
, m_delayRepeatActionList()
, m_instantRepeatActionList()
@@ -247,7 +247,7 @@ void AiCreatureCombatProfile::install()
bool const openIfNotFound = true;
DataTable * const dataTable = DataTableManager::getTable(s_combatProfileTable, openIfNotFound);
if (dataTable != NULL)
if (dataTable != nullptr)
{
#ifdef _DEBUG
DataTableManager::addReloadCallback(s_combatProfileTable, &loadCombatProfileTable);
@@ -267,7 +267,7 @@ void AiCreatureCombatProfile::install()
// ----------------------------------------------------------------------
AiCreatureCombatProfile const * AiCreatureCombatProfile::getCombatProfile(CrcString const & profileName)
{
AiCreatureCombatProfile const * result = NULL;
AiCreatureCombatProfile const * result = nullptr;
CombatProfileMap::const_iterator iterCombatProfileMap = s_combatProfileMap.find(PersistentCrcString(profileName));
if (iterCombatProfileMap != s_combatProfileMap.end())
@@ -46,7 +46,7 @@ namespace AiCreatureDataNamespace
CreatureDataMap s_creatureDataMap;
WeaponDataMap s_weaponDataMap;
AiCreatureData const * s_defaultCreatureData = NULL;
AiCreatureData const * s_defaultCreatureData = nullptr;
int s_creatureErrorCount = 0;
int s_weaponErrorCount = 0;
@@ -154,7 +154,7 @@ void AiCreatureDataNamespace::verifySecondaryWeapon(CrcString const & creatureNa
void AiCreatureDataNamespace::verifyPrimarySpecials(CrcString const & creatureName, CrcString & primarySpecials)
{
if ( !primarySpecials.isEmpty()
&& (AiCreatureCombatProfile::getCombatProfile(primarySpecials) == NULL))
&& (AiCreatureCombatProfile::getCombatProfile(primarySpecials) == nullptr))
{
++s_creatureErrorCount;
WARNING(true, ("AiCreatureData::verifyPrimarySpecials() Creature(%s) has invalid primary_weapon_specials(%s)", creatureName.getString(), primarySpecials.getString()));
@@ -165,7 +165,7 @@ void AiCreatureDataNamespace::verifyPrimarySpecials(CrcString const & creatureNa
void AiCreatureDataNamespace::verifySecondarySpecials(CrcString const & creatureName, CrcString & secondarySpecials)
{
if ( !secondarySpecials.isEmpty()
&& (AiCreatureCombatProfile::getCombatProfile(secondarySpecials) == NULL))
&& (AiCreatureCombatProfile::getCombatProfile(secondarySpecials) == nullptr))
{
++s_creatureErrorCount;
WARNING(true, ("AiCreatureData::verifySecondarySpecials() Creature(%s) has invalid secondary_weapon_specials(%s)", creatureName.getString(), secondarySpecials.getString()));
@@ -320,7 +320,7 @@ void AiCreatureDataNamespace::loadWeaponColumn(WeaponList & weaponList, std::str
// ----------------------------------------------------------------------
AiCreatureData::AiCreatureData()
: m_name(NULL)
: m_name(nullptr)
, m_movementSpeedPercent(1.0f)
, m_primaryWeapon()
, m_secondaryWeapon()
@@ -348,7 +348,7 @@ void AiCreatureData::install()
bool const openIfNotFound = true;
DataTable * const dataTable = DataTableManager::getTable(s_weaponDataTable, openIfNotFound);
if (dataTable != NULL)
if (dataTable != nullptr)
{
DataTableManager::addReloadCallback(s_weaponDataTable, &loadWeaponData);
loadWeaponData(*dataTable);
@@ -366,7 +366,7 @@ void AiCreatureData::install()
bool const openIfNotFound = true;
DataTable * const dataTable = DataTableManager::getTable(s_creaureDataTable, openIfNotFound);
if (dataTable != NULL)
if (dataTable != nullptr)
{
DataTableManager::addReloadCallback(s_creaureDataTable, &loadCreatureData);
loadCreatureData(*dataTable);
@@ -58,7 +58,7 @@ AiCreatureWeaponActions::AiCreatureWeaponActions()
: m_singleUseActionList()
, m_delayRepeatActionList()
, m_instantRepeatActionList()
, m_combatProfile(NULL)
, m_combatProfile(nullptr)
{
}
@@ -81,7 +81,7 @@ void AiCreatureWeaponActions::setCombatProfile(CreatureObject & owner, AiCreatur
// ----------------------------------------------------------------------
void AiCreatureWeaponActions::reset()
{
if (m_combatProfile != NULL)
if (m_combatProfile != nullptr)
{
resetActionTimers(m_singleUseActionList, m_combatProfile->m_singleUseActionList);
resetActionTimers(m_delayRepeatActionList, m_combatProfile->m_delayRepeatActionList);
@@ -92,9 +92,9 @@ void AiCreatureWeaponActions::reset()
// ----------------------------------------------------------------------
PersistentCrcString const & AiCreatureWeaponActions::getCombatAction()
{
// If the combat profile is NULL, then the AI has no special actions assigned
// If the combat profile is nullptr, then the AI has no special actions assigned
if (m_combatProfile != NULL)
if (m_combatProfile != nullptr)
{
time_t const osTime = Os::getRealSystemTime();
@@ -34,12 +34,12 @@ namespace Archive
get(source, target.m_objectId);
get(source, movementType);
AICreatureController * controller = NULL;
AICreatureController * controller = nullptr;
Object * object = NetworkIdManager::getObjectById(target.getObjectId());
if (object != NULL)
if (object != nullptr)
controller = dynamic_cast<AICreatureController *>(object->getController());
if (controller == NULL)
if (controller == nullptr)
{
WARNING(true, ("AiMovementMessage Archive::get, got message to object %s that doesn't have an AICreatureController", target.getObjectId().getValueString().c_str()));
target.m_movement = AiMovementBaseNullPtr;

Some files were not shown because too many files have changed in this diff Show More