refactor: remaining game messages as structs, switch removed

Every game message still written or read by hand is now a NetGameMsg with
Serialize and Deserialize, in per-domain files:
- MovementMessages: teleport, platforms (resync and its request), orient to
  angle, node rotation lock, gravity scale, jetpack mode, control scheme,
  respawn checkpoint, rails (set/start, ready, cancel, arrived), mount
  inventory ID, dismount complete, possession ack, ghost reference override
  and position, camera cycling (eCameraTargetCyclingMode moves here).
- ZoneMessages: player loaded (the old PLAYER_LOADED case), ready for
  updates, player ready, restore to post load stats, server done loading,
  invalid zone transfer list, zone summary display/dismissed, level
  processing complete, object world state, and the localized announcement
  WorldMigration wrote by hand.
- PlayerMessages: chat mode, GM level, LEGO score, currency, reputation,
  GM invis, pickup currency, zone and player statistics, chat commands, bug
  reports, verify ack.
- ObjectMessages: fire event client/server side, notify client
  (zone) object, notify object, script network vars, failed preconditions,
  terminate interaction, set name, request use, request server object info.
- QuickBuildMessages: notify state, enable, cancel.
- ActivityMessages gains match response/update/request, leaderboard request
  and data, shooting gallery score/rotation/fire, activity state change.
- MissionMessages gains MissionDialogueCancelled (a no-op, as before).
The wire structs left in GameMessages.h move to their domains (tooltip and
emote to Effects, loot and item use to Inventory, model build to Building,
behavior sound to Property, skill sets to Skill) and gain the missing
direction. The dismount logic moves to PossessorComponent::OnDismountComplete.

Every inbound message is registered in the GameMessageHandler map; the
switch is gone, and GameMessages.cpp only holds the GameMsg/NetGameMsg base
code. Call sites build the structs (NotifyClientObject, TerminateInteraction,
Teleport, PlatformResync, FireEventClientSide, NotifyObject and
NotifyClientZoneObject get convenience constructors like PlayFXEffect).
Dead senders are dropped: SendSetShootingGalleryParams (no callers, field
order was a guess), SendTeamPickupItem (the struct already existed),
SendRequestActivitySummaryLeaderboardData (the struct covers it).

Verified with RemainingMessagesTests: every old Send* function is frozen
verbatim in Legacy/RemainingMessagesLegacy.h and compared byte for byte
(same bits, destination and broadcast flag) over grids of inputs; every old
Handle* read sequence is frozen as a Read* oracle and compared with the
struct's Deserialize; round trips, truncation and a golden packet.
PlayerLoaded (0x00dc36f0), SetGMLevel (0x00dd6230), MissionDialogueCancelled
(0x00d9cc10) and LocalizedAnnouncementServerToSingleClient (0x00f23c50)
were checked against the client. Behaviour notes: an inbound message that
fails to deserialize is dropped, so ParseChatMessage over MAX_MESSAGE_LENGTH
is dropped instead of truncated, and PLAYER_LOADED / READY_FOR_UPDATES /
MISSION_DIALOGUE_CANCELLED now read their (unused) client fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 00:49:30 -05:00
parent caebff4dca
commit b2a1e9e0b8
143 changed files with 5376 additions and 2698 deletions

View File

@@ -13,6 +13,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
@@ -88,7 +89,7 @@ void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
// There is suppose to be a 0.1 second delay here but that may be admitted?
auto* controller = Game::entityManager->GetZoneControlEntity();
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetPosition({ 10000, 0, 10000 });
@@ -108,7 +109,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
if (withdraw) {
//Move spider away from battle zone
// Disabled because we cant option the reset collition group right now
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
//First rotate for anim
NiQuaternion rot = QuatUtils::IDENTITY;
@@ -536,7 +537,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "AdvanceComplete") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 11, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"SetColGroup", 11, 0, 0, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
//Wind up, telegraphing next round
float animTime = PlayAnimAndReturnTime(self, spiderJeerAnim);

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
@@ -145,7 +146,7 @@ void AmDarklingDragon::OnTimerDone(Entity* self, std::string timerName) {
idleFlags.flagsOff = eAnimationFlags::IDLE_NONE;
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar<int32_t>(u"weakspot", -1);
GameMessages::SendNotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}

View File

@@ -7,6 +7,7 @@
#include "EntityInfo.h"
#include "RenderComponent.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -164,7 +165,7 @@ void FvMaelstromDragon::OnTimerDone(Entity* self, std::string timerName) {
idleFlags.Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar<int32_t>(u"weakspot", -1);
GameMessages::SendNotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(self->GetObjectID(), self->GetObjectID(), u"DragonRevive").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}

View File

@@ -1,6 +1,7 @@
#include "AgCagedBricksServer.h"
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Character.h"
#include "EntityManager.h"
#include "eReplicaComponentType.h"
@@ -10,7 +11,7 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
//Tell the client to spawn the baby spiderling:
auto spooders = Game::entityManager->GetEntitiesInGroup("cagedSpider");
for (auto spodder : spooders) {
GameMessages::SendFireEventClientSide(spodder->GetObjectID(), user->GetSystemAddress(), u"toggle", LWOOBJID_EMPTY, 0, 0, user->GetObjectID());
GameMessages::FireEventClientSide(spodder->GetObjectID(), u"toggle", LWOOBJID_EMPTY, user->GetObjectID()).SendToClient(user->GetSystemAddress());
}
//Set the flag & mission status:

View File

@@ -3,6 +3,7 @@
#include "ScriptedActivityComponent.h"
#include "GameMessages.h"
#include "ActivityMessages.h"
#include "ObjectMessages.h"
#include "LeaderboardManager.h"
#include "dServer.h"
#include "eMissionTaskType.h"
@@ -21,9 +22,9 @@ void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
const auto& userSysAddr = user->GetSystemAddress();
if (scriptedActivityComponent->PlayerHasActivityData(userId)) {
GameMessages::SendNotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
GameMessages::NotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "").Send(userSysAddr);
} else {
GameMessages::SendNotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
GameMessages::NotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "").Send(userSysAddr);
}
}
@@ -36,14 +37,14 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
const auto& senderSysAddr = sender->GetSystemAddress();
if (identifier == u"player_dialog_cancel_course" && button == 1) {
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::SendNotifyClientObject(selfId, u"cancel_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"cancel_timer", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
Game::entityManager->SerializeEntity(self);
} else if (identifier == u"player_dialog_start_course" && button == 1) {
GameMessages::SendNotifyClientObject(selfId, u"start_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"start_timer", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
GameMessages::ActivityStart activityStart;
activityStart.target = selfId;
activityStart.Send(senderSysAddr);
@@ -57,12 +58,12 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
Game::entityManager->SerializeEntity(self);
} else if (identifier == u"FootRaceCancel") {
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
if (scriptedActivityComponent->PlayerHasActivityData(senderId)) {
GameMessages::SendNotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
} else {
GameMessages::SendNotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
}
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
@@ -80,8 +81,7 @@ void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std
if (!scriptedActivityComponent->PlayerHasActivityData(senderId)) return;
if (args == "course_cancel") {
GameMessages::SendNotifyClientObject(selfId, u"cancel_timer", 0, 0,
LWOOBJID_EMPTY, "", senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"cancel_timer", 0, 0, LWOOBJID_EMPTY, "").Send(senderSysAddr);
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
} else if (args == "course_finish") {
const auto raceEndTime = Game::server->GetUptime();
@@ -102,11 +102,8 @@ void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std
Game::entityManager->SerializeEntity(self);
LeaderboardManager::SaveScore(senderId, scriptedActivityComponent->GetActivityID(), raceTimeElapsed);
GameMessages::SendNotifyClientObject(selfId, u"ToggleLeaderBoard",
scriptedActivityComponent->GetActivityID(), 0, senderId,
"", senderSysAddr);
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 1, raceTimeElapsed, LWOOBJID_EMPTY, "",
senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"ToggleLeaderBoard", scriptedActivityComponent->GetActivityID(), 0, senderId, "").Send(senderSysAddr);
GameMessages::NotifyClientObject(selfId, u"stop_timer", 1, raceTimeElapsed, LWOOBJID_EMPTY, "").Send(senderSysAddr);
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
}

View File

@@ -2,6 +2,7 @@
#include "eMissionState.h"
#include "InventoryComponent.h"
#include "dZoneManager.h"
#include "ObjectMessages.h"
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != 1880) {
@@ -34,7 +35,6 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
auto spawners = Game::zoneManager->GetSpawnersByName("PlungerGunTargets");
for (auto* spawner : spawners) {
for (const auto entity : spawner->GetSpawnedObjectIDs())
GameMessages::SendNotifyClientObject(entity, u"SetVisibility", visible, 0,
target->GetObjectID(), "", target->GetSystemAddress());
GameMessages::NotifyClientObject(entity, u"SetVisibility", visible, 0, target->GetObjectID(), "").Send(target->GetSystemAddress());
}
}

View File

@@ -1,5 +1,6 @@
#include "NpcNjAssistantServer.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
#include "Item.h"
@@ -10,7 +11,7 @@ void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int
if (missionID != mailMission) return;
if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "").Send(target->GetSystemAddress());
auto* inv = static_cast<InventoryComponent*>(target->GetComponent(eReplicaComponentType::INVENTORY));

