Game
The game Wraith’s in: which one, its files, and its engine. Kinds are names like steam or
unity. Any thread.
Get it with Api.game().
gameInfo(): Wraith.Game.InfolistedGame(): Wraith.Game.Listedsha512(): Promise<string>speed(): numbersetSpeed(speed: number): voidclaimSpeed(handler: Wraith.Game.SpeedHandler, changed: Wraith.Lease.Changed | null): Wraith.LeasesetSpeedControl(on: boolean): voidspeedControl(): booleansetWorld(world: import("salamander").Given<Wraith.Game.World>): voidgameInfo(): Wraith.Game.InfolistedGame(): Wraith.Game.Listedsha512(): salamander.Promisespeed(): numbersetSpeed(speed: number)claimSpeed(handler: Wraith.Game.SpeedHandler, changed: Wraith.Lease.Changed|nil): Wraith.LeasesetSpeedControl(on: boolean)speedControl(): booleansetWorld(world: Wraith.Game.World)Wraith.Game.Info GameInfo()Wraith.Game.Listed ListedGame()System.Threading.Tasks.Task<string> Sha512Async(System.Threading.CancellationToken cancel = default)double Speed()void SetSpeed(double speed)Wraith.Lease? ClaimSpeed(Wraith.Game.SpeedHandler? handler, Wraith.Lease.Changed? changed)void SetSpeedControl(bool on)bool SpeedControl()void SetWorld(Wraith.Game.World world)Wraith::Game_Info gameInfo() constWraith::Game_Listed listedGame() constsal::Future<sal::String, Wraith::GameError> sha512() constdouble speed() constsal::Result<void, Wraith::GameError> setSpeed(double speed) constsal::Result<Wraith::Lease, Wraith::GameError> claimSpeed(Wraith::Game_SpeedHandler handler, Wraith::Lease_Changed changed) constvoid setSpeedControl(bool on) constbool speedControl() constvoid setWorld(Wraith::Game_World world) constpub fn game_info(&self) -> wraith::GameInfopub fn listed_game(&self) -> wraith::GameListedpub fn sha512(&self) -> salamander::Future<salamander::Str, wraith::GameError>pub fn speed(&self) -> f64pub fn set_speed(&self, speed: f64) -> Result<(), wraith::GameError>pub fn claim_speed(&self, handler: wraith::GameSpeedHandler, changed: wraith::LeaseChanged) -> Result<wraith::Lease, wraith::GameError>pub fn set_speed_control(&self, on: bool)pub fn speed_control(&self) -> boolpub fn set_world(&self, world: wraith::GameWorld)fn gameInfo(self: Wraith.Game) Wraith.Game.Infofn listedGame(self: Wraith.Game) Wraith.Game.Listedfn sha512(self: Wraith.Game) rt.Promise((Wraith.GameError || rt.Failure)![]const u8, Wraith.GameErrorCode)fn speed(self: Wraith.Game) f64fn setSpeed(self: Wraith.Game, speed: f64) (Wraith.GameError || rt.Failure)!voidfn claimSpeed(self: Wraith.Game, handler: Wraith.Game.SpeedHandler, changed: ?Wraith.Lease.Changed) (Wraith.GameError || rt.Failure)!Wraith.Leasefn setSpeedControl(self: Wraith.Game, on: bool) voidfn speedControl(self: Wraith.Game) boolfn setWorld(self: Wraith.Game, world: Wraith.Game.World) voidWraith_Game_Info Wraith_Game_gameInfo(Wraith_Game self)Wraith_Game_Listed Wraith_Game_listedGame(Wraith_Game self)sal_Promise Wraith_Game_sha512(Wraith_Game self)double Wraith_Game_speed(Wraith_Game self)uint32_t Wraith_Game_setSpeed(Wraith_Game self, double speed)uint32_t Wraith_Game_claimSpeed(Wraith_Game self, Wraith_Game_SpeedHandler handler, Wraith_Lease_Changed changed, Wraith_Lease *out)void Wraith_Game_setSpeedControl(Wraith_Game self, bool on)bool Wraith_Game_speedControl(Wraith_Game self)void Wraith_Game_setWorld(Wraith_Game self, Wraith_Game_World world)gameInfo
Section titled “gameInfo”Cheap. Fixed once taken, apart from the graphics API and window early on.
Uses Game.Info.
listedGame
Section titled “listedGame”Which of the calling plugin’s wraith.json games Wraith’s in, to pick its code by.
Uses Game.Listed.
sha512
Section titled “sha512”The exe’s SHA-512 in hex, as a manifest’s hashes lists it. Worked out in the background at startup.
Async. Fails with GameError.
1 is normal, 2 twice as fast.
setSpeed
Section titled “setSpeed”Up to 100. Goes through the speed lease holder, else hooks the game’s clocks (down to 0.01). 0 pauses, with a holder. Back to 1 when the setting plugin goes. Some games don’t follow it.
Fails with GameError.
claimSpeed
Section titled “claimSpeed”A lease on the game’s speed, see Lease. While held, handler gets the speed, straight away
with the current one, and 1 when it’s lost or released.
Fails with GameError. Uses Game.SpeedHandler, Lease.Changed, Lease.
setSpeedControl
Section titled “setSpeedControl”Whether the speed can be changed at all. On by default; turning it off resets the speed. A game plugin’s say beats an engine’s, which beats the rest, then the newest, till that plugin goes.
speedControl
Section titled “speedControl”setWorld
Section titled “setWorld”How the game’s world is laid out. Once’s enough; the last set counts till its plugin goes.
Uses Game.World.
GameError
Section titled “GameError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | Failed |
|
| 2 | SpeedOff |
A plugin has speed control off, see setSpeedControl |
Game.Listed
Section titled “Game.Listed”Which of the plugin’s wraith.json games Wraith’s in. Empty if none.
A struct, 0x20 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | name |
string |
Like cs3 |
| 0x10 | schema |
string |
Its namespace in the plugin’s schema family, like Cs3 |
name: stringschema: stringname: stringschema: stringstring Namestring Schemasal::String namesal::String schemapub name: salamander::Strpub schema: salamander::Strname: []const u8schema: []const u8sal_string namesal_string schemaGame.AntiCheat
Section titled “Game.AntiCheat”A struct, 0x20 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Like easy_anti_cheat |
| 0x10 | name |
string |
Like Easy Anti-Cheat |
id: stringname: stringid: stringname: stringstring Idstring Namesal::String idsal::String namepub id: salamander::Strpub name: salamander::Strid: []const u8name: []const u8sal_string idsal_string nameGame.Info
Section titled “Game.Info”A struct, 0xe8 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Like steam-1245620, or Wraith’s own name for games it knows, like ffxiv. unknown if the exe wasn’t found. |
| 0x10 | store |
string |
steam, gog, epic, xbox, itch, or local |
| 0x20 | title |
string |
The store’s name for it, or empty |
| 0x30 | build |
string |
The store’s build, like steam:18234455, as a manifest’s builds lists them. Empty if unknown; only Steam so far. |
| 0x40 | exe |
string |
The exe’s full path |
| 0x50 | dir |
string |
|
| 0x60 | file_version |
string |
From the exe’s version resource, like 1.2.0.0. Often empty. |
| 0x70 | product_version |
string |
|
| 0x80 | game_engine |
string |
Like unity, unreal, godot or rpg_maker, from the files beside the exe. Empty if unknown. |
| 0x90 | game_engine_variant |
string |
Like IL2CPP or Mono for Unity, or MV for RPG Maker. Can be empty. |
| 0xa0 | game_engine_version |
string |
Like 2021.3.16. Can be empty. |
| 0xb0 | anticheat |
[]Game.AntiCheat |
Found beside the game or loaded in it. Wraith doesn’t stop for it. |
| 0xc0 | graphics_api |
string |
Like d3d11 or vulkan. Empty till the first frame. |
| 0xd0 | window |
usize |
The game’s HWND on Windows. 0 till it’s found. |
| 0xd8 | wraith_version |
string |
Like 0.4.0 |
id: stringstore: stringtitle: stringbuild: stringexe: stringdir: stringfile_version: stringproduct_version: stringgame_engine: stringgame_engine_variant: stringgame_engine_version: stringanticheat: Array<Wraith.Game.AntiCheat>graphics_api: stringwindow: numberwraith_version: stringid: stringstore: stringtitle: stringbuild: stringexe: stringdir: stringfile_version: stringproduct_version: stringgame_engine: stringgame_engine_variant: stringgame_engine_version: stringanticheat: (Wraith.Game.AntiCheat)[]graphics_api: stringwindow: integerwraith_version: stringstring Idstring Storestring Titlestring Buildstring Exestring Dirstring FileVersionstring ProductVersionstring GameEnginestring GameEngineVariantstring GameEngineVersionWraith.Game.AntiCheat[] Anticheatstring GraphicsApinuint Windowstring WraithVersionsal::String idsal::String storesal::String titlesal::String buildsal::String exesal::String dirsal::String file_versionsal::String product_versionsal::String game_enginesal::String game_engine_variantsal::String game_engine_versionsal::Slice<Wraith::Game_AntiCheat> anticheatsal::String graphics_apiuintptr_t windowsal::String wraith_versionpub id: salamander::Strpub store: salamander::Strpub title: salamander::Strpub build: salamander::Strpub exe: salamander::Strpub dir: salamander::Strpub file_version: salamander::Strpub product_version: salamander::Strpub game_engine: salamander::Strpub game_engine_variant: salamander::Strpub game_engine_version: salamander::Strpub anticheat: salamander::Slice<wraith::GameAntiCheat>pub graphics_api: salamander::Strpub window: usizepub wraith_version: salamander::Strid: []const u8store: []const u8title: []const u8build: []const u8exe: []const u8dir: []const u8file_version: []const u8product_version: []const u8game_engine: []const u8game_engine_variant: []const u8game_engine_version: []const u8anticheat: []const Wraith.Game.AntiCheatgraphics_api: []const u8window: usizewraith_version: []const u8sal_string idsal_string storesal_string titlesal_string buildsal_string exesal_string dirsal_string file_versionsal_string product_versionsal_string game_enginesal_string game_engine_variantsal_string game_engine_versionSlice_Wraith_Game_AntiCheat anticheatsal_string graphics_apiuintptr_t windowsal_string wraith_versionGame.Axis
Section titled “Game.Axis”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | pos_y |
|
| 1 | neg_y |
|
| 2 | pos_z |
|
| 3 | neg_z |
|
| 4 | pos_x |
|
| 5 | neg_x |
Game.World
Section titled “Game.World”How the game’s world is laid out, for the free camera and sizing distances like a drag’s.
A struct, 0x8 bytes, aligned to 4.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | up |
Game.Axis |
|
| 0x1 | look |
Game.Axis |
Ahead |
| 0x2 | left_handed |
bool |
|
| 0x4 | metre |
f32 |
Game units per metre, like 100 in Unreal |
up: Wraith.Game.Axis | Wraith.Game.AxisNamelook: Wraith.Game.Axis | Wraith.Game.AxisNameleft_handed: booleanmetre: numberup: Wraith.Game.Axis|Wraith.Game.AxisNamelook: Wraith.Game.Axis|Wraith.Game.AxisNameleft_handed: booleanmetre: numberWraith.Game.Axis UpWraith.Game.Axis LookSalamander.Bool LeftHandedfloat MetreWraith::Game_Axis upWraith::Game_Axis lookbool left_handedfloat metrepub up: wraith::GameAxispub look: wraith::GameAxispub left_handed: boolpub metre: f32up: Wraith.Game.Axislook: Wraith.Game.Axisleft_handed: boolmetre: f32Wraith_Game_Axis upWraith_Game_Axis lookbool left_handedfloat metreGame.SpeedHandler
Section titled “Game.SpeedHandler”Sets the game’s speed the plugin’s own way, like an engine time scale. False falls back to hooking the clocks. Any thread; keep it quick and don’t set the speed from it.
Wraith.Game.SpeedHandlerWraith.Game.SpeedHandlerWraith.Game.SpeedHandlerWraith::Game_SpeedHandlerwraith::GameSpeedHandlerWraith.Game.SpeedHandlerWraith_Game_SpeedHandlerwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
