Core/Entities: Make ObjectGuid formattable with fmt without using ToString()

This commit is contained in:
Shauren
2024-03-31 19:32:39 +02:00
parent 2c702df4e3
commit 4131022f6c
4 changed files with 432 additions and 187 deletions
+4 -8
View File
@@ -198,17 +198,13 @@ std::string const & WorldSession::GetPlayerName() const
std::string WorldSession::GetPlayerInfo() const
{
std::ostringstream ss;
if (_player)
return Trinity::StringFormat("[Player: {} {}, Account: {}]", _player->GetName(), _player->GetGUID(), GetAccountId());
ss << "[Player: ";
if (!m_playerLoading.IsEmpty())
ss << "Logging in: " << m_playerLoading.ToString() << ", ";
else if (_player)
ss << _player->GetName() << ' ' << _player->GetGUID().ToString() << ", ";
return Trinity::StringFormat("[Player: Logging in: {}, Account: {}]", m_playerLoading, GetAccountId());
ss << "Account: " << GetAccountId() << "]";
return ss.str();
return Trinity::StringFormat("[Player: Account: {}]", GetAccountId());
}
/// Send a packet to the client