View File

@@ -3,6 +3,7 @@
#include "dZoneManager.h"
#include "Entity.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "eMissionState.h"
#include "Spawner.h"
@@ -39,8 +40,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
auto spawners = Game::zoneManager->GetSpawnersByName(group);
for (const auto* spawner : spawners) {
for (const auto objId : spawner->GetSpawnedObjectIDs())
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible, 0,
target->GetObjectID(), "", target->GetSystemAddress());
GameMessages::NotifyClientObject(objId, u"SetVisibility", visible, 0, target->GetObjectID(), "").Send(target->GetSystemAddress());
}
}
}

View File

@@ -1,5 +1,6 @@
#include "ZoneAgSpiderQueen.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "ZoneAgProperty.h"
#include "DestroyableComponent.h"
@@ -36,16 +37,14 @@ void ZoneAgSpiderQueen::BasePlayerLoaded(Entity* self, Entity* player) {
}
self->SetNetworkVar(u"unclaimed", true);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY,
"", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY, "").Send(player->GetSystemAddress());
}
void
ZoneAgSpiderQueen::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
int32_t param3) {
if (args == "ClearProperty") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0,
LWOOBJID_EMPTY, destroyedCinematic, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, destroyedCinematic).Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer("tornadoOff", 0.5f);
} else {
ZoneAgProperty::BaseOnFireEventServerSide(self, sender, args);

View File

@@ -1,6 +1,7 @@
#include "AmDrawBridge.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "SimplePhysicsComponent.h"
#include "eTerminateType.h"
@@ -26,7 +27,7 @@ void AmDrawBridge::OnUse(Entity* self, Entity* user) {
auto* player = user;
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {

View File

@@ -1,6 +1,7 @@
#include "AmTeapotServer.h"
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Item.h"
#include "eTerminateType.h"
@@ -14,5 +15,5 @@ void AmTeapotServer::OnUse(Entity* self, Entity* user) {
inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1);
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "InventoryComponent.h"
@@ -89,7 +90,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
self->SetNetworkVar(u"used", true);
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}

View File

@@ -2,6 +2,8 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
@@ -39,7 +41,7 @@ void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
auto rotation = self->GetRotation();
GameMessages::SendTeleport(user->GetObjectID(), position, rotation, user->GetSystemAddress());
GameMessages::Teleport(user->GetObjectID(), position, rotation).SendToClient(user->GetSystemAddress());
RenderComponent::PlayAnimation(user, u"cannon-strike-no-equip");
@@ -107,6 +109,6 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
missionComponent->ForceProgress(601, 910, 1);
}
GameMessages::SendTerminateInteraction(playerId, eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(playerId, eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}

View File

@@ -1,5 +1,6 @@
#include "GfTikiTorch.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
@@ -8,6 +9,7 @@
#include "RenderComponent.h"
#include "eTerminateType.h"
#include "Loot.h"
#include "InventoryMessages.h"
void GfTikiTorch::OnStartup(Entity* self) {
LightTorch(self);
@@ -43,7 +45,7 @@ void GfTikiTorch::OnTimerDone(Entity* self, std::string timerName) {
Entity* player = Game::entityManager->GetEntity(self->GetI64(u"userID"));
if (player != nullptr && player->GetCharacter()) {
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->SetBoolean(u"isInUse", false);

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "MovementMessages.h"
#include "Preconditions.h"
#include "eEndBehavior.h"
#include "DestroyableComponent.h"
@@ -51,9 +52,9 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
auto position = self->GetPosition();
auto rotation = self->GetRotation();
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
GameMessages::Teleport(playerId, position, rotation, true).SendToClient(player->GetSystemAddress());
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
GameMessages::Teleport(playerId, position, rotation, true).SendToClient(player->GetSystemAddress());
const auto cinematic = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Cinematic"));
const auto leanIn = self->GetVar<float>(u"LeanIn");
@@ -97,9 +98,13 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
position.y += 12;
position.z += (forward.z * 20.5f);
GameMessages::SendOrientToAngle(playerId, true, rads, player->GetSystemAddress());
GameMessages::OrientToAngle orientToAngle;
orientToAngle.target = playerId;
orientToAngle.bRelativeToCurrent = true;
orientToAngle.fAngle = rads;
orientToAngle.Send(player->GetSystemAddress());
GameMessages::SendTeleport(playerId, position, QuatUtils::IDENTITY, player->GetSystemAddress());
GameMessages::Teleport(playerId, position, QuatUtils::IDENTITY).SendToClient(player->GetSystemAddress());
GameMessages::SetStunned stun;
stun.target = playerId;

View File

@@ -1,6 +1,7 @@
#include "BankInteractServer.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Entity.h"
#include "Amf3.h"
@@ -29,6 +30,6 @@ void BankInteractServer::OnFireEventServerSide(Entity* self, Entity* sender, std
uiMessage.args = std::move(args);
uiMessage.SendToClient(sender->GetSystemAddress());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY, "").Send(sender->GetSystemAddress());
}
}

View File

@@ -1,6 +1,7 @@
#include "Binoculars.h"
#include "Character.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Game.h"
#include "dServer.h"
@@ -15,6 +16,6 @@ void Binoculars::OnUse(Entity* self, Entity* user) {
if (!flagMsg.flag) {
auto* const character = user->GetCharacter();
if (character) character->SetPlayerFlag(flag, true);
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
GameMessages::FireEventClientSide(self->GetObjectID(), u"achieve", LWOOBJID_EMPTY, LWOOBJID_EMPTY).SendToClient(user->GetSystemAddress());
}
}

View File

@@ -1,5 +1,6 @@
#include "ImaginationBackpackHealServer.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
@@ -15,8 +16,7 @@ void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* cast
auto* missionComponent = caster->GetComponent<MissionComponent>();
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == eMissionState::ACTIVE) {
missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,
caster->GetObjectID(), "", caster->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0, caster->GetObjectID(), "").Send(caster->GetSystemAddress());
}
}
}

View File

