diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
| commit | d791afae1dfcfaf592326f787755ca32d629e4d3 (patch) | |
| tree | 54dc9916ede5800e110a2f0edff91530811fbdb8 /src/server/game/Server | |
| parent | b6820a706f46f18b9652fcd9806e4bec8805d29d (diff) | |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/server/game/Server')
| -rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 16 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSession.cpp | 106 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSocket.cpp | 80 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSocketMgr.cpp | 8 |
4 files changed, 105 insertions, 105 deletions
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7e70da65e95..586bd8e8298 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -69,19 +69,19 @@ bool OpcodeTable::ValidateClientOpcode(OpcodeClient opcode, char const* name) co { if (uint32(opcode) == NULL_OPCODE) { - TC_LOG_ERROR("network", "Opcode %s does not have a value", name); + TC_LOG_ERROR("network", "Opcode {} does not have a value", name); return false; } if (uint32(opcode) >= NUM_OPCODE_HANDLERS) { - TC_LOG_ERROR("network", "Tried to set handler for an invalid opcode %d", opcode); + TC_LOG_ERROR("network", "Tried to set handler for an invalid opcode {}", opcode); return false; } if (_internalTableClient[opcode] != nullptr) { - TC_LOG_ERROR("network", "Tried to override client handler of %s with %s (opcode %u)", _internalTableClient[opcode]->Name, name, opcode); + TC_LOG_ERROR("network", "Tried to override client handler of {} with {} (opcode {})", _internalTableClient[opcode]->Name, name, opcode); return false; } @@ -101,31 +101,31 @@ void OpcodeTable::ValidateAndSetServerOpcode(OpcodeServer opcode, char const* na { if (uint32(opcode) == NULL_OPCODE) { - TC_LOG_ERROR("network", "Opcode %s does not have a value", name); + TC_LOG_ERROR("network", "Opcode {} does not have a value", name); return; } if (uint32(opcode) >= NUM_OPCODE_HANDLERS) { - TC_LOG_ERROR("network", "Tried to set handler for an invalid opcode %d", opcode); + TC_LOG_ERROR("network", "Tried to set handler for an invalid opcode {}", opcode); return; } if (conIdx >= MAX_CONNECTION_TYPES) { - TC_LOG_ERROR("network", "Tried to set invalid connection type %u for opcode %s", conIdx, name); + TC_LOG_ERROR("network", "Tried to set invalid connection type {} for opcode {}", conIdx, name); return; } if (IsInstanceOnlyOpcode(opcode) && conIdx != CONNECTION_TYPE_INSTANCE) { - TC_LOG_ERROR("network", "Tried to set invalid connection type %u for instance only opcode %s", conIdx, name); + TC_LOG_ERROR("network", "Tried to set invalid connection type {} for instance only opcode {}", conIdx, name); return; } if (_internalTableServer[opcode] != nullptr) { - TC_LOG_ERROR("network", "Tried to override server handler of %s with %s (opcode %u)", opcodeTable[opcode]->Name, name, opcode); + TC_LOG_ERROR("network", "Tried to override server handler of {} with {} (opcode {})", opcodeTable[opcode]->Name, name, opcode); return; } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 6e8a2d46744..021f22abc10 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -150,7 +150,7 @@ WorldSession::WorldSession(uint32 id, std::string&& name, uint32 battlenetAccoun { m_Address = sock->GetRemoteIpAddress().to_string(); ResetTimeOutTime(false); - LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query + LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = {};", GetAccountId()); // One-time query } m_Socket[CONNECTION_TYPE_REALM] = sock; @@ -181,7 +181,7 @@ WorldSession::~WorldSession() while (_recvQueue.next(packet)) delete packet; - LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query + LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = {};", GetAccountId()); // One-time query } bool WorldSession::PlayerDisconnected() const @@ -215,12 +215,12 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ { if (packet->GetOpcode() == NULL_OPCODE) { - TC_LOG_ERROR("network.opcode", "Prevented sending of NULL_OPCODE to %s", GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending of NULL_OPCODE to {}", GetPlayerInfo()); return; } else if (packet->GetOpcode() == UNKNOWN_OPCODE) { - TC_LOG_ERROR("network.opcode", "Prevented sending of UNKNOWN_OPCODE to %s", GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending of UNKNOWN_OPCODE to {}", GetPlayerInfo()); return; } @@ -228,7 +228,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ if (!handler) { - TC_LOG_ERROR("network.opcode", "Prevented sending of opcode %u with non existing handler to %s", packet->GetOpcode(), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending of opcode {} with non existing handler to {}", packet->GetOpcode(), GetPlayerInfo()); return; } @@ -240,7 +240,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ { if (packet->GetConnection() != CONNECTION_TYPE_INSTANCE && IsInstanceOnlyOpcode(packet->GetOpcode())) { - TC_LOG_ERROR("network.opcode", "Prevented sending of instance only opcode %u with connection type %u to %s", packet->GetOpcode(), uint32(packet->GetConnection()), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending of instance only opcode {} with connection type {} to {}", packet->GetOpcode(), uint32(packet->GetConnection()), GetPlayerInfo()); return; } @@ -249,7 +249,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ if (!m_Socket[conIdx]) { - TC_LOG_ERROR("network.opcode", "Prevented sending of %s to non existent socket %u to %s", GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())).c_str(), uint32(conIdx), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending of {} to non existent socket {} to {}", GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())), uint32(conIdx), GetPlayerInfo()); return; } @@ -257,7 +257,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ { if (handler->Status == STATUS_UNHANDLED) { - TC_LOG_ERROR("network.opcode", "Prevented sending disabled opcode %s to %s", GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())).c_str(), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Prevented sending disabled opcode {} to {}", GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())), GetPlayerInfo()); return; } } @@ -287,8 +287,8 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ { uint64 minTime = uint64(cur_time - lastTime); uint64 fullTime = uint64(lastTime - firstTime); - TC_LOG_DEBUG("misc", "Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); - TC_LOG_DEBUG("misc", "Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); + TC_LOG_DEBUG("misc", "Send all time packets count: {} bytes: {} avr.count/sec: {} avr.bytes/sec: {} time: {}", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); + TC_LOG_DEBUG("misc", "Send last min packets count: {} bytes: {} avr.count/sec: {} avr.bytes/sec: {}", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); lastTime = cur_time; sendLastPacketCount = 1; @@ -298,7 +298,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ sScriptMgr->OnPacketSend(this, *packet); - TC_LOG_TRACE("network.opcode", "S->C: %s %s", GetPlayerInfo().c_str(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())).c_str()); + TC_LOG_TRACE("network.opcode", "S->C: {} {}", GetPlayerInfo(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode()))); m_Socket[conIdx]->SendPacket(*packet); } @@ -311,8 +311,8 @@ void WorldSession::QueuePacket(WorldPacket* new_packet) /// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, char const* status, const char *reason) { - TC_LOG_ERROR("network.opcode", "Received unexpected opcode %s Status: %s Reason: %s from %s", - GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), status, reason, GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Received unexpected opcode {} Status: {} Reason: {} from {}", + GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), status, reason, GetPlayerInfo()); } /// Logging helper for unexpected opcodes @@ -321,8 +321,8 @@ void WorldSession::LogUnprocessedTail(WorldPacket const* packet) if (!sLog->ShouldLog("network.opcode", LOG_LEVEL_TRACE) || packet->rpos() >= packet->wpos()) return; - TC_LOG_TRACE("network.opcode", "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s", - uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), GetPlayerInfo().c_str()); + TC_LOG_TRACE("network.opcode", "Unprocessed tail data (read stop at {} from {}) Opcode {} from {}", + uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), GetPlayerInfo()); packet->print_storage(); } @@ -366,8 +366,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { requeuePackets.push_back(packet); deletePacket = false; - TC_LOG_DEBUG("network", "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. " - "Player is currently not in world yet.", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str()); + TC_LOG_DEBUG("network", "Re-enqueueing packet with opcode {} with with status STATUS_LOGGEDIN. " + "Player is currently not in world yet.", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode()))); } } else if (_player->IsInWorld()) @@ -430,40 +430,40 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) processedPackets = MAX_PROCESSED_PACKETS_IN_SAME_WORLDSESSION_UPDATE; // break out of packet processing loop break; case STATUS_NEVER: - TC_LOG_ERROR("network.opcode", "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str() - , GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Received not allowed opcode {} from {}", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())) + , GetPlayerInfo()); break; case STATUS_UNHANDLED: - TC_LOG_ERROR("network.opcode", "Received not handled opcode %s from %s", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str() - , GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Received not handled opcode {} from {}", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())) + , GetPlayerInfo()); break; } } catch (WorldPackets::InvalidHyperlinkException const& ihe) { - TC_LOG_ERROR("network", "%s sent %s with an invalid link:\n%s", GetPlayerInfo().c_str(), - GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), ihe.GetInvalidValue().c_str()); + TC_LOG_ERROR("network", "{} sent {} with an invalid link:\n{}", GetPlayerInfo(), + GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), ihe.GetInvalidValue()); if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer("WorldSession::Update Invalid chat link"); } catch (WorldPackets::IllegalHyperlinkException const& ihe) { - TC_LOG_ERROR("network", "%s sent %s which illegally contained a hyperlink:\n%s", GetPlayerInfo().c_str(), - GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), ihe.GetInvalidValue().c_str()); + TC_LOG_ERROR("network", "{} sent {} which illegally contained a hyperlink:\n{}", GetPlayerInfo(), + GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), ihe.GetInvalidValue()); if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer("WorldSession::Update Illegal chat link"); } catch (WorldPackets::PacketArrayMaxCapacityException const& pamce) { - TC_LOG_ERROR("network", "PacketArrayMaxCapacityException: %s while parsing %s from %s.", - pamce.what(), GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network", "PacketArrayMaxCapacityException: {} while parsing {} from {}.", + pamce.what(), GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), GetPlayerInfo()); } catch (ByteBufferException const&) { - TC_LOG_ERROR("network", "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", - packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); + TC_LOG_ERROR("network", "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: {}) from client {}, accountid={}. Skipped packet.", + packet->GetOpcode(), GetRemoteAddress(), GetAccountId()); packet->hexlike(); } @@ -659,8 +659,8 @@ void WorldSession::LogoutPlayer(bool save) // calls to GetMap in this case may cause crashes _player->SetDestroyedObject(true); _player->CleanupsBeforeDelete(); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Logout Character:[%s] %s Level: %d, XP: %u/%u (%u left)", - GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->GetLevel(), + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Logout Character:[{}] {} Level: {}, XP: {}/{} ({} left)", + GetAccountId(), GetRemoteAddress(), _player->GetName(), _player->GetGUID().ToString(), _player->GetLevel(), _player->GetXP(), _player->GetXPForNextLevel(), std::max(0, (int32)_player->GetXPForNextLevel() - (int32)_player->GetXP())); if (Map* _map = _player->FindMap()) @@ -694,8 +694,8 @@ void WorldSession::LogoutPlayer(bool save) /// Kick a player out of the World void WorldSession::KickPlayer(std::string const& reason) { - TC_LOG_INFO("network.kick", "Account: %u Character: '%s' %s kicked with reason: %s", GetAccountId(), _player ? _player->GetName().c_str() : "<none>", - _player ? _player->GetGUID().ToString().c_str() : "", reason.c_str()); + TC_LOG_INFO("network.kick", "Account: {} Character: '{}' {} kicked with reason: {}", GetAccountId(), _player ? _player->GetName() : "<none>", + _player ? _player->GetGUID().ToString() : "", reason); for (uint8 i = 0; i < 2; ++i) { @@ -712,8 +712,8 @@ bool WorldSession::ValidateHyperlinksAndMaybeKick(std::string const& str) if (Trinity::Hyperlinks::CheckAllLinks(str)) return true; - TC_LOG_ERROR("network", "Player %s%s sent a message with an invalid link:\n%s", GetPlayer()->GetName().c_str(), - GetPlayer()->GetGUID().ToString().c_str(), str.c_str()); + TC_LOG_ERROR("network", "Player {}{} sent a message with an invalid link:\n{}", GetPlayer()->GetName(), + GetPlayer()->GetGUID().ToString(), str); if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer("WorldSession::ValidateHyperlinksAndMaybeKick Invalid chat link"); @@ -726,8 +726,8 @@ bool WorldSession::DisallowHyperlinksAndMaybeKick(std::string const& str) if (str.find('|') == std::string::npos) return true; - TC_LOG_ERROR("network", "Player %s %s sent a message which illegally contained a hyperlink:\n%s", GetPlayer()->GetName().c_str(), - GetPlayer()->GetGUID().ToString().c_str(), str.c_str()); + TC_LOG_ERROR("network", "Player {} {} sent a message which illegally contained a hyperlink:\n{}", GetPlayer()->GetName(), + GetPlayer()->GetGUID().ToString(), str); if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer("WorldSession::DisallowHyperlinksAndMaybeKick Illegal chat link"); @@ -791,13 +791,13 @@ bool WorldSession::IsConnectionIdle() const void WorldSession::Handle_NULL(WorldPackets::Null& null) { - TC_LOG_ERROR("network.opcode", "Received unhandled opcode %s from %s", GetOpcodeNameForLogging(null.GetOpcode()).c_str(), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Received unhandled opcode {} from {}", GetOpcodeNameForLogging(null.GetOpcode()), GetPlayerInfo()); } void WorldSession::Handle_EarlyProccess(WorldPackets::Null& null) { - TC_LOG_ERROR("network.opcode", "Received opcode %s that must be processed in WorldSocket::ReadDataHandler from %s" - , GetOpcodeNameForLogging(null.GetOpcode()).c_str(), GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "Received opcode {} that must be processed in WorldSocket::ReadDataHandler from {}" + , GetOpcodeNameForLogging(null.GetOpcode()), GetPlayerInfo()); } void WorldSession::SendConnectToInstance(WorldPackets::Auth::ConnectToSerial serial) @@ -843,14 +843,14 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask) uint32 type = fields[0].GetUInt8(); if (type >= NUM_ACCOUNT_DATA_TYPES) { - TC_LOG_ERROR("misc", "Table `%s` have invalid account data type (%u), ignore.", + TC_LOG_ERROR("misc", "Table `{}` have invalid account data type ({}), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type); continue; } if ((mask & (1 << type)) == 0) { - TC_LOG_ERROR("misc", "Table `%s` have non appropriate for table account data type (%u), ignore.", + TC_LOG_ERROR("misc", "Table `{}` have non appropriate for table account data type ({}), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type); continue; } @@ -1025,8 +1025,8 @@ void WorldSession::LoadPermissions() uint32 id = GetAccountId(); uint8 secLevel = GetSecurity(); - TC_LOG_DEBUG("rbac", "WorldSession::LoadPermissions [AccountId: %u, Name: %s, realmId: %d, secLevel: %u]", - id, _accountName.c_str(), realm.Id.Realm, secLevel); + TC_LOG_DEBUG("rbac", "WorldSession::LoadPermissions [AccountId: {}, Name: {}, realmId: {}, secLevel: {}]", + id, _accountName, realm.Id.Realm, secLevel); _RBACData = new rbac::RBACData(id, _accountName, realm.Id.Realm, secLevel); _RBACData->LoadFromDB(); @@ -1037,8 +1037,8 @@ QueryCallback WorldSession::LoadPermissionsAsync() uint32 id = GetAccountId(); uint8 secLevel = GetSecurity(); - TC_LOG_DEBUG("rbac", "WorldSession::LoadPermissions [AccountId: %u, Name: %s, realmId: %d, secLevel: %u]", - id, _accountName.c_str(), realm.Id.Realm, secLevel); + TC_LOG_DEBUG("rbac", "WorldSession::LoadPermissions [AccountId: {}, Name: {}, realmId: {}, secLevel: {}]", + id, _accountName, realm.Id.Realm, secLevel); _RBACData = new rbac::RBACData(id, _accountName, realm.Id.Realm, secLevel); return _RBACData->LoadFromDBAsync(); @@ -1231,16 +1231,16 @@ bool WorldSession::HasPermission(uint32 permission) LoadPermissions(); bool hasPermission = _RBACData->HasPermission(permission); - TC_LOG_DEBUG("rbac", "WorldSession::HasPermission [AccountId: %u, Name: %s, realmId: %d]", - _RBACData->GetId(), _RBACData->GetName().c_str(), realm.Id.Realm); + TC_LOG_DEBUG("rbac", "WorldSession::HasPermission [AccountId: {}, Name: {}, realmId: {}]", + _RBACData->GetId(), _RBACData->GetName(), realm.Id.Realm); return hasPermission; } void WorldSession::InvalidateRBACData() { - TC_LOG_DEBUG("rbac", "WorldSession::Invalidaterbac::RBACData [AccountId: %u, Name: %s, realmId: %d]", - _RBACData->GetId(), _RBACData->GetName().c_str(), realm.Id.Realm); + TC_LOG_DEBUG("rbac", "WorldSession::Invalidaterbac::RBACData [AccountId: {}, Name: {}, realmId: {}]", + _RBACData->GetId(), _RBACData->GetName(), realm.Id.Realm); delete _RBACData; _RBACData = nullptr; } @@ -1264,8 +1264,8 @@ bool WorldSession::DosProtection::EvaluateOpcode(WorldPacket& p, time_t time) co if (++packetCounter.amountCounter <= maxPacketCounterAllowed) return true; - TC_LOG_WARN("network", "AntiDOS: Account %u, IP: %s, Ping: %u, Character: %s, flooding packet (opc: %s (0x%X), count: %u)", - Session->GetAccountId(), Session->GetRemoteAddress().c_str(), Session->GetLatency(), Session->GetPlayerName().c_str(), + TC_LOG_WARN("network", "AntiDOS: Account {}, IP: {}, Ping: {}, Character: {}, flooding packet (opc: {} (0x{:X}), count: {})", + Session->GetAccountId(), Session->GetRemoteAddress(), Session->GetLatency(), Session->GetPlayerName(), opcodeTable[static_cast<OpcodeClient>(p.GetOpcode())]->Name, p.GetOpcode(), packetCounter.amountCounter); switch (_policy) @@ -1290,7 +1290,7 @@ bool WorldSession::DosProtection::EvaluateOpcode(WorldPacket& p, time_t time) co case BAN_IP: nameOrIp = Session->GetRemoteAddress(); break; } sWorld->BanAccount(bm, nameOrIp, duration, "DOS (Packet Flooding/Spoofing", "Server: AutoDOS"); - TC_LOG_WARN("network", "AntiDOS: Player automatically banned for %u seconds.", duration); + TC_LOG_WARN("network", "AntiDOS: Player automatically banned for {} seconds.", duration); Session->KickPlayer("WorldSession::DosProtection::EvaluateOpcode AntiDOS"); return false; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 3dfd2d58564..93991977321 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -101,7 +101,7 @@ void WorldSocket::CheckIpCallback(PreparedQueryResult result) if (banned) { - TC_LOG_ERROR("network", "WorldSocket::CheckIpCallback: Sent Auth Response (IP %s banned).", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::CheckIpCallback: Sent Auth Response (IP {} banned).", GetRemoteIpAddress().to_string()); DelayedCloseSocket(); return; } @@ -167,8 +167,8 @@ void WorldSocket::InitializeHandler(boost::system::error_code error, std::size_t } catch (ByteBufferException const& ex) { - TC_LOG_ERROR("network", "WorldSocket::InitializeHandler ByteBufferException %s occured while parsing initial packet from %s", - ex.what(), GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::InitializeHandler ByteBufferException {} occured while parsing initial packet from {}", + ex.what(), GetRemoteIpAddress().to_string()); CloseSocket(); return; } @@ -183,7 +183,7 @@ void WorldSocket::InitializeHandler(boost::system::error_code error, std::size_t if (z_res != Z_OK) { CloseSocket(); - TC_LOG_ERROR("network", "Can't initialize packet compression (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res)); + TC_LOG_ERROR("network", "Can't initialize packet compression (zlib: deflateInit) Error code: {} ({})", z_res, zError(z_res)); return; } @@ -337,8 +337,8 @@ bool WorldSocket::ReadHeaderHandler() // CMSG_HOTFIX_REQUEST can be much larger than normal packets, allow receiving it once per session if (header->EncryptedOpcode != CMSG_HOTFIX_REQUEST || header->Size > 0x100000 || !_canRequestHotfixes) { - TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s sent malformed packet (size: %u, opcode %u)", - GetRemoteIpAddress().to_string().c_str(), header->Size, uint32(header->EncryptedOpcode)); + TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client {} sent malformed packet (size: {}, opcode {})", + GetRemoteIpAddress().to_string(), header->Size, uint32(header->EncryptedOpcode)); return false; } } @@ -354,8 +354,8 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() if (!_authCrypt.DecryptRecv(_packetBuffer.GetReadPointer(), header->Size, header->Tag)) { - TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s failed to decrypt packet (size: %u)", - GetRemoteIpAddress().to_string().c_str(), header->Size); + TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client {} failed to decrypt packet (size: {})", + GetRemoteIpAddress().to_string(), header->Size); return ReadDataHandlerResult::Error; } @@ -363,8 +363,8 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() OpcodeClient opcode = packet.read<OpcodeClient>(); if (uint32(opcode) >= uint32(NUM_OPCODE_HANDLERS)) { - TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s sent wrong opcode (opcode: %u)", - GetRemoteIpAddress().to_string().c_str(), uint32(opcode)); + TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client {} sent wrong opcode (opcode: {})", + GetRemoteIpAddress().to_string(), uint32(opcode)); return ReadDataHandlerResult::Error; } @@ -383,7 +383,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() WorldPackets::Auth::Ping ping(std::move(packet)); if (!ping.ReadNoThrow()) { - TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_PING", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client {} sent malformed CMSG_PING", GetRemoteIpAddress().to_string()); return ReadDataHandlerResult::Error; } if (!HandlePing(ping)) @@ -397,14 +397,14 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() { // locking just to safely log offending user is probably overkill but we are disconnecting him anyway if (sessionGuard.try_lock()) - TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from {}", _worldSession->GetPlayerInfo()); return ReadDataHandlerResult::Error; } std::shared_ptr<WorldPackets::Auth::AuthSession> authSession = std::make_shared<WorldPackets::Auth::AuthSession>(std::move(packet)); if (!authSession->ReadNoThrow()) { - TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_AUTH_SESSION", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client {} sent malformed CMSG_AUTH_SESSION", GetRemoteIpAddress().to_string()); return ReadDataHandlerResult::Error; } HandleAuthSession(authSession); @@ -417,14 +417,14 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() { // locking just to safely log offending user is probably overkill but we are disconnecting him anyway if (sessionGuard.try_lock()) - TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_CONTINUED_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_CONTINUED_SESSION from {}", _worldSession->GetPlayerInfo()); return ReadDataHandlerResult::Error; } std::shared_ptr<WorldPackets::Auth::AuthContinuedSession> authSession = std::make_shared<WorldPackets::Auth::AuthContinuedSession>(std::move(packet)); if (!authSession->ReadNoThrow()) { - TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_AUTH_CONTINUED_SESSION", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client {} sent malformed CMSG_AUTH_CONTINUED_SESSION", GetRemoteIpAddress().to_string()); return ReadDataHandlerResult::Error; } HandleAuthContinuedSession(authSession); @@ -438,7 +438,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() _worldSession->ResetTimeOutTime(true); return ReadDataHandlerResult::Ok; } - TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler: client %s sent CMSG_KEEP_ALIVE without being authenticated", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler: client {} sent CMSG_KEEP_ALIVE without being authenticated", GetRemoteIpAddress().to_string()); return ReadDataHandlerResult::Error; case CMSG_LOG_DISCONNECT: LogOpcodeText(opcode, sessionGuard); @@ -456,7 +456,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() WorldPackets::Auth::ConnectToFailed connectToFailed(std::move(packet)); if (!connectToFailed.ReadNoThrow()) { - TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_CONNECT_TO_FAILED", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client {} sent malformed CMSG_CONNECT_TO_FAILED", GetRemoteIpAddress().to_string()); return ReadDataHandlerResult::Error; } HandleConnectToFailed(connectToFailed); @@ -480,14 +480,14 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() if (!_worldSession) { - TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = {}", uint32(opcode)); return ReadDataHandlerResult::Error; } OpcodeHandler const* handler = opcodeTable[opcode]; if (!handler) { - TC_LOG_ERROR("network.opcode", "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet.GetOpcode())).c_str(), _worldSession->GetPlayerInfo().c_str()); + TC_LOG_ERROR("network.opcode", "No defined handler for opcode {} sent by {}", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet.GetOpcode())), _worldSession->GetPlayerInfo()); break; } @@ -507,18 +507,18 @@ void WorldSocket::LogOpcodeText(OpcodeClient opcode, std::unique_lock<std::mutex { if (!guard) { - TC_LOG_TRACE("network.opcode", "C->S: %s %s", GetRemoteIpAddress().to_string().c_str(), GetOpcodeNameForLogging(opcode).c_str()); + TC_LOG_TRACE("network.opcode", "C->S: {} {}", GetRemoteIpAddress().to_string(), GetOpcodeNameForLogging(opcode)); } else { - TC_LOG_TRACE("network.opcode", "C->S: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress().to_string()).c_str(), - GetOpcodeNameForLogging(opcode).c_str()); + TC_LOG_TRACE("network.opcode", "C->S: {} {}", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress().to_string()), + GetOpcodeNameForLogging(opcode)); } } void WorldSocket::SendPacketAndLogOpcode(WorldPacket const& packet) { - TC_LOG_TRACE("network.opcode", "S->C: %s %s", GetRemoteIpAddress().to_string().c_str(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet.GetOpcode())).c_str()); + TC_LOG_TRACE("network.opcode", "S->C: {} {}", GetRemoteIpAddress().to_string(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet.GetOpcode()))); SendPacket(packet); } @@ -590,7 +590,7 @@ uint32 WorldSocket::CompressPacket(uint8* buffer, WorldPacket const& packet) int32 z_res = deflate(_compressionStream, Z_NO_FLUSH); if (z_res != Z_OK) { - TC_LOG_ERROR("network", "Can't compress packet opcode (zlib: deflate) Error code: %i (%s, msg: %s)", z_res, zError(z_res), _compressionStream->msg); + TC_LOG_ERROR("network", "Can't compress packet opcode (zlib: deflate) Error code: {} ({}, msg: {})", z_res, zError(z_res), _compressionStream->msg); return 0; } @@ -600,7 +600,7 @@ uint32 WorldSocket::CompressPacket(uint8* buffer, WorldPacket const& packet) z_res = deflate(_compressionStream, Z_SYNC_FLUSH); if (z_res != Z_OK) { - TC_LOG_ERROR("network", "Can't compress packet data (zlib: deflate) Error code: %i (%s, msg: %s)", z_res, zError(z_res), _compressionStream->msg); + TC_LOG_ERROR("network", "Can't compress packet data (zlib: deflate) Error code: {} ({}, msg: {})", z_res, zError(z_res), _compressionStream->msg); return 0; } @@ -690,7 +690,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (!buildInfo) { SendAuthResponseError(ERROR_BAD_VERSION); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Missing auth seed for realm build %u (%s).", realm.Build, GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Missing auth seed for realm build {} ({}).", realm.Build, GetRemoteIpAddress().to_string()); DelayedCloseSocket(); return; } @@ -718,7 +718,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: // Check that Key and account name are the same on client and server if (memcmp(hmac.GetDigest().data(), authSession->Digest.data(), authSession->Digest.size()) != 0) { - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", account.Game.Id, authSession->RealmJoinTicket.c_str(), address.c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Authentication failed for account: {} ('{}') address: {}", account.Game.Id, authSession->RealmJoinTicket, address); DelayedCloseSocket(); return; } @@ -766,7 +766,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (sWorld->IsClosed()) { SendAuthResponseError(ERROR_DENIED); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: World closed, denying client ({}).", GetRemoteIpAddress().to_string()); DelayedCloseSocket(); return; } @@ -774,8 +774,8 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (authSession->RealmID != realm.Id.Realm) { SendAuthResponseError(ERROR_DENIED); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client %s requested connecting with realm id %u but this realm has id %u set in config.", - GetRemoteIpAddress().to_string().c_str(), authSession->RealmID, realm.Id.Realm); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client {} requested connecting with realm id {} but this realm has id {} set in config.", + GetRemoteIpAddress().to_string(), authSession->RealmID, realm.Id.Realm); DelayedCloseSocket(); return; } @@ -785,7 +785,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (wardenActive && account.Game.OS != "Win" && account.Game.OS != "Wn64" && account.Game.OS != "Mc64") { SendAuthResponseError(ERROR_DENIED); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client %s attempted to log in using invalid client OS (%s).", address.c_str(), account.Game.OS.c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client {} attempted to log in using invalid client OS ({}).", address, account.Game.OS); DelayedCloseSocket(); return; } @@ -799,7 +799,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (account.BattleNet.LastIP != address) { SendAuthResponseError(ERROR_RISK_ACCOUNT_LOCKED); - TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs. Original IP: %s, new IP: %s).", account.BattleNet.LastIP.c_str(), address.c_str()); + TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs. Original IP: {}, new IP: {}).", account.BattleNet.LastIP, address); // We could log on hook only instead of an additional db log, however action logger is config based. Better keep DB logging as well sScriptMgr->OnFailedAccountLogin(account.Game.Id); DelayedCloseSocket(); @@ -811,7 +811,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: if (account.BattleNet.LockCountry != _ipCountry) { SendAuthResponseError(ERROR_RISK_ACCOUNT_LOCKED); - TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account country differs. Original country: %s, new country: %s).", account.BattleNet.LockCountry.c_str(), _ipCountry.c_str()); + TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account country differs. Original country: {}, new country: {}).", account.BattleNet.LockCountry, _ipCountry); // We could log on hook only instead of an additional db log, however action logger is config based. Better keep DB logging as well sScriptMgr->OnFailedAccountLogin(account.Game.Id); DelayedCloseSocket(); @@ -842,7 +842,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: // Check locked state for server AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); - TC_LOG_DEBUG("network", "Allowed Level: %u Player Level %u", allowedAccountType, account.Game.Security); + TC_LOG_DEBUG("network", "Allowed Level: {} Player Level {}", allowedAccountType, account.Game.Security); if (allowedAccountType > SEC_PLAYER && account.Game.Security < allowedAccountType) { SendAuthResponseError(ERROR_SERVER_IS_PRIVATE); @@ -852,7 +852,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth:: return; } - TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", authSession->RealmJoinTicket.c_str(), address.c_str()); + TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Client '{}' authenticated successfully from {}.", authSession->RealmJoinTicket, address); if (sWorld->getBoolConfig(CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE)) { @@ -934,7 +934,7 @@ void WorldSocket::HandleAuthContinuedSessionCallback(std::shared_ptr<WorldPacket if (memcmp(hmac.GetDigest().data(), authSession->Digest.data(), authSession->Digest.size())) { - TC_LOG_ERROR("network", "WorldSocket::HandleAuthContinuedSession: Authentication failed for account: %u ('%s') address: %s", accountId, login.c_str(), GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthContinuedSession: Authentication failed for account: {} ('{}') address: {}", accountId, login, GetRemoteIpAddress().to_string()); DelayedCloseSocket(); return; } @@ -974,7 +974,7 @@ void WorldSocket::HandleConnectToFailed(WorldPackets::Auth::ConnectToFailed& con break; case WorldPackets::Auth::ConnectToSerial::WorldAttempt5: { - TC_LOG_ERROR("network", "%s failed to connect 5 times to world socket, aborting login", _worldSession->GetPlayerInfo().c_str()); + TC_LOG_ERROR("network", "{} failed to connect 5 times to world socket, aborting login", _worldSession->GetPlayerInfo()); _worldSession->AbortLogin(WorldPackets::Character::LoginFailureReason::NoWorld); break; } @@ -1034,8 +1034,8 @@ bool WorldSocket::HandlePing(WorldPackets::Auth::Ping& ping) if (_worldSession && !_worldSession->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_OVERSPEED_PING)) { - TC_LOG_ERROR("network", "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)", - _worldSession->GetPlayerInfo().c_str(), GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandlePing: {} kicked for over-speed pings (address: {})", + _worldSession->GetPlayerInfo(), GetRemoteIpAddress().to_string()); return false; } @@ -1052,7 +1052,7 @@ bool WorldSocket::HandlePing(WorldPackets::Auth::Ping& ping) _worldSession->SetLatency(ping.Latency); else { - TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = %s", GetRemoteIpAddress().to_string().c_str()); + TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = {}", GetRemoteIpAddress().to_string()); return false; } } diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 75299c6f3ce..37f3d2ddda3 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -62,7 +62,7 @@ bool WorldSocketMgr::StartWorldNetwork(Trinity::Asio::IoContext& ioContext, std: _tcpNoDelay = sConfigMgr->GetBoolDefault("Network.TcpNodelay", true); int const max_connections = TRINITY_MAX_LISTEN_CONNECTIONS; - TC_LOG_DEBUG("misc", "Max allowed socket connections %d", max_connections); + TC_LOG_DEBUG("misc", "Max allowed socket connections {}", max_connections); // -1 means use default _socketSystemSendBufferSize = sConfigMgr->GetIntDefault("Network.OutKBuff", -1); @@ -85,7 +85,7 @@ bool WorldSocketMgr::StartWorldNetwork(Trinity::Asio::IoContext& ioContext, std: } catch (boost::system::system_error const& err) { - TC_LOG_ERROR("network", "Exception caught in WorldSocketMgr::StartNetwork (%s:%u): %s", bindIp.c_str(), port, err.what()); + TC_LOG_ERROR("network", "Exception caught in WorldSocketMgr::StartNetwork ({}:{}): {}", bindIp, port, err.what()); return false; } @@ -129,7 +129,7 @@ void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock, uint32 threadIndex) sock.set_option(boost::asio::socket_base::send_buffer_size(_socketSystemSendBufferSize), err); if (err && err != boost::system::errc::not_supported) { - TC_LOG_ERROR("misc", "WorldSocketMgr::OnSocketOpen sock.set_option(boost::asio::socket_base::send_buffer_size) err = %s", err.message().c_str()); + TC_LOG_ERROR("misc", "WorldSocketMgr::OnSocketOpen sock.set_option(boost::asio::socket_base::send_buffer_size) err = {}", err.message()); return; } } @@ -141,7 +141,7 @@ void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock, uint32 threadIndex) sock.set_option(boost::asio::ip::tcp::no_delay(true), err); if (err) { - TC_LOG_ERROR("misc", "WorldSocketMgr::OnSocketOpen sock.set_option(boost::asio::ip::tcp::no_delay) err = %s", err.message().c_str()); + TC_LOG_ERROR("misc", "WorldSocketMgr::OnSocketOpen sock.set_option(boost::asio::ip::tcp::no_delay) err = {}", err.message()); return; } } |
