mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
refactor: death, stun, buff and knockback game messages as structs
Converts the combat messages to NetGameMsgs in CombatMessages.{h,cpp}:
Die, Resurrect, SetResurrectRestoreValues, SetPlayerAllowedRespawn
(SendToClient, as before), Knockback, SetStunned, SetStunImmunity,
SetStatusImmunity, AddBuff, RemoveBuff, AddRunSpeedModifier,
RemoveRunSpeedModifier and DeactivateBubbleBuffFromServer, and the
received RequestDie, RequestSmashPlayer, RequestResurrect, Resurrect,
ActivateBubbleBuff and DeactivateBubbleBuff. Smash and UnSmash move
here from GameMessages.h (Smash's ghostCapacity is ghostOpacity, the
client's name) and gain a Deserialize.
The callers (DestroyableComponent, BuffComponent,
ControllablePhysicsComponent, QuickBuildComponent, RacingControl,
RailActivator and the scripts) build the structs. SendResurrect's
respawn timer moves to DestroyableComponent::Resurrect. The received
messages are registered in GameMessageHandler's map and their switch
cases are deleted, along with the unused HandleRequestDie overload and
the Send* functions nothing called (SendSmash, SendUnSmash, the run
speed modifiers, SendActivateBubbleBuffFromServer). Handler logic is
unchanged.
No wire change and no change in recipients. Verified byte for byte
against a frozen verbatim copy of the old functions over an input grid
(every optional field, bool patterns, empty and long strings), received
messages compared with the old handlers' read sequences and truncated
payloads rejected, hand computed golden bytes, round trips, and a
deliberate width mutation made the tests fail.
Known difference from the client, not changed here: DLU writes
SetStatusImmunity's nine flags in its own order; the client reads them
alphabetically (GameMessage::SetStatusImmunity::Serialize @ 00d8f140).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "SkillComponent.h"
|
||||
@@ -139,9 +140,19 @@ void BaseEnemyApe::StunApe(Entity* self, bool stunState) {
|
||||
skillComponent->Interrupt();
|
||||
}
|
||||
|
||||
GameMessages::SendSetStunned(self->GetObjectID(), stunState ? eStateChangeType::PUSH : eStateChangeType::POP, UNASSIGNED_SYSTEM_ADDRESS, self->GetObjectID(),
|
||||
true, true, true, true, true,
|
||||
true, true, true, true);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = self->GetObjectID();
|
||||
stun.StateChangeType = stunState ? eStateChangeType::PUSH : eStateChangeType::POP;
|
||||
stun.Originator = self->GetObjectID();
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.bDontTerminateInteract = true;
|
||||
stun.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetBoolean(u"knockedOut", stunState);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AmSkullkinDrill.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ProximityMonitorComponent.h"
|
||||
@@ -165,9 +166,15 @@ void AmSkullkinDrill::FreezePlayer(Entity* self, Entity* player, bool bFreeze) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendSetStunned(player->GetObjectID(), StateChangeType, player->GetSystemAddress(), self->GetObjectID(),
|
||||
true, false, true, false, true, false, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = player->GetObjectID();
|
||||
stun.StateChangeType = StateChangeType;
|
||||
stun.Originator = self->GetObjectID();
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AmSkullkinDrillStand.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "dpEntity.h"
|
||||
#include "Entity.h"
|
||||
#include "RenderComponent.h"
|
||||
@@ -30,7 +31,12 @@ void AmSkullkinDrillStand::OnProximityUpdate(Entity* self, Entity* entering, std
|
||||
|
||||
NiPoint3 newVec = { (objPos.x - myPos.x) * 4.5f, 15, (objPos.z - myPos.z) * 4.5f };
|
||||
|
||||
GameMessages::SendKnockback(entering->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
|
||||
GameMessages::Knockback knockback;
|
||||
knockback.target = entering->GetObjectID();
|
||||
knockback.Caster = self->GetObjectID();
|
||||
knockback.Originator = self->GetObjectID();
|
||||
knockback.vector = newVec;
|
||||
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::PlayFXEffect(entering->GetObjectID(), 1378, u"create", "pushBack").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "RaceMaelstromGeiser.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "PossessableComponent.h"
|
||||
#include "PossessorComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -56,7 +57,12 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
}
|
||||
|
||||
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
GameMessages::Die die;
|
||||
die.target = vehicle->GetObjectID();
|
||||
die.bClientDeath = true;
|
||||
die.bSpawnLoot = false;
|
||||
die.killerID = self->GetObjectID();
|
||||
die.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "GfCaptainsCannon.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
@@ -17,9 +18,18 @@ void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
|
||||
self->SetVar<bool>(u"bIsInUse", true);
|
||||
self->SetNetworkVar<bool>(u"bIsInUse", true);
|
||||
|
||||
GameMessages::SendSetStunned(user->GetObjectID(), eStateChangeType::PUSH, user->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = user->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.bDontTerminateInteract = true;
|
||||
stun.Send(user->GetSystemAddress());
|
||||
|
||||
auto position = self->GetPosition();
|
||||
auto forward = QuatUtils::Forward(self->GetRotation());
|
||||
@@ -73,9 +83,18 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
ambientSound.audioGUID = "{7457d85c-4537-4317-ac9d-2f549219ea87}";
|
||||
ambientSound.SendToClient(player->GetSystemAddress());
|
||||
} else if (timerName == "cinematicTimer") {
|
||||
GameMessages::SendSetStunned(playerId, eStateChangeType::POP, player->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerId;
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.bDontTerminateInteract = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
self->SetVar<bool>(u"bIsInUse", false);
|
||||
self->SetNetworkVar<bool>(u"bIsInUse", false);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "Preconditions.h"
|
||||
#include "eEndBehavior.h"
|
||||
#include "DestroyableComponent.h"
|
||||
@@ -21,9 +22,17 @@ void MastTeleport::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (Preconditions::Check(target, 154) && Preconditions::Check(target, 44)) {
|
||||
self->SetVar<LWOOBJID>(u"userID", target->GetObjectID());
|
||||
|
||||
GameMessages::SendSetStunned(target->GetObjectID(), eStateChangeType::PUSH, target->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = target->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(target->GetSystemAddress());
|
||||
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetStatusImmunity(eStateChangeType::PUSH, true, true, true, true, true, false, false, true, true);
|
||||
|
||||
@@ -92,9 +101,17 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
GameMessages::SendTeleport(playerId, position, QuatUtils::IDENTITY, player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendSetStunned(playerId, eStateChangeType::POP, player->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerId;
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetStatusImmunity(eStateChangeType::POP, true, true, true, true, true, false, false, true, true);
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NtAssemblyTubeServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
@@ -42,9 +43,17 @@ void NtAssemblyTubeServer::RunAssemblyTube(Entity* self, Entity* player) {
|
||||
if (player->IsPlayer() && !bPlayerBeingTeleported) {
|
||||
auto teleCinematic = self->GetVar<std::u16string>(u"Cinematic");
|
||||
|
||||
GameMessages::SendSetStunned(playerID, eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerID;
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
if (!teleCinematic.empty()) {
|
||||
const auto teleCinematicUname = teleCinematic;
|
||||
@@ -124,7 +133,15 @@ void NtAssemblyTubeServer::UnlockPlayer(Entity* self, Entity* player) {
|
||||
|
||||
m_TeleportingPlayerTable[playerID] = false;
|
||||
|
||||
GameMessages::SendSetStunned(playerID, eStateChangeType::POP, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerID;
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NtParadoxPanelServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Character.h"
|
||||
@@ -40,11 +41,23 @@ 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::SendSetStunned(player->GetObjectID(), eStateChangeType::POP, player->GetSystemAddress(), LWOOBJID_EMPTY, false, false, true, false, true, true, false, false, true);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = player->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
self->SetVar(u"bActive", false);
|
||||
});
|
||||
RenderComponent::PlayAnimation(user, u"nexus-powerpanel", 6.0f);
|
||||
GameMessages::SendSetStunned(user->GetObjectID(), eStateChangeType::PUSH, user->GetSystemAddress(), LWOOBJID_EMPTY, false, false, true, false, true, true, false, false, true);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = user->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.Send(user->GetSystemAddress());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,7 +65,12 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
const auto dir = QuatUtils::Right(self->GetRotation());
|
||||
|
||||
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, { dir.x * 15, 5, dir.z * 15 });
|
||||
GameMessages::Knockback knockback;
|
||||
knockback.target = user->GetObjectID();
|
||||
knockback.Caster = self->GetObjectID();
|
||||
knockback.Originator = self->GetObjectID();
|
||||
knockback.vector = NiPoint3{ dir.x * 15, 5, dir.z * 15 };
|
||||
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 6432, u"create", "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NtParadoxTeleServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
@@ -26,9 +27,17 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
const auto bPlayerBeingTeleported = m_TeleportingPlayerTable[playerID];
|
||||
|
||||
if (player->IsPlayer() && !bPlayerBeingTeleported) {
|
||||
GameMessages::SendSetStunned(playerID, eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerID;
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
auto animTime = RenderComponent::PlayAnimation(player, u"teledeath", 4.0f);
|
||||
if (animTime == 0.0f) animTime = 2.0f;
|
||||
@@ -106,9 +115,17 @@ void NtParadoxTeleServer::UnlockPlayer(Entity* self, Entity* player) {
|
||||
|
||||
m_TeleportingPlayerTable[playerID] = false;
|
||||
|
||||
GameMessages::SendSetStunned(playerID, eStateChangeType::POP, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerID;
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
auto teleCinematic = self->GetVar<std::u16string>(u"Cinematic");
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "NtVentureCannonServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Entity.h"
|
||||
#include "GeneralUtils.h"
|
||||
@@ -21,9 +22,17 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
self->SetNetworkVar(u"bIsInUse", true);
|
||||
|
||||
GameMessages::SendSetStunned(playerID, eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = playerID;
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
auto destPosition = self->GetPosition();
|
||||
|
||||
@@ -117,9 +126,17 @@ void NtVentureCannonServer::ExitCannonEnded(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
void NtVentureCannonServer::UnlockCannonPlayer(Entity* self, Entity* player) {
|
||||
GameMessages::SendSetStunned(player->GetObjectID(), eStateChangeType::POP, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = player->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
self->SetNetworkVar(u"bIsInUse", false);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "FlameJetServer.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
|
||||
void FlameJetServer::OnStartup(Entity* self) {
|
||||
if (self->GetVar<bool>(u"NotActive")) {
|
||||
@@ -33,7 +34,13 @@ void FlameJetServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
dir.x = -dir.x * 15;
|
||||
dir.z = -dir.z * 15;
|
||||
|
||||
GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 1000, dir);
|
||||
GameMessages::Knockback knockback;
|
||||
knockback.target = target->GetObjectID();
|
||||
knockback.Caster = self->GetObjectID();
|
||||
knockback.Originator = self->GetObjectID();
|
||||
knockback.iKnockBackTimeMS = 1000;
|
||||
knockback.vector = dir;
|
||||
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void FlameJetServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "BaseConsoleTeleportServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "CharacterComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -28,10 +29,18 @@ void BaseConsoleTeleportServer::BaseOnMessageBoxResponse(Entity* self, Entity* s
|
||||
|
||||
if (button == 1) {
|
||||
|
||||
GameMessages::SendSetStunned(
|
||||
player->GetObjectID(), eStateChangeType::PUSH, player->GetSystemAddress(), player->GetObjectID(),
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = player->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.Originator = player->GetObjectID();
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
const auto teleportFXID = self->GetVar<int32_t>(u"teleportEffectID");
|
||||
|
||||
@@ -94,10 +103,18 @@ void BaseConsoleTeleportServer::TransferPlayer(Entity* self, Entity* player, int
|
||||
return;
|
||||
}
|
||||
|
||||
GameMessages::SendSetStunned(
|
||||
player->GetObjectID(), eStateChangeType::POP, player->GetSystemAddress(), player->GetObjectID(),
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = player->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.Originator = player->GetObjectID();
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.Send(player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID());
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "BaseWavesServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "ActivityMessages.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -22,7 +23,10 @@ void BaseWavesServer::SetGameVariables(Entity* self) {
|
||||
// Done
|
||||
void BaseWavesServer::BasePlayerLoaded(Entity* self, Entity* player) {
|
||||
GameMessages::SendPlayerSetCameraCyclingMode(player->GetObjectID(), player->GetSystemAddress());
|
||||
GameMessages::SendPlayerAllowedRespawn(player->GetObjectID(), true, player->GetSystemAddress());
|
||||
GameMessages::SetPlayerAllowedRespawn allowedRespawn;
|
||||
allowedRespawn.target = player->GetObjectID();
|
||||
allowedRespawn.dontPromptForRespawn = true;
|
||||
allowedRespawn.SendToClient(player->GetSystemAddress());
|
||||
|
||||
state.waitingPlayers.push_back(player->GetObjectID());
|
||||
state.players.push_back(player->GetObjectID());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "PersonalFortress.h"
|
||||
#include "GameMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "ControllablePhysicsComponent.h"
|
||||
@@ -22,9 +23,18 @@ void PersonalFortress::OnStartup(Entity* self) {
|
||||
true, true, true, true, true, true
|
||||
);
|
||||
|
||||
GameMessages::SendSetStunned(owner->GetObjectID(), eStateChangeType::PUSH, owner->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = owner->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::PUSH;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.bDontTerminateInteract = true;
|
||||
stun.Send(owner->GetSystemAddress());
|
||||
|
||||
Game::entityManager->SerializeEntity(owner);
|
||||
}
|
||||
@@ -43,9 +53,18 @@ void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
||||
true, true, true, true, true, true
|
||||
);
|
||||
|
||||
GameMessages::SendSetStunned(owner->GetObjectID(), eStateChangeType::POP, owner->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true, true, true, true
|
||||
);
|
||||
GameMessages::SetStunned stun;
|
||||
stun.target = owner->GetObjectID();
|
||||
stun.StateChangeType = eStateChangeType::POP;
|
||||
stun.bCantAttack = true;
|
||||
stun.bCantEquip = true;
|
||||
stun.bCantInteract = true;
|
||||
stun.bCantJump = true;
|
||||
stun.bCantMove = true;
|
||||
stun.bCantTurn = true;
|
||||
stun.bCantUseItem = true;
|
||||
stun.bDontTerminateInteract = true;
|
||||
stun.Send(owner->GetSystemAddress());
|
||||
|
||||
Game::entityManager->SerializeEntity(owner);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "ActVehicleDeathTrigger.h"
|
||||
#include "PossessableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "RacingControlComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -40,7 +41,12 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
|
||||
GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0);
|
||||
GameMessages::Die die;
|
||||
die.target = vehicle->GetObjectID();
|
||||
die.bClientDeath = true;
|
||||
die.bSpawnLoot = false;
|
||||
die.killerID = self->GetObjectID();
|
||||
die.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto* zoneController = Game::zoneManager->GetZoneControlObject();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AgShipPlayerShockServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "eTerminateType.h"
|
||||
@@ -12,7 +13,12 @@ void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
active = true;
|
||||
RenderComponent::PlayAnimation(user, shockAnim);
|
||||
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, NiPoint3(-20, 10, -20));
|
||||
GameMessages::Knockback knockback;
|
||||
knockback.target = user->GetObjectID();
|
||||
knockback.Caster = self->GetObjectID();
|
||||
knockback.Originator = self->GetObjectID();
|
||||
knockback.vector = NiPoint3(-20, 10, -20);
|
||||
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 1430, u"create", "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("FXTime", fxTime);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CombatMessages.h"
|
||||
|
||||
#include "RenderComponent.h"
|
||||
|
||||
@@ -44,7 +45,10 @@ void AgSpiderBossMessage::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
forward.y += 15;
|
||||
forward.x *= 100;
|
||||
forward.z *= 100;
|
||||
GameMessages::SendKnockback(target->GetObjectID(), LWOOBJID_EMPTY, LWOOBJID_EMPTY, 0, forward);
|
||||
GameMessages::Knockback knockback;
|
||||
knockback.target = target->GetObjectID();
|
||||
knockback.vector = forward;
|
||||
knockback.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
if (box.isTouch || box.isDisplayed) return;
|
||||
box.boxSelf = self->GetObjectID();
|
||||
|
||||
Reference in New Issue
Block a user