@@ -1,6 +1,7 @@
#include "PropertyPlatform.h"
#include "QuickBuildComponent.h"
#include "GameMessages.h"
#include "MovementMessages.h"
#include "MovingPlatformComponent.h"
void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
@@ -9,8 +10,7 @@ void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
// movingPlatform->StopPathing();
// movingPlatform->SetNoAutoStart(true);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, eMovementPlatformState::Stationary);
GameMessages::PlatformResync(*self, true, 0, 0, 0, eMovementPlatformState::Stationary).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
@@ -20,8 +20,7 @@ void PropertyPlatform::OnUse(Entity* self, Entity* user) {
// if (movingPlatform != nullptr) {
// movingPlatform->GotoWaypoint(1);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, eMovementPlatformState::Moving);
GameMessages::PlatformResync(*self, true, 0, 1, 1, eMovementPlatformState::Moving).Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddCallbackTimer(movementDelay + effectDelay, [self, this]() {
self->SetNetworkVar<float_t>(u"startEffect", dieDelay);

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "dServer.h"
#include "Amf3.h"
#include "Entity.h"
@@ -54,7 +55,7 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
if (!flagMsg.flag) {
auto* const character = user->GetCharacter();
if (character) character->SetPlayerFlag(boxFlag, true);
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
GameMessages::FireEventClientSide(self->GetObjectID(), u"achieve", LWOOBJID_EMPTY, LWOOBJID_EMPTY).SendToClient(user->GetSystemAddress());
}
}
}

View File

@@ -2,6 +2,7 @@
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Character.h"
#include "eReplicaComponentType.h"
#include "eTerminateType.h"
@@ -38,5 +39,5 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::NONE);
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -2,6 +2,7 @@
#include "eMissionState.h"
#include "Game.h"
#include "dZoneManager.h"
#include "ObjectMessages.h"
void VisToggleNotifierServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionId, eMissionState missionState) {
auto itr = m_GameVariables.find(missionId);
@@ -16,7 +17,7 @@ void VisToggleNotifierServer::OnMissionDialogueOK(Entity* self, Entity* target,
for (const auto spawner : spawners) {
const auto& spawnedObjIds = spawner->GetSpawnedObjectIDs();
for (const auto& objId : spawnedObjIds) {
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible);
GameMessages::NotifyClientObject(objId, u"SetVisibility", visible).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}
}

View File

@@ -2,6 +2,7 @@
#include "ScriptedActivityComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Loot.h"
#include "EntityManager.h"
#include "eTerminateType.h"
@@ -29,7 +30,7 @@ void WishingWellServer::OnUse(Entity* self, Entity* user) {
GeneralUtils::GenerateRandomNumber<int32_t>(1, 1000)
);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"StartCooldown", 0, 0, LWOOBJID_EMPTY, "", user->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"StartCooldown", 0, 0, LWOOBJID_EMPTY, "").Send(user->GetSystemAddress());
const auto userID = user->GetObjectID();
@@ -38,10 +39,10 @@ void WishingWellServer::OnUse(Entity* self, Entity* user) {
if (user == nullptr) return;
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"StopCooldown", 0, 0, LWOOBJID_EMPTY, "", user->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"StopCooldown", 0, 0, LWOOBJID_EMPTY, "").Send(user->GetSystemAddress());
});
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void WishingWellServer::OnTimerDone(Entity* self, std::string timerName) {

View File

@@ -2,6 +2,7 @@
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Character.h"
#include "MissionComponent.h"
#include "QuickBuildComponent.h"
@@ -58,5 +59,5 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
missionComponent->ForceProgressTaskType(863, 1, 1, false);
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -1,6 +1,7 @@
#include "NTPipeVisibilityServer.h"
#include "Entity.h"
#include "Character.h"
#include "ObjectMessages.h"
void NTPipeVisibilityServer::OnQuickBuildComplete(Entity* self, Entity* target) {
const auto flag = self->GetVar<int32_t>(u"flag");
@@ -11,5 +12,5 @@ void NTPipeVisibilityServer::OnQuickBuildComplete(Entity* self, Entity* target)
character->SetPlayerFlag(flag, true);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PipeBuilt");
GameMessages::NotifyClientObject(self->GetObjectID(), u"PipeBuilt").Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "MovementMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
@@ -103,7 +104,7 @@ void NtAssemblyTubeServer::TeleportPlayer(Entity* self, Entity* player) {
const auto destPosition = destination->GetPosition();
const auto destRotation = destination->GetRotation();
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::Teleport(player->GetObjectID(), destPosition, destRotation, true).SendToClient(player->GetSystemAddress());
RenderComponent::PlayAnimation(player, u"tube-resurrect", 4.0f);

View File

@@ -2,13 +2,14 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ActivityMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
void NtCombatChallengeServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UI_Open", 0, 0, user->GetObjectID(), "", user->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"UI_Open", 0, 0, user->GetObjectID(), "").Send(user->GetSystemAddress());
}
void NtCombatChallengeServer::OnDie(Entity* self, Entity* killer) {
@@ -40,7 +41,7 @@ void NtCombatChallengeServer::OnHitOrHealResult(Entity* self, Entity* attacker,
void NtCombatChallengeServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
int32_t param2, int32_t param3) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UI_Close", 0, 0, sender->GetObjectID(), "", sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"UI_Close", 0, 0, sender->GetObjectID(), "").Send(sender->GetSystemAddress());
}
@@ -66,7 +67,7 @@ void NtCombatChallengeServer::OnMessageBoxResponse(Entity* self, Entity* sender,
self->SetNetworkVar(u"toggle", true);
} else if (identifier == u"CloseButton") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UI_Close", 1, 0, sender->GetObjectID(), "", sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"UI_Close", 1, 0, sender->GetObjectID(), "").Send(sender->GetSystemAddress());
}
}

View File

@@ -1,5 +1,6 @@
#include "NtImagimeterVisibility.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Entity.h"
#include "Character.h"
#include "ePlayerFlag.h"
@@ -8,5 +9,5 @@ void NTImagimeterVisibility::OnQuickBuildComplete(Entity* self, Entity* target)
auto* character = target->GetCharacter();
if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlinthBuilt", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlinthBuilt", 0, 0, LWOOBJID_EMPTY, "").Send(target->GetSystemAddress());
}

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "ObjectMessages.h"
#include "MissionComponent.h"
#include "EntityManager.h"
#include "Character.h"
@@ -11,9 +12,9 @@
#include "eStateChangeType.h"
void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "").Send(user->GetSystemAddress());
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetVar(u"bActive", true);
@@ -40,7 +41,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
RenderComponent::PlayAnimation(player, u"rebuild-celebrate");
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SparkStop", 0, 0, player->GetObjectID(), "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"SparkStop", 0, 0, player->GetObjectID(), "").Send(player->GetSystemAddress());
GameMessages::SetStunned stun;
stun.target = player->GetObjectID();
stun.StateChangeType = eStateChangeType::POP;
@@ -81,7 +82,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
return;
}
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 0, 0, player->GetObjectID(), "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"bActive", 0, 0, player->GetObjectID(), "").Send(player->GetSystemAddress());
GameMessages::StopFXEffect(self->GetObjectID(), true, "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "MovementMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
@@ -85,7 +86,7 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
cinematic.Send(player->GetSystemAddress());
}
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::Teleport(player->GetObjectID(), destPosition, destRotation, true).SendToClient(player->GetSystemAddress());
RenderComponent::PlayAnimation(player, u"paradox-teleport-in", 4.0f);

View File

@@ -2,6 +2,8 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "Entity.h"
#include "GeneralUtils.h"
@@ -40,7 +42,7 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
auto destRotation = self->GetRotation();
GameMessages::SendTeleport(playerID, destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::Teleport(playerID, destPosition, destRotation, true).SendToClient(player->GetSystemAddress());
RenderComponent::PlayAnimation(player, u"scale-down", 4.0f);
@@ -140,7 +142,7 @@ void NtVentureCannonServer::UnlockCannonPlayer(Entity* self, Entity* player) {
self->SetNetworkVar(u"bIsInUse", false);
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) {
@@ -158,7 +160,7 @@ void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) {
const auto destPosition = destination->GetPosition();
const auto destRotation = destination->GetRotation();
GameMessages::SendTeleport(player->GetObjectID(), destPosition, destRotation, player->GetSystemAddress(), true);
GameMessages::Teleport(player->GetObjectID(), destPosition, destRotation, true).SendToClient(player->GetSystemAddress());
RenderComponent::PlayAnimation(player, u"venture-cannon-out", 4.0f);
}

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
void HydrantBroken::OnStartup(Entity* self) {
self->AddTimer("playEffect", 1);
@@ -19,7 +20,7 @@ void HydrantBroken::OnStartup(Entity* self) {
msg.bActive = true;
msg.Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->AddTimer("KillBroken", 25);
@@ -35,7 +36,7 @@ void HydrantBroken::OnTimerDone(Entity* self, std::string timerName) {
msg.bActive = false;
msg.Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->Kill();

View File

@@ -1,6 +1,7 @@
#include "SpawnGryphonServer.h"
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eTerminateType.h"
@@ -21,7 +22,7 @@ void SpawnGryphonServer::OnUse(Entity* self, Entity* user) {
if (missionComponent != nullptr && inventoryComponent != nullptr
&& missionComponent->GetMissionState(1391) == eMissionState::ACTIVE) {
inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483), eInventoryType::ALL);
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
return;
}

View File

@@ -4,6 +4,7 @@
#include "Entity.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "dZoneManager.h"
#include "RenderComponent.h"
#include "MissionComponent.h"
@@ -67,8 +68,7 @@ void ZoneAgProperty::OnPlayerLoaded(Entity* self, Entity* player) {
ambientSound.target = player->GetObjectID();
ambientSound.audioGUID = GUIDMaelstrom;
ambientSound.SendToClient(player->GetSystemAddress());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0,
LWOOBJID_EMPTY, "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY, "").Send(player->GetSystemAddress());
self->SetNetworkVar(u"unclaimed", true);
@@ -176,8 +176,7 @@ void ZoneAgProperty::StartMaelstrom(Entity* self, Entity* player) {
StartTornadoFx(self);
if (player != nullptr) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY,
"", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY, "").Send(player->GetSystemAddress());
}
}
@@ -205,7 +204,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
auto* entity = entities[0];
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"GuardChat", 0, 0, entity->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"GuardChat", 0, 0, entity->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
LoadProperty(self);
self->AddTimer("KillGuard", 5);
@@ -235,8 +234,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
self->AddTimer("turnSkyOff", 1.5f);
self->AddTimer("killFXObject", 8);
} else if (timerName == "turnSkyOff") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SkyOff", 0, 0, LWOOBJID_EMPTY,
"", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"SkyOff", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "killSpider") {
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup))) {
entity->Kill();
@@ -271,13 +269,12 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
ambientSound.SendToClient(player->GetSystemAddress());
}
} else if (timerName == "ShowVendor") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"vendorOn", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"vendorOn", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
for (const auto& ambient : self->GetVar<std::vector<std::string>>(AmbientFXSpawner)) {
ActivateSpawner(ambient);
}
} else if (timerName == "BoundsVisOn") {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"boundsAnim", 0, 0,
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"boundsAnim", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "runPlayerLoadedAgain") {
CheckForOwner(self);
} else if (timerName == "pollTornadoFX") {
@@ -424,8 +421,7 @@ void ZoneAgProperty::BaseOnFireEventServerSide(Entity* self, Entity* sender, std
auto* const character = player->GetCharacter();
if (character) character->SetPlayerFlag(self->GetVar<int32_t>(defeatedProperyFlag), true);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0,
LWOOBJID_EMPTY, destroyedCinematic, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, destroyedCinematic).Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer("tornadoOff", 0.5f);
}

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Amf3.h"
#include "Entity.h"
@@ -31,8 +32,7 @@ void PropertyBankInteract::OnUse(Entity* self, Entity* user) {
uiMessage.args = std::move(args);
uiMessage.SendToClient(user->GetSystemAddress());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"OpenBank", 0, 0, LWOOBJID_EMPTY,
"", user->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"OpenBank", 0, 0, LWOOBJID_EMPTY, "").Send(user->GetSystemAddress());
}
void PropertyBankInteract::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
@@ -48,7 +48,6 @@ void PropertyBankInteract::OnFireEventServerSide(Entity* self, Entity* sender, s
uiMessage.args = std::move(amfArgs);
uiMessage.SendToClient(sender->GetSystemAddress());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY,
"", sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"CloseBank", 0, 0, LWOOBJID_EMPTY, "").Send(sender->GetSystemAddress());
}
}

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "MissionComponent.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "eMissionState.h"
void VeBricksampleServer::OnUse(Entity* self, Entity* user) {
@@ -15,7 +16,7 @@ void VeBricksampleServer::OnUse(Entity* self, Entity* user) {
inventoryComponent->AddItem(loot, 1, eLootSourceType::NONE);
for (auto* brickEntity : Game::entityManager->GetEntitiesInGroup("Bricks")) {
GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup");
GameMessages::NotifyClientObject(brickEntity->GetObjectID(), u"Pickedup").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}
}

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "eMissionState.h"
#include "Entity.h"
@@ -22,7 +23,7 @@ void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
// Notify the client that all objects have updated
self->AddCallbackTimer(3.0f, [this]() {
for (const auto* console : Game::entityManager->GetEntitiesInGroup(m_ConsoleGroup)) {
GameMessages::SendNotifyClientObject(console->GetObjectID(), u"");
GameMessages::NotifyClientObject(console->GetObjectID(), u"").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
});
}

View File

@@ -2,6 +2,7 @@
#include "InventoryComponent.h"
#include "Character.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Loot.h"
#include "eTerminateType.h"
@@ -22,6 +23,6 @@ void VeMissionConsole::OnUse(Entity* self, Entity* user) {
character->SetPlayerFlag(flag, true);
}
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"");
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::NotifyClientObject(self->GetObjectID(), u"").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -2,6 +2,7 @@
#include "PetMessages.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "Entity.h"
#include "RenderComponent.h"
@@ -65,7 +66,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
if (bouncer == nullptr) return;
// kill the bouncer
GameMessages::SendNotifyClientObject(bouncer->GetObjectID(), u"TimeToDie");
GameMessages::NotifyClientObject(bouncer->GetObjectID(), u"TimeToDie").Send(UNASSIGNED_SYSTEM_ADDRESS);
bouncer->Smash(self->GetObjectID(), eKillType::VIOLENT);
}
}

View File

@@ -1,9 +1,10 @@
#include "CatapultBouncerServer.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
void CatapultBouncerServer::OnQuickBuildComplete(Entity* self, Entity* target) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"Built", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"Built", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->SetNetworkVar<bool>(u"Built", true);

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "QuickBuildComponent.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Character.h"
#include "dZoneManager.h"
#include "RenderComponent.h"
@@ -158,7 +159,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
return;
}
GameMessages::SendNotifyClientObject(villager->GetObjectID(), u"TimeToChat", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(villager->GetObjectID(), u"TimeToChat", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
// Get the builder and make sure it still exists
auto* builder = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Builder"));

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "eMissionState.h"
#include "ePlayerFlag.h"
@@ -30,8 +31,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
// Hide the chest
for (auto* chest : Game::entityManager->GetEntitiesInGroup(m_DragonChestGroup)) {
GameMessages::SendNotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 0, -1,
target->GetObjectID(), "", target->GetSystemAddress());
GameMessages::NotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 0, -1, target->GetObjectID(), "").Send(target->GetSystemAddress());
}
return;
@@ -43,8 +43,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
// Show the chest
for (auto* chest : Game::entityManager->GetEntitiesInGroup(m_DragonChestGroup)) {
GameMessages::SendNotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 1, -1,
target->GetObjectID(), "", target->GetSystemAddress());
GameMessages::NotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 1, -1, target->GetObjectID(), "").Send(target->GetSystemAddress());
}
auto playerID = target->GetObjectID();

View File

