Introduce an optional timeSync field and event-driven time pushes so host time is only re-applied on connect, resume-from-freeze, or large jumps while weather continues on ~1 Hz heartbeats. Added IsGameTimeFrozen detection and client buffering of latest host time; clients apply host time only when timeSync is true or when gameplay just resumed. Updated networking to read/write timeSync, adjusted F4TWorldStateSync logic (separate time vs weather send/apply paths, changed function signatures and behavior), and updated protocol/docs/changelog and fake_client logging to reflect the new field and behavior.
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace F4T::Networking
|
|
{
|
|
std::string GetLocalPlayerLogPrefix();
|
|
bool ConnectToServer(const char* a_host, std::uint16_t a_port);
|
|
bool ConnectToLocalServer();
|
|
bool ConnectAndValidateServer(const char* a_host, std::uint16_t a_port, std::string& a_error);
|
|
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_isCrouching = false,
|
|
bool a_weaponDrawn = false,
|
|
float a_movementSpeed = 0.0F,
|
|
float a_animationGraphSpeed = -1.0F);
|
|
bool SendWorldStatePacket(
|
|
float a_gameHour,
|
|
float a_gameDaysPassed,
|
|
bool a_hasWeatherFormId,
|
|
std::uint32_t a_weatherFormId,
|
|
bool a_timeSync = false);
|
|
}
|