mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-17 04:04:21 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3ab8abb29 | ||
|
|
26f388eaed |
@@ -962,5 +962,12 @@ namespace GameMessages {
|
|||||||
|
|
||||||
LWOOBJID childID{};
|
LWOOBJID childID{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ObjectLoaded : public GameMsg {
|
||||||
|
ObjectLoaded() : GameMsg(MessageType::Game::OBJECT_LOADED) {}
|
||||||
|
|
||||||
|
LWOOBJID objectID{};
|
||||||
|
LOT lot{};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
#endif // GAMEMESSAGES_H
|
#endif // GAMEMESSAGES_H
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
set(DSCRIPTS_SOURCES_02_SERVER_DLU
|
set(DSCRIPTS_SOURCES_02_SERVER_DLU
|
||||||
"DLUVanityTeleportingObject.cpp"
|
"DLUVanityTeleportingObject.cpp"
|
||||||
|
"RegisterWithZoneControl.cpp"
|
||||||
PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
|
|||||||
12
dScripts/02_server/DLU/RegisterWithZoneControl.cpp
Normal file
12
dScripts/02_server/DLU/RegisterWithZoneControl.cpp
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include "RegisterWithZoneControl.h"
|
||||||
|
|
||||||
|
#include "Entity.h"
|
||||||
|
#include "EntityManager.h"
|
||||||
|
#include "GameMessages.h"
|
||||||
|
|
||||||
|
void RegisterWithZoneControl::OnStartup(Entity* self) {
|
||||||
|
GameMessages::ObjectLoaded objLoaded;
|
||||||
|
objLoaded.objectID = self->GetObjectID();
|
||||||
|
objLoaded.lot = self->GetLOT();
|
||||||
|
objLoaded.Send(Game::entityManager->GetZoneControlEntity()->GetObjectID());
|
||||||
|
}
|
||||||
14
dScripts/02_server/DLU/RegisterWithZoneControl.h
Normal file
14
dScripts/02_server/DLU/RegisterWithZoneControl.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// Darkflame Universe
|
||||||
|
// Copyright 2026
|
||||||
|
|
||||||
|
#ifndef REGISTERWITHZONECONTROL_H
|
||||||
|
#define REGISTERWITHZONECONTROL_H
|
||||||
|
|
||||||
|
#include "CppScripts.h"
|
||||||
|
|
||||||
|
class RegisterWithZoneControl : public CppScripts::Script {
|
||||||
|
public:
|
||||||
|
void OnStartup(Entity* self) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //!REGISTERWITHZONECONTROL_H
|
||||||
@@ -13,7 +13,6 @@ void ResetMissions(Entity& user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OldManNPC::OnUse(Entity* self, Entity* user) {
|
void OldManNPC::OnUse(Entity* self, Entity* user) {
|
||||||
LOG("");
|
|
||||||
const auto* const missionComponent = user->GetComponent<MissionComponent>();
|
const auto* const missionComponent = user->GetComponent<MissionComponent>();
|
||||||
if (!missionComponent) return;
|
if (!missionComponent) return;
|
||||||
|
|
||||||
@@ -24,7 +23,6 @@ void OldManNPC::OnUse(Entity* self, Entity* user) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto missionState = mission->GetMissionState();
|
const auto missionState = mission->GetMissionState();
|
||||||
LOG("mission state %i", missionState);
|
|
||||||
if (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) {
|
if (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) {
|
||||||
ResetMissions(*user);
|
ResetMissions(*user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,6 +339,8 @@
|
|||||||
#include "ImaginationBackPack.h"
|
#include "ImaginationBackPack.h"
|
||||||
#include "NsWinterRaceServer.h"
|
#include "NsWinterRaceServer.h"
|
||||||
|
|
||||||
|
#include "RegisterWithZoneControl.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -663,6 +665,7 @@ namespace {
|
|||||||
|
|
||||||
//WBL
|
//WBL
|
||||||
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
|
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
|
||||||
|
{"scripts\\zone\\LUPs\\Moonbase Intro\\MOONBASE-INTRO_INTRO_CINEMATIC.lua", []() {return new WblGenericZone();}},
|
||||||
|
|
||||||
//Alpha
|
//Alpha
|
||||||
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
|
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
|
||||||
@@ -708,7 +711,8 @@ namespace {
|
|||||||
{"scripts\\ai\\RACING\\OBJECTS\\VEHICLE_DEATH_TRIGGER_WATER_SERVER.lua", []() {return new VehicleDeathTriggerWaterServer();}},
|
{"scripts\\ai\\RACING\\OBJECTS\\VEHICLE_DEATH_TRIGGER_WATER_SERVER.lua", []() {return new VehicleDeathTriggerWaterServer();}},
|
||||||
{"scripts\\equipmenttriggers\\L_TRIAL_FACTION_ARMOR_SERVER.lua", []() {return new TrialFactionArmorServer();}},
|
{"scripts\\equipmenttriggers\\L_TRIAL_FACTION_ARMOR_SERVER.lua", []() {return new TrialFactionArmorServer();}},
|
||||||
{"scripts\\equipmenttriggers\\ImaginationBackPack.lua", []() {return new ImaginationBackPack();}},
|
{"scripts\\equipmenttriggers\\ImaginationBackPack.lua", []() {return new ImaginationBackPack();}},
|
||||||
|
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_ACTOR.lua", [](){return new RegisterWithZoneControl();}},
|
||||||
|
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_EFFECT.lua", [](){return new RegisterWithZoneControl();}},
|
||||||
};
|
};
|
||||||
|
|
||||||
std::set<std::string> g_ExcludedScripts = {
|
std::set<std::string> g_ExcludedScripts = {
|
||||||
@@ -732,6 +736,11 @@ namespace {
|
|||||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_InfectedCitizen.lua",
|
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_InfectedCitizen.lua",
|
||||||
"scripts\\ai\\MINIGAME\\SIEGE\\OBJECTS\\ATTACKER_BOUNCER_SERVER.lua",
|
"scripts\\ai\\MINIGAME\\SIEGE\\OBJECTS\\ATTACKER_BOUNCER_SERVER.lua",
|
||||||
"scripts\\ai\\AG\\L_AG_ZONE_PLAYER.lua",
|
"scripts\\ai\\AG\\L_AG_ZONE_PLAYER.lua",
|
||||||
|
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_MOVEMENT.lua", // Really old alpha script
|
||||||
|
"scripts\\zone\\LUPs\\DeepFreeze Intro\\WBL_Enemy_Beaver.lua", // Really old alpha script
|
||||||
|
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_WANDER_SMALL.lua", // Really old alpha script
|
||||||
|
"scripts\\ai\\NP\\L_NPC_NP_OLD_MAN_SHERLAND.lua", // This NPC doesn't even exist in modern crux, the only place this is used...
|
||||||
|
"scripts\\02_server\\Map\\General\\L_SIMPLE_MOVER_SWITCH.lua", // This platform does not exist even when moved manually on a client
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -745,7 +754,8 @@ CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::strin
|
|||||||
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
||||||
|
|
||||||
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||||
LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
const auto [x, y, z] = parent->GetPosition();
|
||||||
|
LOG_DEBUG("LOT %i at %f %f %f attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), x, y, z, scriptName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Scripts[scriptName] = script;
|
g_Scripts[scriptName] = script;
|
||||||
|
|||||||
Reference in New Issue
Block a user