mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-29 16:07:14 +00:00
fix(stats): RocketsUsed and QuickBuildsCompleted where live sent them
RocketsUsed: live counted the rocket when the client asked to go (FireEventServerSide "ZonePlayer"), right before TransferToZone (captures: 94 of 117 directly before it). DLU counted it when the launch animation started, so a launch that never went counted too. QuickBuildsCompleted: live sent it after RebuildNotifyState(Completed) and the completion effect (507), before EnableRebuild (218 of 227 samples); DLU counted it before the notify state. Check in game: launch a rocket to another world; Rockets Used goes up by 1 as the screen fades out. Finish a quick build: Quick Builds Completed goes up by 1 as the build finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -448,7 +448,6 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
|||||||
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||||
characterComponent->TrackQuickBuildComplete();
|
|
||||||
EconomyLedger::RecordMapEvent(IEconomyLedger::eMapEvent::QUICKBUILDS_COMPLETED, m_Parent->GetLOT(), m_Parent->GetPosition(), 1, user);
|
EconomyLedger::RecordMapEvent(IEconomyLedger::eMapEvent::QUICKBUILDS_COMPLETED, m_Parent->GetLOT(), m_Parent->GetPosition(), 1, user);
|
||||||
} else {
|
} else {
|
||||||
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
||||||
@@ -466,6 +465,8 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
|||||||
GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), 507, u"create", "BrickFadeUpVisCompleteEffect");
|
GameMessages::PlayFXEffect fx(m_Parent->GetObjectID(), 507, u"create", "BrickFadeUpVisCompleteEffect");
|
||||||
fx.priority = 0.4f;
|
fx.priority = 0.4f;
|
||||||
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
fx.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
// Live: RebuildNotifyState(Completed), the effect, then QuickBuildsCompleted, then EnableRebuild
|
||||||
|
characterComponent->TrackQuickBuildComplete();
|
||||||
GameMessages::EnableRebuild enableRebuild;
|
GameMessages::EnableRebuild enableRebuild;
|
||||||
enableRebuild.target = m_Parent->GetObjectID();
|
enableRebuild.target = m_Parent->GetObjectID();
|
||||||
enableRebuild.bEnable = false;
|
enableRebuild.bEnable = false;
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
|
|||||||
character->SetTargetScene(m_TargetScene);
|
character->SetTargetScene(m_TargetScene);
|
||||||
}
|
}
|
||||||
|
|
||||||
characterComponent->UpdatePlayerStatistic(RocketsUsed);
|
|
||||||
|
|
||||||
character->SaveXMLToDatabase();
|
character->SaveXMLToDatabase();
|
||||||
|
|
||||||
SetSelectedMapId(originator->GetObjectID(), zone);
|
SetSelectedMapId(originator->GetObjectID(), zone);
|
||||||
|
|||||||
@@ -97,6 +97,10 @@ namespace GameMessages {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Live counted the rocket when the client asked to go (after the launch), before TransferToZone
|
||||||
|
auto* launcher = player->GetComponent<CharacterComponent>();
|
||||||
|
if (launcher) launcher->UpdatePlayerStatistic(RocketsUsed);
|
||||||
|
|
||||||
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) {
|
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("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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user