mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
Update names in subscribe portion of sync protocol
This commit is contained in:
@@ -93,20 +93,19 @@ impl<F: VfsFetcher> ApiService<F> {
|
||||
let api_messages = messages
|
||||
.into_iter()
|
||||
.map(|message| {
|
||||
let removed_instances = message.removed;
|
||||
let removed = message.removed;
|
||||
|
||||
let mut added_instances = HashMap::new();
|
||||
let mut added = HashMap::new();
|
||||
for id in message.added {
|
||||
let instance = tree.get_instance(id).unwrap();
|
||||
added_instances.insert(id, Instance::from_rojo_instance(instance));
|
||||
added.insert(id, Instance::from_rojo_instance(instance));
|
||||
|
||||
for instance in tree.descendants(id) {
|
||||
added_instances
|
||||
.insert(instance.id(), Instance::from_rojo_instance(instance));
|
||||
added.insert(instance.id(), Instance::from_rojo_instance(instance));
|
||||
}
|
||||
}
|
||||
|
||||
let updated_instances = message
|
||||
let updated = message
|
||||
.updated
|
||||
.into_iter()
|
||||
.map(|update| {
|
||||
@@ -126,9 +125,9 @@ impl<F: VfsFetcher> ApiService<F> {
|
||||
.collect();
|
||||
|
||||
SubscribeMessage {
|
||||
removed_instances,
|
||||
added_instances,
|
||||
updated_instances,
|
||||
removed,
|
||||
added,
|
||||
updated,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -23,9 +23,9 @@ pub const PROTOCOL_VERSION: u64 = 3;
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SubscribeMessage<'a> {
|
||||
pub removed_instances: Vec<RbxId>,
|
||||
pub added_instances: HashMap<RbxId, Instance<'a>>,
|
||||
pub updated_instances: Vec<InstanceUpdate>,
|
||||
pub removed: Vec<RbxId>,
|
||||
pub added: HashMap<RbxId, Instance<'a>>,
|
||||
pub updated: Vec<InstanceUpdate>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user