Add place ID blacklist config (#1021)

This commit is contained in:
Parritz
2025-04-03 11:37:40 -04:00
committed by GitHub
parent 4c4b2dbe17
commit 7dee898400
23 changed files with 56 additions and 39 deletions

View File

@@ -79,6 +79,14 @@ pub struct Project {
#[serde(skip_serializing_if = "Option::is_none")]
pub serve_place_ids: Option<HashSet<u64>>,
/// If specified, contains a set of place IDs that this project is
/// not compatible with when doing live sync.
///
/// This setting is intended to help prevent syncing a Rojo project into the
/// wrong Roblox place.
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_place_ids: Option<HashSet<u64>>,
/// If specified, sets the current place's place ID when connecting to the
/// Rojo server from Roblox Studio.
#[serde(skip_serializing_if = "Option::is_none")]

View File

@@ -208,6 +208,10 @@ impl ServeSession {
self.root_project.serve_place_ids.as_ref()
}
pub fn blocked_place_ids(&self) -> Option<&HashSet<u64>> {
self.root_project.blocked_place_ids.as_ref()
}
pub fn serve_address(&self) -> Option<IpAddr> {
self.root_project.serve_address
}

View File

@@ -64,6 +64,7 @@ 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(),
unexpected_place_ids: self.serve_session.blocked_place_ids().cloned(),
place_id: self.serve_session.place_id(),
game_id: self.serve_session.game_id(),
root_instance_id,

View File

@@ -160,6 +160,7 @@ pub struct ServerInfoResponse {
pub protocol_version: u64,
pub project_name: String,
pub expected_place_ids: Option<HashSet<u64>>,
pub unexpected_place_ids: Option<HashSet<u64>>,
pub game_id: Option<u64>,
pub place_id: Option<u64>,
pub root_instance_id: Ref,