From b73850481249cc39d39792ebf87fffcf65400448 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 14 Jan 2025 02:09:54 -0800 Subject: [PATCH 1/2] reduce traffic greatly --- dGame/dComponents/QuickBuildComponent.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dGame/dComponents/QuickBuildComponent.cpp b/dGame/dComponents/QuickBuildComponent.cpp index 4e393fb0..ac3aa772 100644 --- a/dGame/dComponents/QuickBuildComponent.cpp +++ b/dGame/dComponents/QuickBuildComponent.cpp @@ -125,11 +125,10 @@ void QuickBuildComponent::Update(float deltaTime) { if (isSmashGroup) { ModifyIncompleteTimer(deltaTime); - Game::entityManager->SerializeEntity(m_Parent); // For reset times < 0 this has to be handled manually if (m_TimeBeforeSmash > 0) { - if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) { + if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f && !m_ShowResetEffect) { SetShowResetEffect(true); Game::entityManager->SerializeEntity(m_Parent); @@ -149,11 +148,10 @@ void QuickBuildComponent::Update(float deltaTime) { } case eQuickBuildState::COMPLETED: { ModifyTimer(deltaTime); - Game::entityManager->SerializeEntity(m_Parent); // For reset times < 0 this has to be handled manually if (m_ResetTime > 0) { - if (m_Timer >= m_ResetTime - 4.0f) { + if (m_Timer >= m_ResetTime - 4.0f && !m_ShowResetEffect) { SetShowResetEffect(true); Game::entityManager->SerializeEntity(m_Parent); @@ -210,11 +208,10 @@ void QuickBuildComponent::Update(float deltaTime) { } case eQuickBuildState::INCOMPLETE: { ModifyIncompleteTimer(deltaTime); - Game::entityManager->SerializeEntity(m_Parent); // For reset times < 0 this has to be handled manually if (m_TimeBeforeSmash > 0) { - if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f) { + if (m_TimerIncomplete >= m_TimeBeforeSmash - 4.0f && !m_ShowResetEffect) { SetShowResetEffect(true); Game::entityManager->SerializeEntity(m_Parent); From a0913ff23d6af42a812ed1c3f94e7162e89750e1 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 14 Jan 2025 02:18:46 -0800 Subject: [PATCH 2/2] remove grandmas code --- dGame/dComponents/QuickBuildComponent.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dGame/dComponents/QuickBuildComponent.cpp b/dGame/dComponents/QuickBuildComponent.cpp index ac3aa772..7a5cd8a0 100644 --- a/dGame/dComponents/QuickBuildComponent.cpp +++ b/dGame/dComponents/QuickBuildComponent.cpp @@ -105,16 +105,6 @@ void QuickBuildComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsIni void QuickBuildComponent::Update(float deltaTime) { SetActivator(GetActivator()); - // Serialize the quickbuild every so often, fixes the odd bug where the quickbuild is not buildable - /*if (m_SoftTimer > 0.0f) { - m_SoftTimer -= deltaTime; - } - else { - m_SoftTimer = 5.0f; - - Game::entityManager->SerializeEntity(m_Parent); - }*/ - switch (m_State) { case eQuickBuildState::OPEN: { SpawnActivator();