dGame Precompiled header improvements (#876)

* moving branch

* Add deleteinven slash command

* Change name of BRICKS_IN_BBB

* Use string_view instead of strcmp

* Clean up include tree

* Remove unneeded headers from PCH files

Removes unneeded headers from pre-compiled headers.  This increases compile time, however reduces development time for most files.

* Update Entity.h

* Update EntityManager.h

* Update GameMessages.cpp

* There it compiles now

Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
This commit is contained in:
David Markowitz
2023-01-06 21:17:05 -08:00
committed by GitHub
parent 8bcb4bd36d
commit fc75d6048f
99 changed files with 821 additions and 648 deletions

View File

@@ -5,6 +5,8 @@
#include "GameMessages.h"
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "eAninmationFlags.h"
void AmDarklingDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);

View File

@@ -3,6 +3,8 @@
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
#include "DestroyableComponent.h"
#include "eAninmationFlags.h"
#include "EntityInfo.h"
void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);

View File

@@ -3,7 +3,9 @@
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "SkillComponent.h"
#include "eAninmationFlags.h"
void BaseEnemyApe::OnStartup(Entity* self) {
self->SetVar<uint32_t>(u"timesStunned", 2);

View File

@@ -3,6 +3,7 @@
#include "ControllablePhysicsComponent.h"
#include "EntityManager.h"
#include "dpWorld.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
#include "DestroyableComponent.h"

View File

@@ -2,6 +2,7 @@
#include "ScriptedActivityComponent.h"
#include "TeamManager.h"
#include "EntityManager.h"
#include "Loot.h"
void TreasureChestDragonServer::OnStartup(Entity* self) {

View File

@@ -3,6 +3,7 @@
#include "RenderComponent.h"
#include "MissionComponent.h"
#include "MissionTaskType.h"
#include "Loot.h"
void BootyDigServer::OnStartup(Entity* self) {
auto* zoneControlObject = EntityManager::Instance()->GetZoneControlEntity();

View File

@@ -1,4 +1,5 @@
#include "NpcPirateServer.h"
#include "MissionState.h"
#include "InventoryComponent.h"
void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "Entity.h"
#include "GameMessages.h"
#include "MissionState.h"
void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
if (missionID != 1849 && missionID != 1883)

View File

@@ -1,6 +1,7 @@
#include "RemoveRentalGear.h"
#include "InventoryComponent.h"
#include "Item.h"
#include "MissionState.h"
#include "Character.h"
/*

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "ZoneAgProperty.h"
#include "DestroyableComponent.h"
#include "EntityInfo.h"
void ZoneAgSpiderQueen::SetGameVariables(Entity* self) {
ZoneAgProperty::SetGameVariables(self);

View File

@@ -1,6 +1,7 @@
#include "AmBlueX.h"
#include "SkillComponent.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "Character.h"
void AmBlueX::OnUse(Entity* self, Entity* user) {

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "MovementAIComponent.h"
#include "BaseCombatAIComponent.h"
#include "SkillComponent.h"

View File

@@ -5,6 +5,7 @@
#include "MovementAIComponent.h"
#include "BaseCombatAIComponent.h"
#include "SkillComponent.h"
#include "EntityInfo.h"
#include "RebuildComponent.h"
#include "MissionComponent.h"

View File

@@ -4,6 +4,7 @@
#include "DestroyableComponent.h"
#include "ProximityMonitorComponent.h"
#include "MissionComponent.h"
#include "EntityInfo.h"
void AmSkullkinDrill::OnStartup(Entity* self) {
self->SetNetworkVar(u"bIsInUse", false);

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "MovingPlatformComponent.h"
#include "EntityInfo.h"
#include "GameMessages.h"
#include "MissionComponent.h"

View File

@@ -1,6 +1,7 @@
#include "EnemyRoninSpawner.h"
#include "SkillComponent.h"
#include "RenderComponent.h"
#include "EntityInfo.h"
#include "EntityManager.h"
void EnemyRoninSpawner::OnStartup(Entity* self) {

View File

@@ -1,5 +1,7 @@
#include "BankInteractServer.h"
#include "GameMessages.h"
#include "Entity.h"
#include "AMFFormat.h"
void BankInteractServer::OnUse(Entity* self, Entity* user) {
AMFArrayValue args;

View File

@@ -1,5 +1,6 @@
#include "GrowingFlower.h"
#include "MissionComponent.h"
#include "Loot.h"
void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::string& message) {
if (!self->GetVar<bool>(u"blooming") && (message == "waterspray" || message == "shovelgrow")) {

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "Character.h"
#include "PetComponent.h"
#include "User.h"
std::vector<LWOOBJID> PetDigServer::treasures{};

View File

@@ -1,6 +1,7 @@
#include "PropertyPlatform.h"
#include "RebuildComponent.h"
#include "GameMessages.h"
#include "MovingPlatformComponent.h"
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
@@ -9,7 +10,7 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
// movingPlatform->SetNoAutoStart(true);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, MovementPlatformState::Stationary);
0, 0, eMovementPlatformState::Stationary);
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
@@ -20,7 +21,7 @@ void PropertyPlatform::OnUse(Entity* self, Entity* user) {
// movingPlatform->GotoWaypoint(1);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
self->AddCallbackTimer(movementDelay + effectDelay, [self, this]() {
self->SetNetworkVar<float_t>(u"startEffect", dieDelay);

View File

@@ -1,5 +1,6 @@
#include "QbSpawner.h"
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "MovementAIComponent.h"
void QbSpawner::OnStartup(Entity* self) {
@@ -133,4 +134,3 @@ void QbSpawner::AggroTargetObject(Entity* self, Entity* enemy) {
}
}

View File

@@ -1,6 +1,8 @@
#include "WishingWellServer.h"
#include "ScriptedActivityComponent.h"
#include "GameMessages.h"
#include "Loot.h"
#include "EntityManager.h"
void WishingWellServer::OnStartup(Entity* self) {
}

View File

@@ -1,4 +1,5 @@
#include "NsConcertChoiceBuildManager.h"
#include "EntityInfo.h"
#include "EntityManager.h"
const std::vector<Crate> NsConcertChoiceBuildManager::crates{

View File

@@ -2,6 +2,7 @@
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
class NsLegoClubDoor : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{

View File

@@ -2,6 +2,7 @@
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
class NsLupTeleport : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{

View File

@@ -1,6 +1,7 @@
#include "NtCombatChallengeServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"

View File

@@ -1,5 +1,6 @@
#include "NtVandaServer.h"
#include "InventoryComponent.h"
#include "MissionState.h"
void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {

View File

@@ -1,6 +1,7 @@
#include "EnemySpiderSpawner.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
//----------------------------------------------

View File

@@ -1,6 +1,7 @@
#include "PropertyBankInteract.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "AMFFormat.h"
void PropertyBankInteract::OnStartup(Entity* self) {
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();

View File

@@ -2,6 +2,8 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "MissionState.h"
#include "Entity.h"
void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* character = target->GetCharacter();

View File

@@ -2,6 +2,7 @@
#include "InventoryComponent.h"
#include "Character.h"
#include "GameMessages.h"
#include "Loot.h"
void VeMissionConsole::OnUse(Entity* self, Entity* user) {
LootGenerator::Instance().DropActivityLoot(user, self, 12551);

View File

@@ -2,6 +2,7 @@
#include "SkillComponent.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "EntityInfo.h"
void EnemySkeletonSpawner::OnStartup(Entity* self) {
self->SetProximityRadius(15, "ronin");

View File

@@ -1,5 +1,8 @@
#include "NjDragonEmblemChestServer.h"
#include "Character.h"
#include "EntityInfo.h"
#include "Loot.h"
#include "Entity.h"
#include "DestroyableComponent.h"
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {

View File

@@ -1,6 +1,7 @@
#include "NjNPCMissionSpinjitzuServer.h"
#include "Character.h"
#include "EntityManager.h"
#include "MissionState.h"
void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
MissionState missionState) {

View File

@@ -1,6 +1,7 @@
#include "RainOfArrows.h"
#include "EntityManager.h"
#include "SkillComponent.h"
#include "EntityInfo.h"
#include "GameMessages.h"
void RainOfArrows::OnStartup(Entity* self) {

View File

@@ -3,6 +3,7 @@
#include "TeamManager.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Loot.h"
void MinigameTreasureChestServer::OnUse(Entity* self, Entity* user) {
auto* sac = self->GetComponent<ScriptedActivityComponent>();

View File

@@ -1,5 +1,6 @@
#include "StinkyFishTarget.h"
#include "EntityManager.h"
#include "EntityInfo.h"
void StinkyFishTarget::OnStartup(Entity* self) {
auto position = self->GetPosition();

View File

@@ -5,6 +5,7 @@
#include "GameMessages.h"
#include <algorithm>
#include "dLogger.h"
#include "Loot.h"
bool ActivityManager::IsPlayerInActivity(Entity* self, LWOOBJID playerID) {
const auto* sac = self->GetComponent<ScriptedActivityComponent>();

View File

@@ -1,12 +1,13 @@
#pragma once
#include "dCommonVars.h"
#include "MissionState.h"
#include <cstdint>
#include <string>
#include <vector>
class User;
class Entity;
class NiPoint3;
enum class MissionState : int32_t;
namespace CppScripts {
/**

View File

@@ -1,5 +1,6 @@
#include "NPCAddRemoveItem.h"
#include "InventoryComponent.h"
#include "MissionState.h"
void NPCAddRemoveItem::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* inventory = target->GetComponent<InventoryComponent>();

View File

@@ -1,6 +1,7 @@
#include "ScriptedPowerupSpawner.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "Loot.h"
void ScriptedPowerupSpawner::OnTemplateStartup(Entity* self) {
self->SetVar<uint32_t>(u"currentCycle", 1);

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "PetComponent.h"
#include "EntityInfo.h"
void SpawnPetBaseServer::OnStartup(Entity* self) {
SetVariables(self);

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "GeneralUtils.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
void AgImagSmashable::OnDie(Entity* self, Entity* killer) {

View File

@@ -1,5 +1,7 @@
#include "AgPicnicBlanket.h"
#include "Loot.h"
#include "GameMessages.h"
#include "Entity.h"
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());

View File

@@ -15,7 +15,7 @@ void AgQbElevator::OnRebuildComplete(Entity* self, Entity* target) {
if (delayTime < 1) delayTime = 1;
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, MovementPlatformState::Stationary);
0, 0, eMovementPlatformState::Stationary);
//add a timer that will kill the QB if no players get on in the killTime
self->AddTimer("startKillTimer", killTime);
@@ -33,7 +33,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
self->CancelTimer("StartElevator");
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
} else if (!self->GetBoolean(u"StartTimer")) {
self->SetBoolean(u"StartTimer", true);
self->AddTimer("StartElevator", startTime);
@@ -45,7 +45,7 @@ void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "StartElevator") {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
} else if (timerName == "startKillTimer") {
killTimerStartup(self);
} else if (timerName == "KillTimer") {

View File

@@ -1,4 +1,5 @@
#include "AgSpaceStuff.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
#include "GameMessages.h"
#include "EntityManager.h"

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "ScriptedActivityComponent.h"
void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {

View File

@@ -2,6 +2,7 @@
#include "Entity.h"
#include "DestroyableComponent.h"
#include "EntityInfo.h"
#include "EntityManager.h"
void GfBanana::SpawnBanana(Entity* self) {

View File

@@ -1,5 +1,6 @@
#include "PetDigBuild.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "MissionComponent.h"
void PetDigBuild::OnRebuildComplete(Entity* self, Entity* target) {

View File

@@ -1,5 +1,7 @@
#include "PirateRep.h"
#include "Character.h"
#include "MissionState.h"
#include "Entity.h"
void PirateRep::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
if (missionID == m_PirateRepMissionID && missionState >= MissionState::MISSION_STATE_READY_TO_COMPLETE) {

View File

@@ -11,6 +11,7 @@
#include "MovementAIComponent.h"
#include "../dWorldServer/ObjectIDManager.h"
#include "MissionComponent.h"
#include "Loot.h"
#include "InventoryComponent.h"
void SGCannon::OnStartup(Entity* self) {

View File

@@ -1,5 +1,6 @@
#include "RockHydrantSmashable.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
void RockHydrantSmashable::OnDie(Entity* self, Entity* killer) {

View File

@@ -1,5 +1,6 @@
#include "HydrantSmashable.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
void HydrantSmashable::OnDie(Entity* self, Entity* killer) {

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "MissionState.h"
void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* character = target->GetCharacter();