@@ -5,6 +5,8 @@
#include "dZoneManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "BaseCombatAIComponent.h"
#include "BuffComponent.h"
#include "SkillComponent.h"
@@ -84,8 +86,7 @@ void NjMonastryBossInstance::OnPlayerLoaded(Entity* self, Entity* player) {
self->AddCallbackTimer(0.0f, [self, player]() {
if (player != nullptr) {
// If we don't have enough players yet, wait for the others to load and notify the client to play a cool cinematic
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayerLoaded", 0, 0,
player->GetObjectID(), "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlayerLoaded", 0, 0, player->GetObjectID(), "").Send(player->GetSystemAddress());
}
});
@@ -114,7 +115,7 @@ void NjMonastryBossInstance::OnPlayerExit(Entity* self, Entity* player) {
// resize the instance to account for such.
if (totalPlayersLoaded.size() <= 2) self->SetVar<bool>(LargeTeamVariable, false);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayerLeft", 0, 0, player->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlayerLeft", 0, 0, player->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string& name) {
@@ -173,8 +174,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
}
ActivityTimerStart(self, SpawnLowerFrakjawTimer, 1.0f, 1.0f);
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, BottomFrakSpawn, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, BottomFrakSpawn).Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == SpawnLowerFrakjawTimer) {
auto spawners = Game::zoneManager->GetSpawnersByName(LowerFrakjawSpawner);
if (!spawners.empty()) {
@@ -182,8 +182,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
spawner->Activate();
}
} else if (timerName == SpawnRailTimer) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, FireRailSpawn, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, FireRailSpawn).Send(UNASSIGNED_SYSTEM_ADDRESS);
auto spawners = Game::zoneManager->GetSpawnersByName(FireRailSpawner);
if (!spawners.empty()) {
@@ -230,15 +229,10 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
switch (state) {
case eQuickBuildState::BUILDING:
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
0, 0, counterWeight->GetObjectID(),
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, counterWeight->GetObjectID(), BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable))).Send(UNASSIGNED_SYSTEM_ADDRESS);
return;
case eQuickBuildState::INCOMPLETE:
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
0, 0, LWOOBJID_EMPTY, "",
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), EndCinematicNotification, 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
return;
case eQuickBuildState::RESETTING:
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
@@ -255,8 +249,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
auto* frakjaw = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
if (frakjaw == nullptr) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"LedgeFrakjawDead", 0,
0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"LedgeFrakjawDead", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
return;
}
@@ -304,8 +297,7 @@ void NjMonastryBossInstance::HandleLowerFrakjawSpawned(Entity* self, Entity* low
NjMonastryBossInstance::HandleLowerFrakjawDied(self, lowerFrakjaw);
});
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"LedgeFrakjawDead", 0, 0,
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"LedgeFrakjawDead", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
if (self->GetVar<bool>(LargeTeamVariable)) {
// Double frakjaws health for large teams
@@ -397,37 +389,30 @@ void NjMonastryBossInstance::HandleWaveEnemyDied(Entity* self, Entity* waveEnemy
void NjMonastryBossInstance::TeleportPlayer(Entity* player, uint32_t position) {
for (const auto* spawnPoint : Game::entityManager->GetEntitiesInGroup("SpawnPoint" + std::to_string(position))) {
GameMessages::SendTeleport(player->GetObjectID(), spawnPoint->GetPosition(), spawnPoint->GetRotation(),
player->GetSystemAddress(), true);
GameMessages::Teleport(player->GetObjectID(), spawnPoint->GetPosition(), spawnPoint->GetRotation(), true).SendToClient(player->GetSystemAddress());
}
}
void NjMonastryBossInstance::SummonWave(Entity* self, Entity* frakjaw) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY,
LedgeFrakSummon, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, LedgeFrakSummon).Send(UNASSIGNED_SYSTEM_ADDRESS);
RenderComponent::PlayAnimation(frakjaw, SummonAnimation);
// Stop the music for the first, fourth and fifth wave
const auto wave = self->GetVar<uint32_t>(WaveNumberVariable);
if (wave >= 1 && wave < (m_Waves.size() - 1)) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), StopMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(wave - 1),
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), StopMusicNotification, 0, 0, LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(wave - 1)).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
// After frakjaw moves down the music stays the same
if (wave < (m_Waves.size() - 1)) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), StartMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(wave),
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), StartMusicNotification, 0, 0, LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(wave)).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
ActivityTimerStart(self, SpawnWaveTimer, 4.0f, 4.0f);
}
void NjMonastryBossInstance::LowerFrakjawSummon(Entity* self, Entity* frakjaw) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, BottomFrakSummon, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, BottomFrakSummon).Send(UNASSIGNED_SYSTEM_ADDRESS);
ActivityTimerStart(self, SpawnWaveTimer, 2.0f, 2.0f);
RenderComponent::PlayAnimation(frakjaw, SummonAnimation);
}
@@ -451,10 +436,8 @@ void NjMonastryBossInstance::LowerFrakjaw(Entity* self, Entity* frakjaw) {
RenderComponent::PlayAnimation(frakjaw, TeleportOutAnimation);
ActivityTimerStart(self, LowerFrakjawCamTimer, 2.0f, 2.0f);
GameMessages::SendNotifyClientObject(frakjaw->GetObjectID(), StopMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 3), UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyClientObject(frakjaw->GetObjectID(), StartMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 2), UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(frakjaw->GetObjectID(), StopMusicNotification, 0, 0, LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 3)).Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(frakjaw->GetObjectID(), StartMusicNotification, 0, 0, LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 2)).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
void NjMonastryBossInstance::SpawnOnNetwork(Entity* self, const LOT& toSpawn, const uint32_t& numberToSpawn, const std::string& spawnerName) {
@@ -475,16 +458,13 @@ void NjMonastryBossInstance::WaveOver(Entity* self) {
if (wave >= m_Waves.size() - 1)
return;
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, BaseCounterweightSpawn + std::to_string(wave),
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, BaseCounterweightSpawn + std::to_string(wave)).Send(UNASSIGNED_SYSTEM_ADDRESS);
ActivityTimerStart(self, SpawnCounterWeightTimer, 1.5f, 1.5f);
RemovePoison(self);
}
void NjMonastryBossInstance::FightOver(Entity* self) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"GroundFrakjawDead", 0, 0,
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"GroundFrakjawDead", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
// Remove all the enemies from the battlefield
for (auto i = 1; i < 5; i++) {
@@ -500,13 +480,9 @@ void NjMonastryBossInstance::FightOver(Entity* self) {
ActivityTimerStart(self, SpawnRailTimer, 1.5f, 1.5f);
// Set the music to play the victory music
GameMessages::SendNotifyClientObject(self->GetObjectID(), StopMusicNotification, 0, 0,
LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 2),
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyClientObject(self->GetObjectID(), FlashMusicNotification, 0, 0,
LWOOBJID_EMPTY, "Monastery_Frakjaw_Battle_Win", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
LWOOBJID_EMPTY, TreasureChestSpawning, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), StopMusicNotification, 0, 0, LWOOBJID_EMPTY, AudioWaveAudio + std::to_string(m_Waves.size() - 2)).Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), FlashMusicNotification, 0, 0, LWOOBJID_EMPTY, "Monastery_Frakjaw_Battle_Win").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, LWOOBJID_EMPTY, TreasureChestSpawning).Send(UNASSIGNED_SYSTEM_ADDRESS);
auto treasureChests = Game::entityManager->GetEntitiesInGroup(ChestSpawnpointGroup);
for (auto* treasureChest : treasureChests) {

View File

@@ -5,6 +5,7 @@
#include "SkillComponent.h"
#include "TeamManager.h"
#include "Loot.h"
#include "InventoryMessages.h"
void AgSurvivalBuffStation::OnQuickBuildComplete(Entity* self, Entity* target) {
auto destroyableComponent = self->GetComponent<DestroyableComponent>();

View File

@@ -1,6 +1,7 @@
#include "PetFromObjectServer.h"
#include "PetComponent.h"
#include "ePetTamingNotifyType.h"
#include "ObjectMessages.h"
void PetFromObjectServer::OnStartup(Entity* self) {
self->SetNetworkVar(u"pettamer", std::to_string(self->GetVar<LWOOBJID>(u"tamer")));
@@ -27,8 +28,7 @@ void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer,
break;
case ePetTamingNotifyType::SUCCESS:
// TODO: Remove from groups?
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0,
0, tamer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0, 0, tamer->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
default:
break;
}

View File

@@ -3,6 +3,7 @@
#include "ScriptedActivityComponent.h"
#include "LeaderboardManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include <algorithm>
#include "Logger.h"
#include "Loot.h"
@@ -91,7 +92,7 @@ void ActivityManager::SaveScore(Entity* self, const LWOOBJID playerID, const flo
LeaderboardManager::SaveScore(playerID, gameID, primaryScore, secondaryScore, tertiaryScore);
// Makes the leaderboard show up for the player
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ToggleLeaderBoard", gameID, 0, playerID, "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"ToggleLeaderBoard", gameID, 0, playerID, "").Send(player->GetSystemAddress());
}
bool ActivityManager::TakeActivityCost(const Entity* self, const LWOOBJID playerID) {

View File

@@ -2,6 +2,8 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "ObjectMessages.h"
#include "ZoneMessages.h"
#include "CharacterComponent.h"
#include "RenderComponent.h"
#include "EntityManager.h"
@@ -69,10 +71,15 @@ void BaseConsoleTeleportServer::BaseOnMessageBoxResponse(Entity* self, Entity* s
return;
}
GameMessages::SendDisplayZoneSummary(playerID, player->GetSystemAddress(), false, false, self->GetObjectID());
GameMessages::DisplayZoneSummary zoneSummary;
zoneSummary.target = playerID;
zoneSummary.isPropertyMap = false;
zoneSummary.isZoneStart = false;
zoneSummary.sender = self->GetObjectID();
zoneSummary.Send(player->GetSystemAddress());
});
} else if (button == -1 || button == 0) {
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}
@@ -116,7 +123,7 @@ void BaseConsoleTeleportServer::TransferPlayer(Entity* self, Entity* player, int
stun.bCantUseItem = true;
stun.Send(player->GetSystemAddress());
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID());
GameMessages::TerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
const auto& teleportZone = self->GetVar<std::u16string>(u"transferZoneID");

