From f15b716ea79d0ce8f36b648d1576fa2efa2d3cd3 Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Fri, 31 Dec 2021 02:52:35 +0000 Subject: [PATCH 1/6] Implement master server fix --- dNet/dServer.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/dNet/dServer.cpp b/dNet/dServer.cpp index 2a9a612e..9b01ed8c 100644 --- a/dNet/dServer.cpp +++ b/dNet/dServer.cpp @@ -126,28 +126,9 @@ Packet* dServer::ReceiveFromMaster() { } //When we handle these packets in World instead dServer, we just return the packet's pointer. - case MSG_MASTER_REQUEST_PERSISTENT_ID_RESPONSE: { - return packet; - break; - } - - case MSG_MASTER_SESSION_KEY_RESPONSE: { - return packet; - break; - } - - case MSG_MASTER_SHUTDOWN : { - return packet; - break; - } - - case MSG_MASTER_AFFIRM_TRANSFER_REQUEST: { - return packet; - break; - } - default: mLogger->Log("Server", "Unknown packet ID from master: %i\n", packet->data[3]); + return packet; } } } From 2d5d5b273a0e204e0b4fb0fbbda6e6dce58d76a5 Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Fri, 31 Dec 2021 15:07:20 +0000 Subject: [PATCH 2/6] remove unneeded log --- dNet/dServer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dNet/dServer.cpp b/dNet/dServer.cpp index 9b01ed8c..df366955 100644 --- a/dNet/dServer.cpp +++ b/dNet/dServer.cpp @@ -127,7 +127,6 @@ Packet* dServer::ReceiveFromMaster() { //When we handle these packets in World instead dServer, we just return the packet's pointer. default: - mLogger->Log("Server", "Unknown packet ID from master: %i\n", packet->data[3]); return packet; } } From a15f9f38d81b57cfbeb023041d42bf9ace688d52 Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Sat, 1 Jan 2022 08:02:28 +0000 Subject: [PATCH 3/6] Update script value to that in the lua file (#331) --- dScripts/AgSpaceStuff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dScripts/AgSpaceStuff.cpp b/dScripts/AgSpaceStuff.cpp index 2550f001..507b908f 100644 --- a/dScripts/AgSpaceStuff.cpp +++ b/dScripts/AgSpaceStuff.cpp @@ -20,7 +20,7 @@ void AgSpaceStuff::OnStartup(Entity* self) { self->SetVar(u"ShakeObject", ref->GetObjectID()); - self->AddTimer("ShipShakeIdle", 1.0f); + self->AddTimer("ShipShakeIdle", 2.0f); self->SetVar(u"RandomTime", 10); } From 83107d413d8ad66ac8c61985aa37ccb4adf85c46 Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Sat, 1 Jan 2022 09:38:45 +0000 Subject: [PATCH 4/6] More windows fixes (#329) - Added World, Chat and Auth servers as deps to Master - Added "windows-default" CMake preset so that CMake didn't error out on Windows - Added NOMINMAX define above cpplinq include --- CMakeLists.txt | 6 ++++++ CMakePresets.json | 14 ++++++++++++++ dDatabase/Tables/CDTable.h | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe1f2751..a8395c8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,3 +487,9 @@ if(UNIX) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") endif(UNIX) + +if(WIN32) +add_dependencies(MasterServer WorldServer) +add_dependencies(MasterServer AuthServer) +add_dependencies(MasterServer ChatServer) +endif() \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index c892287a..8b25452f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,6 +12,20 @@ "description": "Sets build and install directories", "binaryDir": "${sourceDir}/build", "generator": "Unix Makefiles" + }, + { + "name": "windows-default", + "displayName": "Windows only Configure Settings", + "description": "Sets build and install directories", + "binaryDir": "${sourceDir}/build", + "generator": "Ninja", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } } ], "buildPresets": [ diff --git a/dDatabase/Tables/CDTable.h b/dDatabase/Tables/CDTable.h index c7c64377..ec056e8e 100644 --- a/dDatabase/Tables/CDTable.h +++ b/dDatabase/Tables/CDTable.h @@ -10,6 +10,10 @@ #include // CPPLinq +#ifdef _WIN32 +#define NOMINMAX +// windows.h has min and max macros that breaks cpplinq +#endif #include "cpplinq.hpp" #pragma warning (disable : 4244) //Disable double to float conversion warnings From 14fc049ea0b52623a301b6aa8bc1bda5215859fd Mon Sep 17 00:00:00 2001 From: m888r <25947228+m888r@users.noreply.github.com> Date: Sat, 1 Jan 2022 01:46:05 -0800 Subject: [PATCH 5/6] Damage Buff source fix - inventor beehive bug (#306) * add HandleUnmanaged overload to account for skill source * add source to buff damage skill call to credit players for kills * use LWOOBJID_EMPTY default arg & behaviorcontext constructor --- dGame/dComponents/BuffComponent.cpp | 2 +- dGame/dComponents/SkillComponent.cpp | 6 +++--- dGame/dComponents/SkillComponent.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dGame/dComponents/BuffComponent.cpp b/dGame/dComponents/BuffComponent.cpp index bf159964..06c859c8 100644 --- a/dGame/dComponents/BuffComponent.cpp +++ b/dGame/dComponents/BuffComponent.cpp @@ -71,7 +71,7 @@ void BuffComponent::Update(float deltaTime) buff.second.tickTime = buff.second.tick; buff.second.stacks--; - SkillComponent::HandleUnmanaged(buff.second.behaviorID, m_Parent->GetObjectID()); + SkillComponent::HandleUnmanaged(buff.second.behaviorID, m_Parent->GetObjectID(), buff.second.source); } } diff --git a/dGame/dComponents/SkillComponent.cpp b/dGame/dComponents/SkillComponent.cpp index 2f7ff7ab..0846f014 100644 --- a/dGame/dComponents/SkillComponent.cpp +++ b/dGame/dComponents/SkillComponent.cpp @@ -481,9 +481,9 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry) delete bitStream; } -void SkillComponent::HandleUnmanaged(const uint32_t behaviorId, const LWOOBJID target) +void SkillComponent::HandleUnmanaged(const uint32_t behaviorId, const LWOOBJID target, LWOOBJID source) { - auto* context = new BehaviorContext(target); + auto* context = new BehaviorContext(source); context->unmanaged = true; context->caster = target; @@ -496,7 +496,7 @@ void SkillComponent::HandleUnmanaged(const uint32_t behaviorId, const LWOOBJID t delete bitStream; - delete context; + delete context; } void SkillComponent::HandleUnCast(const uint32_t behaviorId, const LWOOBJID target) diff --git a/dGame/dComponents/SkillComponent.h b/dGame/dComponents/SkillComponent.h index 830b3db6..c0738efc 100644 --- a/dGame/dComponents/SkillComponent.h +++ b/dGame/dComponents/SkillComponent.h @@ -158,8 +158,9 @@ public: * Computes a server-side skill calculation without an associated entity. * @param behaviorId the root behavior ID of the skill * @param target the explicit target of the skill + * @param source the explicit source of the skill */ - static void HandleUnmanaged(uint32_t behaviorId, LWOOBJID target); + static void HandleUnmanaged(uint32_t behaviorId, LWOOBJID target, LWOOBJID source = LWOOBJID_EMPTY); /** * Computes a server-side skill uncast calculation without an associated entity. From 203e75ef3d1c3ef166199d3fc353f88eb9c0adb8 Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Sat, 1 Jan 2022 10:10:12 +0000 Subject: [PATCH 6/6] Fix resurrecting in BONS (#334) --- dGame/dUtilities/SlashCommandHandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 8be99612..47704d2b 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -61,6 +61,7 @@ #include "SkillComponent.h" #include "VanityUtilities.h" #include "GameConfig.h" +#include "ScriptedActivityComponent.h" void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) { std::string chatCommand; @@ -384,6 +385,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit } if (chatCommand == "resurrect") { + ScriptedActivityComponent* scriptedActivityComponent = dZoneManager::Instance()->GetZoneControlObject()->GetComponent(); + + if (scriptedActivityComponent) { // check if user is in activity world and if so, they can't resurrect + ChatPackets::SendSystemMessage(sysAddr, u"You cannot resurrect in an activity world."); + return; + } + GameMessages::SendResurrect(entity); }