diff --git a/CMakeLists.txt b/CMakeLists.txt index fe1f275..a8395c8 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 c892287..8b25452 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/README.md b/README.md index 190bfab..aee2ae8 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,15 @@ Make sure packages like `gcc`, `cmake`, and `zlib` are installed. Depending on t cmake must be version 3.12 or higher! **Build the repository** + +You can either run `build.sh` when in the root folder of the repository: + +```bash +./build.sh +``` + +Or manually run the commands used in `build.sh`: + ```bash # Create the build directory, preserving it if it already exists mkdir -p build diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/dDatabase/Tables/CDTable.h b/dDatabase/Tables/CDTable.h index c7c6437..ec056e8 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 diff --git a/dGame/dComponents/BuffComponent.cpp b/dGame/dComponents/BuffComponent.cpp index bf15996..06c859c 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 2f7ff7a..0846f01 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 830b3db..c0738ef 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. diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 8be9961..47704d2 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); } diff --git a/dNet/dServer.cpp b/dNet/dServer.cpp index 245b768..27b6df7 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("dServer", "Unknown packet ID from master: %i\n", packet->data[3]); + + return packet; } } } diff --git a/dScripts/AgSpaceStuff.cpp b/dScripts/AgSpaceStuff.cpp index 2550f00..507b908 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); }