Add gameId and placeId project properties

This commit is contained in:
Lucien Greathouse
2021-04-15 14:27:35 -04:00
parent 98db3b4f08
commit c7ab6c435c
6 changed files with 34 additions and 0 deletions

View File

@@ -57,6 +57,14 @@ pub struct Project {
#[serde(skip_serializing_if = "Option::is_none")]
pub serve_place_ids: Option<HashSet<u64>>,
/// If specified, sets the current place's place ID when connecting to the
/// Rojo server from Roblox Studio.
pub place_id: Option<u64>,
/// If specified, sets the current place's game ID when connecting to the
/// Rojo server from Roblox Studio.
pub game_id: Option<u64>,
/// A list of globs, relative to the folder the project file is in, that
/// match files that should be excluded if Rojo encounters them.
#[serde(default, skip_serializing_if = "Vec::is_empty")]

View File

@@ -195,6 +195,14 @@ impl ServeSession {
self.root_project.serve_port
}
pub fn place_id(&self) -> Option<u64> {
self.root_project.place_id
}
pub fn game_id(&self) -> Option<u64> {
self.root_project.game_id
}
pub fn start_time(&self) -> Instant {
self.start_time
}

View File

@@ -69,6 +69,8 @@ impl ApiService {
session_id: self.serve_session.session_id(),
project_name: self.serve_session.project_name().to_owned(),
expected_place_ids: self.serve_session.serve_place_ids().cloned(),
place_id: self.serve_session.place_id(),
game_id: self.serve_session.game_id(),
root_instance_id,
})
}

View File

@@ -104,6 +104,8 @@ pub struct ServerInfoResponse {
pub protocol_version: u64,
pub project_name: String,
pub expected_place_ids: Option<HashSet<u64>>,
pub game_id: Option<u64>,
pub place_id: Option<u64>,
pub root_instance_id: Ref,
}