Update SyncbackRequest structure and API protocol validation

- Changed the `protocol_version` and `place_id` fields in the `SyncbackRequest` struct from `u64` to `f64` to accommodate Luau's numeric representation.
- Updated the API's protocol version validation to compare the `syncback_request.protocol_version` as a `u64`, ensuring compatibility with the expected protocol version.
- Enhanced type handling for `place_id` to maintain consistency in the syncback process.

These changes improve the handling of numeric fields in syncback requests, aligning with the requirements of the Luau environment.
This commit is contained in:
Joe 2026-02-18 05:32:46 -06:00
parent fa2b86c3d9
commit 372a422b3d
2 changed files with 10 additions and 5 deletions

View file

@ -37,12 +37,15 @@ pub struct ServiceChunk {
}
/// Incoming request from the plugin for live syncback.
/// Numeric fields use `f64` because Luau has no integer type -- all numbers
/// are IEEE 754 doubles, and large values (like place IDs) get encoded as
/// msgpack float64 which rmp_serde cannot coerce into u64.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SyncbackRequest {
pub protocol_version: u64,
pub protocol_version: f64,
pub server_version: String,
pub place_id: Option<u64>,
pub place_id: Option<f64>,
pub services: Vec<ServiceChunk>,
}