[Linux-only] basically bloxstap for sober
at dev 167 lines 3.9 kB view raw
1export type PlrJoinLeaveAction = { 2 name: string; 3 id: string; 4 action: "JOIN" | "LEAVE"; 5}; 6 7export enum ServerType { 8 PUBLIC = "PUBLIC", 9 PRIVATE = "PRIVATE", 10 RESERVED = "RESERVED" 11} 12 13export type fflagValue = string | number | boolean; 14 15export type fflagList = { 16 [flag: string]: fflagValue; 17}; 18 19export type GameJoinAction = { 20 ipAddr: string; 21 /** roblox's proxy ip address */ 22 ipAddrUdmux?: string; 23 placeId: string; 24 jobId: string; 25 serverType: ServerType; 26}; 27 28export type BloxstrapRPCAction = { 29 type: string; 30 data: any; 31}; 32 33export type TeleportAction = { 34 serverType: ServerType; 35}; 36 37export interface Message { 38 command: string; 39 data: any; 40} 41 42// CurrentState API types 43export interface GameState { 44 /** The Roblox Place ID of the current game */ 45 placeId: string; 46 /** The Job ID of the current server instance */ 47 jobId: string; 48 /** The IP address of the server */ 49 ipAddr: string; 50 /** Roblox's proxy IP address (if available) */ 51 ipAddrUdmux?: string; 52 /** The type of server (public, private, reserved) */ 53 serverType: ServerType; 54 /** Whether the user is currently in a game */ 55 isInGame: boolean; 56 /** Timestamp when the game was joined */ 57 joinTime?: number; 58 /** List of players currently in the game */ 59 players: PlayerInfo[]; 60} 61 62export interface PlayerInfo { 63 /** Player's display name */ 64 name: string; 65 /** Player's user ID */ 66 id: string; 67 /** When the player joined (timestamp) */ 68 joinTime: number; 69} 70 71export interface CurrentStateAPI { 72 /** Get the current game state */ 73 getCurrentState(): GameState; 74 /** Subscribe to state changes */ 75 onStateChange(callback: (state: GameState) => void): () => void; 76 /** Check if currently in a game */ 77 isInGame(): boolean; 78 /** Get the current place ID */ 79 getPlaceId(): string | null; 80 /** Get the current job ID */ 81 getJobId(): string | null; 82} 83 84/** 85 * https://vinegarhq.org/Sober/Configuration/index.html 86 */ 87export type SoberConfig = { 88 /** 89 * Enables the service to use gamepads or controllers 90 * @note Will prompt Sober to update Flatpak permissions 91 * @name allow_gamepad_permission 92 * @default false 93 */ 94 allowGamepad?: boolean; 95 96 /** 97 * Bring back the nostalgic 'oof' sound 98 * @name bring_back_oof 99 * @default false 100 */ 101 bringBackOof?: boolean; 102 103 /** 104 * Closes Sober upon leaving a game 105 * @name close_on_leave 106 * @default false 107 */ 108 closeOnLeaave?: boolean; 109 110 /** 111 * Share the game you're playing with your Discord servers and contacts 112 * @name discord_rpc_enabled 113 * @default true 114 */ 115 enableRichPresence?: boolean; 116 117 /** 118 * Enables gamemode, a tool which enhances game performance 119 * @name enable_gamemode 120 * @default true 121 */ 122 enableGamemode?: boolean; 123 124 /** 125 * Scale Sober's game window depending on your screen's pixel density, useful for very high resolution displays/laptops 126 * @name enable_hidpi 127 * @default false 128 */ 129 enableHiDPI?: boolean; 130 131 /** 132 * Show a popup with the location of the gameserver you connected to upon visiting an experience 133 * @name server_location_indicator_enabled 134 * @default false 135 */ 136 serverLocationIndicator?: boolean; 137 138 /** 139 * - "off" - touchscreen is disabled 140 * - "on" - touchscreen is enabled, experiences will use the mobile UI 141 * - "fake-off" - touchscreen is enabled, experiences will use the desktop UI 142 * @name touch_mode 143 * @default "off" 144 */ 145 touchMode?: "off" | "on" | "fake-off"; 146 147 /** 148 * @todo I have NO IDEA what this does - ocbwoy3 149 * @name use_console_experience 150 * @default false 151 */ 152 useConsoleExperience?: boolean; 153 154 /** 155 * use libsecret for storing the session cookie instead of plaintext, experimental 156 * @name use_libsecret 157 * @default false 158 */ 159 useLibsecret?: boolean; 160 161 /** 162 * use OpenGL instead of Vulkan as the graphics API, useful as a workaround for certain issues, like "OutOfMemory" repeated crashes 163 * @name use_opengl 164 * @default false 165 */ 166 useOpenGL?: boolean; 167};