View File

@@ -1,6 +1,7 @@
#include "BasePropertyServer.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Character.h"
@@ -179,8 +180,7 @@ void BasePropertyServer::PropGuardCheck(Entity* self, Entity* player) {
}
void BasePropertyServer::BaseZonePropertyRented(Entity* self, Entity* player) const {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, "ShowProperty",
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, "ShowProperty").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer(BoundsVisOnTimer, 2);
self->SetVar<LWOOBJID>(PropertyOwnerVariable, player->GetObjectID());
@@ -247,8 +247,7 @@ void BasePropertyServer::StartMaelstrom(Entity* self, Entity* player) {
StartTornadoFx(self);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY,
"", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"maelstromSkyOn", 0, 0, LWOOBJID_EMPTY, "").Send(player->GetSystemAddress());
self->AddTimer(StartGeneratorTimer, 0.0f);
self->AddTimer(StartOrbTimer, 0.0f);
@@ -354,9 +353,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
return;
auto* guard = entities[0];
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
u"GuardChat", 0, 0, guard->GetObjectID(),
"", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"GuardChat", 0, 0, guard->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer(KillGuardTimer, 5.0f);
} else if (timerName == KillGuardTimer) {
@@ -388,8 +385,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
self->AddTimer(KillFXObjectTimer, 8.0f);
} else if (timerName == TurnSkyOffTimer) {
auto* controller = Game::zoneManager->GetZoneControlObject();
GameMessages::SendNotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0,
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == KillStrombiesTimer) {
const auto enemies = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup));
for (auto* enemy : enemies) {
@@ -429,16 +425,13 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
self->AddTimer(ShowVendorTimer, 1.0f);
} else if (timerName == ShowVendorTimer) {
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
u"vendorOn", 0, 0, LWOOBJID_EMPTY, "",
UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"vendorOn", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
for (const auto& ambientFXSpawner : self->GetVar<std::vector<std::string>>(AmbientFXSpawner)) {
ActivateSpawner(ambientFXSpawner);
}
} else if (timerName == BoundsVisOnTimer) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"boundsAnim", 0, 0,
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"boundsAnim", 0, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == RunPlayerLoadedAgainTimer) {
CheckForOwner(self);
} else if (timerName == PollTornadoFXTimer) {
@@ -483,9 +476,7 @@ void BasePropertyServer::HandleOrbsTimer(Entity* self) {
}
DestroySpawner(self->GetVar<std::string>(GeneratorFXSpawner));
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
u"PlayCinematic", 0, 0, LWOOBJID_EMPTY,
"DestroyMaelstrom", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, "DestroyMaelstrom").Send(UNASSIGNED_SYSTEM_ADDRESS);
// Notifies the client that the property has been claimed with a flag, completes missions too
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));

View File

