Add basic movement state to transform packets
Add optional movement-state fields (isMoving, isSprinting, isSneaking, isJumping, weaponDrawn, movementSpeed) to transform packets and wire them end-to-end. Plugin changes: extend F4TNetworking API and RemotePlayerState, derive movement speed/jump state on the game-thread, validate values, include fields when formatting transform JSON, and add throttled remote movement-state logging. main.cpp adds sampling, speed/vertical calculations, jump hold logic, and change-detection to avoid extra sends. Networking parsing (F4TNetworking.cpp) reads optional booleans/floats safely, preserves backwards compatibility, and clears movement-state logs on disconnect. Proxy controller includes a TODO note for future animation use. Server and docs: update protocol and packet docs, dev-log, server README, and fake_client.py to parse/display optional fields safely. Also add several .cursor rule files for coding, documentation, protocol, project overview, and testing guidance. This milestone prepares the data model for later animation/behavior work while keeping existing relay behavior unchanged.
This commit is contained in:
@@ -18,5 +18,11 @@ namespace F4T::Networking
|
||||
bool a_hasCellId = false,
|
||||
std::uint32_t a_cellId = 0,
|
||||
bool a_hasWorldspaceId = false,
|
||||
std::uint32_t a_worldspaceId = 0);
|
||||
std::uint32_t a_worldspaceId = 0,
|
||||
bool a_isMoving = false,
|
||||
bool a_isSprinting = false,
|
||||
bool a_isSneaking = false,
|
||||
bool a_isJumping = false,
|
||||
bool a_weaponDrawn = false,
|
||||
float a_movementSpeed = 0.0F);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,12 @@ namespace F4T::RemotePlayerState
|
||||
std::string worldspaceId;
|
||||
std::optional<double> clientTime;
|
||||
std::optional<double> serverTime;
|
||||
bool isMoving{ false };
|
||||
bool isSprinting{ false };
|
||||
bool isSneaking{ false };
|
||||
bool isJumping{ false };
|
||||
bool weaponDrawn{ false };
|
||||
float movementSpeed{ 0.0F };
|
||||
std::chrono::steady_clock::time_point lastReceivedLocalTime{};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user