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.
29 lines
635 B
C++
29 lines
635 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace F4T::Networking
|
|
{
|
|
std::string GetLocalPlayerLogPrefix();
|
|
bool ConnectToLocalServer();
|
|
void DisconnectFromLocalServer();
|
|
bool IsConnectedToServer();
|
|
bool SendTransformPacket(
|
|
float a_x,
|
|
float a_y,
|
|
float a_z,
|
|
float a_angleZ,
|
|
const char* a_movementType,
|
|
bool a_hasCellId = false,
|
|
std::uint32_t a_cellId = 0,
|
|
bool a_hasWorldspaceId = false,
|
|
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);
|
|
}
|