Utils¶
-
class
steampak.libsteam.resources.utils.
Utils
¶ Exposes various utility methods.
Interface can be accessed through
api.utils
:print(api.utils.ui_language)
-
app_id
¶ Application ID of the current process.
Return type: int
-
battery_power
¶ The amount of battery power left in the current system in % [0..100]. 255 for being on AC power.
Return type: int
-
country_code
¶ 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
E.g: RU.
Return type: str
-
get_universe
(as_str=False)¶ Returns universe the client is connected to. See
Universe
.Parameters: as_str (bool) – Return human-friendly universe name instead of an ID. Return type: int|str
-
ipc_call_count
¶ The number of IPC calls made since the last time this function was called. Used for perf debugging so you can understand how many IPC calls your game makes per frame. Every IPC call is at minimum a thread context switch if not a process one so you want to rate control how often you do them.
Return type: int
-
overlay_enabled
¶ True
if the overlay is running & the user can access it.The overlay process could take a few seconds to start & hook the game process, so this function will initially return
False
while the overlay is loading.Return type: bool
-
seconds_app_active
¶ Number seconds application is active.
Return type: int
-
seconds_computer_active
¶ Number seconds computer is active.
Return type: int
-
server_time
¶ Date and time on server.
Return type: datetime
-
set_notification_position
(position)¶ Sets the position where the overlay instance for the currently calling game should show notifications.
This position is per-game and if this function is called from outside of a game context it will do nothing.
Parameters: position (int) – Position. See NotificationPosition
.
-
ui_language
¶ The language the steam client is running in.
E.g.: russian
Return type: str
-
universe
¶ Universe the client is connected to.
Return type: str
-
vr_mode
¶ True
if Steam itself is running in VR mode.Return type: bool
-