2021-12-05 17:54:36 +00:00
|
|
|
#include "ZoneSGServer.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
void ZoneSGServer::OnStartup(Entity* self) {
|
2023-07-15 20:56:33 +00:00
|
|
|
const auto cannons = Game::entityManager->GetEntitiesByLOT(1864);
|
2021-12-05 17:54:36 +00:00
|
|
|
for (const auto& cannon : cannons)
|
|
|
|
self->SetVar<LWOOBJID>(CannonIDVariable, cannon->GetObjectID());
|
|
|
|
}
|
|
|
|
|
|
|
|
void ZoneSGServer::OnActivityStateChangeRequest(Entity* self, const LWOOBJID senderID, const int32_t value1,
|
|
|
|
const int32_t value2, const std::u16string& stringValue) {
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
auto* cannon = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
2021-12-05 17:54:36 +00:00
|
|
|
if (cannon != nullptr) {
|
|
|
|
cannon->OnActivityStateChangeRequest(senderID, value1, value2, stringValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ZoneSGServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
|
|
|
int32_t param3) {
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
auto* cannon = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
2021-12-05 17:54:36 +00:00
|
|
|
if (cannon != nullptr) {
|
|
|
|
cannon->OnFireEventServerSide(sender, args, param1, param2, param3);
|
|
|
|
}
|
|
|
|
}
|