Steam๏ƒ

Inherits: Object

Steamworks integration for Web API session ticket generation and backend authentication.

Description๏ƒ

The Steam singleton dynamically loads the Steam API library at runtime. If the library is not found, all methods fail gracefully without crashing.

Use request_web_api_ticket() to obtain a ticket for ISteamUserAuth/AuthenticateUserTicket, then authenticate_with_server() to exchange it for a JWT from your backend.

Methods๏ƒ

bool

add_promo_item(def_id: int)

bool

add_promo_items(def_ids: PackedInt32Array)

SteamAuthResult

authenticate_with_server(url: String, ticket: String, app_id: int)

void

cancel_auth_ticket(handle: int)

bool

clear_achievement(name: String)

void

clear_debug_log()

bool

clear_stat(name: String)

bool

consume_item(instance_id: int, quantity: int)

int

deserialize_inventory(bytes: PackedByteArray, expected_steam_id: int = 0)

bool

exchange_items(generate_def_ids: PackedInt32Array, generate_quantities: PackedInt32Array, destroy_instance_ids: PackedInt64Array, destroy_quantities: PackedInt32Array)

Array

find_items_by_def_id(def_id: int)

bool

get_achievement(name: String) const

SteamAchievementInfo

get_achievement_info(name: String, include_icon: bool = true)

Array

get_all_achievements(include_icons: bool = false)

Array

get_all_item_definitions()

Array

get_all_items()

Image

get_avatar_image(steam_id: int = 0, size: AvatarSize = 2)

Array

get_debug_log() const

PackedInt32Array

get_eligible_promo_item_definition_ids(steam_id: int = 0)

Array

get_inventory_result_items(result_handle: int)

int

get_inventory_result_status(result_handle: int)

SteamItemDefinition

get_item_definition(def_id: int)

Image

get_item_definition_icon(def_id: int)

PackedInt32Array

get_item_definition_ids()

Array

get_items_by_id(instance_ids: PackedInt64Array)

int

get_local_steam_id() const

int

get_pending_auth_ticket_handle() const

String

get_pending_hex_ticket() const

String

get_pending_ticket_error() const

String

get_persona_name() const

float

get_stat_float(name: String) const

int

get_stat_int(name: String) const

TicketState

get_ticket_state() const

bool

grant_promo_items()

bool

has_inventory_support() const

bool

increment_stat_int(name: String, delta: int)

Error

initialize(app_id: int = 0)

bool

is_available()

bool

is_debug_logging_enabled() const

bool

is_initialized() const

bool

is_logged_on() const

bool

load_item_definitions()

void

poll_callbacks()

bool

refresh_current_stats()

bool

remove_property(instance_id: int, property_name: String)

bool

request_current_stats()

bool

request_item_definitions(timeout_sec: float = 15.0)

void

request_web_api_ticket(identity: String = "blazium")

PackedByteArray

serialize_inventory_result(result_handle: int)

bool

set_achievement(name: String)

void

set_debug_logging(enabled: bool)

bool

set_property_bool(instance_id: int, property_name: String, value: bool)

bool

set_property_float(instance_id: int, property_name: String, value: float)

bool

set_property_int64(instance_id: int, property_name: String, value: int)

bool

set_property_string(instance_id: int, property_name: String, value: String)

bool

set_stat_float(name: String, value: float)

bool

set_stat_int(name: String, value: int)

void

shutdown()

bool

start_property_update()

bool

store_stats()

bool

submit_property_update()

bool

transfer_item_quantity(source_instance_id: int, quantity: int, dest_instance_id: int)

bool

trigger_item_drop(drop_list_definition: int)


Signals๏ƒ

inventory_definitions_updated() ๐Ÿ”—

There is currently no description for this signal. Please help us by contributing one!


inventory_full_update(result_handle: int) ๐Ÿ”—

There is currently no description for this signal. Please help us by contributing one!


inventory_result_ready(result_handle: int, result_code: int) ๐Ÿ”—

There is currently no description for this signal. Please help us by contributing one!


web_api_ticket_failed(error_message: String) ๐Ÿ”—

Emitted when request_web_api_ticket() fails.


web_api_ticket_ready(hex_ticket: String, auth_ticket_handle: int) ๐Ÿ”—

Emitted when a Web API session ticket is ready.


Enumerations๏ƒ

enum TicketState: ๐Ÿ”—

TicketState TICKET_STATE_IDLE = 0

No ticket request is active.

TicketState TICKET_STATE_PENDING = 1

A ticket request is in progress.

TicketState TICKET_STATE_READY = 2

The latest ticket request succeeded.

TicketState TICKET_STATE_FAILED = 3

The latest ticket request failed.


enum AvatarSize: ๐Ÿ”—

AvatarSize AVATAR_SIZE_SMALL = 0

Small avatar (32x32).

AvatarSize AVATAR_SIZE_MEDIUM = 1

Medium avatar (64x64).

AvatarSize AVATAR_SIZE_LARGE = 2

Large avatar (184x184).


Method Descriptions๏ƒ

