experimenting; not looking to pr

This commit is contained in:
jadebenn
2024-03-08 15:44:02 -06:00
parent 642c86a449
commit 7250aa51f6
87 changed files with 510 additions and 423 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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