pub struct ViewerConfig {
pub account: String,
pub host: IpAddr,
pub port: u16,
pub view_distance: u8,
pub idle: Duration,
pub token: Option<String>,
pub replay_dir: Option<PathBuf>,
pub cache_dir: PathBuf,
pub client_jar: Option<PathBuf>,
pub entities: EntityTracking,
}Expand description
Viewer options.
Fields§
§account: StringShown on the page (the bot’s name).
host: IpAddrListen address (default 127.0.0.1: put a proxy with access control in front for remote use).
port: u16Port (0 = any free port).
view_distance: u8Columns sent around the bot: a (2d − 1)² square, 1..=12 (default 8 → 15×15).
idle: DurationStop the server after this long without a page (default 60 s).
token: Option<String>Required on every request as Authorization: Bearer <token>, ?token=<token> (the page
then keeps it in a cookie) or that cookie. None: no check (fine on 127.0.0.1).
replay_dir: Option<PathBuf>Recordings folder (/replays, ?replay=); None: no replays.
cache_dir: PathBufCache folder for the client jar, extracted textures and built assets
(default .cache/ghast-viewer).
client_jar: Option<PathBuf>A local vanilla 1.8.9 client jar; None: downloaded from Mojang into the cache.
entities: EntityTrackingWhen to track entities, the tab list and skins for the page (default
EntityTracking::Always).
Implementations§
Source§impl ViewerConfig
impl ViewerConfig
Sourcepub fn view_distance(self, d: u8) -> Self
pub fn view_distance(self, d: u8) -> Self
Sets the view distance (clamped to 1..=12).
Sourcepub fn replay_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn replay_dir(self, dir: impl Into<PathBuf>) -> Self
Sets the recordings folder.
Sourcepub fn client_jar(self, jar: impl Into<PathBuf>) -> Self
pub fn client_jar(self, jar: impl Into<PathBuf>) -> Self
Uses a local client jar.
Sourcepub fn entities(self, e: EntityTracking) -> Self
pub fn entities(self, e: EntityTracking) -> Self
Sets when entities are tracked.