mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 04:54:07 +00:00
Track what needs to be done in-source
This commit is contained in:
parent
63ea182f94
commit
bf6766919e
8 changed files with 15 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ local HttpError = require(script.Parent.HttpError)
|
||||||
local ApiContext = {}
|
local ApiContext = {}
|
||||||
ApiContext.__index = ApiContext
|
ApiContext.__index = ApiContext
|
||||||
|
|
||||||
|
-- TODO: Audit cases of errors and create enum values for each of them.
|
||||||
ApiContext.Error = {
|
ApiContext.Error = {
|
||||||
ServerIdMismatch = "ServerIdMismatch",
|
ServerIdMismatch = "ServerIdMismatch",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ local function dprint(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO: Factor out into separate library, especially error handling
|
||||||
local Http = {}
|
local Http = {}
|
||||||
|
|
||||||
function Http.get(url)
|
function Http.get(url)
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@ local function main()
|
||||||
|
|
||||||
local currentSession
|
local currentSession
|
||||||
|
|
||||||
|
-- TODO: More robust session tracking to handle errors
|
||||||
|
-- TODO: Icon!
|
||||||
toolbar:CreateButton("Connect", "Connect to Rojo Session", "")
|
toolbar:CreateButton("Connect", "Connect to Rojo Session", "")
|
||||||
.Click:Connect(function()
|
.Click:Connect(function()
|
||||||
checkUpgrade()
|
checkUpgrade()
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ function Session.new()
|
||||||
|
|
||||||
setmetatable(self, Session)
|
setmetatable(self, Session)
|
||||||
|
|
||||||
|
-- TODO: Rewrite all instance tracking logic and implement a real reconciler
|
||||||
local created = {}
|
local created = {}
|
||||||
|
|
||||||
created["0"] = game:GetService("ReplicatedFirst")
|
created["0"] = game:GetService("ReplicatedFirst")
|
||||||
|
|
||||||
local api
|
local api
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ use std::path::{Path, PathBuf, Component};
|
||||||
|
|
||||||
use partition::Partition;
|
use partition::Partition;
|
||||||
|
|
||||||
|
// TODO: Change backing data structure to use a single allocation with slices
|
||||||
|
// taken out of it for each portion
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct FileRoute {
|
pub struct FileRoute {
|
||||||
pub partition: String,
|
pub partition: String,
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ pub enum Message {
|
||||||
InstanceChanged {
|
InstanceChanged {
|
||||||
id: Id,
|
id: Id,
|
||||||
},
|
},
|
||||||
Error {
|
|
||||||
message: String
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ use session::SessionConfig;
|
||||||
use vfs_session::{VfsSession, FileItem, FileChange};
|
use vfs_session::{VfsSession, FileItem, FileChange};
|
||||||
use message_session::{Message, MessageSession};
|
use message_session::{Message, MessageSession};
|
||||||
|
|
||||||
|
// TODO: Rethink data structure and insertion/update behavior. Maybe break some
|
||||||
|
// pieces off into a new object?
|
||||||
fn file_to_instances(
|
fn file_to_instances(
|
||||||
file_item: &FileItem,
|
file_item: &FileItem,
|
||||||
partition: &Partition,
|
partition: &Partition,
|
||||||
|
|
@ -81,6 +83,8 @@ fn file_to_instances(
|
||||||
output.get_mut(&child_id).unwrap().parent = Some(primary_id);
|
output.get_mut(&child_id).unwrap().parent = Some(primary_id);
|
||||||
|
|
||||||
changed_ids.push(child_id);
|
changed_ids.push(child_id);
|
||||||
|
|
||||||
|
// TODO: Should I stop using drain on Vecs of Copyable types?
|
||||||
for id in child_changed_ids.drain(..) {
|
for id in child_changed_ids.drain(..) {
|
||||||
changed_ids.push(id);
|
changed_ids.push(id);
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +103,7 @@ pub struct RbxSession {
|
||||||
message_session: MessageSession,
|
message_session: MessageSession,
|
||||||
|
|
||||||
/// The RbxInstance that represents each partition.
|
/// The RbxInstance that represents each partition.
|
||||||
|
// TODO: Can this be removed in favor of instances_by_route?
|
||||||
partition_instances: HashMap<String, Id>,
|
partition_instances: HashMap<String, Id>,
|
||||||
|
|
||||||
/// The store of all instances in the session.
|
/// The store of all instances in the session.
|
||||||
|
|
@ -153,6 +158,7 @@ impl RbxSession {
|
||||||
self.message_session.push_messages(&messages);
|
self.message_session.push_messages(&messages);
|
||||||
},
|
},
|
||||||
FileChange::Deleted(route) => {
|
FileChange::Deleted(route) => {
|
||||||
|
// TODO: Handle deletion of children here and in Moved case.
|
||||||
match self.instances_by_route.get(route) {
|
match self.instances_by_route.get(route) {
|
||||||
Some(id) => {
|
Some(id) => {
|
||||||
self.instances.remove(id);
|
self.instances.remove(id);
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,8 @@ pub fn start(config: WebConfig) {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: API to read only specific instances
|
||||||
|
|
||||||
_ => rouille::Response::empty_404()
|
_ => rouille::Response::empty_404()
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue