Clean up warnings, add RojoTree into ServeSession

This commit is contained in:
Lucien Greathouse
2019-09-09 15:17:03 -07:00
parent 3e759b3e8e
commit bb6ab74c19
9 changed files with 23 additions and 21 deletions

View File

@@ -53,11 +53,15 @@ impl ApiService {
/// Get a summary of information about the server
fn handle_api_rojo(&self) -> Response<Body> {
let tree = self.serve_session.tree();
let root_instance_id = tree.get_root_id();
response_json(&ServerInfoResponse {
server_version: SERVER_VERSION.to_owned(),
protocol_version: PROTOCOL_VERSION,
session_id: self.serve_session.session_id(),
expected_place_ids: self.serve_session.serve_place_ids().map(Clone::clone),
expected_place_ids: self.serve_session.serve_place_ids().cloned(),
root_instance_id,
})
}

View File

@@ -2,6 +2,7 @@
use std::collections::HashSet;
use rbx_dom_weak::RbxId;
use serde::{Deserialize, Serialize};
use crate::session_id::SessionId;
@@ -20,7 +21,7 @@ pub struct ServerInfoResponse {
pub server_version: String,
pub protocol_version: u64,
pub expected_place_ids: Option<HashSet<u64>>,
// pub root_instance_id: RbxId,
pub root_instance_id: RbxId,
}
/// Response body from /api/read/{id}