Compare commits

..

14 Commits

Author SHA1 Message Date
David Markowitz
1b9f7e44c7 remove dead loop (#1700) 2024-12-28 17:11:44 -06:00
David Markowitz
08a168de88 update cdclient.fdb file check (#1699) 2024-12-27 22:15:32 -06:00
David Markowitz
0c948a8df6 use simpler converter (#1695) 2024-12-24 22:23:14 -08:00
Gie "Max" Vanommeslaeghe
6ed6efa921 Merge pull request #1694 from DarkflameUniverse/latin1
fix: use encoding on latin1 strings from cdclient
2024-12-25 00:27:00 +01:00
Gie "Max" Vanommeslaeghe
dcc9e023a6 Merge pull request #1693 from DarkflameUniverse/bandwidth
fix: remove bandwidth limit
2024-12-25 00:26:51 +01:00
Gie "Max" Vanommeslaeghe
8509ec8856 Merge pull request #1692 from DarkflameUniverse/really
fix: folder and file checks
2024-12-25 00:25:48 +01:00
David Markowitz
18295017c1 use encoding
use template function

Update GeneralUtils.cpp

consolidate duplicate code

Update GeneralUtils.cpp

Update BinaryIO.cpp

compilers
2024-12-24 14:32:08 -08:00
David Markowitz
e8f011b830 Update sharedconfig.ini 2024-12-24 13:07:55 -08:00
David Markowitz
a787673baf show error box for windows 2024-12-24 12:57:20 -08:00
David Markowitz
e869c0ad03 Add parenthesis around path 2024-12-24 12:39:18 -08:00
David Markowitz
b2af3fa9d4 use binary dir paths, create ones that dont exist, do not run if critical ones do not exist. 2024-12-24 12:36:54 -08:00
David Markowitz
2560bb00da feat: add ns race server script and ignore 3 scripts from pet cove (#1682)
* brother

* use some better logic

* Implement spider boss msg script

tested that the message now shows up when hitting the survival spider entrance area

* add drag to start race feature

* ignore 3 more scripts

* add Ns race server script

* remove logs

* unique

* Update RaceImaginationServer.cpp

* Update CppScripts.cpp
2024-12-20 01:59:22 -06:00
David Markowitz
1ae21c423f skip non-files (#1690) 2024-12-19 12:19:41 -06:00
jadebenn
0ae9eb4a96 remove unneeded Component.cpp, forward declare dependencies, and make Component definition header-only (#1688) 2024-12-18 00:45:56 -08:00
28 changed files with 701 additions and 530 deletions

View File

@@ -1,5 +1,5 @@
PROJECT_VERSION_MAJOR=2 PROJECT_VERSION_MAJOR=3
PROJECT_VERSION_MINOR=3 PROJECT_VERSION_MINOR=0
PROJECT_VERSION_PATCH=0 PROJECT_VERSION_PATCH=0
# Debugging # Debugging

View File

@@ -2,16 +2,25 @@
#include <string> #include <string>
//For reading null-terminated strings //For reading null-terminated strings
std::string BinaryIO::ReadString(std::istream& instream) { template<typename StringType>
std::string toReturn; StringType ReadString(std::istream& instream) {
char buffer; StringType toReturn{};
typename StringType::value_type buffer{};
BinaryIO::BinaryRead(instream, buffer); BinaryIO::BinaryRead(instream, buffer);
while (buffer != 0x00) { while (buffer != 0x00) {
toReturn += buffer; toReturn += buffer;
BinaryRead(instream, buffer); BinaryIO::BinaryRead(instream, buffer);
} }
return toReturn; return toReturn;
} }
std::string BinaryIO::ReadString(std::istream& instream) {
return ::ReadString<std::string>(instream);
}
std::u8string BinaryIO::ReadU8String(std::istream& instream) {
return ::ReadString<std::u8string>(instream);
}

View File

@@ -65,6 +65,8 @@ namespace BinaryIO {
std::string ReadString(std::istream& instream); std::string ReadString(std::istream& instream);
std::u8string ReadU8String(std::istream& instream);
inline bool DoesFileExist(const std::string& name) { inline bool DoesFileExist(const std::string& name) {
std::ifstream f(name.c_str()); std::ifstream f(name.c_str());
return f.good(); return f.good();

View File

@@ -65,13 +65,14 @@ int64_t FdbToSqlite::Convert::ReadInt64(std::istream& cdClientBuffer) {
return value; return value;
} }
// cdclient is encoded in latin1
std::string FdbToSqlite::Convert::ReadString(std::istream& cdClientBuffer) { std::string FdbToSqlite::Convert::ReadString(std::istream& cdClientBuffer) {
int32_t prevPosition = SeekPointer(cdClientBuffer); int32_t prevPosition = SeekPointer(cdClientBuffer);
auto readString = BinaryIO::ReadString(cdClientBuffer); const auto readString = BinaryIO::ReadU8String(cdClientBuffer);
cdClientBuffer.seekg(prevPosition); cdClientBuffer.seekg(prevPosition);
return readString; return GeneralUtils::Latin1ToUTF8(readString);
} }
int32_t FdbToSqlite::Convert::SeekPointer(std::istream& cdClientBuffer) { int32_t FdbToSqlite::Convert::SeekPointer(std::istream& cdClientBuffer) {

View File

@@ -167,6 +167,15 @@ std::u16string GeneralUtils::ASCIIToUTF16(const std::string_view string, const s
return ret; return ret;
} }
std::string GeneralUtils::Latin1ToUTF8(const std::u8string_view string, const size_t size) {
std::string toReturn{};
for (const auto u : string) {
PushUTF8CodePoint(toReturn, u);
}
return toReturn;
}
//! Converts a (potentially-ill-formed) UTF-16 string to UTF-8 //! Converts a (potentially-ill-formed) UTF-16 string to UTF-8
//! See: <http://simonsapin.github.io/wtf-8/#decoding-ill-formed-utf-16> //! See: <http://simonsapin.github.io/wtf-8/#decoding-ill-formed-utf-16>
std::string GeneralUtils::UTF16ToWTF8(const std::u16string_view string, const size_t size) { std::string GeneralUtils::UTF16ToWTF8(const std::u16string_view string, const size_t size) {
@@ -175,9 +184,9 @@ std::string GeneralUtils::UTF16ToWTF8(const std::u16string_view string, const si
ret.reserve(newSize); ret.reserve(newSize);
for (size_t i = 0; i < newSize; ++i) { for (size_t i = 0; i < newSize; ++i) {
const char16_t u = string[i]; const auto u = string[i];
if (IsLeadSurrogate(u) && (i + 1) < newSize) { if (IsLeadSurrogate(u) && (i + 1) < newSize) {
const char16_t next = string[i + 1]; const auto next = string[i + 1];
if (IsTrailSurrogate(next)) { if (IsTrailSurrogate(next)) {
i += 1; i += 1;
const char32_t cp = 0x10000 const char32_t cp = 0x10000
@@ -291,11 +300,12 @@ std::u16string GeneralUtils::ReadWString(RakNet::BitStream& inStream) {
std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) { std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) {
// Because we dont know how large the initial number before the first _ is we need to make it a map like so. // Because we dont know how large the initial number before the first _ is we need to make it a map like so.
std::map<uint32_t, std::string> filenames{}; std::map<uint32_t, std::string> filenames{};
for (const auto& t : std::filesystem::directory_iterator(folder)) { for (const auto& t : std::filesystem::directory_iterator(folder)) {
auto filename = t.path().filename().string(); if (t.is_directory() || t.is_symlink()) continue;
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0)); auto filename = t.path().filename().string();
filenames.emplace(index, std::move(filename)); const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
filenames.emplace(index, std::move(filename));
} }
// Now sort the map by the oldest migration. // Now sort the map by the oldest migration.

View File

@@ -51,6 +51,14 @@ namespace GeneralUtils {
bool _NextUTF8Char(std::string_view& slice, uint32_t& out); bool _NextUTF8Char(std::string_view& slice, uint32_t& out);
} }
//! Converts a Latin1 string to a UTF-8 string
/*!
\param string The string to convert
\param size A size to trim the string to. Default is SIZE_MAX (No trimming)
\return An UTF-8 representation of the string
*/
std::string Latin1ToUTF8(const std::u8string_view string, const size_t size = SIZE_MAX);
//! Converts a UTF-16 string to a UTF-8 string //! Converts a UTF-16 string to a UTF-8 string
/*! /*!
\param string The string to convert \param string The string to convert

View File

@@ -1253,6 +1253,7 @@ namespace MessageType {
VEHICLE_NOTIFY_HIT_EXPLODER = 1385, VEHICLE_NOTIFY_HIT_EXPLODER = 1385,
CHECK_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1386, CHECK_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1386,
REQUEST_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1387, REQUEST_NEAREST_ROCKET_LAUNCH_PRE_CONDITIONS = 1387,
CONFIGURE_RACING_CONTROL = 1388,
CONFIGURE_RACING_CONTROL_CLIENT = 1389, CONFIGURE_RACING_CONTROL_CLIENT = 1389,
NOTIFY_RACING_CLIENT = 1390, NOTIFY_RACING_CLIENT = 1390,
RACING_PLAYER_HACK_CAR = 1391, RACING_PLAYER_HACK_CAR = 1391,

View File

@@ -5,6 +5,7 @@
#include "dConfig.h" #include "dConfig.h"
#include "Logger.h" #include "Logger.h"
#include "dPlatforms.h" #include "dPlatforms.h"
#include "BinaryPathFinder.h"
// Static Variables // Static Variables
@@ -17,7 +18,14 @@ namespace {
void SQLiteDatabase::Connect() { void SQLiteDatabase::Connect() {
LOG("Using SQLite database"); LOG("Using SQLite database");
con = new CppSQLite3DB(); con = new CppSQLite3DB();
con->open(Game::config->GetValue("sqlite_database_path").c_str()); const auto path = BinaryPathFinder::GetBinaryDir() / Game::config->GetValue("sqlite_database_path");
if (!std::filesystem::exists(path)) {
LOG("Creating sqlite path %s", path.string().c_str());
std::filesystem::create_directories(path.parent_path());
}
con->open(path.string().c_str());
isConnected = true; isConnected = true;
// Make sure wal is enabled for the database. // Make sure wal is enabled for the database.

View File

@@ -1499,7 +1499,7 @@ void Entity::RequestActivityExit(Entity* sender, LWOOBJID player, bool canceled)
CppScripts::Script* const Entity::GetScript() { CppScripts::Script* const Entity::GetScript() {
auto* scriptComponent = GetComponent<ScriptComponent>(); auto* scriptComponent = GetComponent<ScriptComponent>();
auto* script = scriptComponent ? scriptComponent->GetScript() : &CppScripts::GetInvalidScript(); auto* script = scriptComponent ? scriptComponent->GetScript() : CppScripts::GetInvalidScript();
DluAssert(script != nullptr); DluAssert(script != nullptr);
return script; return script;
} }
@@ -2175,7 +2175,7 @@ void Entity::SetRespawnRot(const NiQuaternion& rotation) {
int32_t Entity::GetCollisionGroup() const { int32_t Entity::GetCollisionGroup() const {
for (const auto* component : m_Components | std::views::values) { for (const auto* component : m_Components | std::views::values) {
auto* compToCheck = dynamic_cast<const PhysicsComponent*>(component); auto* compToCheck = dynamic_cast<const PhysicsComponent*>(component);
if (compToCheck) { if (compToCheck) {
return compToCheck->GetCollisionGroup(); return compToCheck->GetCollisionGroup();
} }

View File

@@ -7,7 +7,6 @@ set(DGAME_DCOMPONENTS_SOURCES
"BuildBorderComponent.cpp" "BuildBorderComponent.cpp"
"CharacterComponent.cpp" "CharacterComponent.cpp"
"CollectibleComponent.cpp" "CollectibleComponent.cpp"
"Component.cpp"
"ControllablePhysicsComponent.cpp" "ControllablePhysicsComponent.cpp"
"DestroyableComponent.cpp" "DestroyableComponent.cpp"
"DonationVendorComponent.cpp" "DonationVendorComponent.cpp"

View File

@@ -1,34 +0,0 @@
#include "Component.h"
Component::Component(Entity* parent) {
m_Parent = parent;
}
Component::~Component() {
}
Entity* Component::GetParent() const {
return m_Parent;
}
void Component::Update(float deltaTime) {
}
void Component::OnUse(Entity* originator) {
}
void Component::UpdateXml(tinyxml2::XMLDocument& doc) {
}
void Component::LoadFromXml(const tinyxml2::XMLDocument& doc) {
}
void Component::Serialize(RakNet::BitStream& outBitStream, bool isConstruction) {
}

View File

@@ -1,6 +1,12 @@
#pragma once #pragma once
#include "tinyxml2.h" namespace tinyxml2 {
class XMLDocument;
}
namespace RakNet {
class BitStream;
}
class Entity; class Entity;
@@ -9,40 +15,40 @@ class Entity;
*/ */
class Component { class Component {
public: public:
Component(Entity* parent); Component(Entity* parent) : m_Parent{ parent } {}
virtual ~Component(); virtual ~Component() = default;
/** /**
* Gets the owner of this component * Gets the owner of this component
* @return the owner of this component * @return the owner of this component
*/ */
Entity* GetParent() const; Entity* GetParent() const { return m_Parent; }
/** /**
* Updates the component in the game loop * Updates the component in the game loop
* @param deltaTime time passed since last update * @param deltaTime time passed since last update
*/ */
virtual void Update(float deltaTime); virtual void Update(float deltaTime) {}
/** /**
* Event called when this component is being used, e.g. when some entity interacted with it * Event called when this component is being used, e.g. when some entity interacted with it
* @param originator * @param originator
*/ */
virtual void OnUse(Entity* originator); virtual void OnUse(Entity* originator) {}
/** /**
* Save data from this componennt to character XML * Save data from this componennt to character XML
* @param doc the document to write data to * @param doc the document to write data to
*/ */
virtual void UpdateXml(tinyxml2::XMLDocument& doc); virtual void UpdateXml(tinyxml2::XMLDocument& doc) {}
/** /**
* Load base data for this component from character XML * Load base data for this component from character XML
* @param doc the document to read data from * @param doc the document to read data from
*/ */
virtual void LoadFromXml(const tinyxml2::XMLDocument& doc); virtual void LoadFromXml(const tinyxml2::XMLDocument& doc) {}
virtual void Serialize(RakNet::BitStream& outBitStream, bool isConstruction); virtual void Serialize(RakNet::BitStream& outBitStream, bool isConstruction) {}
protected: protected:

View File

@@ -938,8 +938,11 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
if (scriptComponentID > -1) { if (scriptComponentID > -1) {
CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>(); CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>();
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID); CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto& itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name); auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
itemScript.OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId()); if (!itemScript) {
LOG("null script?");
}
itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
} }
} }
@@ -950,8 +953,11 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
if (scriptComponentID > -1) { if (scriptComponentID > -1) {
CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>(); CDScriptComponentTable* scriptCompTable = CDClientManager::GetTable<CDScriptComponentTable>();
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID); CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
auto& itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name); auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
itemScript.OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId()); if (!itemScript) {
LOG("null script?");
}
itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
} }
} }

View File

@@ -35,7 +35,8 @@
RacingControlComponent::RacingControlComponent(Entity* parent) RacingControlComponent::RacingControlComponent(Entity* parent)
: Component(parent) { : Component(parent) {
m_PathName = u"MainPath"; m_PathName = u"MainPath";
m_RemainingLaps = 3; m_NumberOfLaps = 3;
m_RemainingLaps = m_NumberOfLaps;
m_LeadingPlayer = LWOOBJID_EMPTY; m_LeadingPlayer = LWOOBJID_EMPTY;
m_RaceBestTime = 0; m_RaceBestTime = 0;
m_RaceBestLap = 0; m_RaceBestLap = 0;
@@ -658,23 +659,9 @@ void RacingControlComponent::Update(float deltaTime) {
} }
} }
// Spawn imagination pickups GameMessages::ZoneLoadedInfo zoneLoadInfo{};
auto* minSpawner = Game::zoneManager->GetSpawnersByName( zoneLoadInfo.maxPlayers = m_LoadedPlayers;
"ImaginationSpawn_Min")[0]; m_Parent->GetScript()->OnZoneLoadedInfo(m_Parent, zoneLoadInfo);
auto* medSpawner = Game::zoneManager->GetSpawnersByName(
"ImaginationSpawn_Med")[0];
auto* maxSpawner = Game::zoneManager->GetSpawnersByName(
"ImaginationSpawn_Max")[0];
minSpawner->Activate();
if (m_LoadedPlayers > 2) {
medSpawner->Activate();
}
if (m_LoadedPlayers > 4) {
maxSpawner->Activate();
}
// Reset players to their start location, without smashing them // Reset players to their start location, without smashing them
for (auto& player : m_RacingPlayers) { for (auto& player : m_RacingPlayers) {
@@ -764,7 +751,7 @@ void RacingControlComponent::Update(float deltaTime) {
// new checkpoint // new checkpoint
uint32_t respawnIndex = 0; uint32_t respawnIndex = 0;
for (const auto& waypoint : path->pathWaypoints) { for (const auto& waypoint : path->pathWaypoints) {
if (player.lap == 3) { if (player.lap == m_NumberOfLaps) {
break; break;
} }
@@ -835,7 +822,7 @@ void RacingControlComponent::Update(float deltaTime) {
// Progress lap time tasks // Progress lap time tasks
missionComponent->Progress(eMissionTaskType::RACING, lapTime.count(), static_cast<LWOOBJID>(eRacingTaskParam::LAP_TIME)); missionComponent->Progress(eMissionTaskType::RACING, lapTime.count(), static_cast<LWOOBJID>(eRacingTaskParam::LAP_TIME));
if (player.lap == 3) { if (player.lap == m_NumberOfLaps) {
m_Finished++; m_Finished++;
player.finished = m_Finished; player.finished = m_Finished;
@@ -882,3 +869,20 @@ void RacingControlComponent::Update(float deltaTime) {
} }
} }
} }
void RacingControlComponent::MsgConfigureRacingControl(const GameMessages::ConfigureRacingControl& msg) {
for (const auto& dataUnique : msg.racingSettings) {
if (!dataUnique) continue;
const auto* const data = dataUnique.get();
if (data->GetKey() == u"Race_PathName" && data->GetValueType() == LDF_TYPE_UTF_16) {
m_PathName = static_cast<const LDFData<std::u16string>*>(data)->GetValue();
} else if (data->GetKey() == u"activityID" && data->GetValueType() == LDF_TYPE_S32) {
m_ActivityID = static_cast<const LDFData<int32_t>*>(data)->GetValue();
} else if (data->GetKey() == u"Number_of_Laps" && data->GetValueType() == LDF_TYPE_S32) {
m_NumberOfLaps = static_cast<const LDFData<int32_t>*>(data)->GetValue();
m_RemainingLaps = m_NumberOfLaps;
} else if (data->GetKey() == u"Minimum_Players_for_Group_Achievements" && data->GetValueType() == LDF_TYPE_S32) {
m_MinimumPlayersForGroupAchievements = static_cast<const LDFData<int32_t>*>(data)->GetValue();
}
}
}

View File

@@ -152,6 +152,8 @@ public:
*/ */
RacingPlayerInfo* GetPlayerData(LWOOBJID playerID); RacingPlayerInfo* GetPlayerData(LWOOBJID playerID);
void MsgConfigureRacingControl(const GameMessages::ConfigureRacingControl& msg);
private: private:
/** /**
@@ -161,11 +163,13 @@ private:
/** /**
* The paths that are followed for the camera scenes * The paths that are followed for the camera scenes
* Configurable in the ConfigureRacingControl msg with the key `Race_PathName`.
*/ */
std::u16string m_PathName; std::u16string m_PathName;
/** /**
* The ID of the activity for participating in this race * The ID of the activity for participating in this race
* Configurable in the ConfigureRacingControl msg with the key `activityID`.
*/ */
uint32_t m_ActivityID; uint32_t m_ActivityID;
@@ -245,5 +249,20 @@ private:
* Value for message box response to know if we are exiting the race via the activity dialogue * Value for message box response to know if we are exiting the race via the activity dialogue
*/ */
const int32_t m_ActivityExitConfirm = 1; const int32_t m_ActivityExitConfirm = 1;
bool m_AllPlayersReady = false; bool m_AllPlayersReady = false;
/**
* @brief The number of laps in this race. Configurable in the ConfigureRacingControl msg
* with the key `Number_of_Laps`.
*
*/
int32_t m_NumberOfLaps{ 3 };
/**
* @brief The minimum number of players required to progress group achievements.
* Configurable with the ConfigureRacingControl msg with the key `Minimum_Players_for_Group_Achievements`.
*
*/
int32_t m_MinimumPlayersForGroupAchievements{ 2 };
}; };

View File

@@ -48,5 +48,5 @@ CppScripts::Script* const ScriptComponent::GetScript() {
void ScriptComponent::SetScript(const std::string& scriptName) { void ScriptComponent::SetScript(const std::string& scriptName) {
// Scripts are managed by the CppScripts class and are effecitvely singletons // Scripts are managed by the CppScripts class and are effecitvely singletons
// and they may also be used by other script components so DON'T delete them. // and they may also be used by other script components so DON'T delete them.
m_Script = &CppScripts::GetScript(m_Parent, scriptName); m_Script = CppScripts::GetScript(m_Parent, scriptName);
} }

View File

@@ -717,6 +717,16 @@ namespace GameMessages {
NiPoint3 targetPosition{}; NiPoint3 targetPosition{};
void Serialize(RakNet::BitStream& bitStream) const override; void Serialize(RakNet::BitStream& bitStream) const override;
}; };
struct ZoneLoadedInfo : public GameMsg {
ZoneLoadedInfo() : GameMsg(MessageType::Game::ZONE_LOADED_INFO) {}
int32_t maxPlayers{};
};
struct ConfigureRacingControl : public GameMsg {
ConfigureRacingControl() : GameMsg(MessageType::Game::CONFIGURE_RACING_CONTROL) {}
std::vector<std::unique_ptr<LDFBaseData>> racingSettings{};
};
}; };
#endif // GAMEMESSAGES_H #endif // GAMEMESSAGES_H

View File

@@ -84,6 +84,24 @@ int main(int argc, char** argv) {
Server::SetupLogger("MasterServer"); Server::SetupLogger("MasterServer");
if (!Game::logger) return EXIT_FAILURE; if (!Game::logger) return EXIT_FAILURE;
auto folders = { "navmeshes", "migrations", "vanity" };
for (const auto folder : folders) {
if (!std::filesystem::exists(BinaryPathFinder::GetBinaryDir() / folder)) {
std::string msg = "The (" +
std::string(folder) +
") folder was not copied to the binary directory. Please copy the (" +
std::string(folder) +
") folder from your download to the binary directory or re-run cmake.";
LOG("%s", msg.c_str());
// toss an error box up for windows users running the download
#ifdef DARKFLAME_PLATFORM_WIN32
MessageBoxA(nullptr, msg.c_str(), "Missing Folder", MB_OK | MB_ICONERROR);
#endif
return EXIT_FAILURE;
}
}
if (!dConfig::Exists("authconfig.ini")) LOG("Could not find authconfig.ini, using default settings"); if (!dConfig::Exists("authconfig.ini")) LOG("Could not find authconfig.ini, using default settings");
if (!dConfig::Exists("chatconfig.ini")) LOG("Could not find chatconfig.ini, using default settings"); if (!dConfig::Exists("chatconfig.ini")) LOG("Could not find chatconfig.ini, using default settings");
if (!dConfig::Exists("masterconfig.ini")) LOG("Could not find masterconfig.ini, using default settings"); if (!dConfig::Exists("masterconfig.ini")) LOG("Could not find masterconfig.ini, using default settings");
@@ -177,7 +195,7 @@ int main(int argc, char** argv) {
} }
// Run migrations should any need to be run. // Run migrations should any need to be run.
MigrationRunner::RunSQLiteMigrations(); MigrationRunner::RunSQLiteMigrations();
//If the first command line argument is -a or --account then make the user //If the first command line argument is -a or --account then make the user
//input a username and password, with the password being hidden. //input a username and password, with the password being hidden.

View File

@@ -330,6 +330,7 @@
#include "EnemyClearThreat.h" #include "EnemyClearThreat.h"
#include "AgSpiderBossMessage.h" #include "AgSpiderBossMessage.h"
#include "GfRaceInstancer.h" #include "GfRaceInstancer.h"
#include "NsRaceServer.h"
#include <map> #include <map>
#include <string> #include <string>
@@ -339,359 +340,360 @@ namespace {
// This is in the translation unit instead of the header to prevent weird linker errors // This is in the translation unit instead of the header to prevent weird linker errors
InvalidScript InvalidToReturn; InvalidScript InvalidToReturn;
std::map<std::string, CppScripts::Script*> g_Scripts; std::map<std::string, CppScripts::Script*> g_Scripts;
std::map<std::string, std::function<std::unique_ptr<CppScripts::Script> ()>> scriptLoader = { std::map<std::string, std::function<CppScripts::Script* ()>> scriptLoader = {
//VE / AG //VE / AG
{ "scripts\\ai\\AG\\L_AG_SHIP_PLAYER_DEATH_TRIGGER.lua", []() { return std::make_unique<AgShipPlayerDeathTrigger>(); } }, { "scripts\\ai\\AG\\L_AG_SHIP_PLAYER_DEATH_TRIGGER.lua", []() { return new AgShipPlayerDeathTrigger(); } },
{"scripts\\ai\\NP\\L_NPC_NP_SPACEMAN_BOB.lua", []() { return std::make_unique<NpcNpSpacemanBob>(); } }, {"scripts\\ai\\NP\\L_NPC_NP_SPACEMAN_BOB.lua", []() { return new NpcNpSpacemanBob(); } },
{"scripts\\ai\\AG\\L_AG_SPACE_STUFF.lua", []() { return std::make_unique<AgSpaceStuff>();} }, {"scripts\\ai\\AG\\L_AG_SPACE_STUFF.lua", []() { return new AgSpaceStuff();} },
{"scripts\\ai\\AG\\L_AG_SHIP_SHAKE.lua", []() { return std::make_unique<AgShipShake>();}}, {"scripts\\ai\\AG\\L_AG_SHIP_SHAKE.lua", []() { return new AgShipShake();}},
{"scripts\\ai\\AG\\L_AG_SHIP_PLAYER_SHOCK_SERVER.lua", []() { return std::make_unique<AgShipPlayerShockServer>();} }, {"scripts\\ai\\AG\\L_AG_SHIP_PLAYER_SHOCK_SERVER.lua", []() { return new AgShipPlayerShockServer();} },
{"scripts\\ai\\AG\\L_AG_IMAG_SMASHABLE.lua", []() { return std::make_unique<AgImagSmashable>();} }, {"scripts\\ai\\AG\\L_AG_IMAG_SMASHABLE.lua", []() { return new AgImagSmashable();} },
{"scripts\\02_server\\Map\\General\\L_STORY_BOX_INTERACT_SERVER.lua", []() { return std::make_unique<StoryBoxInteractServer>();} }, {"scripts\\02_server\\Map\\General\\L_STORY_BOX_INTERACT_SERVER.lua", []() { return new StoryBoxInteractServer();} },
{"scripts\\02_server\\Map\\General\\L_BINOCULARS.lua", []() { return std::make_unique<Binoculars>();} }, {"scripts\\02_server\\Map\\General\\L_BINOCULARS.lua", []() { return new Binoculars();} },
{"scripts\\ai\\WILD\\L_ALL_CRATE_CHICKEN.lua", []() { return std::make_unique<AllCrateChicken>();} }, {"scripts\\ai\\WILD\\L_ALL_CRATE_CHICKEN.lua", []() { return new AllCrateChicken();} },
// Broken? (below) // Broken? (below)
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_SMASHABLE.lua", []() { return std::make_unique<RockHydrantSmashable>();} }, {"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_SMASHABLE.lua", []() { return new RockHydrantSmashable();} },
{"scripts\\02_server\\Map\\SS\\L_SS_MODULAR_BUILD_SERVER.lua", []() { return std::make_unique<SsModularBuildServer>();} }, {"scripts\\02_server\\Map\\SS\\L_SS_MODULAR_BUILD_SERVER.lua", []() { return new SsModularBuildServer();} },
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ZONE_AG_PROPERTY.lua", []() { return std::make_unique<ZoneAgProperty>();} }, {"scripts\\02_server\\Map\\Property\\AG_Small\\L_ZONE_AG_PROPERTY.lua", []() { return new ZoneAgProperty();} },
// this is done in Entity.cpp, not needed for our implementation (below) // this is done in Entity.cpp, not needed for our implementation (below)
{"scripts\\02_server\\Map\\General\\L_POI_MISSION.lua", []() { return std::make_unique<InvalidScript>();} }, {"scripts\\02_server\\Map\\General\\L_POI_MISSION.lua", []() { return new InvalidScript();} },
{"scripts\\02_server\\Map\\General\\L_TOUCH_MISSION_UPDATE_SERVER.lua", []() { return std::make_unique<TouchMissionUpdateServer>();} }, {"scripts\\02_server\\Map\\General\\L_TOUCH_MISSION_UPDATE_SERVER.lua", []() { return new TouchMissionUpdateServer();} },
{"scripts\\ai\\AG\\L_ACT_SHARK_PLAYER_DEATH_TRIGGER.lua", []() { return std::make_unique<ActSharkPlayerDeathTrigger>();} }, {"scripts\\ai\\AG\\L_ACT_SHARK_PLAYER_DEATH_TRIGGER.lua", []() { return new ActSharkPlayerDeathTrigger();} },
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_MECH.lua", []() { return std::make_unique<BaseEnemyMech>();} }, {"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_MECH.lua", []() { return new BaseEnemyMech();} },
{"scripts\\zone\\AG\\L_ZONE_AG_SURVIVAL.lua", []() { return std::make_unique<ZoneAgSurvival>();} }, {"scripts\\zone\\AG\\L_ZONE_AG_SURVIVAL.lua", []() { return new ZoneAgSurvival();} },
{"scripts\\02_server\\Objects\\L_BUFF_STATION_SERVER.lua", []() { return std::make_unique<AgSurvivalBuffStation>();} }, {"scripts\\02_server\\Objects\\L_BUFF_STATION_SERVER.lua", []() { return new AgSurvivalBuffStation();} },
{"scripts\\ai\\AG\\L_AG_BUS_DOOR.lua", []() { return std::make_unique<AgBusDoor>();} }, {"scripts\\ai\\AG\\L_AG_BUS_DOOR.lua", []() { return new AgBusDoor();} },
{"scripts\\02_server\\Equipment\\L_MAESTROM_EXTRACTICATOR_SERVER.lua", []() { return std::make_unique<MaestromExtracticatorServer>();} }, {"scripts\\02_server\\Equipment\\L_MAESTROM_EXTRACTICATOR_SERVER.lua", []() { return new MaestromExtracticatorServer();} },
{"scripts\\02_server\\Map\\AG\\L_AG_CAGED_BRICKS_SERVER.lua", []() { return std::make_unique<AgCagedBricksServer>();} }, {"scripts\\02_server\\Map\\AG\\L_AG_CAGED_BRICKS_SERVER.lua", []() { return new AgCagedBricksServer();} },
{"scripts\\02_server\\Map\\AG\\L_NPC_WISP_SERVER.lua", []() { return std::make_unique<NpcWispServer>();} }, {"scripts\\02_server\\Map\\AG\\L_NPC_WISP_SERVER.lua", []() { return new NpcWispServer();} },
{"scripts\\02_server\\Map\\AG\\L_NPC_EPSILON_SERVER.lua", []() { return std::make_unique<NpcEpsilonServer>();} }, {"scripts\\02_server\\Map\\AG\\L_NPC_EPSILON_SERVER.lua", []() { return new NpcEpsilonServer();} },
{"scripts\\ai\\AG\\L_AG_TURRET.lua", []() {return std::make_unique<AgTurret>();}}, {"scripts\\ai\\AG\\L_AG_TURRET.lua", []() {return new AgTurret();}},
{"scripts\\ai\\AG\\L_AG_TURRET_FOR_SHIP.lua", []() { return std::make_unique<AgTurret>();}}, {"scripts\\ai\\AG\\L_AG_TURRET_FOR_SHIP.lua", []() { return new AgTurret();}},
{"scripts\\02_server\\Map\\AG\\L_AG_LASER_SENSOR_SERVER.lua", []() {return std::make_unique<AgLaserSensorServer>();}}, {"scripts\\02_server\\Map\\AG\\L_AG_LASER_SENSOR_SERVER.lua", []() {return new AgLaserSensorServer();}},
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_LASER_SERVER.lua", []() {return std::make_unique<AgMonumentLaserServer>();}}, {"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_LASER_SERVER.lua", []() {return new AgMonumentLaserServer();}},
{"scripts\\ai\\AG\\L_AG_FANS.lua", []() {return std::make_unique<AgFans>();}}, {"scripts\\ai\\AG\\L_AG_FANS.lua", []() {return new AgFans();}},
{"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_BIRDS.lua", []() {return std::make_unique<AgMonumentBirds>();}}, {"scripts\\02_server\\Map\\AG\\L_AG_MONUMENT_BIRDS.lua", []() {return new AgMonumentBirds();}},
{"scripts\\02_server\\Map\\AG\\L_REMOVE_RENTAL_GEAR.lua", []() {return std::make_unique<RemoveRentalGear>();}}, {"scripts\\02_server\\Map\\AG\\L_REMOVE_RENTAL_GEAR.lua", []() {return new RemoveRentalGear();}},
{"scripts\\02_server\\Map\\AG\\L_NPC_NJ_ASSISTANT_SERVER.lua", []() {return std::make_unique<NpcNjAssistantServer>();}}, {"scripts\\02_server\\Map\\AG\\L_NPC_NJ_ASSISTANT_SERVER.lua", []() {return new NpcNjAssistantServer();}},
{"scripts\\ai\\AG\\L_AG_SALUTING_NPCS.lua", []() {return std::make_unique<AgSalutingNpcs>();}}, {"scripts\\ai\\AG\\L_AG_SALUTING_NPCS.lua", []() {return new AgSalutingNpcs();}},
{"scripts\\ai\\AG\\L_AG_JET_EFFECT_SERVER.lua", []() {return std::make_unique<AgJetEffectServer>();}}, {"scripts\\ai\\AG\\L_AG_JET_EFFECT_SERVER.lua", []() {return new AgJetEffectServer();}},
{"scripts\\02_server\\Enemy\\AG\\L_BOSS_SPIDER_QUEEN_ENEMY_SERVER.lua", []() {return std::make_unique<BossSpiderQueenEnemyServer>();}}, {"scripts\\02_server\\Enemy\\AG\\L_BOSS_SPIDER_QUEEN_ENEMY_SERVER.lua", []() {return new BossSpiderQueenEnemyServer();}},
{"scripts\\02_server\\Map\\Property\\AG_Small\\L_ENEMY_SPIDER_SPAWNER.lua", []() {return std::make_unique<EnemySpiderSpawner>();}}, {"scripts\\02_server\\Map\\Property\\AG_Small\\L_ENEMY_SPIDER_SPAWNER.lua", []() {return new EnemySpiderSpawner();}},
{"scripts/02_server/Map/Property/AG_Small/L_ENEMY_SPIDER_SPAWNER.lua", []() {return std::make_unique<EnemySpiderSpawner>();}}, {"scripts/02_server/Map/Property/AG_Small/L_ENEMY_SPIDER_SPAWNER.lua", []() {return new EnemySpiderSpawner();}},
{"scripts\\ai\\AG\\L_AG_QB_Elevator.lua", []() {return std::make_unique<AgQbElevator>();}}, {"scripts\\ai\\AG\\L_AG_QB_Elevator.lua", []() {return new AgQbElevator();}},
{"scripts\\ai\\PROPERTY\\AG\\L_AG_PROP_GUARD.lua", []() {return std::make_unique<AgPropGuard>();}}, {"scripts\\ai\\PROPERTY\\AG\\L_AG_PROP_GUARD.lua", []() {return new AgPropGuard();}},
{"scripts\\02_server\\Map\\AG\\L_AG_BUGSPRAYER.lua", []() {return std::make_unique<AgBugsprayer>();}}, {"scripts\\02_server\\Map\\AG\\L_AG_BUGSPRAYER.lua", []() {return new AgBugsprayer();}},
{"scripts\\02_server\\Map\\AG\\L_NPC_AG_COURSE_STARTER.lua", []() {return std::make_unique<NpcAgCourseStarter>();}}, {"scripts\\02_server\\Map\\AG\\L_NPC_AG_COURSE_STARTER.lua", []() {return new NpcAgCourseStarter();}},
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_GOAL.lua", []() {return std::make_unique<AgMonumentRaceGoal>();}}, {"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_GOAL.lua", []() {return new AgMonumentRaceGoal();}},
{"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_CANCEL.lua", []() {return std::make_unique<AgMonumentRaceCancel>();}}, {"scripts\\02_server\\Map\\AG\\L__AG_MONUMENT_RACE_CANCEL.lua", []() {return new AgMonumentRaceCancel();}},
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_ZONE_AG_SPIDER_QUEEN.lua", []() {return std::make_unique<ZoneAgSpiderQueen>();}}, {"scripts\\02_server\\Map\\AG_Spider_Queen\\L_ZONE_AG_SPIDER_QUEEN.lua", []() {return new ZoneAgSpiderQueen();}},
{"scripts\\02_server\\Map\\AG_Spider_Queen\\L_SPIDER_BOSS_TREASURE_CHEST_SERVER.lua", []() {return std::make_unique<SpiderBossTreasureChestServer>();}}, {"scripts\\02_server\\Map\\AG_Spider_Queen\\L_SPIDER_BOSS_TREASURE_CHEST_SERVER.lua", []() {return new SpiderBossTreasureChestServer();}},
{"scripts\\02_server\\Map\\AG\\L_NPC_COWBOY_SERVER.lua", []() {return std::make_unique<NpcCowboyServer>();}}, {"scripts\\02_server\\Map\\AG\\L_NPC_COWBOY_SERVER.lua", []() {return new NpcCowboyServer();}},
{"scripts\\02_server\\Map\\Property\\AG_Med\\L_ZONE_AG_MED_PROPERTY.lua", []() {return std::make_unique<ZoneAgMedProperty>();}}, {"scripts\\02_server\\Map\\Property\\AG_Med\\L_ZONE_AG_MED_PROPERTY.lua", []() {return new ZoneAgMedProperty();}},
{"scripts\\ai\\AG\\L_AG_STROMBIE_PROPERTY.lua", []() {return std::make_unique<AgStromlingProperty>();}}, {"scripts\\ai\\AG\\L_AG_STROMBIE_PROPERTY.lua", []() {return new AgStromlingProperty();}},
{"scripts\\ai\\AG\\L_AG_DARKLING_MECH.lua", []() {return std::make_unique<BaseEnemyMech>();}}, {"scripts\\ai\\AG\\L_AG_DARKLING_MECH.lua", []() {return new BaseEnemyMech();}},
{"scripts\\ai\\AG\\L_AG_DARK_SPIDERLING.lua", []() {return std::make_unique<AgDarkSpiderling>();}}, {"scripts\\ai\\AG\\L_AG_DARK_SPIDERLING.lua", []() {return new AgDarkSpiderling();}},
{"scripts\\ai\\PROPERTY\\L_PROP_GUARDS.lua", []() {return std::make_unique<AgPropguards>();}}, {"scripts\\ai\\PROPERTY\\L_PROP_GUARDS.lua", []() {return new AgPropguards();}},
{"scripts\\ai\\PROPERTY\\L_PROPERTY_FX_DAMAGE.lua", []() {return std::make_unique<PropertyFXDamage>();}}, {"scripts\\ai\\PROPERTY\\L_PROPERTY_FX_DAMAGE.lua", []() {return new PropertyFXDamage();}},
{"scripts\\02_server\\Map\\AG\\L_NPC_PIRATE_SERVER.lua", []() {return std::make_unique<NpcPirateServer>();}}, {"scripts\\02_server\\Map\\AG\\L_NPC_PIRATE_SERVER.lua", []() {return new NpcPirateServer();}},
{"scripts\\ai\\AG\\L_AG_PICNIC_BLANKET.lua", []() {return std::make_unique<AgPicnicBlanket>();}}, {"scripts\\ai\\AG\\L_AG_PICNIC_BLANKET.lua", []() {return new AgPicnicBlanket();}},
{"scripts\\02_server\\Map\\Property\\L_PROPERTY_BANK_INTERACT_SERVER.lua", []() {return std::make_unique<PropertyBankInteract>();}}, {"scripts\\02_server\\Map\\Property\\L_PROPERTY_BANK_INTERACT_SERVER.lua", []() {return new PropertyBankInteract();}},
{"scripts\\02_server\\Enemy\\VE\\L_VE_MECH.lua", []() {return std::make_unique<VeMech>();}}, {"scripts\\02_server\\Enemy\\VE\\L_VE_MECH.lua", []() {return new VeMech();}},
{"scripts\\02_server\\Map\\VE\\L_MISSION_CONSOLE_SERVER.lua", []() {return std::make_unique<VeMissionConsole>();}}, {"scripts\\02_server\\Map\\VE\\L_MISSION_CONSOLE_SERVER.lua", []() {return new VeMissionConsole();}},
{"scripts\\02_server\\Map\\VE\\L_EPSILON_SERVER.lua", []() {return std::make_unique<VeEpsilonServer>();}}, {"scripts\\02_server\\Map\\VE\\L_EPSILON_SERVER.lua", []() {return new VeEpsilonServer();}},
//NS //NS
{"scripts\\ai\\NS\\L_NS_MODULAR_BUILD.lua", []() {return std::make_unique<NsModularBuild>();}}, {"scripts\\ai\\NS\\L_NS_MODULAR_BUILD.lua", []() {return new NsModularBuild();}},
{"scripts\\ai\\NS\\L_NS_GET_FACTION_MISSION_SERVER.lua", []() {return std::make_unique<NsGetFactionMissionServer>();}}, {"scripts\\ai\\NS\\L_NS_GET_FACTION_MISSION_SERVER.lua", []() {return new NsGetFactionMissionServer();}},
{"scripts\\ai\\NS\\L_NS_QB_IMAGINATION_STATUE.lua", []() {return std::make_unique<NsQbImaginationStatue>();}}, {"scripts\\ai\\NS\\L_NS_QB_IMAGINATION_STATUE.lua", []() {return new NsQbImaginationStatue();}},
{"scripts\\02_server\\Map\\NS\\CONCERT_CHOICEBUILD_MANAGER_SERVER.lua", []() {return std::make_unique<NsConcertChoiceBuildManager>();}}, {"scripts\\02_server\\Map\\NS\\CONCERT_CHOICEBUILD_MANAGER_SERVER.lua", []() {return new NsConcertChoiceBuildManager();}},
{"scripts\\ai\\NS\\L_NS_CONCERT_CHOICEBUILD.lua", []() {return std::make_unique<NsConcertChoiceBuild>();}}, {"scripts\\ai\\NS\\L_NS_CONCERT_CHOICEBUILD.lua", []() {return new NsConcertChoiceBuild();}},
{"scripts\\ai\\NS\\L_NS_CONCERT_QUICKBUILD.lua", []() {return std::make_unique<NsConcertQuickBuild>();}}, {"scripts\\ai\\NS\\L_NS_CONCERT_QUICKBUILD.lua", []() {return new NsConcertQuickBuild();}},
{"scripts\\ai\\AG\\L_AG_STAGE_PLATFORMS.lua", []() {return std::make_unique<AgStagePlatforms>();}}, {"scripts\\ai\\AG\\L_AG_STAGE_PLATFORMS.lua", []() {return new AgStagePlatforms();}},
{"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return std::make_unique<NsConcertInstrument>();}}, {"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return new NsConcertInstrument();}},
{"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return std::make_unique<NsJohnnyMissionServer>();}}, {"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return new NsJohnnyMissionServer();}},
{"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return std::make_unique<StinkyFishTarget>();}}, {"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return new StinkyFishTarget();}},
{"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return std::make_unique<ZoneNsProperty>();}}, {"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return new ZoneNsProperty();}},
{"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return std::make_unique<ZoneNsMedProperty>();}}, {"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return new ZoneNsMedProperty();}},
{"scripts\\02_server\\Map\\NS\\L_NS_TOKEN_CONSOLE_SERVER.lua", []() {return std::make_unique<NsTokenConsoleServer>();}}, {"scripts\\02_server\\Map\\NS\\L_NS_TOKEN_CONSOLE_SERVER.lua", []() {return new NsTokenConsoleServer();}},
{"scripts\\02_server\\Map\\NS\\L_NS_LUP_TELEPORT.lua", []() {return std::make_unique<NsLupTeleport>();}}, {"scripts\\02_server\\Map\\NS\\L_NS_LUP_TELEPORT.lua", []() {return new NsLupTeleport();}},
{"scripts\\02_server\\Map\\NS\\Waves\\L_ZONE_NS_WAVES.lua", []() {return std::make_unique<ZoneNsWaves>();}}, {"scripts\\02_server\\Map\\NS\\Waves\\L_ZONE_NS_WAVES.lua", []() {return new ZoneNsWaves();}},
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HAMMERLING_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossHammerling>();}}, {"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HAMMERLING_ENEMY_SERVER.lua", []() {return new WaveBossHammerling();}},
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_APE_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossApe>();}}, {"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_APE_ENEMY_SERVER.lua", []() {return new WaveBossApe();}},
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_DARK_SPIDERLING_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossSpiderling>();}}, {"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_DARK_SPIDERLING_ENEMY_SERVER.lua", []() {return new WaveBossSpiderling();}},
{"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HORESEMEN_ENEMY_SERVER.lua", []() {return std::make_unique<WaveBossHorsemen>();}}, {"scripts\\02_server\\Enemy\\Waves\\L_WAVES_BOSS_HORESEMEN_ENEMY_SERVER.lua", []() {return new WaveBossHorsemen();}},
{"scripts\\02_server\\Minigame\\General\\L_MINIGAME_TREASURE_CHEST_SERVER.lua", []() {return std::make_unique<MinigameTreasureChestServer>();}}, {"scripts\\02_server\\Minigame\\General\\L_MINIGAME_TREASURE_CHEST_SERVER.lua", []() {return new MinigameTreasureChestServer();}},
{"scripts\\02_server\\Map\\NS\\L_NS_LEGO_CLUB_DOOR.lua", []() {return std::make_unique<NsLegoClubDoor>();}}, {"scripts\\02_server\\Map\\NS\\L_NS_LEGO_CLUB_DOOR.lua", []() {return new NsLegoClubDoor();}},
{"scripts/ai/NS/L_CL_RING.lua", []() {return std::make_unique<ClRing>();}}, {"scripts/ai/NS/L_CL_RING.lua", []() {return new ClRing();}},
{"scripts\\ai\\WILD\\L_WILD_AMBIENTS.lua", []() {return std::make_unique<WildAmbients>();}}, {"scripts\\ai\\WILD\\L_WILD_AMBIENTS.lua", []() {return new WildAmbients();}},
{"scripts\\ai\\NS\\NS_PP_01\\L_NS_PP_01_TELEPORT.lua", []() {return std::make_unique<PropertyDeathPlane>();}}, {"scripts\\ai\\NS\\NS_PP_01\\L_NS_PP_01_TELEPORT.lua", []() {return new PropertyDeathPlane();}},
{"scripts\\02_server\\Map\\General\\L_QB_SPAWNER.lua", []() {return std::make_unique<QbSpawner>();}}, {"scripts\\02_server\\Map\\General\\L_QB_SPAWNER.lua", []() {return new QbSpawner();}},
{"scripts\\ai\\AG\\L_AG_QB_Wall.lua", []() {return std::make_unique<AgQbWall>();}}, {"scripts\\ai\\AG\\L_AG_QB_Wall.lua", []() {return new AgQbWall();}},
//GF //GF
{"scripts\\02_server\\Map\\GF\\L_GF_TORCH.lua", []() {return std::make_unique<GfTikiTorch>();}}, {"scripts\\02_server\\Map\\GF\\L_GF_TORCH.lua", []() {return new GfTikiTorch();}},
{"scripts\\ai\\GF\\L_SPECIAL_FIREPIT.lua", []() {return std::make_unique<GfCampfire>();}}, {"scripts\\ai\\GF\\L_SPECIAL_FIREPIT.lua", []() {return new GfCampfire();}},
{"scripts\\ai\\GF\\L_GF_ORGAN.lua", []() {return std::make_unique<GfOrgan>();}}, {"scripts\\ai\\GF\\L_GF_ORGAN.lua", []() {return new GfOrgan();}},
{"scripts\\ai\\GF\\L_GF_BANANA.lua", []() {return std::make_unique<GfBanana>();}}, {"scripts\\ai\\GF\\L_GF_BANANA.lua", []() {return new GfBanana();}},
{"scripts\\ai\\GF\\L_GF_BANANA_CLUSTER.lua", []() {return std::make_unique<GfBananaCluster>();}}, {"scripts\\ai\\GF\\L_GF_BANANA_CLUSTER.lua", []() {return new GfBananaCluster();}},
{"scripts/ai/GF/L_GF_JAILKEEP_MISSION.lua", []() {return std::make_unique<GfJailkeepMission>();}}, {"scripts/ai/GF/L_GF_JAILKEEP_MISSION.lua", []() {return new GfJailkeepMission();}},
{"scripts\\ai\\GF\\L_TRIGGER_AMBUSH.lua", []() {return std::make_unique<TriggerAmbush>();}}, {"scripts\\ai\\GF\\L_TRIGGER_AMBUSH.lua", []() {return new TriggerAmbush();}},
{"scripts\\02_server\\Map\\GF\\L_GF_CAPTAINS_CANNON.lua", []() {return std::make_unique<GfCaptainsCannon>();}}, {"scripts\\02_server\\Map\\GF\\L_GF_CAPTAINS_CANNON.lua", []() {return new GfCaptainsCannon();}},
{"scripts\\02_server\\Map\\GF\\L_MAST_TELEPORT.lua", []() {return std::make_unique<MastTeleport>();}}, {"scripts\\02_server\\Map\\GF\\L_MAST_TELEPORT.lua", []() {return new MastTeleport();}},
{"scripts\\ai\\GF\\L_GF_JAIL_WALLS.lua", []() {return std::make_unique<GfJailWalls>();}}, {"scripts\\ai\\GF\\L_GF_JAIL_WALLS.lua", []() {return new GfJailWalls();}},
{"scripts\\02_server\\Map\\General\\L_QB_ENEMY_STUNNER.lua", []() {return std::make_unique<QbEnemyStunner>();}}, {"scripts\\02_server\\Map\\General\\L_QB_ENEMY_STUNNER.lua", []() {return new QbEnemyStunner();}},
//Technically also used once in AG (below) //Technically also used once in AG (below)
{"scripts\\ai\\GF\\L_GF_PET_DIG_BUILD.lua", []() {return std::make_unique<PetDigBuild>();}}, {"scripts\\ai\\GF\\L_GF_PET_DIG_BUILD.lua", []() {return new PetDigBuild();}},
{"scripts\\02_server\\Map\\GF\\L_SPAWN_LION_SERVER.lua", []() {return std::make_unique<SpawnLionServer>();}}, {"scripts\\02_server\\Map\\GF\\L_SPAWN_LION_SERVER.lua", []() {return new SpawnLionServer();}},
{"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_APE.lua", []() {return std::make_unique<BaseEnemyApe>();}}, {"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_APE.lua", []() {return new BaseEnemyApe();}},
{"scripts\\02_server\\Enemy\\General\\L_GF_APE_SMASHING_QB.lua", []() {return std::make_unique<GfApeSmashingQB>();}}, {"scripts\\02_server\\Enemy\\General\\L_GF_APE_SMASHING_QB.lua", []() {return new GfApeSmashingQB();}},
{"scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua", []() {return std::make_unique<ZoneGfProperty>();}}, {"scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua", []() {return new ZoneGfProperty();}},
{"scripts\\ai\\GF\\L_GF_ARCHWAY.lua", []() {return std::make_unique<GfArchway>();}}, {"scripts\\ai\\GF\\L_GF_ARCHWAY.lua", []() {return new GfArchway();}},
{"scripts\\ai\\GF\\L_GF_MAELSTROM_GEYSER.lua", []() {return std::make_unique<GfMaelstromGeyser>();}}, {"scripts\\ai\\GF\\L_GF_MAELSTROM_GEYSER.lua", []() {return new GfMaelstromGeyser();}},
{"scripts\\ai\\GF\\L_PIRATE_REP.lua", []() {return std::make_unique<PirateRep>();}}, {"scripts\\ai\\GF\\L_PIRATE_REP.lua", []() {return new PirateRep();}},
{"scripts\\ai\\GF\\L_GF_PARROT_CRASH.lua", []() {return std::make_unique<GfParrotCrash>();}}, {"scripts\\ai\\GF\\L_GF_PARROT_CRASH.lua", []() {return new GfParrotCrash();}},
//SG //SG
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua", []() {return std::make_unique<SGCannon>();}}, {"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua", []() {return new SGCannon();}},
{"scripts\\ai\\MINIGAME\\SG_GF\\L_ZONE_SG_SERVER.lua", []() {return std::make_unique<ZoneSGServer>();}}, {"scripts\\ai\\MINIGAME\\SG_GF\\L_ZONE_SG_SERVER.lua", []() {return new ZoneSGServer();}},
//PR //PR
{"scripts\\client\\ai\\PR\\L_PR_WHISTLE.lua", []() {return std::make_unique<PrWhistle>();}}, {"scripts\\client\\ai\\PR\\L_PR_WHISTLE.lua", []() {return new PrWhistle();}},
{"scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua", []() {return std::make_unique<PrSeagullFly>();}}, {"scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua", []() {return new PrSeagullFly();}},
{"scripts\\ai\\PETS\\L_HYDRANT_SMASHABLE.lua", []() {return std::make_unique<HydrantSmashable>();}}, {"scripts\\ai\\PETS\\L_HYDRANT_SMASHABLE.lua", []() {return new HydrantSmashable();}},
{"scripts\\02_server\\map\\PR\\L_HYDRANT_BROKEN.lua", []() {return std::make_unique<HydrantBroken>();}}, {"scripts\\02_server\\map\\PR\\L_HYDRANT_BROKEN.lua", []() {return new HydrantBroken();}},
{"scripts\\02_server\\Map\\General\\PET_DIG_SERVER.lua", []() {return std::make_unique<PetDigServer>();}}, {"scripts\\02_server\\Map\\General\\PET_DIG_SERVER.lua", []() {return new PetDigServer();}},
{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", []() {return std::make_unique<PetDigServer>();}}, {"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", []() {return new PetDigServer();}},
//{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", [](){return std::make_unique<PetDigServer>();}}, //{"scripts\\02_server\\Map\\AM\\L_SKELETON_DRAGON_PET_DIG_SERVER.lua", [](){return new PetDigServer();}},
{"scripts\\client\\ai\\PR\\L_CRAB_SERVER.lua", []() {return std::make_unique<CrabServer>();}}, {"scripts\\client\\ai\\PR\\L_CRAB_SERVER.lua", []() {return new CrabServer();}},
{"scripts\\02_server\\Pets\\L_PET_FROM_DIG_SERVER.lua", []() {return std::make_unique<PetFromDigServer>();}}, {"scripts\\02_server\\Pets\\L_PET_FROM_DIG_SERVER.lua", []() {return new PetFromDigServer();}},
{"scripts\\02_server\\Pets\\L_PET_FROM_OBJECT_SERVER.lua", []() {return std::make_unique<PetFromObjectServer>();}}, {"scripts\\02_server\\Pets\\L_PET_FROM_OBJECT_SERVER.lua", []() {return new PetFromObjectServer();}},
{"scripts\\02_server\\Pets\\L_DAMAGING_PET.lua", []() {return std::make_unique<DamagingPets>();}}, {"scripts\\02_server\\Pets\\L_DAMAGING_PET.lua", []() {return new DamagingPets();}},
{"scripts\\02_server\\Map\\PR\\L_SPAWN_GRYPHON_SERVER.lua", []() {return std::make_unique<SpawnGryphonServer>();}}, {"scripts\\02_server\\Map\\PR\\L_SPAWN_GRYPHON_SERVER.lua", []() {return new SpawnGryphonServer();}},
//FV //FV
{"scripts\\02_server\\Map\\FV\\L_ACT_CANDLE.lua", []() {return std::make_unique<FvCandle>();}}, {"scripts\\02_server\\Map\\FV\\L_ACT_CANDLE.lua", []() {return new FvCandle();}},
{"scripts\\02_server\\Map\\FV\\L_ENEMY_RONIN_SPAWNER.lua", []() {return std::make_unique<EnemyRoninSpawner>();}}, {"scripts\\02_server\\Map\\FV\\L_ENEMY_RONIN_SPAWNER.lua", []() {return new EnemyRoninSpawner();}},
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_CAVALRY.lua", []() {return std::make_unique<FvMaelstromCavalry>();}}, {"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_CAVALRY.lua", []() {return new FvMaelstromCavalry();}},
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return std::make_unique<ActNinjaTurret>();}}, {"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return new ActNinjaTurret();}},
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return std::make_unique<FvHorsemenTrigger>();}}, {"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return new FvHorsemenTrigger();}},
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return std::make_unique<FvFlyingCreviceDragon>();}}, {"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return new FvFlyingCreviceDragon();}},
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return std::make_unique<FvMaelstromDragon>();}}, {"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return new FvMaelstromDragon();}},
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return std::make_unique<FvDragonSmashingGolemQb>();}}, {"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return new FvDragonSmashingGolemQb();}},
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return std::make_unique<TreasureChestDragonServer>();}}, {"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return new TreasureChestDragonServer();}},
{"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return std::make_unique<InstanceExitTransferPlayerToLastNonInstance>();}}, {"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return new InstanceExitTransferPlayerToLastNonInstance();}},
{"scripts\\ai\\FV\\L_NPC_FREE_GF_NINJAS.lua", []() {return std::make_unique<FvFreeGfNinjas>();}}, {"scripts\\ai\\FV\\L_NPC_FREE_GF_NINJAS.lua", []() {return new FvFreeGfNinjas();}},
{"scripts\\ai\\FV\\L_FV_PANDA_SPAWNER_SERVER.lua", []() {return std::make_unique<FvPandaSpawnerServer>();}}, {"scripts\\ai\\FV\\L_FV_PANDA_SPAWNER_SERVER.lua", []() {return new FvPandaSpawnerServer();}},
{"scripts\\ai\\FV\\L_FV_PANDA_SERVER.lua", []() {return std::make_unique<FvPandaServer>();}}, {"scripts\\ai\\FV\\L_FV_PANDA_SERVER.lua", []() {return new FvPandaServer();}},
{"scripts\\zone\\PROPERTY\\FV\\L_ZONE_FV_PROPERTY.lua", []() {return std::make_unique<ZoneFvProperty>();}}, {"scripts\\zone\\PROPERTY\\FV\\L_ZONE_FV_PROPERTY.lua", []() {return new ZoneFvProperty();}},
{"scripts\\ai\\FV\\L_FV_BRICK_PUZZLE_SERVER.lua", []() {return std::make_unique<FvBrickPuzzleServer>();}}, {"scripts\\ai\\FV\\L_FV_BRICK_PUZZLE_SERVER.lua", []() {return new FvBrickPuzzleServer();}},
{"scripts\\ai\\FV\\L_FV_CONSOLE_LEFT_QUICKBUILD.lua", []() {return std::make_unique<FvConsoleLeftQuickbuild>();}}, {"scripts\\ai\\FV\\L_FV_CONSOLE_LEFT_QUICKBUILD.lua", []() {return new FvConsoleLeftQuickbuild();}},
{"scripts\\ai\\FV\\L_FV_CONSOLE_RIGHT_QUICKBUILD.lua", []() {return std::make_unique<FvConsoleRightQuickbuild>();}}, {"scripts\\ai\\FV\\L_FV_CONSOLE_RIGHT_QUICKBUILD.lua", []() {return new FvConsoleRightQuickbuild();}},
{"scripts\\ai\\FV\\L_FV_FACILITY_BRICK.lua", []() {return std::make_unique<FvFacilityBrick>();}}, {"scripts\\ai\\FV\\L_FV_FACILITY_BRICK.lua", []() {return new FvFacilityBrick();}},
{"scripts\\ai\\FV\\L_FV_FACILITY_PIPES.lua", []() {return std::make_unique<FvFacilityPipes>();}}, {"scripts\\ai\\FV\\L_FV_FACILITY_PIPES.lua", []() {return new FvFacilityPipes();}},
{"scripts\\02_server\\Map\\FV\\L_IMG_BRICK_CONSOLE_QB.lua", []() {return std::make_unique<ImgBrickConsoleQB>();}}, {"scripts\\02_server\\Map\\FV\\L_IMG_BRICK_CONSOLE_QB.lua", []() {return new ImgBrickConsoleQB();}},
{"scripts\\ai\\FV\\L_ACT_PARADOX_PIPE_FIX.lua", []() {return std::make_unique<ActParadoxPipeFix>();}}, {"scripts\\ai\\FV\\L_ACT_PARADOX_PIPE_FIX.lua", []() {return new ActParadoxPipeFix();}},
{"scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua", []() {return std::make_unique<FvNinjaGuard>();}}, {"scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua", []() {return new FvNinjaGuard();}},
{"scripts\\ai\\FV\\L_ACT_PASS_THROUGH_WALL.lua", []() {return std::make_unique<FvPassThroughWall>();}}, {"scripts\\ai\\FV\\L_ACT_PASS_THROUGH_WALL.lua", []() {return new FvPassThroughWall();}},
{"scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua", []() {return std::make_unique<FvBounceOverWall>();}}, {"scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua", []() {return new FvBounceOverWall();}},
{"scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua", []() {return std::make_unique<FvFong>();}}, {"scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua", []() {return new FvFong();}},
{"scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua", []() {return std::make_unique<FvMaelstromGeyser>();}}, {"scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua", []() {return new FvMaelstromGeyser();}},
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_SHIP_LAP_COLUMNS_SERVER.lua", []() {return std::make_unique<RaceShipLapColumnsServer>();}}, {"scripts\\02_server\\Map\\FV\\Racing\\RACE_SHIP_LAP_COLUMNS_SERVER.lua", []() {return new RaceShipLapColumnsServer();}},
//yes we know the lap numbers dont match the file name or anim. Thats what they desgined it as. //yes we know the lap numbers dont match the file name or anim. Thats what they desgined it as.
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP1_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_01", 2);}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP1_SERVER.lua", []() {return new FvRaceDragon("lap_01", 2);}},
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP2_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_02", 0);}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP2_SERVER.lua", []() {return new FvRaceDragon("lap_02", 0);}},
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP3_SERVER.lua", []() {return std::make_unique<FvRaceDragon>("lap_03", 1);}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_DRAGON_LAP3_SERVER.lua", []() {return new FvRaceDragon("lap_03", 1);}},
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_ABC_SERVER.lua", []() {return std::make_unique<FvRacePillarABCServer>();}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_ABC_SERVER.lua", []() {return new FvRacePillarABCServer();}},
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_D_SERVER.lua", []() {return std::make_unique<FvRacePillarDServer>();}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_PILLAR_D_SERVER.lua", []() {return new FvRacePillarDServer();}},
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_FIREBALLS.lua", []() {return std::make_unique<RaceFireballs>();}}, {"scripts\\02_server\\Map\\FV\\Racing\\RACE_FIREBALLS.lua", []() {return new RaceFireballs();}},
//Misc. //Misc.
{"scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua", []() {return std::make_unique<ExplodingAsset>();}}, {"scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua", []() {return new ExplodingAsset();}},
{"scripts\\02_server\\Map\\General\\L_WISHING_WELL_SERVER.lua", []() {return std::make_unique<WishingWellServer>();}}, {"scripts\\02_server\\Map\\General\\L_WISHING_WELL_SERVER.lua", []() {return new WishingWellServer();}},
{"scripts\\ai\\ACT\\L_ACT_PLAYER_DEATH_TRIGGER.lua", []() {return std::make_unique<ActPlayerDeathTrigger>();}}, {"scripts\\ai\\ACT\\L_ACT_PLAYER_DEATH_TRIGGER.lua", []() {return new ActPlayerDeathTrigger();}},
{"scripts\\02_server\\Map\\General\\L_GROWING_FLOWER_SERVER.lua", []() {return std::make_unique<GrowingFlower>();}}, {"scripts\\02_server\\Map\\General\\L_GROWING_FLOWER_SERVER.lua", []() {return new GrowingFlower();}},
{"scripts\\02_server\\Map\\General\\L_TOKEN_CONSOLE_SERVER.lua", []() {return std::make_unique<TokenConsoleServer>();}}, {"scripts\\02_server\\Map\\General\\L_TOKEN_CONSOLE_SERVER.lua", []() {return new TokenConsoleServer();}},
{"scripts\\ai\\ACT\\FootRace\\L_ACT_BASE_FOOT_RACE.lua", []() {return std::make_unique<BaseFootRaceManager>();}}, {"scripts\\ai\\ACT\\FootRace\\L_ACT_BASE_FOOT_RACE.lua", []() {return new BaseFootRaceManager();}},
{"scripts\\02_server\\Map\\General\\L_PROP_PLATFORM.lua", []() {return std::make_unique<PropertyPlatform>();}}, {"scripts\\02_server\\Map\\General\\L_PROP_PLATFORM.lua", []() {return new PropertyPlatform();}},
{"scripts\\02_server\\Map\\VE\\L_VE_BRICKSAMPLE_SERVER.lua", []() {return std::make_unique<VeBricksampleServer>();}}, {"scripts\\02_server\\Map\\VE\\L_VE_BRICKSAMPLE_SERVER.lua", []() {return new VeBricksampleServer();}},
{"scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua", []() {return std::make_unique<MailBoxServer>();}}, {"scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua", []() {return new MailBoxServer();}},
{"scripts\\ai\\ACT\\L_ACT_MINE.lua", []() {return std::make_unique<ActMine>();}}, {"scripts\\ai\\ACT\\L_ACT_MINE.lua", []() {return new ActMine();}},
{"scripts\\02_server\\Map\\AM\\L_WANDERING_VENDOR.lua", []() {return std::make_unique<WanderingVendor>();}}, {"scripts\\02_server\\Map\\AM\\L_WANDERING_VENDOR.lua", []() {return new WanderingVendor();}},
//Racing //Racing
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua", []() {return std::make_unique<RaceImagineCrateServer>();}}, {"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua", []() {return new RaceImagineCrateServer();}},
{"scripts\\ai\\ACT\\L_ACT_VEHICLE_DEATH_TRIGGER.lua", []() {return std::make_unique<ActVehicleDeathTrigger>();}}, {"scripts\\ai\\ACT\\L_ACT_VEHICLE_DEATH_TRIGGER.lua", []() {return new ActVehicleDeathTrigger();}},
{"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_POWERUP.lua", []() {return std::make_unique<RaceImaginePowerup>();}}, {"scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_POWERUP.lua", []() {return new RaceImaginePowerup();}},
{"scripts\\02_server\\Map\\FV\\Racing\\RACE_MAELSTROM_GEISER.lua", []() {return std::make_unique<RaceMaelstromGeiser>();}}, {"scripts\\02_server\\Map\\FV\\Racing\\RACE_MAELSTROM_GEISER.lua", []() {return new RaceMaelstromGeiser();}},
{"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_SMASH_EGG_IMAGINE_SERVER.lua", []() {return std::make_unique<FvRaceSmashEggImagineServer>();}}, {"scripts\\ai\\RACING\\OBJECTS\\FV_RACE_SMASH_EGG_IMAGINE_SERVER.lua", []() {return new FvRaceSmashEggImagineServer();}},
{"scripts\\02_server\\Map\\FV\\Racing\\FV_RACING_COLUMNS.lua", []() {return std::make_unique<FvRacingColumns>();}}, {"scripts\\02_server\\Map\\FV\\Racing\\FV_RACING_COLUMNS.lua", []() {return new FvRacingColumns();}},
{"scripts\\ai\\RACING\\OBJECTS\\RACE_SMASH_SERVER.lua", []() {return std::make_unique<RaceSmashServer>();}}, {"scripts\\ai\\RACING\\OBJECTS\\RACE_SMASH_SERVER.lua", []() {return new RaceSmashServer();}},
//NT //NT
{"scripts\\02_server\\Map\\NT\\L_NT_SENTINELWALKWAY_SERVER.lua", []() {return std::make_unique<NtSentinelWalkwayServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_SENTINELWALKWAY_SERVER.lua", []() {return new NtSentinelWalkwayServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOXTELE_SERVER.lua", []() {return std::make_unique<NtParadoxTeleServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_PARADOXTELE_SERVER.lua", []() {return new NtParadoxTeleServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_DARKITECT_REVEAL_SERVER.lua", []() {return std::make_unique<NtDarkitectRevealServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_DARKITECT_REVEAL_SERVER.lua", []() {return new NtDarkitectRevealServer();}},
{"scripts\\02_server\\Map\\General\\L_BANK_INTERACT_SERVER.lua", []() {return std::make_unique<BankInteractServer>();}}, {"scripts\\02_server\\Map\\General\\L_BANK_INTERACT_SERVER.lua", []() {return new BankInteractServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURESPEEDPAD_SERVER.lua", []() {return std::make_unique<NtVentureSpeedPadServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_VENTURESPEEDPAD_SERVER.lua", []() {return new NtVentureSpeedPadServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_VENTURE_CANNON_SERVER.lua", []() {return std::make_unique<NtVentureCannonServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_VENTURE_CANNON_SERVER.lua", []() {return new NtVentureCannonServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_SERVER.lua", []() {return std::make_unique<NtCombatChallengeServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_SERVER.lua", []() {return new NtCombatChallengeServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua", []() {return std::make_unique<NtCombatChallengeDummy>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua", []() {return new NtCombatChallengeDummy();}},
{"scripts\\02_server\\Map\\NT\\\\L_NT_COMBAT_EXPLODING_TARGET.lua", []() {return std::make_unique<NtCombatChallengeExplodingDummy>();}}, {"scripts\\02_server\\Map\\NT\\\\L_NT_COMBAT_EXPLODING_TARGET.lua", []() {return new NtCombatChallengeExplodingDummy();}},
{"scripts\\02_server\\Map\\General\\L_BASE_INTERACT_DROP_LOOT_SERVER.lua", []() {return std::make_unique<BaseInteractDropLootServer>();}}, {"scripts\\02_server\\Map\\General\\L_BASE_INTERACT_DROP_LOOT_SERVER.lua", []() {return new BaseInteractDropLootServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_ASSEMBLYTUBE_SERVER.lua", []() {return std::make_unique<NtAssemblyTubeServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_ASSEMBLYTUBE_SERVER.lua", []() {return new NtAssemblyTubeServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_PARADOX_PANEL_SERVER.lua", []() {return std::make_unique<NtParadoxPanelServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_PARADOX_PANEL_SERVER.lua", []() {return new NtParadoxPanelServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_IMAG_BEAM_BUFFER.lua", []() {return std::make_unique<NtImagBeamBuffer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_IMAG_BEAM_BUFFER.lua", []() {return new NtImagBeamBuffer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_BEAM_IMAGINATION_COLLECTORS.lua", []() {return std::make_unique<NtBeamImaginationCollectors>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_BEAM_IMAGINATION_COLLECTORS.lua", []() {return new NtBeamImaginationCollectors();}},
{"scripts\\02_server\\Map\\NT\\L_NT_DIRT_CLOUD_SERVER.lua", []() {return std::make_unique<NtDirtCloudServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_DIRT_CLOUD_SERVER.lua", []() {return new NtDirtCloudServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_CONSOLE_TELEPORT_SERVER.lua", []() {return std::make_unique<NtConsoleTeleportServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_CONSOLE_TELEPORT_SERVER.lua", []() {return new NtConsoleTeleportServer();}},
{"scripts\\02_server\\Map\\NT\\L_SPAWN_STEGO_SERVER.lua", []() {return std::make_unique<SpawnStegoServer>();}}, {"scripts\\02_server\\Map\\NT\\L_SPAWN_STEGO_SERVER.lua", []() {return new SpawnStegoServer();}},
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SABERCAT_SERVER.lua", []() {return std::make_unique<SpawnSaberCatServer>();}}, {"scripts\\02_server\\Map\\NT\\L_SPAWN_SABERCAT_SERVER.lua", []() {return new SpawnSaberCatServer();}},
{"scripts\\02_server\\Map\\NT\\L_SPAWN_SHRAKE_SERVER.lua", []() {return std::make_unique<SpawnShrakeServer>();}}, {"scripts\\02_server\\Map\\NT\\L_SPAWN_SHRAKE_SERVER.lua", []() {return new SpawnShrakeServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_DUKE_SERVER.lua", []() {return std::make_unique<NtDukeServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_DUKE_SERVER.lua", []() {return new NtDukeServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_HAEL_SERVER.lua", []() {return std::make_unique<NtHaelServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_HAEL_SERVER.lua", []() {return new NtHaelServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_FACTION_SPY_SERVER.lua", []() {return std::make_unique<NtFactionSpyServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_FACTION_SPY_SERVER.lua", []() {return new NtFactionSpyServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_OVERBUILD_SERVER.lua", []() {return std::make_unique<NtOverbuildServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_OVERBUILD_SERVER.lua", []() {return new NtOverbuildServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_VANDA_SERVER.lua", []() {return std::make_unique<NtVandaServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_VANDA_SERVER.lua", []() {return new NtVandaServer();}},
{"scripts\\02_server\\Map\\General\\L_FORCE_VOLUME_SERVER.lua", []() {return std::make_unique<ForceVolumeServer>();}}, {"scripts\\02_server\\Map\\General\\L_FORCE_VOLUME_SERVER.lua", []() {return new ForceVolumeServer();}},
{"scripts\\02_server\\Map\\General\\L_FRICTION_VOLUME_SERVER.lua", []() {return std::make_unique<FrictionVolumeServer>();}}, {"scripts\\02_server\\Map\\General\\L_FRICTION_VOLUME_SERVER.lua", []() {return new FrictionVolumeServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_XRAY_SERVER.lua", []() {return std::make_unique<NtXRayServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_XRAY_SERVER.lua", []() {return new NtXRayServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_SLEEPING_GUARD.lua", []() {return std::make_unique<NtSleepingGuard>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_SLEEPING_GUARD.lua", []() {return new NtSleepingGuard();}},
{"scripts\\02_server\\Map\\NT\\L_NT_IMAGIMETER_VISIBILITY_SERVER.lua", []() {return std::make_unique<NTImagimeterVisibility>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_IMAGIMETER_VISIBILITY_SERVER.lua", []() {return new NTImagimeterVisibility();}},
{"scripts\\02_server\\Map\\NT\\L_NT_PIPE_VISIBILITY_SERVER.lua", []() {return std::make_unique<NTPipeVisibilityServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_PIPE_VISIBILITY_SERVER.lua", []() {return new NTPipeVisibilityServer();}},
{"scripts\\ai\\MINIGAME\\Objects\\MINIGAME_BLUE_MARK.lua", []() {return std::make_unique<MinigameBlueMark>();}}, {"scripts\\ai\\MINIGAME\\Objects\\MINIGAME_BLUE_MARK.lua", []() {return new MinigameBlueMark();}},
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_BREADCRUMB_SERVER.lua", []() {return std::make_unique<NtNaomiBreadcrumbServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_BREADCRUMB_SERVER.lua", []() {return new NtNaomiBreadcrumbServer();}},
{"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_DIRT_SERVER.lua", []() {return std::make_unique<NTNaomiDirtServer>();}}, {"scripts\\02_server\\Map\\NT\\L_NT_NAOMI_DIRT_SERVER.lua", []() {return new NTNaomiDirtServer();}},
//AM Crux //AM Crux
{"scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua", []() {return std::make_unique<AmConsoleTeleportServer>();}}, {"scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua", []() {return new AmConsoleTeleportServer();}},
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_FIN.lua", []() {return std::make_unique<RandomSpawnerFin>();}}, {"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_FIN.lua", []() {return new RandomSpawnerFin();}},
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_PIT.lua", []() {return std::make_unique<RandomSpawnerPit>();}}, {"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_PIT.lua", []() {return new RandomSpawnerPit();}},
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_STR.lua", []() {return std::make_unique<RandomSpawnerStr>();}}, {"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_STR.lua", []() {return new RandomSpawnerStr();}},
{"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_ZIP.lua", []() {return std::make_unique<RandomSpawnerZip>();}}, {"scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_ZIP.lua", []() {return new RandomSpawnerZip();}},
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_MECH.lua", []() {return std::make_unique<AmDarklingMech>();}}, {"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_MECH.lua", []() {return new AmDarklingMech();}},
{"scripts\\02_server\\Map\\AM\\L_BRIDGE.lua", []() {return std::make_unique<AmBridge>();}}, {"scripts\\02_server\\Map\\AM\\L_BRIDGE.lua", []() {return new AmBridge();}},
{"scripts\\02_server\\Map\\AM\\L_DRAW_BRIDGE.lua", []() {return std::make_unique<AmDrawBridge>();}}, {"scripts\\02_server\\Map\\AM\\L_DRAW_BRIDGE.lua", []() {return new AmDrawBridge();}},
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR.lua", []() {return std::make_unique<AmShieldGenerator>();}}, {"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR.lua", []() {return new AmShieldGenerator();}},
{"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR_QUICKBUILD.lua", []() {return std::make_unique<AmShieldGeneratorQuickbuild>();}}, {"scripts\\02_server\\Map\\AM\\L_SHIELD_GENERATOR_QUICKBUILD.lua", []() {return new AmShieldGeneratorQuickbuild();}},
{"scripts\\02_server\\Map\\AM\\L_DROPSHIP_COMPUTER.lua", []() {return std::make_unique<AmDropshipComputer>();}}, {"scripts\\02_server\\Map\\AM\\L_DROPSHIP_COMPUTER.lua", []() {return new AmDropshipComputer();}},
{"scripts\\02_server\\Map\\AM\\L_SCROLL_READER_SERVER.lua", []() {return std::make_unique<AmScrollReaderServer>();}}, {"scripts\\02_server\\Map\\AM\\L_SCROLL_READER_SERVER.lua", []() {return new AmScrollReaderServer();}},
{"scripts\\02_server\\Map\\AM\\L_TEMPLE_SKILL_VOLUME.lua", []() {return std::make_unique<AmTemplateSkillVolume>();}}, {"scripts\\02_server\\Map\\AM\\L_TEMPLE_SKILL_VOLUME.lua", []() {return new AmTemplateSkillVolume();}},
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF.lua", []() {return std::make_unique<EnemyNjBuff>();}}, {"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF.lua", []() {return new EnemyNjBuff();}},
{"scripts\\02_server\\Enemy\\AM\\L_AM_SKELETON_ENGINEER.lua", []() {return std::make_unique<AmSkeletonEngineer>();}}, {"scripts\\02_server\\Enemy\\AM\\L_AM_SKELETON_ENGINEER.lua", []() {return new AmSkeletonEngineer();}},
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL.lua", []() {return std::make_unique<AmSkullkinDrill>();}}, {"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL.lua", []() {return new AmSkullkinDrill();}},
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL_STAND.lua", []() {return std::make_unique<AmSkullkinDrillStand>();}}, {"scripts\\02_server\\Map\\AM\\L_SKULLKIN_DRILL_STAND.lua", []() {return new AmSkullkinDrillStand();}},
{"scripts\\02_server\\Map\\AM\\L_SKULLKIN_TOWER.lua", []() {return std::make_unique<AmSkullkinTower>();}}, {"scripts\\02_server\\Map\\AM\\L_SKULLKIN_TOWER.lua", []() {return new AmSkullkinTower();}},
{"scripts\\02_server\\Enemy\\AM\\L_AM_NAMED_DARKLING_DRAGON.lua", []() {return std::make_unique<AmDarklingDragon>();}}, {"scripts\\02_server\\Enemy\\AM\\L_AM_NAMED_DARKLING_DRAGON.lua", []() {return new AmDarklingDragon();}},
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_DRAGON.lua", []() {return std::make_unique<AmDarklingDragon>();}}, {"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_DRAGON.lua", []() {return new AmDarklingDragon();}},
{"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_APE.lua", []() {return std::make_unique<BaseEnemyApe>();}}, {"scripts\\02_server\\Enemy\\AM\\L_AM_DARKLING_APE.lua", []() {return new BaseEnemyApe();}},
{"scripts\\02_server\\Map\\AM\\L_BLUE_X.lua", []() {return std::make_unique<AmBlueX>();}}, {"scripts\\02_server\\Map\\AM\\L_BLUE_X.lua", []() {return new AmBlueX();}},
{"scripts\\02_server\\Map\\AM\\L_TEAPOT_SERVER.lua", []() {return std::make_unique<AmTeapotServer>();}}, {"scripts\\02_server\\Map\\AM\\L_TEAPOT_SERVER.lua", []() {return new AmTeapotServer();}},
//Ninjago //Ninjago
{"scripts\\02_server\\Map\\njhub\\L_GARMADON_CELEBRATION_SERVER.lua", []() {return std::make_unique<NjGarmadonCelebration>();}}, {"scripts\\02_server\\Map\\njhub\\L_GARMADON_CELEBRATION_SERVER.lua", []() {return new NjGarmadonCelebration();}},
{"scripts\\02_server\\Map\\njhub\\L_WU_NPC.lua", []() {return std::make_unique<NjWuNPC>();}}, {"scripts\\02_server\\Map\\njhub\\L_WU_NPC.lua", []() {return new NjWuNPC();}},
{"scripts\\02_server\\Map\\njhub\\L_SCROLL_CHEST_SERVER.lua", []() {return std::make_unique<NjScrollChestServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_SCROLL_CHEST_SERVER.lua", []() {return new NjScrollChestServer();}},
{"scripts\\02_server\\Map\\njhub\\L_COLE_NPC.lua", []() {return std::make_unique<NjColeNPC>();}}, {"scripts\\02_server\\Map\\njhub\\L_COLE_NPC.lua", []() {return new NjColeNPC();}},
{"scripts\\02_server\\Map\\njhub\\L_JAY_MISSION_ITEMS.lua", []() {return std::make_unique<NjJayMissionItems>();}}, {"scripts\\02_server\\Map\\njhub\\L_JAY_MISSION_ITEMS.lua", []() {return new NjJayMissionItems();}},
{"scripts\\02_server\\Map\\njhub\\L_NPC_MISSION_SPINJITZU_SERVER.lua", []() {return std::make_unique<NjNPCMissionSpinjitzuServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_NPC_MISSION_SPINJITZU_SERVER.lua", []() {return new NjNPCMissionSpinjitzuServer();}},
{"scripts\\02_server\\Map\\njhub\\L_ENEMY_SKELETON_SPAWNER.lua", []() {return std::make_unique<EnemySkeletonSpawner>();}}, {"scripts\\02_server\\Map\\njhub\\L_ENEMY_SKELETON_SPAWNER.lua", []() {return new EnemySkeletonSpawner();}},
{"scripts\\02_server\\Map\\General\\L_NJ_RAIL_SWITCH.lua", []() {return std::make_unique<NjRailSwitch>();}}, {"scripts\\02_server\\Map\\General\\L_NJ_RAIL_SWITCH.lua", []() {return new NjRailSwitch();}},
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_ACTIVATORS_SERVER.lua", []() {return std::make_unique<NjRailActivatorsServer>();}}, {"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_ACTIVATORS_SERVER.lua", []() {return new NjRailActivatorsServer();}},
{"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_POST_SERVER.lua", []() {return std::make_unique<NjRailPostServer>();}}, {"scripts\\02_server\\Map\\General\\Ninjago\\L_RAIL_POST_SERVER.lua", []() {return new NjRailPostServer();}},
{"scripts\\02_server\\Map\\General\\Ninjago\\L_ICE_RAIL_ACTIVATOR_SERVER.lua", []() {return std::make_unique<NjIceRailActivator>();}}, {"scripts\\02_server\\Map\\General\\Ninjago\\L_ICE_RAIL_ACTIVATOR_SERVER.lua", []() {return new NjIceRailActivator();}},
{"scripts\\02_server\\Map\\njhub\\L_FALLING_TILE.lua", []() {return std::make_unique<FallingTile>();}}, {"scripts\\02_server\\Map\\njhub\\L_FALLING_TILE.lua", []() {return new FallingTile();}},
{"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF_STUN_IMMUNITY.lua", []() {return std::make_unique<EnemyNjBuff>();}}, {"scripts\\02_server\\Enemy\\General\\L_ENEMY_NJ_BUFF_STUN_IMMUNITY.lua", []() {return new EnemyNjBuff();}},
{"scripts\\02_server\\Map\\njhub\\L_IMAGINATION_SHRINE_SERVER.lua", []() {return std::make_unique<ImaginationShrineServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_IMAGINATION_SHRINE_SERVER.lua", []() {return new ImaginationShrineServer();}},
{"scripts\\02_server\\Map\\njhub\\L_LIEUTENANT.lua", []() {return std::make_unique<Lieutenant>();}}, {"scripts\\02_server\\Map\\njhub\\L_LIEUTENANT.lua", []() {return new Lieutenant();}},
{"scripts\\02_server\\Map\\njhub\\L_RAIN_OF_ARROWS.lua", []() {return std::make_unique<RainOfArrows>();}}, {"scripts\\02_server\\Map\\njhub\\L_RAIN_OF_ARROWS.lua", []() {return new RainOfArrows();}},
{"scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua", []() {return std::make_unique<CavePrisonCage>();}}, {"scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua", []() {return new CavePrisonCage();}},
{"scripts\\02_server\\Map\\njhub\\boss_instance\\L_MONASTERY_BOSS_INSTANCE_SERVER.lua", []() {return std::make_unique<NjMonastryBossInstance>();}}, {"scripts\\02_server\\Map\\njhub\\boss_instance\\L_MONASTERY_BOSS_INSTANCE_SERVER.lua", []() {return new NjMonastryBossInstance();}},
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BOUNCER_SERVER.lua", []() {return std::make_unique<CatapultBouncerServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BOUNCER_SERVER.lua", []() {return new CatapultBouncerServer();}},
{"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BASE_SERVER.lua", []() {return std::make_unique<CatapultBaseServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_CATAPULT_BASE_SERVER.lua", []() {return new CatapultBaseServer();}},
{"scripts\\02_server\\Map\\General\\Ninjago\\L_NJHUB_LAVA_PLAYER_DEATH_TRIGGER.lua", []() {return std::make_unique<NjhubLavaPlayerDeathTrigger>();}}, {"scripts\\02_server\\Map\\General\\Ninjago\\L_NJHUB_LAVA_PLAYER_DEATH_TRIGGER.lua", []() {return new NjhubLavaPlayerDeathTrigger();}},
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_NOOK_DOORS.lua", []() {return std::make_unique<MonCoreNookDoors>();}}, {"scripts\\02_server\\Map\\njhub\\L_MON_CORE_NOOK_DOORS.lua", []() {return new MonCoreNookDoors();}},
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return std::make_unique<MonCoreSmashableDoors>();}}, {"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return std::make_unique<MonCoreSmashableDoors>();}}, {"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return std::make_unique<FlameJetServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return std::make_unique<BurningTile>();}}, {"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return std::make_unique<NjEarthDragonPetServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return std::make_unique<NjEarthPetServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
{"scripts\\02_server\\Map\\njhub\\L_DRAGON_EMBLEM_CHEST_SERVER.lua", []() {return std::make_unique<NjDragonEmblemChestServer>();}}, {"scripts\\02_server\\Map\\njhub\\L_DRAGON_EMBLEM_CHEST_SERVER.lua", []() {return new NjDragonEmblemChestServer();}},
{"scripts\\02_server\\Map\\njhub\\L_NYA_MISSION_ITEMS.lua", []() {return std::make_unique<NjNyaMissionitems>();}}, {"scripts\\02_server\\Map\\njhub\\L_NYA_MISSION_ITEMS.lua", []() {return new NjNyaMissionitems();}},
//DLU //DLU
{"scripts\\02_server\\DLU\\DLUVanityTeleportingObject.lua", []() {return std::make_unique<DLUVanityTeleportingObject>();}}, {"scripts\\02_server\\DLU\\DLUVanityTeleportingObject.lua", []() {return new DLUVanityTeleportingObject();}},
//Survival Minigame //Survival Minigame
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_STROMBIE.lua", []() {return std::make_unique<AgSurvivalStromling>();}}, {"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_STROMBIE.lua", []() {return new AgSurvivalStromling();}},
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARKLING_MECH.lua", []() {return std::make_unique<AgSurvivalMech>();}}, {"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARKLING_MECH.lua", []() {return new AgSurvivalMech();}},
{"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARK_SPIDERLING.lua", []() {return std::make_unique<AgSurvivalSpiderling>();}}, {"scripts\\02_server\\Enemy\\Survival\\L_AG_SURVIVAL_DARK_SPIDERLING.lua", []() {return new AgSurvivalSpiderling();}},
//Scripted Equipment //Scripted Equipment
{"scripts\\EquipmentScripts\\Sunflower.lua", []() {return std::make_unique<Sunflower>();}}, {"scripts\\EquipmentScripts\\Sunflower.lua", []() {return new Sunflower();}},
{"scripts/EquipmentScripts/AnvilOfArmor.lua", []() {return std::make_unique<AnvilOfArmor>();}}, {"scripts/EquipmentScripts/AnvilOfArmor.lua", []() {return new AnvilOfArmor();}},
{"scripts/EquipmentScripts/FountainOfImagination.lua", []() {return std::make_unique<FountainOfImagination>();}}, {"scripts/EquipmentScripts/FountainOfImagination.lua", []() {return new FountainOfImagination();}},
{"scripts/EquipmentScripts/CauldronOfLife.lua", []() {return std::make_unique<CauldronOfLife>();}}, {"scripts/EquipmentScripts/CauldronOfLife.lua", []() {return new CauldronOfLife();}},
{"scripts\\02_server\\Equipment\\L_BOOTYDIG_SERVER.lua", []() {return std::make_unique<BootyDigServer>();}}, {"scripts\\02_server\\Equipment\\L_BOOTYDIG_SERVER.lua", []() {return new BootyDigServer();}},
{"scripts\\EquipmentScripts\\PersonalFortress.lua", []() {return std::make_unique<PersonalFortress>();}}, {"scripts\\EquipmentScripts\\PersonalFortress.lua", []() {return new PersonalFortress();}},
{"scripts\\02_server\\Map\\General\\L_PROPERTY_DEVICE.lua", []() {return std::make_unique<PropertyDevice>();}}, {"scripts\\02_server\\Map\\General\\L_PROPERTY_DEVICE.lua", []() {return new PropertyDevice();}},
{"scripts\\02_server\\Map\\General\\L_IMAG_BACKPACK_HEALS_SERVER.lua", []() {return std::make_unique<ImaginationBackpackHealServer>();}}, {"scripts\\02_server\\Map\\General\\L_IMAG_BACKPACK_HEALS_SERVER.lua", []() {return new ImaginationBackpackHealServer();}},
{"scripts\\ai\\GENERAL\\L_LEGO_DIE_ROLL.lua", []() {return std::make_unique<LegoDieRoll>();}}, {"scripts\\ai\\GENERAL\\L_LEGO_DIE_ROLL.lua", []() {return new LegoDieRoll();}},
{"scripts\\EquipmentScripts\\BuccaneerValiantShip.lua", []() {return std::make_unique<BuccaneerValiantShip>();}}, {"scripts\\EquipmentScripts\\BuccaneerValiantShip.lua", []() {return new BuccaneerValiantShip();}},
{"scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua", []() {return std::make_unique<FireFirstSkillonStartup>();}}, {"scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua", []() {return new FireFirstSkillonStartup();}},
{"scripts\\equipmenttriggers\\gempack.lua", []() {return std::make_unique<GemPack>();}}, {"scripts\\equipmenttriggers\\gempack.lua", []() {return new GemPack();}},
{"scripts\\equipmenttriggers\\shardarmor.lua", []() {return std::make_unique<ShardArmor>();}}, {"scripts\\equipmenttriggers\\shardarmor.lua", []() {return new ShardArmor();}},
{"scripts\\equipmenttriggers\\coilbackpack.lua", []() {return std::make_unique<TeslaPack>();}}, {"scripts\\equipmenttriggers\\coilbackpack.lua", []() {return new TeslaPack();}},
{"scripts\\EquipmentScripts\\stunImmunity.lua", []() {return std::make_unique<StunImmunity>();}}, {"scripts\\EquipmentScripts\\stunImmunity.lua", []() {return new StunImmunity();}},
//FB //FB
{"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua", []() {return std::make_unique<RockHydrantBroken>();}}, {"scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua", []() {return new RockHydrantBroken();}},
{"scripts\\ai\\NS\\L_NS_WH_FANS.lua", []() {return std::make_unique<WhFans>();}}, {"scripts\\ai\\NS\\L_NS_WH_FANS.lua", []() {return new WhFans();}},
//WBL //WBL
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return std::make_unique<WblGenericZone>();}}, {"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
//Alpha //Alpha
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return std::make_unique<TriggerGas>();}}, {"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
{"scripts\\ai\\FV\\L_ACT_NINJA_SENSEI.lua", []() {return std::make_unique<ActNinjaSensei>();}}, {"scripts\\ai\\FV\\L_ACT_NINJA_SENSEI.lua", []() {return new ActNinjaSensei();}},
//Pickups //Pickups
{"scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(1);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(1);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(10000);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(10000);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(100);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(100);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(10);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(10);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(100000);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(100000);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(1000);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(1000);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(25);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(25);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(250000);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(250000);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua", []() {return std::make_unique<SpecialCoinSpawner>(2500);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua", []() {return new SpecialCoinSpawner(2500);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(13);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(13);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua", []() {return std::make_unique<SpecialPowerupSpawner>(129);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua", []() {return new SpecialPowerupSpawner(129);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(5);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(5);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua", []() {return std::make_unique<SpecialPowerupSpawner>(747);}}, {"scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua", []() {return new SpecialPowerupSpawner(747);}},
{"scripts\\ai\\SPEC\\L_SPECIAL_SPEED_BUFF_SPAWNER.lua", []() {return std::make_unique<SpecialSpeedBuffSpawner>();}}, {"scripts\\ai\\SPEC\\L_SPECIAL_SPEED_BUFF_SPAWNER.lua", []() {return new SpecialSpeedBuffSpawner();}},
//Wild //Wild
{"scripts\\ai\\WILD\\L_WILD_GF_RAT.lua", []() {return std::make_unique<WildAndScared>();}}, {"scripts\\ai\\WILD\\L_WILD_GF_RAT.lua", []() {return new WildAndScared();}},
{"scripts\\ai\\WILD\\L_WILD_GF_SNAIL.lua", []() {return std::make_unique<WildAndScared>();}}, {"scripts\\ai\\WILD\\L_WILD_GF_SNAIL.lua", []() {return new WildAndScared();}},
{"scripts\\ai\\WILD\\L_WILD_GF_GLOWBUG.lua", []() {return std::make_unique<WildGfGlowbug>();}}, {"scripts\\ai\\WILD\\L_WILD_GF_GLOWBUG.lua", []() {return new WildGfGlowbug();}},
{"scripts\\ai\\WILD\\L_WILD_AMBIENT_CRAB.lua", []() {return std::make_unique<WildAmbientCrab>();}}, {"scripts\\ai\\WILD\\L_WILD_AMBIENT_CRAB.lua", []() {return new WildAmbientCrab();}},
{"scripts\\ai\\WILD\\L_WILD_PANTS.lua", []() {return std::make_unique<WildPants>();}}, {"scripts\\ai\\WILD\\L_WILD_PANTS.lua", []() {return new WildPants();}},
{"scripts\\ai\\WILD\\L_WILD_NINJA_BRICKS.lua", []() {return std::make_unique<WildNinjaBricks>();}}, {"scripts\\ai\\WILD\\L_WILD_NINJA_BRICKS.lua", []() {return new WildNinjaBricks();}},
{"scripts\\ai\\WILD\\L_WILD_NINJA_STUDENT.lua", []() {return std::make_unique<WildNinjaStudent>();}}, {"scripts\\ai\\WILD\\L_WILD_NINJA_STUDENT.lua", []() {return new WildNinjaStudent();}},
{"scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua", []() {return std::make_unique<WildNinjaSensei>();}}, {"scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua", []() {return new WildNinjaSensei();}},
{"scripts\\ai\\WILD\\L_LUP_generic_interact.lua", []() {return std::make_unique<LupGenericInteract>();}}, {"scripts\\ai\\WILD\\L_LUP_generic_interact.lua", []() {return new LupGenericInteract();}},
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenBlue.lua", []() {return std::make_unique<WblRobotCitizen>();}}, {"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenBlue.lua", []() {return new WblRobotCitizen();}},
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenGreen.lua", []() {return std::make_unique<WblRobotCitizen>();}}, {"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenGreen.lua", []() {return new WblRobotCitizen();}},
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenOrange.lua", []() {return std::make_unique<WblRobotCitizen>();}}, {"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenOrange.lua", []() {return new WblRobotCitizen();}},
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenRed.lua", []() {return std::make_unique<WblRobotCitizen>();}}, {"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenRed.lua", []() {return new WblRobotCitizen();}},
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenYellow.lua", []() {return std::make_unique<WblRobotCitizen>();}}, {"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenYellow.lua", []() {return new WblRobotCitizen();}},
{"scripts\\02_server\\Map\\General\\L_ENEMY_CLEAR_THREAT.lua", []() {return std::make_unique<EnemyClearThreat>();}}, {"scripts\\02_server\\Map\\General\\L_ENEMY_CLEAR_THREAT.lua", []() {return new EnemyClearThreat();}},
{"scripts\\ai\\AG\\L_AG_SPIDER_BOSS_MESSAGE.lua", []() {return std::make_unique<AgSpiderBossMessage>();}}, {"scripts\\ai\\AG\\L_AG_SPIDER_BOSS_MESSAGE.lua", []() {return new AgSpiderBossMessage();}},
{"scripts\\ai\\GF\\L_GF_RACE_INSTANCER.lua", []() {return std::make_unique<GfRaceInstancer>();}}, {"scripts\\ai\\GF\\L_GF_RACE_INSTANCER.lua", []() {return new GfRaceInstancer();}},
{"scripts\\ai\\RACING\\TRACK_NS\\NS_RACE_SERVER.lua", []() {return new NsRaceServer();}},
}; };
@@ -704,29 +706,32 @@ namespace {
"scripts\\empty.lua", "scripts\\empty.lua",
"scripts\\zone\\AG\\L_ZONE_AG.lua", "scripts\\zone\\AG\\L_ZONE_AG.lua",
"scripts\\zone\\NS\\L_ZONE_NS.lua", "scripts\\zone\\NS\\L_ZONE_NS.lua",
"scripts\\zone\\GF\\L_ZONE_GF.lua", "scripts\\ai\\GF\\L_ZONE_GF.lua",
"scripts\\ai\\AG\\CONCERT_STAGE.lua", "scripts\\ai\\AG\\CONCERT_STAGE.lua",
"scripts\\ai\\NS\\L_NS_CAR_MODULAR_BUILD.lua", // In our implementation, this is done in GameMessages.cpp "scripts\\ai\\NS\\L_NS_CAR_MODULAR_BUILD.lua", // In our implementation, this is done in GameMessages.cpp
"scripts\\ai\\PETS\\PET_BLOCKER.lua",
"scripts\\ai\\PETS\\PET_FLEA_MISSION.lua",
"scripts\\ai\\ACT\\L_ACT_PET_INSTANCE_EXIT.lua",
}; };
}; };
CppScripts::Script& CppScripts::GetScript(Entity* parent, const std::string& scriptName) { CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::string& scriptName) {
auto itr = g_Scripts.find(scriptName); auto itr = g_Scripts.find(scriptName);
if (itr != g_Scripts.end()) { if (itr != g_Scripts.end()) {
return *itr->second; return itr->second;
} }
const auto itrTernary = scriptLoader.find(scriptName); const auto itrTernary = scriptLoader.find(scriptName);
auto& 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()); LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
} }
g_Scripts[scriptName] = &script; g_Scripts[scriptName] = script;
return script; return script;
} }
CppScripts::Script& CppScripts::GetInvalidScript() { CppScripts::Script* const CppScripts::GetInvalidScript() {
return InvalidToReturn; return &InvalidToReturn;
} }

View File

@@ -355,12 +355,14 @@ namespace CppScripts {
* @param canceled if it was done via the cancel button * @param canceled if it was done via the cancel button
*/ */
virtual void OnRequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {}; virtual void OnRequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {};
virtual void OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) {};
}; };
Script& GetScript(Entity* parent, const std::string& scriptName); Script* const GetScript(Entity* parent, const std::string& scriptName);
// Get the invalid script. Would be a static variable of the namespace, but that would be // Get the invalid script. Would be a static variable of the namespace, but that would be
// more cluttery to use. Also this allows us to control where this invalid script is defined and initialized // more cluttery to use. Also this allows us to control where this invalid script is defined and initialized
// since we dont want anyone externally modifying it. // since we dont want anyone externally modifying it.
Script& GetInvalidScript(); Script* const GetInvalidScript();
}; };

View File

@@ -1,4 +1,5 @@
set(DSCRIPTS_SOURCES_AI_RACING) set(DSCRIPTS_SOURCES_AI_RACING
"RaceImaginationServer.cpp")
add_subdirectory(OBJECTS) add_subdirectory(OBJECTS)
@@ -6,6 +7,12 @@ foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS})
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}") set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}")
endforeach() endforeach()
add_subdirectory(TRACK_NS)
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_TRACK_NS})
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "TRACK_NS/${file}")
endforeach()
add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING}) add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING})
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS") target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS" "TRACK_NS")
target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase) target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase)

View File

@@ -0,0 +1,19 @@
#include "RaceImaginationServer.h"
#include "dZoneManager.h"
void StartSpawner(const std::vector<Spawner*>& spawner) {
for (auto* const entity : spawner) {
entity->Activate();
}
}
void RaceImaginationServer::OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) {
// Spawn imagination pickups
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Min"));
if (info.maxPlayers > 2) {
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Med"));
}
if (info.maxPlayers > 4) {
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Max"));
}
}

View File

@@ -0,0 +1,11 @@
#ifndef RACEIMAGINATIONSERVER_H
#define RACEIMAGINATIONSERVER_H
#include "CppScripts.h"
class RaceImaginationServer : public virtual CppScripts::Script {
public:
void OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) override;
};
#endif //!RACEIMAGINATIONSERVER_H

View File

@@ -0,0 +1,3 @@
set(DSCRIPTS_SOURCES_AI_RACING_TRACK_NS
"NsRaceServer.cpp"
PARENT_SCOPE)

View File

@@ -0,0 +1,54 @@
#include "NsRaceServer.h"
#include "RacingControlComponent.h"
#include "Entity.h"
using std::unique_ptr;
using std::make_unique;
void NsRaceServer::OnStartup(Entity* self) {
GameMessages::ConfigureRacingControl config;
auto& raceSet = config.racingSettings;
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameType", u"Racing"));
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameState", u"Starting"));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_Of_PlayersPerTeam", 6));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_to_Start", 2));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_for_Group_Achievements", 2));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Car_Object", 7703));
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"Race_PathName", u"MainPath"));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Current_Lap", 1));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Laps", 3));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"activityID", 42));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_1", 100));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_2", 90));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_3", 80));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_4", 70));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_5", 60));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_6", 50));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_1", 15));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_2", 25));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_3", 50));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_4", 85));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_5", 90));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_6", 100));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Spawn_Groups", 1));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Spawners", 4847));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Spawners", 4848));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Flag", 4850));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Flag", 4851));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Point", 4846));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Point", 4845));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Mark", 4844));
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Mark", 4843));
std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
for (auto* const racingController : racingControllers) {
auto* racingComponent = racingController->GetComponent<RacingControlComponent>();
if (racingComponent) racingComponent->MsgConfigureRacingControl(config);
}
}

View File

@@ -0,0 +1,12 @@
#ifndef NSRACESERVER_H
#define NSRACESERVER_H
#include "CppScripts.h"
#include "RaceImaginationServer.h"
class NsRaceServer : public RaceImaginationServer {
public:
void OnStartup(Entity* self) override;
};
#endif //!NSRACESERVER_H

View File

@@ -267,41 +267,31 @@ int main(int argc, char** argv) {
// pre calculate the FDB checksum // pre calculate the FDB checksum
if (Game::config->GetValue("check_fdb") == "1") { if (Game::config->GetValue("check_fdb") == "1") {
std::ifstream fileStream; auto cdclient = Game::assetManager->GetFile("cdclient.fdb");
if (cdclient) {
static const std::vector<std::string> aliases = { const int32_t bufferSize = 1024;
"CDServers.fdb", MD5 md5;
"cdserver.fdb",
"CDClient.fdb",
"cdclient.fdb",
};
for (const auto& file : aliases) { char fileStreamBuffer[bufferSize] = {};
fileStream.open(Game::assetManager->GetResPath() / file, std::ios::binary | std::ios::in);
if (fileStream.is_open()) { while (!cdclient.eof()) {
break; memset(fileStreamBuffer, 0, bufferSize);
cdclient.read(fileStreamBuffer, bufferSize);
md5.update(fileStreamBuffer, cdclient.gcount());
} }
const char* nullTerminateBuffer = "\0";
md5.update(nullTerminateBuffer, 1); // null terminate the data
md5.finalize();
databaseChecksum = md5.hexdigest();
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
} }
if (databaseChecksum.empty()) {
const int32_t bufferSize = 1024; LOG("check_fdb is on but no fdb file found.");
MD5 md5; return EXIT_FAILURE;
char fileStreamBuffer[1024] = {};
while (!fileStream.eof()) {
memset(fileStreamBuffer, 0, bufferSize);
fileStream.read(fileStreamBuffer, bufferSize);
md5.update(fileStreamBuffer, fileStream.gcount());
} }
fileStream.close();
const char* nullTerminateBuffer = "\0";
md5.update(nullTerminateBuffer, 1); // null terminate the data
md5.finalize();
databaseChecksum = md5.hexdigest();
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
} }
uint32_t currentFrameDelta = highFrameDelta; uint32_t currentFrameDelta = highFrameDelta;
@@ -548,115 +538,115 @@ void HandlePacketChat(Packet* packet) {
if (packet->data[0] == ID_USER_PACKET_ENUM && packet->length >= 4) { if (packet->data[0] == ID_USER_PACKET_ENUM && packet->length >= 4) {
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::CHAT) { if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::CHAT) {
switch (static_cast<MessageType::Chat>(packet->data[3])) { switch (static_cast<MessageType::Chat>(packet->data[3])) {
case MessageType::Chat::WORLD_ROUTE_PACKET: { case MessageType::Chat::WORLD_ROUTE_PACKET: {
CINSTREAM_SKIP_HEADER; CINSTREAM_SKIP_HEADER;
LWOOBJID playerID; LWOOBJID playerID;
inStream.Read(playerID); inStream.Read(playerID);
auto player = Game::entityManager->GetEntity(playerID); auto player = Game::entityManager->GetEntity(playerID);
if (!player) return; if (!player) return;
auto sysAddr = player->GetSystemAddress(); auto sysAddr = player->GetSystemAddress();
//Write our stream outwards: //Write our stream outwards:
CBITSTREAM; CBITSTREAM;
unsigned char data; unsigned char data;
while (inStream.Read(data)) { while (inStream.Read(data)) {
bitStream.Write(data); bitStream.Write(data);
}
SEND_PACKET; //send routed packet to player
break;
} }
case MessageType::Chat::GM_ANNOUNCE: { SEND_PACKET; //send routed packet to player
CINSTREAM_SKIP_HEADER; break;
}
std::string title; case MessageType::Chat::GM_ANNOUNCE: {
std::string msg; CINSTREAM_SKIP_HEADER;
uint32_t len; std::string title;
inStream.Read<uint32_t>(len); std::string msg;
for (uint32_t i = 0; len > i; i++) {
char character;
inStream.Read<char>(character);
title += character;
}
len = 0; uint32_t len;
inStream.Read<uint32_t>(len); inStream.Read<uint32_t>(len);
for (uint32_t i = 0; len > i; i++) { for (uint32_t i = 0; len > i; i++) {
char character; char character;
inStream.Read<char>(character); inStream.Read<char>(character);
msg += character; title += character;
} }
//Send to our clients: len = 0;
AMFArrayValue args; inStream.Read<uint32_t>(len);
for (uint32_t i = 0; len > i; i++) {
char character;
inStream.Read<char>(character);
msg += character;
}
args.Insert("title", title); //Send to our clients:
args.Insert("message", msg); AMFArrayValue args;
GameMessages::SendUIMessageServerToAllClients("ToggleAnnounce", args); args.Insert("title", title);
args.Insert("message", msg);
GameMessages::SendUIMessageServerToAllClients("ToggleAnnounce", args);
break;
}
case MessageType::Chat::GM_MUTE: {
CINSTREAM_SKIP_HEADER;
LWOOBJID playerId;
time_t expire = 0;
inStream.Read(playerId);
inStream.Read(expire);
auto* entity = Game::entityManager->GetEntity(playerId);
auto* character = entity != nullptr ? entity->GetCharacter() : nullptr;
auto* user = character != nullptr ? character->GetParentUser() : nullptr;
if (user) {
user->SetMuteExpire(expire);
entity->GetCharacter()->SendMuteNotice();
}
break;
}
case MessageType::Chat::TEAM_GET_STATUS: {
CINSTREAM_SKIP_HEADER;
LWOOBJID teamID = 0;
char lootOption = 0;
char memberCount = 0;
std::vector<LWOOBJID> members;
inStream.Read(teamID);
bool deleteTeam = inStream.ReadBit();
if (deleteTeam) {
TeamManager::Instance()->DeleteTeam(teamID);
LOG("Deleting team (%llu)", teamID);
break; break;
} }
case MessageType::Chat::GM_MUTE: { inStream.Read(lootOption);
CINSTREAM_SKIP_HEADER; inStream.Read(memberCount);
LWOOBJID playerId; LOG("Updating team (%llu), (%i), (%i)", teamID, lootOption, memberCount);
time_t expire = 0; for (char i = 0; i < memberCount; i++) {
inStream.Read(playerId); LWOOBJID member = LWOOBJID_EMPTY;
inStream.Read(expire); inStream.Read(member);
members.push_back(member);
auto* entity = Game::entityManager->GetEntity(playerId); LOG("Updating team member (%llu)", member);
auto* character = entity != nullptr ? entity->GetCharacter() : nullptr;
auto* user = character != nullptr ? character->GetParentUser() : nullptr;
if (user) {
user->SetMuteExpire(expire);
entity->GetCharacter()->SendMuteNotice();
}
break;
} }
case MessageType::Chat::TEAM_GET_STATUS: { TeamManager::Instance()->UpdateTeam(teamID, lootOption, members);
CINSTREAM_SKIP_HEADER;
LWOOBJID teamID = 0; break;
char lootOption = 0; }
char memberCount = 0; default:
std::vector<LWOOBJID> members; LOG("Received an unknown chat: %i", int(packet->data[3]));
inStream.Read(teamID);
bool deleteTeam = inStream.ReadBit();
if (deleteTeam) {
TeamManager::Instance()->DeleteTeam(teamID);
LOG("Deleting team (%llu)", teamID);
break;
}
inStream.Read(lootOption);
inStream.Read(memberCount);
LOG("Updating team (%llu), (%i), (%i)", teamID, lootOption, memberCount);
for (char i = 0; i < memberCount; i++) {
LWOOBJID member = LWOOBJID_EMPTY;
inStream.Read(member);
members.push_back(member);
LOG("Updating team member (%llu)", member);
}
TeamManager::Instance()->UpdateTeam(teamID, lootOption, members);
break;
}
default:
LOG("Received an unknown chat: %i", int(packet->data[3]));
} }
} }
} }

View File

@@ -28,7 +28,8 @@ client_location=
# The maximum outgoing bandwidth in bits. If your clients are having # The maximum outgoing bandwidth in bits. If your clients are having
# issues with enemies taking a while to catch up to them, increse this value. # issues with enemies taking a while to catch up to them, increse this value.
maximum_outgoing_bandwidth=80000 # Empty or 0 means no limit
maximum_outgoing_bandwidth=0
# The Maximum Translation Unit (MTU) size for packets. If players are # The Maximum Translation Unit (MTU) size for packets. If players are
# getting stuck at 55% on the loading screen, lower this number to # getting stuck at 55% on the loading screen, lower this number to