mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-05 06:16:47 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -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;
|
||||
|
||||
+8
-8
@@ -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;
|
||||
|
||||
+10
-10
@@ -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();
|
||||
|
||||
+5
-5
@@ -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;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
+32
-32
@@ -11,28 +11,28 @@ namespace NAMESPACE
|
||||
|
||||
//used when want to open new connection with this socket
|
||||
TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAlloc, TcpManager::TcpParams ¶ms, 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 ¶ms, 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)
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
+53
-53
@@ -41,14 +41,14 @@ TcpManager::TcpParams::TcpParams(const TcpParams &cpy)
|
||||
}
|
||||
|
||||
TcpManager::TcpManager(const TcpParams ¶ms)
|
||||
: 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;
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+19
-19
@@ -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:
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user