mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 23:08:31 +00:00
.github
cmake
dAuthServer
dChatFilter
dChatServer
dCommon
dDatabase
dGame
dMasterServer
dNavigation
dNet
dPhysics
dScripts
02_server
EquipmentScripts
EquipmentTriggers
ai
ACT
AG
FV
ActNinjaSensei.cpp
ActNinjaSensei.h
ActNinjaTurret.cpp
ActNinjaTurret.h
ActParadoxPipeFix.cpp
ActParadoxPipeFix.h
CMakeLists.txt
FvBounceOverWall.cpp
FvBounceOverWall.h
FvBrickPuzzleServer.cpp
FvBrickPuzzleServer.h
FvConsoleLeftQuickbuild.cpp
FvConsoleLeftQuickbuild.h
FvConsoleRightQuickbuild.cpp
FvConsoleRightQuickbuild.h
FvDragonSmashingGolemQb.cpp
FvDragonSmashingGolemQb.h
FvFacilityBrick.cpp
FvFacilityBrick.h
FvFacilityPipes.cpp
FvFacilityPipes.h
FvFlyingCreviceDragon.cpp
FvFlyingCreviceDragon.h
FvFreeGfNinjas.cpp
FvFreeGfNinjas.h
FvMaelstromGeyser.cpp
FvMaelstromGeyser.h
FvNinjaGuard.cpp
FvNinjaGuard.h
FvPandaServer.cpp
FvPandaServer.h
FvPandaSpawnerServer.cpp
FvPandaSpawnerServer.h
FvPassThroughWall.cpp
FvPassThroughWall.h
TriggerGas.cpp
TriggerGas.h
GENERAL
GF
MINIGAME
NP
NS
PETS
PROPERTY
RACING
SPEC
WILD
CMakeLists.txt
client
zone
ActivityManager.cpp
ActivityManager.h
BaseConsoleTeleportServer.cpp
BaseConsoleTeleportServer.h
BasePropertyServer.cpp
BasePropertyServer.h
BaseRandomServer.cpp
BaseRandomServer.h
BaseSurvivalServer.cpp
BaseSurvivalServer.h
BaseWavesGenericEnemy.cpp
BaseWavesGenericEnemy.h
BaseWavesServer.cpp
BaseWavesServer.h
CMakeLists.txt
ChooseYourDestinationNsToNt.cpp
ChooseYourDestinationNsToNt.h
CppScripts.cpp
CppScripts.h
Darkitect.cpp
Darkitect.h
InvalidScript.cpp
InvalidScript.h
NPCAddRemoveItem.cpp
NPCAddRemoveItem.h
NtFactionSpyServer.cpp
NtFactionSpyServer.h
ScriptedPowerupSpawner.cpp
ScriptedPowerupSpawner.h
SpawnPetBaseServer.cpp
SpawnPetBaseServer.h
dServer
dWeb
dWorldServer
dZoneManager
docs
migrations
resources
tests
thirdparty
vanity
.dockerignore
.editorconfig
.env.example
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
CMakeLists.txt
CMakePresets.json
CMakeVariables.txt
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
SECURITY.md
build.sh
docker-compose.yml
entrypoint.sh
logo.png
systemd.example
versions.txt

* Changed how the TryParse function works (and also did some general cleanup along the way) * Update noexcept attributes (verified these are correct) * Add fp overload for MacOS functionality * resolving some feedback * Split out unrelated changes to CleanupRoundup branch * Update in response to feedback * the consequences of emo's member variable renaming request * Revert "the consequences of emo's member variable renaming request" This reverts commitbf318caeda
. * Fully revert renaming attempt * Revert "the consequences of emo's member variable renaming request" This reverts commitbf318caeda
. Fully revert renaming attempt * Created ClientVersion.h and moved the client version defaults to it * Fix partial parsing and MacOS floating point errors * attempting fix to MacOS compiler error * syntax pass (should be the last commit unless the CI fails) * ah, wait, forgot to uncomment the preprocessor statements for MacOS. THIS should be the last commit pending CI * Okay, one last thing I noticed: We were including C headers here. Now they're C++ headers. Pinky swear this is it! * typo and I am OCD. please let this be the last * hash is usally but not always noexcept, so the specifier should go * Address MOST of the feedback * address the claim codes issue
65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
#include "FvBrickPuzzleServer.h"
|
|
#include "GeneralUtils.h"
|
|
#include "dZoneManager.h"
|
|
#include "Spawner.h"
|
|
#include "QuickBuildComponent.h"
|
|
|
|
void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
|
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
|
|
|
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
|
if (!pipeNum) return;
|
|
|
|
if (pipeNum != 1) {
|
|
self->AddTimer("reset", 30);
|
|
}
|
|
}
|
|
|
|
void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
|
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
|
|
|
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
|
if (!pipeNum) return;
|
|
|
|
const auto pipeGroup = myGroup.substr(0, 10);
|
|
|
|
const auto nextPipeNum = pipeNum.value() + 1;
|
|
|
|
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
|
|
|
if (!samePipeSpawners.empty()) {
|
|
samePipeSpawners[0]->SoftReset();
|
|
|
|
samePipeSpawners[0]->Deactivate();
|
|
}
|
|
|
|
if (killer && killer->IsPlayer()) {
|
|
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
|
|
|
const auto nextPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
|
|
|
if (!nextPipeSpawners.empty()) {
|
|
nextPipeSpawners[0]->Activate();
|
|
}
|
|
} else {
|
|
const auto nextPipe = pipeGroup + "1";
|
|
|
|
const auto firstPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
|
|
|
if (!firstPipeSpawners.empty()) {
|
|
firstPipeSpawners[0]->Activate();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
|
|
if (timerName == "reset") {
|
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
|
|
|
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
|
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
|
}
|
|
}
|
|
}
|