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
@@ -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);