mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 09:15:28 +00:00
feat(moving platform): the server runs movers as live did and answers resyncs with their state
The client's LWOPlatform logic (ArrivedAtWaypoint 0x00c86c30, ProcessStateChange 0x00cce380, GetNextWaypoint, the waypoint speeds) runs on the server: stopped at a waypoint (25 at an end) for its wait, then travelling (2), serialized on arrival and departure as in the NT mover captures; constructions carry the path and the mover state; RequestPlatformResync gets the current state, percent and position. The LOT 9483 timers are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "MovementMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
|
||||
#include "BitStreamUtils.h"
|
||||
#include "CppScripts.h"
|
||||
@@ -120,6 +121,16 @@ namespace GameMessages {
|
||||
}
|
||||
|
||||
void RequestPlatformResync::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||
// A mover answers with where the server has it (live: travelling 2 with its percent and position, or 25 at a
|
||||
// waypoint with the time waited)
|
||||
auto* const platform = entity.GetComponent<MovingPlatformComponent>();
|
||||
if (platform && platform->IsMover()) {
|
||||
PlatformResync resync;
|
||||
resync.target = entity.GetObjectID();
|
||||
platform->FillResync(resync);
|
||||
resync.Send(sysAddr);
|
||||
return;
|
||||
}
|
||||
if (entity.GetLOT() == 6267 || entity.GetLOT() == 16141) return;
|
||||
PlatformResync(entity).Send(sysAddr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user