@@ -2,6 +2,8 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ActivityMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "dZoneManager.h"
@@ -140,8 +142,7 @@ void BaseSurvivalServer::BasePlayerDied(Entity* self, Entity* player) {
SetActivityValue(self, player->GetObjectID(), 1, finalTime);
auto paramString = CheckAllPlayersDead() ? "true" : "false";
GameMessages::SendNotifyClientZoneObject(self->GetObjectID(), u"Player_Died", finalTime, 0,
player->GetObjectID(), paramString, player->GetSystemAddress());
GameMessages::NotifyClientZoneObject(self->GetObjectID(), u"Player_Died", finalTime, 0, player->GetObjectID(), paramString).Send(player->GetSystemAddress());
GameOver(self);
} else {
player->Resurrect();
@@ -303,7 +304,9 @@ void BaseSurvivalServer::StartWaves(Entity* self) {
TakeActivityCost(self, playerID);
}
GameMessages::SendPlayerSetCameraCyclingMode(playerID, player->GetSystemAddress());
GameMessages::PlayerSetCameraCyclingMode cameraCyclingMode;
cameraCyclingMode.target = playerID;
cameraCyclingMode.SendToClient(player->GetSystemAddress());
}
}
@@ -336,7 +339,7 @@ void BaseSurvivalServer::SetPlayerSpawnPoints() {
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
if (!possibleSpawners.empty()) {
auto* spawner = possibleSpawners.at(0);
GameMessages::SendTeleport(playerID, spawner->GetPosition(), spawner->GetRotation(), player->GetSystemAddress(), true);
GameMessages::Teleport(playerID, spawner->GetPosition(), spawner->GetRotation(), true).SendToClient(player->GetSystemAddress());
}
}
@@ -364,8 +367,7 @@ void BaseSurvivalServer::GameOver(Entity* self) {
const auto time = GetActivityValue(self, playerID, 1);
SaveScore(self, playerID, score, time);
GameMessages::SendNotifyClientZoneObject(self->GetObjectID(), u"Update_ScoreBoard", time, 0,
playerID, std::to_string(score), UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientZoneObject(self->GetObjectID(), u"Update_ScoreBoard", time, 0, playerID, std::to_string(score)).Send(UNASSIGNED_SYSTEM_ADDRESS);
player->Resurrect();
// Update all mission progression

View File

@@ -3,6 +3,8 @@
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "ActivityMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "dZoneManager.h"
@@ -22,7 +24,9 @@ void BaseWavesServer::SetGameVariables(Entity* self) {
// Done
void BaseWavesServer::BasePlayerLoaded(Entity* self, Entity* player) {
GameMessages::SendPlayerSetCameraCyclingMode(player->GetObjectID(), player->GetSystemAddress());
GameMessages::PlayerSetCameraCyclingMode cameraCyclingMode;
cameraCyclingMode.target = player->GetObjectID();
cameraCyclingMode.SendToClient(player->GetSystemAddress());
GameMessages::SetPlayerAllowedRespawn allowedRespawn;
allowedRespawn.target = player->GetObjectID();
allowedRespawn.dontPromptForRespawn = true;
@@ -132,8 +136,7 @@ void BaseWavesServer::BasePlayerDied(Entity* self, Entity* player) {
auto paramString = CheckAllPlayersDead() ? "true" : "false";
GameMessages::SendNotifyClientZoneObject(self->GetObjectID(), u"Player_Died", finalTime, finalWave,
player->GetObjectID(), paramString, player->GetSystemAddress());
GameMessages::NotifyClientZoneObject(self->GetObjectID(), u"Player_Died", finalTime, finalWave, player->GetObjectID(), paramString).Send(player->GetSystemAddress());
if (!self->GetNetworkVar<bool>(WavesStartedVariable)) {
player->Resurrect();
@@ -145,8 +148,7 @@ void BaseWavesServer::BasePlayerDied(Entity* self, Entity* player) {
// Done
void BaseWavesServer::BasePlayerResurrected(Entity* self, Entity* player) {
GameMessages::SendNotifyClientZoneObject(self->GetObjectID(), u"Player_Res", 0, 0,
player->GetObjectID(), "", player->GetSystemAddress());
GameMessages::NotifyClientZoneObject(self->GetObjectID(), u"Player_Res", 0, 0, player->GetObjectID(), "").Send(player->GetSystemAddress());
if (self->GetNetworkVar<bool>(WavesStartedVariable))
return;
@@ -335,7 +337,7 @@ void BaseWavesServer::SetPlayerSpawnPoints(const LWOOBJID& specificPlayerID) {
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
if (!possibleSpawners.empty()) {
auto* spawner = possibleSpawners.at(0);
GameMessages::SendTeleport(playerID, spawner->GetPosition(), spawner->GetRotation(), player->GetSystemAddress(), true);
GameMessages::Teleport(playerID, spawner->GetPosition(), spawner->GetRotation(), true).SendToClient(player->GetSystemAddress());
}
}
@@ -369,8 +371,7 @@ void BaseWavesServer::GameOver(Entity* self, bool won) {
const auto time = GetActivityValue(self, playerID, 1);
const auto wave = GetActivityValue(self, playerID, 2);
GameMessages::SendNotifyClientZoneObject(self->GetObjectID(), u"Update_ScoreBoard", time, 0,
playerID, std::to_string(wave), UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientZoneObject(self->GetObjectID(), u"Update_ScoreBoard", time, 0, playerID, std::to_string(wave)).Send(UNASSIGNED_SYSTEM_ADDRESS);
if (won) {
SetPlayerSpawnPoints();

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "eTerminateType.h"
bool ChooseYourDestinationNsToNt::CheckChoice(Entity* self, Entity* player) {
@@ -67,6 +68,6 @@ void ChooseYourDestinationNsToNt::BaseChoiceBoxRespond(Entity* self, Entity* sen
messageBox.userData = u"";
messageBox.Send(sender->GetSystemAddress());
} else {
GameMessages::SendTerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}

View File

@@ -11,6 +11,10 @@ enum class eMissionState : int32_t;
enum class ePetTamingNotifyType : uint32_t;
enum class eQuickBuildState : uint32_t;
namespace GameMessages {
struct ShootingGalleryFire;
};
namespace CppScripts {
/**
* Base class for all scripts. Includes virtual methods to be overridden to handle LUA equivelent events.

View File

@@ -3,13 +3,14 @@
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Character.h"
#include "eMissionState.h"
void Darkitect::Reveal(Entity* self, Entity* player) {
const auto playerID = player->GetObjectID();
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"reveal", 0, 0, playerID, "", player->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"reveal", 0, 0, playerID, "").Send(player->GetSystemAddress());
self->AddCallbackTimer(20, [this, self, playerID]() {
auto* player = Game::entityManager->GetEntity(playerID);

View File

@@ -4,6 +4,7 @@
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
@@ -87,9 +88,7 @@ void NtFactionSpyServer::OnCinematicUpdate(Entity* self, Entity* sender, eCinema
if (event == eCinematicEvent::STARTED && pathIndex >= 0 && pathIndex < dialogueTable.size()) {
// If the cinematic started, show part of the conversation
GameMessages::SendNotifyClientObject(self->GetObjectID(), m_SpyDialogueNotification, 0,
0, ParamObjectForConversationID(self, dialogueTable.at(pathIndex).conversationID),
dialogueTable.at(pathIndex).token, sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), m_SpyDialogueNotification, 0, 0, ParamObjectForConversationID(self, dialogueTable.at(pathIndex).conversationID), dialogueTable.at(pathIndex).token).Send(sender->GetSystemAddress());
} else if (event == eCinematicEvent::ENDED && pathIndex >= dialogueTable.size() - 1) {
auto spyData = self->GetVar<SpyData>(m_SpyDataVariable);

View File

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

View File

@@ -1,6 +1,7 @@
#include "SpawnPetBaseServer.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "PetComponent.h"
#include "EntityInfo.h"
@@ -46,7 +47,7 @@ void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) {
cinematic.Send(UNASSIGNED_SYSTEM_ADDRESS);
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
bool SpawnPetBaseServer::CheckNumberOfPets(Entity* self, Entity* user) {

View File

@@ -2,6 +2,7 @@
#include "Entity.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "MovementMessages.h"
#include "ProximityMonitorComponent.h"
void AgBusDoor::OnStartup(Entity* self) {
@@ -49,9 +50,9 @@ void AgBusDoor::OnProximityUpdate(Entity* self, Entity* entering, std::string na
void AgBusDoor::MoveDoor(Entity* self, bool bOpen) {
if (bOpen) {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 1, 0);
GameMessages::PlatformResync(*self, true, 1, 0).Send(UNASSIGNED_SYSTEM_ADDRESS);
} else {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0, 1);
GameMessages::PlatformResync(*self, true, 0, 1).Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddTimer("dustTimer", 2.0f);
}

View File

@@ -6,6 +6,7 @@
#include "DestroyableComponent.h"
#include "eReplicaComponentType.h"
#include "Loot.h"
#include "InventoryMessages.h"
void AgImagSmashable::OnDie(Entity* self, Entity* killer) {
bool maxImagGreaterThanZero = false;

View File

@@ -1,6 +1,7 @@
#include "AgJetEffectServer.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
@@ -8,9 +9,7 @@
void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
if (inUse || self->GetLOT() != 6859) return;
GameMessages::SendNotifyClientObject(
self->GetObjectID(), u"toggleInUse", 1, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS
);
GameMessages::NotifyClientObject(self->GetObjectID(), u"toggleInUse", 1, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
inUse = true;
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
@@ -53,9 +52,7 @@ void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
auto* skillComponent = mortar->GetComponent<SkillComponent>();
if (skillComponent) skillComponent->CastSkill(318);
} else if (timerName == "CineDone") {
GameMessages::SendNotifyClientObject(
self->GetObjectID(), u"toggleInUse", -1, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS
);
GameMessages::NotifyClientObject(self->GetObjectID(), u"toggleInUse", -1, 0, LWOOBJID_EMPTY, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
inUse = false;
}
}

View File

@@ -1,11 +1,13 @@
#include "AgPicnicBlanket.h"
#include "Loot.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "Entity.h"
#include "eTerminateType.h"
#include "InventoryMessages.h"
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
if (self->GetVar<bool>(u"active"))
return;
self->SetVar<bool>(u"active", true);

View File

@@ -1,6 +1,7 @@
#include "AgQbElevator.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "MovementMessages.h"
void AgQbElevator::OnStartup(Entity* self) {
@@ -14,8 +15,7 @@ void AgQbElevator::OnQuickBuildComplete(Entity* self, Entity* target) {
float delayTime = killTime - endTime;
if (delayTime < 1) delayTime = 1;
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, eMovementPlatformState::Stationary);
GameMessages::PlatformResync(*self, true, 0, 0, 0, eMovementPlatformState::Stationary).Send(UNASSIGNED_SYSTEM_ADDRESS);
//add a timer that will kill the QB if no players get on in the killTime
self->AddTimer("startKillTimer", killTime);
@@ -32,8 +32,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
self->SetBoolean(u"qbPlayerRdy", true);
self->CancelTimer("StartElevator");
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, eMovementPlatformState::Moving);
GameMessages::PlatformResync(*self, true, 0, 1, 1, eMovementPlatformState::Moving).Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (!self->GetBoolean(u"StartTimer")) {
self->SetBoolean(u"StartTimer", true);
self->AddTimer("StartElevator", startTime);
@@ -44,8 +43,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "StartElevator") {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, eMovementPlatformState::Moving);
GameMessages::PlatformResync(*self, true, 0, 1, 1, eMovementPlatformState::Moving).Send(UNASSIGNED_SYSTEM_ADDRESS);
} else if (timerName == "startKillTimer") {
killTimerStartup(self);
} else if (timerName == "KillTimer") {

View File

@@ -2,12 +2,13 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "CombatMessages.h"
#include "ObjectMessages.h"
#include "RenderComponent.h"
#include "Entity.h"
#include "eTerminateType.h"
void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
if (active) {
return;
}

View File

@@ -1,5 +1,6 @@
#include "AgTurret.h"
#include "GameMessages.h"
#include "MovementMessages.h"
void AgTurret::OnStartup(Entity* self) {
// TODO: do this legit way
@@ -13,5 +14,8 @@ void AgTurret::OnTimerDone(Entity* self, std::string timerName) {
}
void AgTurret::OnQuickBuildStart(Entity* self, Entity* user) {
GameMessages::SendLockNodeRotation(self, "base");
GameMessages::LockNodeRotation lockNodeRotation;
lockNodeRotation.target = self->GetObjectID();
lockNodeRotation.nodeName = "base";
lockNodeRotation.Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -1,6 +1,7 @@
#include "FvConsoleLeftQuickbuild.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "eTerminateType.h"
#include "eQuickBuildState.h"
@@ -45,5 +46,5 @@ void FvConsoleLeftQuickbuild::OnUse(Entity* self, Entity* user) {
}
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -1,6 +1,7 @@
#include "FvConsoleRightQuickbuild.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "eTerminateType.h"
#include "eQuickBuildState.h"
@@ -45,5 +46,5 @@ void FvConsoleRightQuickbuild::OnUse(Entity* self, Entity* user) {
}
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "ObjectMessages.h"
#include "EntityInfo.h"
#include "ScriptedActivityComponent.h"
@@ -21,16 +22,14 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
// If the player already spawned a panda
auto playerPandas = Game::entityManager->GetEntitiesInGroup("panda" + std::to_string(target->GetObjectID()));
if (!playerPandas.empty()) {
GameMessages::SendFireEventClientSide(self->GetObjectID(), target->GetSystemAddress(), u"playerPanda",
target->GetObjectID(), 0, 0, target->GetObjectID());
GameMessages::FireEventClientSide(self->GetObjectID(), u"playerPanda", target->GetObjectID(), target->GetObjectID()).SendToClient(target->GetSystemAddress());
return;
}
// If there's already too many spawned pandas
auto pandas = Game::entityManager->GetEntitiesInGroup("pandas");
if (pandas.size() > 4) {
GameMessages::SendFireEventClientSide(self->GetObjectID(), target->GetSystemAddress(), u"tooManyPandas",
target->GetObjectID(), 0, 0, target->GetObjectID());
GameMessages::FireEventClientSide(self->GetObjectID(), u"tooManyPandas", target->GetObjectID(), target->GetObjectID()).SendToClient(target->GetSystemAddress());
return;
}

View File

@@ -1,6 +1,7 @@
#include "InstanceExitTransferPlayerToLastNonInstance.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "CharacterComponent.h"
#include "Character.h"
#include "dServer.h"
@@ -50,7 +51,7 @@ void InstanceExitTransferPlayerToLastNonInstance::OnMessageBoxResponse(Entity* s
}
}
GameMessages::SendTerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
GameMessages::TerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()).Send(UNASSIGNED_SYSTEM_ADDRESS);
}

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ActivityMessages.h"
#include "MovementMessages.h"
#include "dZoneManager.h"
#include "Character.h"
#include "ShootingGalleryComponent.h"
@@ -19,6 +20,7 @@
#include "eGameActivity.h"
#include "Item.h"
#include <ranges>
#include "BuildingMessages.h"
void SGCannon::OnStartup(Entity* self) {
LOG("OnStartup");
@@ -314,7 +316,7 @@ void SGCannon::DoSpawnTimerFunc(Entity* self, const std::string& name) {
// Save the enemy and tell it to start pathing
if (enemy != nullptr) {
const_cast<std::vector<LWOOBJID>&>(self->GetVar<std::vector<LWOOBJID>>(SpawnedObjects)).push_back(enemy->GetObjectID());
GameMessages::SendPlatformResync(enemy, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::PlatformResync(*enemy).Send(UNASSIGNED_SYSTEM_ADDRESS);
}
}
}
@@ -713,12 +715,13 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
UpdateStreak(self);
GameMessages::SendNotifyClientShootingGalleryScore(self->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS,
0.0f,
score,
target->GetObjectID(),
target->GetPosition()
);
GameMessages::NotifyClientShootingGalleryScore galleryScore;
galleryScore.target = self->GetObjectID();
galleryScore.addTime = 0.0f;
galleryScore.score = score;
galleryScore.targetID = target->GetObjectID();
galleryScore.targetPos = target->GetPosition();
galleryScore.Send(UNASSIGNED_SYSTEM_ADDRESS);
auto newScore = self->GetVar<int32_t>(TotalScoreVariable) + score;

View File

@@ -1,6 +1,7 @@
#include "PropertyDeathPlane.h"
#include "Entity.h"
#include "GameMessages.h"
#include "MovementMessages.h"
#include "EntityManager.h"
void PropertyDeathPlane::OnCollisionPhantom(Entity* self, Entity* target) {
@@ -12,5 +13,5 @@ void PropertyDeathPlane::OnCollisionPhantom(Entity* self, Entity* target) {
auto* teleport = teleportGroup[0];
GameMessages::SendTeleport(target->GetObjectID(), teleport->GetPosition(), teleport->GetRotation(), target->GetSystemAddress());
GameMessages::Teleport(target->GetObjectID(), teleport->GetPosition(), teleport->GetRotation()).SendToClient(target->GetSystemAddress());
}

View File

@@ -1,6 +1,8 @@
#include "NsConcertInstrument.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "MovementMessages.h"
#include "ObjectMessages.h"
#include "Item.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
@@ -71,8 +73,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
}
if (activePlayer != nullptr && name == "checkPlayer" && self->GetVar<bool>(u"beingPlayed")) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"checkMovement", 0, 0,
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"checkMovement", 0, 0, activePlayer->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
auto* stats = activePlayer->GetComponent<DestroyableComponent>();
if (stats) {
if (stats->GetImagination() > 0) {
@@ -90,8 +91,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
} else if (name == "cleanupAfterStop") {
if (activePlayer != nullptr) {
UnEquipInstruments(self, activePlayer);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stopPlaying", 0, 0,
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"stopPlaying", 0, 0, activePlayer->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
@@ -120,8 +120,7 @@ void NsConcertInstrument::StartPlayingInstrument(Entity* self, Entity* player) {
// Stuff to notify the player
EquipInstruments(self, player);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"startPlaying", 0, 0,
player->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"startPlaying", 0, 0, player->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::PlayCinematic cinematic;
cinematic.target = player->GetObjectID();
cinematic.pathName = cinematics.at(instrumentLot);
@@ -163,8 +162,7 @@ void NsConcertInstrument::StopPlayingInstrument(Entity* self, Entity* player) {
endCinematic.leadOut = 1.0f;
endCinematic.Send(UNASSIGNED_SYSTEM_ADDRESS);
RenderComponent::PlayAnimation(player, smashAnimations.at(instrumentLot), 2.0f);
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stopCheckingMovement", 0, 0,
player->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(self->GetObjectID(), u"stopCheckingMovement", 0, 0, player->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->SetVar<bool>(u"beingPlayed", false);
@@ -288,7 +286,7 @@ void NsConcertInstrument::RepositionPlayer(Entity* self, Entity* player) {
break;
}
GameMessages::SendTeleport(player->GetObjectID(), position, rotation, player->GetSystemAddress());
GameMessages::Teleport(player->GetObjectID(), position, rotation).SendToClient(player->GetSystemAddress());
}
InstrumentLot NsConcertInstrument::GetInstrumentLot(Entity* self) {

View File

@@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "Loot.h"
#include "InventoryMessages.h"
void NsQbImaginationStatue::OnStartup(Entity* self) {

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
void RockHydrantBroken::OnStartup(Entity* self) {
self->AddTimer("playEffect", 1);
@@ -20,7 +21,7 @@ void RockHydrantBroken::OnStartup(Entity* self) {
msg.bActive = true;
msg.Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->AddTimer("KillBroken", 10);
@@ -36,7 +37,7 @@ void RockHydrantBroken::OnTimerDone(Entity* self, std::string timerName) {
msg.bActive = false;
msg.Send(UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision").Send(UNASSIGNED_SYSTEM_ADDRESS);
}
self->Kill();

View File

@@ -2,6 +2,7 @@
#include "Character.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "eMissionState.h"
@@ -25,8 +26,7 @@ void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int mission
} else if (missionState == eMissionState::READY_TO_COMPLETE) {
// Makes the guard disappear once the mission has been completed
const auto zoneControlID = Game::entityManager->GetZoneControlEntity()->GetObjectID();
GameMessages::SendNotifyClientObject(zoneControlID, u"GuardChat", 0, 0, self->GetObjectID(),
"", UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::NotifyClientObject(zoneControlID, u"GuardChat", 0, 0, self->GetObjectID(), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
self->AddCallbackTimer(5.0f, [self]() {
auto spawnerName = self->GetVar<std::string>(u"spawner_name");