mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-26 07:27:18 +00:00
First volume of optimizations
This commit is contained in:
parent
d79d8d4991
commit
cb746f2a96
@ -11,6 +11,8 @@
|
||||
#include "dConfig.h"
|
||||
#include "dServer.h"
|
||||
#include "tinyxml2.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
@ -2,18 +2,12 @@
|
||||
|
||||
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state)
|
||||
{
|
||||
Game::logger->Log("ActNinjaTurret", "Rebuild state: %i\n", state);
|
||||
|
||||
if (state == eRebuildState::REBUILD_COMPLETED)
|
||||
{
|
||||
Game::logger->Log("ActNinjaTurret", "I am build\n");
|
||||
|
||||
self->SetVar(u"AmBuilt", true);
|
||||
}
|
||||
else if (state == eRebuildState::REBUILD_RESETTING)
|
||||
{
|
||||
Game::logger->Log("ActNinjaTurret", "I am not build\n");
|
||||
|
||||
self->SetVar(u"AmBuilt", false);
|
||||
}
|
||||
}
|
||||
@ -22,8 +16,6 @@ void
|
||||
ActNinjaTurret::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3)
|
||||
{
|
||||
Game::logger->Log("ActNinjaTurret", "Got server side event %s\n", args.c_str());
|
||||
|
||||
if (args == "ISpawned" && self->GetVar<bool>(u"AmBuilt"))
|
||||
{
|
||||
sender->Smash();
|
||||
|
@ -1,25 +1,16 @@
|
||||
#include "ActSharkPlayerDeathTrigger.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void ActSharkPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
|
||||
}
|
||||
|
||||
void ActSharkPlayerDeathTrigger::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1,
|
||||
int32_t param2, int32_t param3) {
|
||||
if (args == "achieve") {
|
||||
MissionComponent* mis = static_cast<MissionComponent*>(sender->GetComponent(COMPONENT_TYPE_MISSION));
|
||||
if (!mis) return;
|
||||
auto missionComponent = sender->GetComponent<MissionComponent>();
|
||||
if (!missionComponent) return;
|
||||
|
||||
mis->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, 8419);
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, 8419);
|
||||
|
||||
if (sender->GetIsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
|
||||
|
||||
Game::logger->Log("ActSharkPlayerDeathTrigger", "%i\n", self->GetLOT());
|
||||
|
||||
if (sender->GetCharacter()) {
|
||||
sender->Smash(self->GetObjectID(), eKillType::VIOLENT, u"big-shark-death");
|
||||
}
|
||||
|
@ -4,8 +4,7 @@
|
||||
class ActSharkPlayerDeathTrigger : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnCollisionPhantom(Entity* self, Entity* target);
|
||||
void OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3);
|
||||
int32_t param3) override;
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "LeaderboardManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include <algorithm>
|
||||
#include "dLogger.h"
|
||||
|
||||
bool ActivityManager::IsPlayerInActivity(Entity *self, LWOOBJID playerID) {
|
||||
const auto* sac = self->GetComponent<ScriptedActivityComponent>();
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "AgBugsprayer.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
|
||||
void AgBugsprayer::OnRebuildComplete(Entity* self, Entity* target)
|
||||
{
|
||||
self->AddTimer("castSkill", 1);
|
||||
|
@ -1,8 +1,6 @@
|
||||
#include "AgBusDoor.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
#include "ProximityMonitorComponent.h"
|
||||
|
||||
void AgBusDoor::OnStartup(Entity* self) {
|
||||
|
@ -12,7 +12,11 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
//Set the flag & mission status:
|
||||
user->GetCharacter()->SetPlayerFlag(74, true);
|
||||
auto character = user->GetCharacter();
|
||||
|
||||
if (!character) return;
|
||||
|
||||
character->SetPlayerFlag(74, true);
|
||||
|
||||
//Remove the maelstrom cube:
|
||||
auto inv = static_cast<InventoryComponent*>(user->GetComponent(COMPONENT_TYPE_INVENTORY));
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "AgFans.h"
|
||||
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void AgFans::OnStartup(Entity* self) {
|
||||
|
@ -1,8 +1,5 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
|
||||
class AgFans : public CppScripts::Script
|
||||
{
|
||||
|
@ -4,7 +4,6 @@
|
||||
class AgImagSmashable : public CppScripts::Script {
|
||||
public:
|
||||
void OnDie(Entity* self, Entity* killer);
|
||||
|
||||
private:
|
||||
void CrateAnimal(Entity* self);
|
||||
};
|
@ -1,15 +1,8 @@
|
||||
#include "AgJetEffectServer.h"
|
||||
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
|
||||
void AgJetEffectServer::OnStartup(Entity* self)
|
||||
{
|
||||
}
|
||||
|
||||
void AgJetEffectServer::OnUse(Entity* self, Entity* user)
|
||||
{
|
||||
if (inUse)
|
||||
@ -41,7 +34,6 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user)
|
||||
GameMessages::SendPlayFXEffect(effect, 641, u"create", "radarDish", LWOOBJID_EMPTY, 1, 1, true);
|
||||
|
||||
self->AddTimer("radarDish", 2);
|
||||
//self->AddTimer("PlayEffect", 2.5f);
|
||||
self->AddTimer("CineDone", 9);
|
||||
}
|
||||
|
||||
|
@ -4,16 +4,12 @@
|
||||
class AgJetEffectServer final : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
|
||||
private:
|
||||
LWOOBJID builder;
|
||||
|
||||
bool inUse;
|
||||
};
|
||||
|
@ -1,5 +1,9 @@
|
||||
#include "AgLaserSensorServer.h"
|
||||
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "AgMonumentLaserServer.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void AgLaserSensorServer::OnStartup(Entity* self) {
|
||||
|
@ -1,9 +1,7 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "AgMonumentLaserServer.h"
|
||||
|
||||
class SkillComponent;
|
||||
|
||||
class AgLaserSensorServer : public CppScripts::Script {
|
||||
public:
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "MovingPlatformComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ProximityMonitorComponent.h"
|
||||
#include "dLogger.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
void AmSkullkinDrill::OnStartup(Entity* self)
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "dZoneManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "Spawner.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void BaseRandomServer::BaseStartup(Entity* self)
|
||||
{
|
||||
|
@ -1,11 +1,8 @@
|
||||
#pragma once
|
||||
#include "dCommonVars.h"
|
||||
#include "RakNetTypes.h"
|
||||
#include <string>
|
||||
#include "MissionComponent.h"
|
||||
#include "MissionState.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
#include "Loot.h"
|
||||
|
||||
class User;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "ForceVolumeServer.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
|
||||
void ForceVolumeServer::OnStartup(Entity* self)
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "GeneralUtils.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
|
||||
void FvFacilityBrick::OnStartup(Entity* self)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "FvHorsemenTrigger.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void FvHorsemenTrigger::OnStartup(Entity* self)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "FvMaelstromCavalry.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void FvMaelstromCavalry::OnStartup(Entity* self)
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "dLogger.h"
|
||||
#include "InventoryComponent.h"
|
||||
|
||||
int32_t ImgBrickConsoleQB::ResetBricks = 30;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Player.h"
|
||||
#include "Character.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
#include "dServer.h"
|
||||
|
||||
void InstanceExitTransferPlayerToLastNonInstance::OnUse(Entity* self, Entity* user)
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
#include "dLogger.h"
|
||||
|
||||
void NtCombatChallengeServer::OnUse(Entity* self, Entity* user)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "NtSentinelWalkwayServer.h"
|
||||
#include "PhantomPhysicsComponent.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
#include "dLogger.h"
|
||||
|
||||
void NtSentinelWalkwayServer::OnStartup(Entity* self)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "TriggerAmbush.h"
|
||||
|
||||
#include "dZoneManager.h"
|
||||
#include "dLogger.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void TriggerAmbush::OnStartup(Entity* self)
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "ZoneAgMedProperty.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void ZoneAgMedProperty::SetGameVariables(Entity *self) {
|
||||
Game::logger->Log("Properties", "Setting variables in instance\n");
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "dZoneManager.h"
|
||||
#include "LDFFormat.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void ZoneAgProperty::SetGameVariables(Entity *self) {
|
||||
self->SetVar<std::string>(GuardGroup, "Guard");
|
||||
|
Loading…
Reference in New Issue
Block a user