bool add_promo_item(def_id: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool add_promo_items(def_ids: PackedInt32Array) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


SteamAuthResult authenticate_with_server(url: String, ticket: String, app_id: int) ๐Ÿ”—

POSTs the hex-encoded session ticket to the auth server and returns the parsed response.


void cancel_auth_ticket(handle: int) ๐Ÿ”—

Cancels a previously issued auth ticket handle.


bool clear_achievement(name: String) ๐Ÿ”—

Clears an achievement for the local user in memory. Call store_stats() to persist.


void clear_debug_log() ๐Ÿ”—

Clears the in-memory debug log buffer.


bool clear_stat(name: String) ๐Ÿ”—

Sets a numeric stat to 0 in memory. Call store_stats() to persist.


bool consume_item(instance_id: int, quantity: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


int deserialize_inventory(bytes: PackedByteArray, expected_steam_id: int = 0) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool exchange_items(generate_def_ids: PackedInt32Array, generate_quantities: PackedInt32Array, destroy_instance_ids: PackedInt64Array, destroy_quantities: PackedInt32Array) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


Array find_items_by_def_id(def_id: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool get_achievement(name: String) const ๐Ÿ”—

Returns whether the local user has unlocked the named achievement.


SteamAchievementInfo get_achievement_info(name: String, include_icon: bool = true) ๐Ÿ”—

Returns metadata and optional icon for a single achievement.


Array get_all_achievements(include_icons: bool = false) ๐Ÿ”—

Returns an array of SteamAchievementInfo for every achievement defined for the app.


Array get_all_item_definitions() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


Array get_all_items() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


Image get_avatar_image(steam_id: int = 0, size: AvatarSize = 2) ๐Ÿ”—

Returns the user's avatar as an RGBA Image. steam_id 0 uses the local user.


Array get_debug_log() const ๐Ÿ”—

Returns recent debug log lines when debug logging is enabled.


PackedInt32Array get_eligible_promo_item_definition_ids(steam_id: int = 0) ๐Ÿ”—

Returns item definition IDs for promo items the user can still receive. steam_id 0 uses the local user.


Array get_inventory_result_items(result_handle: int) ๐Ÿ”—

Parses SteamInventoryItem entries from a valid inventory result handle (before serialize_inventory_result() or destroy).


int get_inventory_result_status(result_handle: int) ๐Ÿ”—

Returns the Steam result code for an inventory result handle (k_EResult values).


SteamItemDefinition get_item_definition(def_id: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


Image get_item_definition_icon(def_id: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


PackedInt32Array get_item_definition_ids() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


Array get_items_by_id(instance_ids: PackedInt64Array) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


int get_local_steam_id() const ๐Ÿ”—

Returns the local user's 64-bit Steam ID, or 0 if unavailable.


int get_pending_auth_ticket_handle() const ๐Ÿ”—

Returns the auth ticket handle from the last ticket request.


String get_pending_hex_ticket() const ๐Ÿ”—

Returns the hex-encoded ticket from the last successful ticket request.


String get_pending_ticket_error() const ๐Ÿ”—

Returns the error message from the last failed ticket request.


String get_persona_name() const ๐Ÿ”—

Returns the local user's Steam persona (display) name.


float get_stat_float(name: String) const ๐Ÿ”—

Returns the current float stat value, or 0.0 if unavailable.


int get_stat_int(name: String) const ๐Ÿ”—

Returns the current integer stat value, or -1 if unavailable.


TicketState get_ticket_state() const ๐Ÿ”—

Returns the current ticket request state.


bool grant_promo_items() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool has_inventory_support() const ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool increment_stat_int(name: String, delta: int) ๐Ÿ”—

Increments an integer stat in memory by 1. delta must be 1. Call store_stats() to persist.


Error initialize(app_id: int = 0) ๐Ÿ”—

Loads and initializes the Steam API. app_id sets SteamAppId when greater than zero.


bool is_available() ๐Ÿ”—

Returns true when the Steam API library was found and loaded.


bool is_debug_logging_enabled() const ๐Ÿ”—

Returns whether debug logging is enabled.


bool is_initialized() const ๐Ÿ”—

Returns true after a successful initialize() call.


bool is_logged_on() const ๐Ÿ”—

Returns whether the local Steam user is logged on.


bool load_item_definitions() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


void poll_callbacks() ๐Ÿ”—

Pumps the Steam manual callback dispatch queue.


bool refresh_current_stats() ๐Ÿ”—

Waits for a fresh user-stats callback from Steam, for example after server-side achievement changes. Uses cached data if no callback arrives in time.


bool remove_property(instance_id: int, property_name: String) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool request_current_stats() ๐Ÿ”—

Ensures local achievement and stat data is loaded. Returns immediately when stats are already available.


bool request_item_definitions(timeout_sec: float = 15.0) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


void request_web_api_ticket(identity: String = "blazium") ๐Ÿ”—

Requests a Web API session ticket and emits web_api_ticket_ready on success.


PackedByteArray serialize_inventory_result(result_handle: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool set_achievement(name: String) ๐Ÿ”—

Unlocks an achievement for the local user in memory. Call store_stats() to persist.


void set_debug_logging(enabled: bool) ๐Ÿ”—

Enables or disables verbose debug logging.


bool set_property_bool(instance_id: int, property_name: String, value: bool) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool set_property_float(instance_id: int, property_name: String, value: float) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool set_property_int64(instance_id: int, property_name: String, value: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool set_property_string(instance_id: int, property_name: String, value: String) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool set_stat_float(name: String, value: float) ๐Ÿ”—

Sets a float stat to an absolute value in memory. Call store_stats() to persist.


bool set_stat_int(name: String, value: int) ๐Ÿ”—

Sets an integer stat to an absolute value in memory. Call store_stats() to persist.


void shutdown() ๐Ÿ”—

Shuts down the Steam API session.


bool start_property_update() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool store_stats() ๐Ÿ”—

Uploads pending achievement and stat changes to Steam.


bool submit_property_update() ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool transfer_item_quantity(source_instance_id: int, quantity: int, dest_instance_id: int) ๐Ÿ”—

There is currently no description for this method. Please help us by contributing one!


bool trigger_item_drop(drop_list_definition: int) ๐Ÿ”—

Triggers a playtime item drop for a playtimegenerator item definition. Waits for the async inventory result.