mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor encoding logic in ChangeBatcher and enhance duplicate handling
- Updated `encodeInstance` and `encodeService` to utilize helper functions for encoding attributes and tags, improving code organization and readability. - Changed duplicate handling to allow encoding of instances with duplicate-named siblings, with the server managing name collisions through a dedup suffix system. - Added debug logging for duplicate detection to aid in diagnostics. - Streamlined property encoding by implementing a helper function to iterate over encodable properties, enhancing maintainability and consistency. These changes improve the clarity and efficiency of the encoding process while ensuring accurate handling of duplicate instances.
This commit is contained in:
parent
24dec4073d
commit
9d8762bbaf
5 changed files with 274 additions and 188 deletions
|
|
@ -37,9 +37,10 @@ pub const PROTOCOL_VERSION: u64 = 6;
|
|||
/// to the service). The next `ref_target_count` are ObjectValue carriers
|
||||
/// whose `Value` property holds a Ref to the actual target.
|
||||
///
|
||||
/// `refs` maps property names to 1-based indices into this combined range
|
||||
/// (0 = nil). Indices <= child_count point directly to a child instance.
|
||||
/// Indices > child_count point to an ObjectValue carrier.
|
||||
/// `refs` maps property names to 1-based indices into the carrier slice
|
||||
/// (the ObjectValue entries after the children). Index 1 is the first
|
||||
/// carrier, 2 the second, etc. The server reads carriers via
|
||||
/// `carriers[idx - 1]`.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServiceChunk {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue