- Made F4AnimationDescriptor constructor public - Fixed logging macros by using std::string_view and renaming helpers - Fixed int32_t/uint32_t type mismatch in animation variable reads/writes - Disabled actor state flag setting (needs bitfield mapping in Phase 7) - Disabled dynamic spawn APIs pending CommonLibF4 verification (Phase 7) - Added move semantics to RemoteActionQueue for ProxyActorSlot Build status: clean compilation, Phase 6 testing ready with pre-placed proxies Co-authored-by: Cursor <cursoragent@cursor.com>
68 lines
2.4 KiB
C++
68 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
#include <chrono>
|
|
|
|
#include "F4AnimationDescriptor.h"
|
|
#include "RE/A/Actor.h"
|
|
#include "RE/A/ActorState.h"
|
|
|
|
namespace F4T::RemoteActionComponent
|
|
{
|
|
// Represents a remote action event to be replayed on a proxy actor
|
|
// Includes animation state snapshot and actor state at the time of capture
|
|
struct RemoteActionSnapshot
|
|
{
|
|
std::uint32_t actionType{}; // Action enum value
|
|
std::string eventName; // Human-readable event name
|
|
AnimationDescriptor::AnimationVariableSnapshot animationVariables; // Graph variables at action time
|
|
std::uint32_t actorStateFlags1{}; // Actor state flags1 at action time
|
|
std::uint32_t actorStateFlags2{}; // Actor state flags2 at action time
|
|
std::chrono::steady_clock::time_point captureTime{}; // When action was captured
|
|
};
|
|
|
|
// Manages action queue for a single remote player's proxy actor
|
|
// Queues discrete actions and replays them with proper state synchronization
|
|
class RemoteActionQueue
|
|
{
|
|
public:
|
|
// Initialize empty queue
|
|
RemoteActionQueue() = default;
|
|
|
|
// Prevent copies
|
|
RemoteActionQueue(const RemoteActionQueue&) = delete;
|
|
RemoteActionQueue& operator=(const RemoteActionQueue&) = delete;
|
|
|
|
// Enable moves
|
|
RemoteActionQueue(RemoteActionQueue&&) noexcept = default;
|
|
RemoteActionQueue& operator=(RemoteActionQueue&&) noexcept = default;
|
|
|
|
// Enqueue an action for replay
|
|
void Enqueue(const RemoteActionSnapshot& a_action);
|
|
|
|
// Clear all pending actions
|
|
void Clear();
|
|
|
|
// Get number of pending actions
|
|
std::size_t GetPendingActionCount() const { return m_actionQueue.size(); }
|
|
|
|
// Replay next action on proxy actor
|
|
// Returns true if an action was replayed, false if queue empty
|
|
bool ReplayNextAction(RE::Actor& a_proxy);
|
|
|
|
private:
|
|
std::vector<RemoteActionSnapshot> m_actionQueue;
|
|
std::size_t m_maxQueueSize{ 16 }; // Prevent excessive queuing
|
|
|
|
// Helper: Apply action state to proxy and trigger animation
|
|
bool ApplyActionToProxy(RE::Actor& a_proxy, const RemoteActionSnapshot& a_action);
|
|
|
|
// Helper: Set actor state flags from snapshot
|
|
void ApplyActorStateFromSnapshot(RE::Actor& a_proxy, const RemoteActionSnapshot& a_action);
|
|
|
|
// Helper: Load animation variables and trigger action animation
|
|
void TriggerActionAnimation(RE::Actor& a_proxy, const RemoteActionSnapshot& a_action);
|
|
};
|
|
}
|