mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Implement live syncback service properties encoding and enhance syncback functionality
- Introduced a new `encodeService` helper in the plugin to serialize service properties, attributes, tags, and references alongside children data. - Updated the `performSyncback` function to utilize the new encoding method, ensuring all services are processed without child-only restrictions. - Extended the `ServiceChunk` struct to include fields for properties, attributes, tags, and references, improving data handling during syncback. - Modified the `build_dom_from_chunks` function to apply service properties and resolve references when reconstructing the service instances. - Added comprehensive tests to validate the new service properties handling, ensuring accurate synchronization and data integrity. These enhancements significantly improve the live syncback process, allowing for better service data management and consistency.
This commit is contained in:
parent
30e032b27e
commit
72ad84b5a7
16 changed files with 896 additions and 444 deletions
|
|
@ -27,13 +27,31 @@ pub(crate) const SERVER_VERSION: &str = env!("CARGO_PKG_VERSION");
|
|||
/// Current protocol version, which is required to match.
|
||||
pub const PROTOCOL_VERSION: u64 = 6;
|
||||
|
||||
/// A single service's children serialized as rbxm binary data.
|
||||
/// A single service's children serialized as rbxm binary data, plus the
|
||||
/// service's own properties, attributes, tags, and Ref property hints.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServiceChunk {
|
||||
pub class_name: String,
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub data: Vec<u8>,
|
||||
#[serde(default)]
|
||||
pub properties: HashMap<String, Variant>,
|
||||
#[serde(default)]
|
||||
pub attributes: HashMap<String, Variant>,
|
||||
#[serde(default)]
|
||||
pub tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub refs: HashMap<String, ServiceRef>,
|
||||
}
|
||||
|
||||
/// Describes a Ref property target by name and class so the server can resolve
|
||||
/// it among the service's cloned children.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServiceRef {
|
||||
pub name: String,
|
||||
pub class_name: String,
|
||||
}
|
||||
|
||||
/// Incoming request from the plugin for live syncback.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue