mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 15:28:39 +00:00
experimenting; not looking to pr
This commit is contained in:
@@ -82,16 +82,16 @@ void Character::DoQuickXMLDataParse() {
|
||||
if (!m_Doc) return;
|
||||
|
||||
if (m_Doc->Parse(m_XMLData.c_str(), m_XMLData.size()) == 0) {
|
||||
LOG("Loaded xmlData for character %s (%i)!", m_Name.c_str(), m_ID);
|
||||
Log::Info("Loaded xmlData for character {:s} ({:d})!", m_Name, m_ID);
|
||||
} else {
|
||||
LOG("Failed to load xmlData!");
|
||||
Log::Warn("Failed to load xmlData!");
|
||||
//Server::rakServer->CloseConnection(m_ParentUser->GetSystemAddress(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
tinyxml2::XMLElement* mf = m_Doc->FirstChildElement("obj")->FirstChildElement("mf");
|
||||
if (!mf) {
|
||||
LOG("Failed to find mf tag!");
|
||||
Log::Warn("Failed to find mf tag!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,14 +110,14 @@ void Character::DoQuickXMLDataParse() {
|
||||
|
||||
tinyxml2::XMLElement* inv = m_Doc->FirstChildElement("obj")->FirstChildElement("inv");
|
||||
if (!inv) {
|
||||
LOG("Char has no inv!");
|
||||
Log::Warn("Char has no inv!");
|
||||
return;
|
||||
}
|
||||
|
||||
tinyxml2::XMLElement* bag = inv->FirstChildElement("items")->FirstChildElement("in");
|
||||
|
||||
if (!bag) {
|
||||
LOG("Couldn't find bag0!");
|
||||
Log::Warn("Couldn't find bag0!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ void Character::SaveXMLToDatabase() {
|
||||
|
||||
//Call upon the entity to update our xmlDoc:
|
||||
if (!m_OurEntity) {
|
||||
LOG("%i:%s didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!", this->GetID(), this->GetName().c_str());
|
||||
Log::Warn("{:d}:{:s} didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!", this->GetID(), this->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ void Character::SaveXMLToDatabase() {
|
||||
//For metrics, log the time it took to save:
|
||||
auto end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed = end - start;
|
||||
LOG("%i:%s Saved character to Database in: %fs", this->GetID(), this->GetName().c_str(), elapsed.count());
|
||||
Log::Info("{:d}:{:s} Saved character to Database in: {:f}s", this->GetID(), this->GetName(), elapsed.count());
|
||||
}
|
||||
|
||||
void Character::SetIsNewLogin() {
|
||||
@@ -334,7 +334,7 @@ void Character::SetIsNewLogin() {
|
||||
auto* nextChild = currentChild->NextSiblingElement();
|
||||
if (currentChild->Attribute("si")) {
|
||||
flags->DeleteChild(currentChild);
|
||||
LOG("Removed isLoggedIn flag from character %i:%s, saving character to database", GetID(), GetName().c_str());
|
||||
Log::Info("Removed isLoggedIn flag from character {:d}:{:s}, saving character to database", GetID(), GetName());
|
||||
WriteToDatabase();
|
||||
}
|
||||
currentChild = nextChild;
|
||||
|
@@ -236,7 +236,7 @@ void Leaderboard::SetupLeaderboard(bool weekly, uint32_t resultStart, uint32_t r
|
||||
baseLookup += std::to_string(static_cast<uint32_t>(this->relatedPlayer));
|
||||
}
|
||||
baseLookup += " LIMIT 1";
|
||||
LOG_DEBUG("query is %s", baseLookup.c_str());
|
||||
Log::Debug("query is {:s}", baseLookup);
|
||||
std::unique_ptr<sql::PreparedStatement> baseQuery(Database::Get()->CreatePreppedStmt(baseLookup));
|
||||
baseQuery->setInt(1, this->gameID);
|
||||
std::unique_ptr<sql::ResultSet> baseResult(baseQuery->executeQuery());
|
||||
@@ -251,7 +251,7 @@ void Leaderboard::SetupLeaderboard(bool weekly, uint32_t resultStart, uint32_t r
|
||||
int32_t res = snprintf(lookupBuffer.get(), STRING_LENGTH, queryBase.c_str(), orderBase.data(), filter.c_str(), resultStart, resultEnd);
|
||||
DluAssert(res != -1);
|
||||
std::unique_ptr<sql::PreparedStatement> query(Database::Get()->CreatePreppedStmt(lookupBuffer.get()));
|
||||
LOG_DEBUG("Query is %s vars are %i %i %i", lookupBuffer.get(), this->gameID, this->relatedPlayer, relatedPlayerLeaderboardId);
|
||||
Log::Debug("Query is {:s} vars are {:d} {:d} {:d}", lookupBuffer.get(), this->gameID, this->relatedPlayer, relatedPlayerLeaderboardId);
|
||||
query->setInt(1, this->gameID);
|
||||
if (this->infoType == InfoType::Friends) {
|
||||
query->setInt(2, this->relatedPlayer);
|
||||
@@ -358,7 +358,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
||||
}
|
||||
case Leaderboard::Type::None:
|
||||
default:
|
||||
LOG("Unknown leaderboard type %i for game %i. Cannot save score!", leaderboardType, activityId);
|
||||
Log::Warn("Unknown leaderboard type {:d} for game {:d}. Cannot save score!", GeneralUtils::ToUnderlying(leaderboardType), activityId);
|
||||
return;
|
||||
}
|
||||
bool newHighScore = lowerScoreBetter ? newScore < oldScore : newScore > oldScore;
|
||||
@@ -377,7 +377,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
||||
} else {
|
||||
saveQuery = FormatInsert(leaderboardType, newScore, false);
|
||||
}
|
||||
LOG("save query %s %i %i", saveQuery.c_str(), playerID, activityId);
|
||||
Log::Info("save query {:s} {:d} {:d}", saveQuery, playerID, activityId);
|
||||
std::unique_ptr<sql::PreparedStatement> saveStatement(Database::Get()->CreatePreppedStmt(saveQuery));
|
||||
saveStatement->setInt(1, playerID);
|
||||
saveStatement->setInt(2, activityId);
|
||||
|
@@ -125,7 +125,7 @@ void Trade::Complete() {
|
||||
|
||||
// First verify both players have the coins and items requested for the trade.
|
||||
if (characterA->GetCoins() < m_CoinsA || characterB->GetCoins() < m_CoinsB) {
|
||||
LOG("Possible coin trade cheating attempt! Aborting trade.");
|
||||
Log::Warn("Possible coin trade cheating attempt! Aborting trade.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,11 +133,11 @@ void Trade::Complete() {
|
||||
auto* itemToRemove = inventoryA->FindItemById(tradeItem.itemId);
|
||||
if (itemToRemove) {
|
||||
if (itemToRemove->GetCount() < tradeItem.itemCount) {
|
||||
LOG("Possible cheating attempt from %s in trading!!! Aborting trade", characterA->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading!!! Aborting trade", characterA->GetName());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG("Possible cheating attempt from %s in trading due to item not being available!!!", characterA->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading due to item not being available!!!", characterA->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -146,11 +146,11 @@ void Trade::Complete() {
|
||||
auto* itemToRemove = inventoryB->FindItemById(tradeItem.itemId);
|
||||
if (itemToRemove) {
|
||||
if (itemToRemove->GetCount() < tradeItem.itemCount) {
|
||||
LOG("Possible cheating attempt from %s in trading!!! Aborting trade", characterB->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading!!! Aborting trade", characterB->GetName());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG("Possible cheating attempt from %s in trading due to item not being available!!! Aborting trade", characterB->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading due to item not being available!!! Aborting trade", characterB->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ User::User(const SystemAddress& sysAddr, const std::string& username, const std:
|
||||
Character* character = new Character(lastUsedCharacterId, this);
|
||||
character->UpdateFromDatabase();
|
||||
m_Characters.push_back(character);
|
||||
LOG("Loaded %i as it is the last used char", lastUsedCharacterId);
|
||||
Log::Info("Loaded {:d} as it is the last used char", lastUsedCharacterId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void User::UserOutOfSync() {
|
||||
m_AmountOfTimesOutOfSync++;
|
||||
if (m_AmountOfTimesOutOfSync > m_MaxDesyncAllowed) {
|
||||
//YEET
|
||||
LOG("User %s was out of sync %i times out of %i, disconnecting for suspected speedhacking.", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Log::Warn("User {:s} was out of sync {:d} times out of {:d}, disconnecting for suspected speedhacking.", m_Username, m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Game::server->Disconnect(this->m_SystemAddress, eServerDisconnectIdentifiers::PLAY_SCHEDULE_TIME_DONE);
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto fnStream = Game::assetManager->GetFile("names/minifigname_first.txt");
|
||||
if (!fnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_first.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_first.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto mnStream = Game::assetManager->GetFile("names/minifigname_middle.txt");
|
||||
if (!mnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_middle.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_middle.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto lnStream = Game::assetManager->GetFile("names/minifigname_last.txt");
|
||||
if (!lnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_last.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_last.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void UserManager::Initialize() {
|
||||
// Load our pre-approved names:
|
||||
auto chatListStream = Game::assetManager->GetFile("chatplus_en_us.txt");
|
||||
if (!chatListStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "chatplus_en_us.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "chatplus_en_us.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing chat whitelist file.");
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ bool UserManager::DeleteUser(const SystemAddress& sysAddr) {
|
||||
|
||||
void UserManager::DeletePendingRemovals() {
|
||||
for (auto* user : m_UsersToDelete) {
|
||||
LOG("Deleted user %i", user->GetAccountID());
|
||||
Log::Info("Deleted user {:d}", user->GetAccountID());
|
||||
|
||||
delete user;
|
||||
}
|
||||
@@ -306,27 +306,27 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
LOT pantsLOT = FindCharPantsID(pantsColor);
|
||||
|
||||
if (!name.empty() && Database::Get()->GetCharacterInfo(name)) {
|
||||
LOG("AccountID: %i chose unavailable name: %s", u->GetAccountID(), name.c_str());
|
||||
Log::Info("AccountID: {:d} chose unavailable name: {:s}", u->GetAccountID(), name);
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::CUSTOM_NAME_IN_USE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Database::Get()->GetCharacterInfo(predefinedName)) {
|
||||
LOG("AccountID: %i chose unavailable predefined name: %s", u->GetAccountID(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} chose unavailable predefined name: {:s}", u->GetAccountID(), predefinedName);
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::PREDEFINED_NAME_IN_USE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
LOG("AccountID: %i is creating a character with predefined name: %s", u->GetAccountID(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} is creating a character with predefined name: {:s}", u->GetAccountID(), predefinedName);
|
||||
} else {
|
||||
LOG("AccountID: %i is creating a character with name: %s (temporary: %s)", u->GetAccountID(), name.c_str(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} is creating a character with name: {:s} (temporary: {:s})", u->GetAccountID(), name, predefinedName);
|
||||
}
|
||||
|
||||
//Now that the name is ok, we can get an objectID from Master:
|
||||
ObjectIDManager::RequestPersistentID([=, this](uint32_t objectID) mutable {
|
||||
if (Database::Get()->GetCharacterInfo(objectID)) {
|
||||
LOG("Character object id unavailable, check object_id_tracker!");
|
||||
Log::Warn("Character object id unavailable, check object_id_tracker!");
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE);
|
||||
return;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to delete character");
|
||||
Log::Warn("Couldn't get user to delete character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
inStream.Read(objectID);
|
||||
uint32_t charID = static_cast<uint32_t>(objectID);
|
||||
|
||||
LOG("Received char delete req for ID: %llu (%u)", objectID, charID);
|
||||
Log::Info("Received char delete req for ID: {:d} ({:d})", objectID, charID);
|
||||
|
||||
bool hasCharacter = CheatDetection::VerifyLwoobjidIsSender(
|
||||
objectID,
|
||||
@@ -418,7 +418,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
if (!hasCharacter) {
|
||||
WorldPackets::SendCharacterDeleteResponse(sysAddr, false);
|
||||
} else {
|
||||
LOG("Deleting character %i", charID);
|
||||
Log::Info("Deleting character {:d}", charID);
|
||||
Database::Get()->DeleteCharacter(charID);
|
||||
|
||||
CBITSTREAM;
|
||||
@@ -433,7 +433,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to delete character");
|
||||
Log::Warn("Couldn't get user to delete character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
GeneralUtils::ClearBit(objectID, eObjectBits::PERSISTENT);
|
||||
|
||||
uint32_t charID = static_cast<uint32_t>(objectID);
|
||||
LOG("Received char rename request for ID: %llu (%u)", objectID, charID);
|
||||
Log::Info("Received char rename request for ID: {:d} ({:d})", objectID, charID);
|
||||
|
||||
LUWString LUWStringName;
|
||||
inStream.Read(LUWStringName);
|
||||
@@ -479,12 +479,12 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
if (!Database::Get()->GetCharacterInfo(newName)) {
|
||||
if (IsNamePreapproved(newName)) {
|
||||
Database::Get()->SetCharacterName(charID, newName);
|
||||
LOG("Character %s now known as %s", character->GetName().c_str(), newName.c_str());
|
||||
Log::Info("Character {:s} now known as {:s}", character->GetName(), newName);
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS);
|
||||
UserManager::RequestCharacterList(sysAddr);
|
||||
} else {
|
||||
Database::Get()->SetPendingCharacterName(charID, newName);
|
||||
LOG("Character %s has been renamed to %s and is pending approval by a moderator.", character->GetName().c_str(), newName.c_str());
|
||||
Log::Info("Character {:s} has been renamed to {:s} and is pending approval by a moderator.", character->GetName(), newName);
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS);
|
||||
UserManager::RequestCharacterList(sysAddr);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::NAME_IN_USE);
|
||||
}
|
||||
} else {
|
||||
LOG("Unknown error occurred when renaming character, either hasCharacter or character variable != true.");
|
||||
Log::Warn("Unknown error occurred when renaming character, either hasCharacter or character variable != true.");
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to log in character");
|
||||
Log::Warn("Couldn't get user to log in character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID
|
||||
if (zoneID == LWOZONEID_INVALID) zoneID = 1000; //Send char to VE
|
||||
|
||||
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, zoneID, character->GetZoneClone(), false, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", character->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (character) {
|
||||
character->SetZoneID(zoneID);
|
||||
character->SetZoneInstance(zoneInstance);
|
||||
@@ -529,7 +529,7 @@ void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
LOG("Unknown error occurred when logging in a character, either hasCharacter or character variable != true.");
|
||||
Log::Warn("Unknown error occurred when logging in a character, either hasCharacter or character variable != true.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ uint32_t FindCharShirtID(uint32_t shirtColor, uint32_t shirtStyle) {
|
||||
tableData.finalize();
|
||||
return shirtLOT;
|
||||
} catch (const std::exception& ex) {
|
||||
LOG("Could not look up shirt %i %i: %s", shirtColor, shirtStyle, ex.what());
|
||||
Log::Warn("Could not look up shirt {:d} {:d}: {:s}", shirtColor, shirtStyle, ex.what());
|
||||
// in case of no shirt found in CDServer, return problematic red vest.
|
||||
return 4069;
|
||||
}
|
||||
@@ -564,7 +564,7 @@ uint32_t FindCharPantsID(uint32_t pantsColor) {
|
||||
tableData.finalize();
|
||||
return pantsLOT;
|
||||
} catch (const std::exception& ex) {
|
||||
LOG("Could not look up pants %i: %s", pantsColor, ex.what());
|
||||
Log::Warn("Could not look up pants {:d}: {:s}", pantsColor, ex.what());
|
||||
// in case of no pants color found in CDServer, return red pants.
|
||||
return 2508;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ void AirMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
uint32_t handle{};
|
||||
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ void AirMovementBehavior::Sync(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
uint32_t behaviorId{};
|
||||
|
||||
if (!bitStream.Read(behaviorId)) {
|
||||
LOG("Unable to read behaviorId from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read behaviorId from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
LWOOBJID target{};
|
||||
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
uint32_t targetCount{};
|
||||
|
||||
if (!bitStream.Read(targetCount)) {
|
||||
LOG("Unable to read targetCount from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read targetCount from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
}
|
||||
|
||||
if (targetCount > this->m_maxTargets) {
|
||||
LOG("Serialized size is greater than max targets! Size: %i, Max: %i", targetCount, this->m_maxTargets);
|
||||
Log::Warn("Serialized size is greater than max targets! Size: {:d}, Max: {:d}", targetCount, this->m_maxTargets);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
for (auto i = 0u; i < targetCount; ++i) {
|
||||
LWOOBJID target{};
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("failed to read in target %i from bitStream, aborting target Handle!", i);
|
||||
Log::Warn("failed to read in target {:d} from bitStream, aborting target Handle!", i);
|
||||
};
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ void AttackDelayBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
uint32_t handle{};
|
||||
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
@@ -34,10 +34,10 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
|
||||
uint16_t allocatedBits{};
|
||||
if (!bitStream.Read(allocatedBits) || allocatedBits == 0) {
|
||||
LOG_DEBUG("No allocated bits");
|
||||
Log::Debug("No allocated bits");
|
||||
return;
|
||||
}
|
||||
LOG_DEBUG("Number of allocated bits %i", allocatedBits);
|
||||
Log::Debug("Number of allocated bits {:d}", allocatedBits);
|
||||
const auto baseAddress = bitStream.GetReadOffset();
|
||||
|
||||
DoHandleBehavior(context, bitStream, branch);
|
||||
@@ -48,13 +48,13 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
auto* targetEntity = Game::entityManager->GetEntity(branch.target);
|
||||
if (!targetEntity) {
|
||||
LOG("Target targetEntity %llu not found.", branch.target);
|
||||
Log::Warn("Target targetEntity {:d} not found.", branch.target);
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent) {
|
||||
LOG("No destroyable found on the obj/lot %llu/%i", branch.target, targetEntity->GetLOT());
|
||||
Log::Warn("No destroyable found on the obj/lot {:d}/{:d}", branch.target, targetEntity->GetLOT());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
bool isSuccess{};
|
||||
|
||||
if (!bitStream.Read(isBlocked)) {
|
||||
LOG("Unable to read isBlocked");
|
||||
Log::Warn("Unable to read isBlocked");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
break;
|
||||
default:
|
||||
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
|
||||
LOG("Unknown success state (%i)!", successState);
|
||||
Log::Warn("Unknown success state ({:d})!", successState);
|
||||
return;
|
||||
}
|
||||
this->m_OnFailImmune->Handle(context, bitStream, branch);
|
||||
@@ -241,7 +241,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
|
||||
break;
|
||||
default:
|
||||
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
|
||||
LOG("Unknown success state (%i)!", successState);
|
||||
Log::Warn("Unknown success state ({:d})!", GeneralUtils::ToUnderlying(successState));
|
||||
break;
|
||||
}
|
||||
this->m_OnFailImmune->Calculate(context, bitStream, branch);
|
||||
|
@@ -281,12 +281,12 @@ Behavior* Behavior::CreateBehavior(const uint32_t behaviorId) {
|
||||
case BehaviorTemplates::BEHAVIOR_MOUNT: break;
|
||||
case BehaviorTemplates::BEHAVIOR_SKILL_SET: break;
|
||||
default:
|
||||
//LOG("Failed to load behavior with invalid template id (%i)!", templateId);
|
||||
//Log::Warn("Failed to load behavior with invalid template id ({:d})!", templateId);
|
||||
break;
|
||||
}
|
||||
|
||||
if (behavior == nullptr) {
|
||||
//LOG("Failed to load unimplemented template id (%i)!", templateId);
|
||||
//Log::Warn("Failed to load unimplemented template id ({:d})!", templateId);
|
||||
|
||||
behavior = new EmptyBehavior(behaviorId);
|
||||
}
|
||||
@@ -309,7 +309,7 @@ BehaviorTemplates Behavior::GetBehaviorTemplate(const uint32_t behaviorId) {
|
||||
}
|
||||
|
||||
if (templateID == BehaviorTemplates::BEHAVIOR_EMPTY && behaviorId != 0) {
|
||||
LOG("Failed to load behavior template with id (%i)!", behaviorId);
|
||||
Log::Warn("Failed to load behavior template with id ({:d})!", behaviorId);
|
||||
}
|
||||
|
||||
return templateID;
|
||||
@@ -429,7 +429,7 @@ Behavior::Behavior(const uint32_t behaviorId) {
|
||||
|
||||
// Make sure we do not proceed if we are trying to load an invalid behavior
|
||||
if (templateInDatabase.behaviorID == 0) {
|
||||
LOG("Failed to load behavior with id (%i)!", behaviorId);
|
||||
Log::Warn("Failed to load behavior with id ({:d})!", behaviorId);
|
||||
|
||||
this->m_effectId = 0;
|
||||
this->m_effectHandle = nullptr;
|
||||
|
@@ -126,7 +126,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
LOG("Failed to find behavior sync entry with sync id (%i)!", syncId);
|
||||
Log::Warn("Failed to find behavior sync entry with sync id ({:d})!", syncId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
|
||||
const auto branch = entry.branchContext;
|
||||
|
||||
if (behavior == nullptr) {
|
||||
LOG("Invalid behavior for sync id (%i)!", syncId);
|
||||
Log::Warn("Invalid behavior for sync id ({:d})!", syncId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -317,7 +317,7 @@ void BehaviorContext::FilterTargets(std::vector<Entity*>& targets, std::forward_
|
||||
// if the caster is not there, return empty targets list
|
||||
auto* caster = Game::entityManager->GetEntity(this->caster);
|
||||
if (!caster) {
|
||||
LOG_DEBUG("Invalid caster for (%llu)!", this->originator);
|
||||
Log::Debug("Invalid caster for ({:d})!", this->originator);
|
||||
targets.clear();
|
||||
return;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ void ChainBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
uint32_t chainIndex{};
|
||||
|
||||
if (!bitStream.Read(chainIndex)) {
|
||||
LOG("Unable to read chainIndex from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read chainIndex from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void ChainBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
if (chainIndex < this->m_behaviors.size()) {
|
||||
this->m_behaviors.at(chainIndex)->Handle(context, bitStream, branch);
|
||||
} else {
|
||||
LOG("chainIndex out of bounds, aborting handle of chain %i bits unread %i", chainIndex, bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("chainIndex out of bounds, aborting handle of chain {:d} bits unread {:d}", chainIndex, bitStream.GetNumberOfUnreadBits());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ void ForceMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
|
||||
uint32_t handle{};
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
context->RegisterSyncBehavior(handle, this, branch, this->m_Duration);
|
||||
@@ -22,13 +22,13 @@ void ForceMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
void ForceMovementBehavior::Sync(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
uint32_t next{};
|
||||
if (!bitStream.Read(next)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
LWOOBJID target{};
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown1 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown1 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown2 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown2 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown3 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown3 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ void KnockbackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown{};
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ void MovementSwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
this->m_movingAction->m_templateId == BehaviorTemplates::BEHAVIOR_EMPTY) {
|
||||
return;
|
||||
}
|
||||
LOG("Unable to read movementType from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read movementType from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
@@ -12,14 +12,14 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
LWOOBJID target{};
|
||||
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
auto* entity = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find originator (%llu)!", context->originator);
|
||||
Log::Warn("Failed to find originator ({:d})!", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
LOG("Failed to find skill component for (%llu)!", -context->originator);
|
||||
Log::Warn("Failed to find skill component for ({:d})!", -context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
if (m_useMouseposit && !branch.isSync) {
|
||||
NiPoint3 targetPosition = NiPoint3Constant::ZERO;
|
||||
if (!bitStream.Read(targetPosition)) {
|
||||
LOG("Unable to read targetPosition from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read targetPosition from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
@@ -46,7 +46,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
LWOOBJID projectileId{};
|
||||
|
||||
if (!bitStream.Read(projectileId)) {
|
||||
LOG("Unable to read projectileId from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read projectileId from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
@@ -40,7 +40,7 @@ void PropertyTeleportBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
if (zoneClone != 0) ChatPackets::SendSystemMessage(sysAddr, u"Transfering to your property!");
|
||||
else ChatPackets::SendSystemMessage(sysAddr, u"Transfering back to previous world!");
|
||||
|
||||
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (entity->GetCharacter()) {
|
||||
entity->GetCharacter()->SetZoneID(zoneID);
|
||||
entity->GetCharacter()->SetZoneInstance(zoneInstance);
|
||||
|
@@ -45,7 +45,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to spawn entity (%i)!", this->m_lot);
|
||||
Log::Warn("Failed to spawn entity ({:d})!", this->m_lot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -524,7 +524,7 @@ void ActivityInstance::StartZone() {
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", player->GetCharacter()->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (player->GetCharacter()) {
|
||||
player->GetCharacter()->SetZoneID(zoneID);
|
||||
player->GetCharacter()->SetZoneInstance(zoneInstance);
|
||||
|
@@ -110,7 +110,7 @@ void BuffComponent::Update(float deltaTime) {
|
||||
const std::string& GetFxName(const std::string& buffname) {
|
||||
const auto& toReturn = BuffFx[buffname];
|
||||
if (toReturn.empty()) {
|
||||
LOG_DEBUG("No fx name for %s", buffname.c_str());
|
||||
Log::Debug("No fx name for {:s}", buffname);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void BuffComponent::ApplyBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
if (buffName.empty()) return;
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Playing %s %i", fxToPlay.c_str(), buff.effectId);
|
||||
Log::Debug("Playing {:s} {:d}", fxToPlay, buff.effectId);
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), buff.effectId, u"cast", fxToPlay, LWOOBJID_EMPTY, 1.07f, 1.0f, false);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void BuffComponent::RemoveBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
if (buffName.empty()) return;
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Stopping %s", fxToPlay.c_str());
|
||||
Log::Debug("Stopping {:s}", fxToPlay);
|
||||
GameMessages::SendStopFXEffect(m_Parent, false, fxToPlay);
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ const std::vector<BuffParameter>& BuffComponent::GetBuffParameters(int32_t buffI
|
||||
|
||||
param.values.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -200,7 +200,7 @@ void InventoryComponent::AddItem(
|
||||
const auto slot = preferredSlot != -1 && inventory->IsSlotEmpty(preferredSlot) ? preferredSlot : inventory->FindEmptySlot();
|
||||
|
||||
if (slot == -1) {
|
||||
LOG("Failed to find empty slot for inventory (%i)!", inventoryType);
|
||||
Log::Warn("Failed to find empty slot for inventory ({:d})!", GeneralUtils::ToUnderlying(inventoryType));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1379,7 +1379,7 @@ std::vector<Item*> InventoryComponent::GenerateProxies(Item* parent) {
|
||||
try {
|
||||
lots.push_back(std::stoi(segment));
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse proxy (%s): (%s)!", segment.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse proxy ({:s}): ({:s})!", segment, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -364,7 +364,7 @@ const std::vector<uint32_t> MissionComponent::LookForAchievements(eMissionTaskTy
|
||||
break;
|
||||
}
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse target (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse target ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -130,7 +130,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
|
||||
|
||||
randomMissionPool.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
|
||||
m_NoAutoStart = false;
|
||||
|
||||
if (m_Path == nullptr) {
|
||||
LOG("Path not found: %s", pathName.c_str());
|
||||
Log::Warn("Path not found: {:s}", pathName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -229,7 +229,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
|
||||
if (bricks.empty()) {
|
||||
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
|
||||
LOG("Couldn't find %s for minigame!", buildFile.c_str());
|
||||
Log::Warn("Couldn't find {:s} for minigame!", buildFile);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -640,7 +640,7 @@ void PetComponent::RequestSetPetName(std::u16string name) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
|
||||
Log::Info("Got set pet name ({:s})", GeneralUtils::UTF16ToWTF8(name));
|
||||
|
||||
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
|
||||
|
@@ -182,7 +182,7 @@ PhantomPhysicsComponent::PhantomPhysicsComponent(Entity* parent) : PhysicsCompon
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 390.496826f, 111.467964f, 600.821534f, true);
|
||||
m_Position.y -= (111.467964f * m_Scale) / 2;
|
||||
} else {
|
||||
// LOG_DEBUG("This one is supposed to have %s", info->physicsAsset.c_str());
|
||||
// Log::Debug("This one is supposed to have {:s}", info->physicsAsset);
|
||||
|
||||
//add fallback cube:
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 2.0f, 2.0f, 2.0f);
|
||||
|
@@ -114,7 +114,7 @@ std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
|
||||
|
||||
points.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ RenderComponent::RenderComponent(Entity* const parentEntity, const int32_t compo
|
||||
const auto groupIdInt = GeneralUtils::TryParse<int32_t>(groupId);
|
||||
|
||||
if (!groupIdInt) {
|
||||
LOG("bad animation group Id %s", groupId.c_str());
|
||||
Log::Warn("bad animation group Id {:s}", groupId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -176,6 +176,6 @@ float RenderComponent::DoAnimation(Entity* self, const std::string& animation, b
|
||||
}
|
||||
}
|
||||
if (sendAnimation) GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(animation), priority, scale);
|
||||
if (returnlength == 0.0f) LOG("WARNING: Unable to find animation %s for lot %i in any group.", animation.c_str(), self->GetLOT());
|
||||
if (returnlength == 0.0f) LOG("WARNING: Unable to find animation {:s} for lot {:d} in any group.", animation, self->GetLOT());
|
||||
return returnlength;
|
||||
}
|
||||
|
@@ -154,7 +154,7 @@ void TriggerComponent::HandleTriggerCommand(LUTriggers::Command* command, Entity
|
||||
case eTriggerCommandType::DEACTIVATE_MIXER_PROGRAM: break;
|
||||
// DEPRECATED BLOCK END
|
||||
default:
|
||||
LOG_DEBUG("Event %i was not handled!", command->id);
|
||||
Log::Debug("Event {:d} was not handled!", GeneralUtils::ToUnderlying(command->id));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void TriggerComponent::HandleDestroyObject(Entity* targetEntity, std::string arg
|
||||
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
|
||||
auto* triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
||||
if (!triggerComponent) {
|
||||
LOG_DEBUG("Trigger component not found!");
|
||||
Log::Debug("Trigger component not found!");
|
||||
return;
|
||||
}
|
||||
triggerComponent->SetTriggerEnabled(args == "1");
|
||||
@@ -203,7 +203,7 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
|
||||
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
||||
auto* quickBuildComponent = targetEntity->GetComponent<QuickBuildComponent>();
|
||||
if (!quickBuildComponent) {
|
||||
LOG_DEBUG("Rebuild component not found!");
|
||||
Log::Debug("Rebuild component not found!");
|
||||
return;
|
||||
}
|
||||
quickBuildComponent->ResetQuickBuild(args == "1");
|
||||
@@ -233,7 +233,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
||||
|
||||
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
@@ -249,7 +249,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
||||
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
|
||||
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
const float forceMultiplier = GeneralUtils::TryParse<float>(args).value_or(1.0f);
|
||||
@@ -272,7 +272,7 @@ void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args)
|
||||
|
||||
void TriggerComponent::HandleSetTimer(Entity* targetEntity, std::vector<std::string> argArray){
|
||||
if (argArray.size() != 2) {
|
||||
LOG_DEBUG("Not enough variables!");
|
||||
Log::Debug("Not enough variables!");
|
||||
return;
|
||||
}
|
||||
const float time = GeneralUtils::TryParse<float>(argArray.at(1)).value_or(0.0f);
|
||||
@@ -312,7 +312,7 @@ void TriggerComponent::HandlePlayCinematic(Entity* targetEntity, std::vector<std
|
||||
void TriggerComponent::HandleToggleBBB(Entity* targetEntity, std::string args) {
|
||||
auto* character = targetEntity->GetCharacter();
|
||||
if (!character) {
|
||||
LOG_DEBUG("Character was not found!");
|
||||
Log::Debug("Character was not found!");
|
||||
return;
|
||||
}
|
||||
bool buildMode = !(character->GetBuildMode());
|
||||
@@ -328,7 +328,7 @@ void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std
|
||||
if (argArray.at(0) != "exploretask") return;
|
||||
MissionComponent* missionComponent = targetEntity->GetComponent<MissionComponent>();
|
||||
if (!missionComponent){
|
||||
LOG_DEBUG("Mission component not found!");
|
||||
Log::Debug("Mission component not found!");
|
||||
return;
|
||||
}
|
||||
missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, argArray.at(4));
|
||||
@@ -351,7 +351,7 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
|
||||
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
auto* skillComponent = targetEntity->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) {
|
||||
LOG_DEBUG("Skill component not found!");
|
||||
Log::Debug("Skill component not found!");
|
||||
return;
|
||||
}
|
||||
const uint32_t skillId = GeneralUtils::TryParse<uint32_t>(args).value_or(0);
|
||||
@@ -361,7 +361,7 @@ void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
@@ -395,7 +395,7 @@ void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::v
|
||||
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(args == "On");
|
||||
@@ -432,6 +432,6 @@ void TriggerComponent::HandleActivatePhysics(Entity* targetEntity, std::string a
|
||||
} else if (args == "false"){
|
||||
// TODO remove Phsyics entity if there is one
|
||||
} else {
|
||||
LOG_DEBUG("Invalid argument for ActivatePhysics Trigger: %s", args.c_str());
|
||||
Log::Debug("Invalid argument for ActivatePhysics Trigger: {:s}", args);
|
||||
}
|
||||
}
|
||||
|
@@ -49,11 +49,11 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
User* usr = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
if (!entity) {
|
||||
LOG("Failed to find associated entity (%llu), aborting GM: %4i, %s!", objectID, messageID, StringifiedEnum::ToString(messageID).data());
|
||||
Log::Warn("Failed to find associated entity ({:d}), aborting GM: {:4d}, {:s}!", objectID, GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
return;
|
||||
}
|
||||
|
||||
if (messageID != eGameMessageType::READY_FOR_UPDATES) LOG_DEBUG("Received GM with ID and name: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
if (messageID != eGameMessageType::READY_FOR_UPDATES) Log::Debug("Received GM with ID and name: {:4d}, {:s}", GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
|
||||
switch (messageID) {
|
||||
|
||||
@@ -167,7 +167,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
character->OnZoneLoad();
|
||||
}
|
||||
|
||||
LOG("Player %s (%llu) loaded.", entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
|
||||
Log::Info("Player {:s} ({:d}) loaded.", entity->GetCharacter()->GetName(), entity->GetObjectID());
|
||||
|
||||
// After we've done our thing, tell the client they're ready
|
||||
GameMessages::SendPlayerReady(entity, sysAddr);
|
||||
@@ -686,7 +686,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
GameMessages::SendVendorStatusUpdate(entity, sysAddr, true);
|
||||
break;
|
||||
default:
|
||||
LOG_DEBUG("Received Unknown GM with ID: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
Log::Info("Received Unknown GM with ID: {:4d}, {:s}", GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -1713,7 +1713,7 @@ void GameMessages::HandleActivityStateChangeRequest(RakNet::BitStream& inStream,
|
||||
|
||||
auto* assosiate = Game::entityManager->GetEntity(objectID);
|
||||
|
||||
LOG("%s [%i, %i] from %i to %i", GeneralUtils::UTF16ToWTF8(stringValue).c_str(), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
|
||||
Log::Info("{:s} [{:d}, {:d}] from {:d} to {:d}", GeneralUtils::UTF16ToWTF8(stringValue), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
|
||||
|
||||
std::vector<Entity*> scriptedActs = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::SHOOTING_GALLERY);
|
||||
for (Entity* scriptEntity : scriptedActs) {
|
||||
@@ -3810,7 +3810,7 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream& inStream, Entity*
|
||||
userData.push_back(character);
|
||||
}
|
||||
|
||||
LOG("Button: %d; LOT: %u identifier: %s; userData: %s", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(identifier).c_str(), GeneralUtils::UTF16ToWTF8(userData).c_str());
|
||||
Log::Info("Button: {:d}; LOT: {:d} identifier: {:s}; userData: {:s}", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(identifier), GeneralUtils::UTF16ToWTF8(userData));
|
||||
|
||||
auto* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
@@ -3866,7 +3866,7 @@ void GameMessages::HandleChoiceBoxRespond(RakNet::BitStream& inStream, Entity* e
|
||||
identifier.push_back(character);
|
||||
}
|
||||
|
||||
LOG("Button: %d; LOT: %u buttonIdentifier: %s; userData: %s", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(buttonIdentifier).c_str(), GeneralUtils::UTF16ToWTF8(identifier).c_str());
|
||||
Log::Info("Button: {:d}; LOT: {:d} buttonIdentifier: {:s}; userData: {:s}", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(buttonIdentifier), GeneralUtils::UTF16ToWTF8(identifier));
|
||||
|
||||
auto* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
@@ -4046,10 +4046,10 @@ void GameMessages::HandleAcknowledgePossession(RakNet::BitStream& inStream, Enti
|
||||
void GameMessages::HandleModuleAssemblyQueryData(RakNet::BitStream& inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||
auto* moduleAssemblyComponent = entity->GetComponent<ModuleAssemblyComponent>();
|
||||
|
||||
LOG("Got Query from %i", entity->GetLOT());
|
||||
Log::Info("Got Query from {:d}", entity->GetLOT());
|
||||
|
||||
if (moduleAssemblyComponent != nullptr) {
|
||||
LOG("Returning assembly %s", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()).c_str());
|
||||
Log::Info("Returning assembly {:s}", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()));
|
||||
|
||||
SendModuleAssemblyDBDataForClient(entity->GetObjectID(), moduleAssemblyComponent->GetSubKey(), moduleAssemblyComponent->GetAssemblyPartsLOTs(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
@@ -4872,7 +4872,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream& inStream, Entity
|
||||
mapId = Game::zoneManager->GetZoneID().GetMapID(); // Fallback to sending the player back to the same zone.
|
||||
}
|
||||
|
||||
LOG("Player %llu has requested zone transfer to (%i, %i).", sender->GetObjectID(), static_cast<int>(mapId), static_cast<int>(cloneId));
|
||||
Log::Info("Player {:d} has requested zone transfer to ({:d}, {:d}).", sender->GetObjectID(), static_cast<int>(mapId), static_cast<int>(cloneId));
|
||||
|
||||
auto* character = player->GetCharacter();
|
||||
|
||||
@@ -4881,7 +4881,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream& inStream, Entity
|
||||
}
|
||||
|
||||
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, mapId, cloneId, false, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", character->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
|
||||
if (character) {
|
||||
character->SetZoneID(zoneID);
|
||||
|
@@ -100,7 +100,7 @@ Item::Item(
|
||||
if (isModMoveAndEquip) {
|
||||
Equip();
|
||||
|
||||
LOG("Move and equipped (%i) from (%i)", this->lot, this->inventory->GetType());
|
||||
Log::Info("Move and equipped ({:d}) from ({:d})", this->lot, GeneralUtils::ToUnderlying(this->inventory->GetType()));
|
||||
|
||||
Game::entityManager->SerializeEntity(inventory->GetComponent()->GetParent());
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_DEBUG("Player %llu %s used item %i", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot);
|
||||
Log::Debug("Player {:d} {:s} used item {:d}", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot);
|
||||
GameMessages::SendUseItemResult(playerInventoryComponent->GetParent(), thisLot, success);
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
auto file = Game::assetManager->GetFile(lxfmlPath.c_str());
|
||||
|
||||
if (!file) {
|
||||
LOG("Failed to load %s to disassemble model into bricks, check that this file exists", lxfmlPath.c_str());
|
||||
Log::Warn("Failed to load {:s} to disassemble model into bricks, check that this file exists", lxfmlPath);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
if (designID) {
|
||||
const auto designId = GeneralUtils::TryParse<uint32_t>(designID);
|
||||
if (!designId) {
|
||||
LOG("Failed to parse designID %s", designID);
|
||||
Log::Warn("Failed to parse designID {:s}", designID);
|
||||
continue;
|
||||
}
|
||||
parts[designId.value()]++;
|
||||
|
@@ -10,5 +10,5 @@ AddActionMessage::AddActionMessage(const AMFArrayValue& arguments)
|
||||
|
||||
m_Action = Action{ *actionValue };
|
||||
|
||||
LOG_DEBUG("actionIndex %i stripId %i stateId %i type %s valueParameterName %s valueParameterString %s valueParameterDouble %f m_BehaviorId %i", m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_Action.GetType().c_str(), m_Action.GetValueParameterName().c_str(), m_Action.GetValueParameterString().c_str(), m_Action.GetValueParameterDouble(), m_BehaviorId);
|
||||
Log::Debug("actionIndex {:d} stripId {:d} stateId {:d} type {:s} valueParameterName {:s} valueParameterString {:s} valueParameterDouble {:f} m_BehaviorId {:d}", m_ActionIndex, m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_Action.GetType(), m_Action.GetValueParameterName(), m_Action.GetValueParameterString(), m_Action.GetValueParameterDouble(), m_BehaviorId);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ AddStripMessage::AddStripMessage(const AMFArrayValue& arguments)
|
||||
|
||||
m_ActionsToAdd.emplace_back(*actionValue);
|
||||
|
||||
LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i t %s valueParameterName %s valueParameterString %s valueParameterDouble %f", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId, m_ActionsToAdd.back().GetType().c_str(), m_ActionsToAdd.back().GetValueParameterName().c_str(), m_ActionsToAdd.back().GetValueParameterString().c_str(), m_ActionsToAdd.back().GetValueParameterDouble());
|
||||
Log::Debug("xPosition {:f} yPosition {:f} stripId {:d} stateId {:d} behaviorId {:d} t {:s} valueParameterName {:s} valueParameterString {:s} valueParameterDouble {:f}", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_BehaviorId, m_ActionsToAdd.back().GetType(), m_ActionsToAdd.back().GetValueParameterName(), m_ActionsToAdd.back().GetValueParameterString(), m_ActionsToAdd.back().GetValueParameterDouble());
|
||||
}
|
||||
LOG_DEBUG("number of actions %i", m_ActionsToAdd.size());
|
||||
Log::Debug("number of actions {:d}", m_ActionsToAdd.size());
|
||||
}
|
||||
|
@@ -6,6 +6,6 @@ MergeStripsMessage::MergeStripsMessage(const AMFArrayValue& arguments)
|
||||
, m_SourceActionContext{ arguments, "srcStateID", "srcStripID" }
|
||||
, m_DestinationActionContext{ arguments, "dstStateID", "dstStripID" } {
|
||||
|
||||
LOG_DEBUG("srcstripId %i dststripId %i srcstateId %i dststateId %i dstactionIndex %i behaviorId %i", m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), m_SourceActionContext.GetStateId(), m_DestinationActionContext.GetStateId(), m_DstActionIndex, m_BehaviorId);
|
||||
Log::Debug("srcstripId {:d} dststripId {:d} srcstateId {:d} dststateId {:d} dstactionIndex {:d} behaviorId {:d}", m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_SourceActionContext.GetStateId()), GeneralUtils::ToUnderlying(m_DestinationActionContext.GetStateId()), m_DstActionIndex, m_BehaviorId);
|
||||
}
|
||||
|
||||
|
@@ -7,5 +7,5 @@ MigrateActionsMessage::MigrateActionsMessage(const AMFArrayValue& arguments)
|
||||
, m_SourceActionContext{ arguments, "srcStateID", "srcStripID" }
|
||||
, m_DestinationActionContext{ arguments, "dstStateID", "dstStripID" } {
|
||||
|
||||
LOG_DEBUG("srcactionIndex %i dstactionIndex %i srcstripId %i dststripId %i srcstateId %i dststateId %i behaviorId %i", m_SrcActionIndex, m_DstActionIndex, m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), m_SourceActionContext.GetStateId(), m_DestinationActionContext.GetStateId(), m_BehaviorId);
|
||||
Log::Debug("srcactionIndex {:d} dstactionIndex {:d} srcstripId {:d} dststripId {:d} srcstateId {:d} dststateId {:d} behaviorId {:d}", m_SrcActionIndex, m_DstActionIndex, m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_SourceActionContext.GetStateId()), GeneralUtils::ToUnderlying(m_DestinationActionContext.GetStateId()), m_BehaviorId);
|
||||
}
|
||||
|
@@ -6,5 +6,5 @@ RearrangeStripMessage::RearrangeStripMessage(const AMFArrayValue& arguments)
|
||||
, m_DstActionIndex{ GetActionIndexFromArgument(arguments, "dstActionIndex") }
|
||||
, m_ActionContext{ arguments } {
|
||||
|
||||
LOG_DEBUG("srcactionIndex %i dstactionIndex %i stripId %i behaviorId %i stateId %i", m_SrcActionIndex, m_DstActionIndex, m_ActionContext.GetStripId(), m_BehaviorId, m_ActionContext.GetStateId());
|
||||
Log::Debug("srcactionIndex {:d} dstactionIndex {:d} stripId {:d} behaviorId {:d} stateId {:d}", m_SrcActionIndex, m_DstActionIndex, m_ActionContext.GetStripId(), m_BehaviorId, GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()));
|
||||
}
|
||||
|
@@ -5,5 +5,5 @@ RemoveActionsMessage::RemoveActionsMessage(const AMFArrayValue& arguments)
|
||||
, m_ActionIndex{ GetActionIndexFromArgument(arguments) }
|
||||
, m_ActionContext{ arguments } {
|
||||
|
||||
LOG_DEBUG("behaviorId %i actionIndex %i stripId %i stateId %i", m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId());
|
||||
Log::Debug("behaviorId {:d} actionIndex {:d} stripId {:d} stateId {:d}", m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()));
|
||||
}
|
||||
|
@@ -4,5 +4,5 @@ RemoveStripMessage::RemoveStripMessage(const AMFArrayValue& arguments)
|
||||
: BehaviorMessageBase{ arguments }
|
||||
, m_ActionContext{ arguments } {
|
||||
|
||||
LOG_DEBUG("stripId %i stateId %i behaviorId %i", m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId);
|
||||
Log::Debug("stripId {:d} stateId {:d} behaviorId {:d}", m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_BehaviorId);
|
||||
}
|
||||
|
@@ -7,5 +7,5 @@ SplitStripMessage::SplitStripMessage(const AMFArrayValue& arguments)
|
||||
, m_DestinationActionContext{ arguments, "dstStateID", "dstStripID" }
|
||||
, m_DestinationPosition{ arguments, "dstStripUI" } {
|
||||
|
||||
LOG_DEBUG("behaviorId %i xPosition %f yPosition %f sourceStrip %i destinationStrip %i sourceState %i destinationState %i srcActindex %i", m_BehaviorId, m_DestinationPosition.GetX(), m_DestinationPosition.GetY(), m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), m_SourceActionContext.GetStateId(), m_DestinationActionContext.GetStateId(), m_SrcActionIndex);
|
||||
Log::Debug("behaviorId {:d} xPosition {:f} yPosition {:f} sourceStrip {:d} destinationStrip {:d} sourceState {:d} destinationState {:d} srcActindex {:d}", m_BehaviorId, m_DestinationPosition.GetX(), m_DestinationPosition.GetY(), m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_SourceActionContext.GetStateId()), GeneralUtils::ToUnderlying(m_DestinationActionContext.GetStateId()), m_SrcActionIndex);
|
||||
}
|
||||
|
@@ -12,5 +12,5 @@ UpdateActionMessage::UpdateActionMessage(const AMFArrayValue& arguments)
|
||||
|
||||
m_Action = Action{ *actionValue };
|
||||
|
||||
LOG_DEBUG("type %s valueParameterName %s valueParameterString %s valueParameterDouble %f behaviorId %i actionIndex %i stripId %i stateId %i", m_Action.GetType().c_str(), m_Action.GetValueParameterName().c_str(), m_Action.GetValueParameterString().c_str(), m_Action.GetValueParameterDouble(), m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId());
|
||||
Log::Debug("type {:s} valueParameterName {:s} valueParameterString {:s} valueParameterDouble {:f} behaviorId {:d} actionIndex {:d} stripId {:d} stateId {:d}", m_Action.GetType(), m_Action.GetValueParameterName(), m_Action.GetValueParameterString(), m_Action.GetValueParameterDouble(), m_BehaviorId, m_ActionIndex, m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()));
|
||||
}
|
||||
|
@@ -5,5 +5,5 @@ UpdateStripUiMessage::UpdateStripUiMessage(const AMFArrayValue& arguments)
|
||||
, m_Position{ arguments }
|
||||
, m_ActionContext{ arguments } {
|
||||
|
||||
LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId);
|
||||
Log::Debug("xPosition {:f} yPosition {:f} stripId {:d} stateId {:d} behaviorId {:d}", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_BehaviorId);
|
||||
}
|
||||
|
@@ -190,14 +190,14 @@ ControlBehaviors::ControlBehaviors() {
|
||||
|
||||
auto ret = m_Doc.Parse(buffer.c_str());
|
||||
if (ret == tinyxml2::XML_SUCCESS) {
|
||||
LOG_DEBUG("Successfully parsed the blocksdef file!");
|
||||
Log::Debug("Successfully parsed the blocksdef file!");
|
||||
} else {
|
||||
LOG("Failed to parse BlocksDef xmlData due to error %i!", ret);
|
||||
Log::Warn("Failed to parse BlocksDef xmlData due to error {:d}!", GeneralUtils::ToUnderlying(ret));
|
||||
return;
|
||||
}
|
||||
auto* blockLibrary = m_Doc.FirstChildElement();
|
||||
if (!blockLibrary) {
|
||||
LOG("No Block Library child element found.");
|
||||
Log::Warn("No Block Library child element found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -96,12 +96,12 @@ void PropertyBehavior::VerifyLastEditedState() {
|
||||
for (const auto& [stateId, state] : m_States) {
|
||||
if (state.IsEmpty()) continue;
|
||||
|
||||
LOG_DEBUG("Updating last edited state to %i because %i is empty.", stateId, m_LastEditedState);
|
||||
Log::Debug("Updating last edited state to {:d} because {:d} is empty.", GeneralUtils::ToUnderlying(stateId), GeneralUtils::ToUnderlying(m_LastEditedState));
|
||||
m_LastEditedState = stateId;
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG("No states found, sending default state");
|
||||
Log::Debug("No states found, sending default state");
|
||||
|
||||
m_LastEditedState = BehaviorState::HOME_STATE;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void PropertyBehavior::SendBehaviorBlocksToClient(AMFArrayValue& args) const {
|
||||
for (const auto& [stateId, state] : m_States) {
|
||||
if (state.IsEmpty()) continue;
|
||||
|
||||
LOG_DEBUG("Serializing state %i", stateId);
|
||||
Log::Debug("Serializing state {:d}", GeneralUtils::ToUnderlying(stateId));
|
||||
auto* const stateArgs = stateArray->PushArray();
|
||||
stateArgs->Insert("id", static_cast<double>(stateId));
|
||||
state.SendBehaviorBlocksToClient(*stateArgs);
|
||||
|
@@ -25,7 +25,7 @@ Entity* GetPossessedEntity(const LWOOBJID& objId) {
|
||||
|
||||
void ReportCheat(User* user, const SystemAddress& sysAddr, const char* messageIfNotSender, va_list args) {
|
||||
if (!user) {
|
||||
LOG("WARNING: User is null, using defaults.");
|
||||
Log::Warn("User is null, using defaults.");
|
||||
}
|
||||
|
||||
IPlayerCheatDetections::Info info;
|
||||
@@ -42,7 +42,7 @@ void ReportCheat(User* user, const SystemAddress& sysAddr, const char* messageIf
|
||||
|
||||
Database::Get()->InsertCheatDetection(info);
|
||||
|
||||
LOG("Anti-cheat message: %s", extraMsg);
|
||||
Log::Info("Anti-cheat message: {:s}", extraMsg);
|
||||
}
|
||||
|
||||
void LogAndSaveFailedAntiCheatCheck(const LWOOBJID& id, const SystemAddress& sysAddr, const CheckType checkType, const char* messageIfNotSender, va_list args) {
|
||||
@@ -54,20 +54,20 @@ void LogAndSaveFailedAntiCheatCheck(const LWOOBJID& id, const SystemAddress& sys
|
||||
|
||||
// If player exists and entity exists in world, use both for logging info.
|
||||
if (entity && player) {
|
||||
LOG("Player (%s) (%llu) at system address (%s) with sending player (%s) (%llu) does not match their own.",
|
||||
player->GetCharacter()->GetName().c_str(), player->GetObjectID(),
|
||||
Log::Warn("Player ({:s}) ({:d}) at system address ({:s}) with sending player ({:s}) ({:d}) does not match their own.",
|
||||
player->GetCharacter()->GetName(), player->GetObjectID(),
|
||||
sysAddr.ToString(),
|
||||
entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
|
||||
entity->GetCharacter()->GetName(), entity->GetObjectID());
|
||||
if (player->GetCharacter()) toReport = player->GetCharacter()->GetParentUser();
|
||||
// In the case that the target entity id did not exist, just log the player info.
|
||||
} else if (player) {
|
||||
LOG("Player (%s) (%llu) at system address (%s) with sending player (%llu) does not match their own.",
|
||||
player->GetCharacter()->GetName().c_str(), player->GetObjectID(),
|
||||
Log::Warn("Player ({:s}) ({:d}) at system address ({:s}) with sending player ({:d}) does not match their own.",
|
||||
player->GetCharacter()->GetName(), player->GetObjectID(),
|
||||
sysAddr.ToString(), id);
|
||||
if (player->GetCharacter()) toReport = player->GetCharacter()->GetParentUser();
|
||||
// In the rare case that the player does not exist, just log the system address and who the target id was.
|
||||
} else {
|
||||
LOG("Player at system address (%s) with sending player (%llu) does not match their own.",
|
||||
Log::Warn("Player at system address ({:s}) with sending player ({:d}) does not match their own.",
|
||||
sysAddr.ToString(), id);
|
||||
}
|
||||
break;
|
||||
@@ -76,11 +76,11 @@ void LogAndSaveFailedAntiCheatCheck(const LWOOBJID& id, const SystemAddress& sys
|
||||
auto* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
if (user) {
|
||||
LOG("User at system address (%s) (%s) (%llu) sent a packet as (%i) which is not an id they own.",
|
||||
sysAddr.ToString(), user->GetLastUsedChar()->GetName().c_str(), user->GetLastUsedChar()->GetObjectID(), static_cast<int32_t>(id));
|
||||
Log::Warn("User at system address ({:s}) ({:s}) ({:d}) sent a packet as ({:d}) which is not an id they own.",
|
||||
sysAddr.ToString(), user->GetLastUsedChar()->GetName(), user->GetLastUsedChar()->GetObjectID(), id);
|
||||
// Can't know sending player. Just log system address for IP banning.
|
||||
} else {
|
||||
LOG("No user found for system address (%s).", sysAddr.ToString());
|
||||
Log::Warn("No user found for system address ({:s}).", sysAddr.ToString());
|
||||
}
|
||||
toReport = user;
|
||||
break;
|
||||
@@ -113,7 +113,7 @@ bool CheatDetection::VerifyLwoobjidIsSender(const LWOOBJID& id, const SystemAddr
|
||||
// Check here if the system address has a character with id matching the lwoobjid after unsetting the flag bits.
|
||||
auto* sendingUser = UserManager::Instance()->GetUser(sysAddr);
|
||||
if (!sendingUser) {
|
||||
LOG("No user found for system address (%s).", sysAddr.ToString());
|
||||
Log::Warn("No user found for system address ({:s}).", sysAddr.ToString());
|
||||
return false;
|
||||
}
|
||||
invalidPacket = true;
|
||||
|
@@ -145,7 +145,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
WorldPackets::SendGMLevelChange(sysAddr, success, user->GetMaxGMLevel(), entity->GetGMLevel(), level);
|
||||
GameMessages::SendChatModeUpdate(entity->GetObjectID(), level);
|
||||
entity->SetGMLevel(level);
|
||||
LOG("User %s (%i) has changed their GM level to %i for charID %llu", user->GetUsername().c_str(), user->GetAccountID(), level, entity->GetObjectID());
|
||||
Log::Info("User {:s} ({:d}) has changed their GM level to {:d} for charID {:d}", user->GetUsername(), user->GetAccountID(), GeneralUtils::ToUnderlying(level), entity->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user