steamworks

package module
v1.63.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

go-steamworks

Go bindings covering all Steamworks API interface families, with typed wrappers for implemented methods and purego/ffi handles for the remaining surfaces.

[!WARNING] 32-bit OSes are not supported.

Steamworks SDK version

163

[!NOTE] If newer Steamworks SDK releases add or update symbols that are not yet in these bindings, use the raw symbol access method to call them directly.

Getting started

Requirements

Before using this library, make sure Steam's redistributable binaries are available on your runtime machine. This repository no longer ships the precompiled Steamworks shared libraries; provide them alongside your application at runtime (for example, next to your executable).

Common locations and filenames:

  • Linux (64-bit): libsteam_api.so
  • macOS: libsteam_api.dylib
  • Windows (64-bit): steam_api64.dll

On Windows, copy the DLL into the working directory:

  • steam_api64.dll (copy from redistribution_bin\\win64\\steam_api64.dll in the SDK)

For local development, ensure steam_appid.txt is available next to the executable (or run Steam with your app ID configured).

Initialization

The Steamworks client must be running and the API must be initialized before calling most interfaces. Load is optional, but allows you to surface missing redistributables early.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/badhex/go-steamworks"
)

const appID = 480 // Replace with your own App ID.

func main() {
	if steamworks.RestartAppIfNecessary(appID) {
		os.Exit(0)
	}
	if err := steamworks.Load(); err != nil {
		log.Fatalf("failed to load steamworks: %v", err)
	}
	if err := steamworks.Init(); err != nil {
		log.Fatalf("steamworks.Init failed: %v", err)
	}

	fmt.Printf("SteamID: %v\n", steamworks.SteamUser().GetSteamID())
}
Callback pump

Steamworks expects you to poll callbacks regularly on your main thread.

for running {
	steamworks.RunCallbacks()
	// ...your game loop...
}
Example: language selection
package steamapi

import (
	"github.com/badhex/go-steamworks"
	"golang.org/x/text/language"
)

func SystemLang() language.Tag {
	switch steamworks.SteamApps().GetCurrentGameLanguage() {
	case "english":
		return language.English
	case "japanese":
		return language.Japanese
	}
	return language.Und
}
Example: achievements
if achieved, ok := steamworks.SteamUserStats().GetAchievement("FIRST_WIN"); ok && !achieved {
	steamworks.SteamUserStats().SetAchievement("FIRST_WIN")
	steamworks.SteamUserStats().StoreStats()
}
Example: async call results
call := steamworks.SteamHTTP().CreateHTTPRequest(steamworks.EHTTPMethodGET, "https://example.com")
callHandle, ok := steamworks.SteamHTTP().SendHTTPRequest(call)
if !ok {
	// handle request creation failure
}

type HTTPRequestCompleted struct {
	Request steamworks.HTTPRequestHandle
	Context uint64
	Status  int32
}

// Define the struct to mirror the Steamworks callback payload you expect.
// Use the SDK's callback ID for the expected payload.
result := steamworks.NewCallResult[HTTPRequestCompleted](callHandle, 2101)

if _, failed, err := result.Wait(context.Background(), 0); err == nil && !failed {
	// process response
}

SDK-aligned helpers

This repository ships typed helpers for async call results and manual callback dispatch, plus additional interface accessors to align with common Steamworks flows.

  • Use NewCallResult to await async call results with typed payloads.
  • Use NewCallbackDispatcher + RegisterCallback for manual callback registration and dispatch.
  • Use versioned accessors such as SteamAppsV008() when you need explicit interface versions.

Build tags and runtime loading

By default, the package expects Steam redistributables to be available on the runtime library path. You can also opt into embedding redistributables with a build tag:

  • Runtime loading (default): rely on libsteam_api.so / libsteam_api.dylib being in the dynamic linker path or alongside your executable.
  • Embedded loading: build with -tags steamworks_embedded to embed the SDK redistributables and load them from a temporary file at runtime.

Use STEAMWORKS_LIB_PATH to point at a custom shared library location when runtime loading.

Repository layout

  • gen.go — code generator for parsing the SDK and building bindings.
  • examples/ — runnable samples for common startup flows.
Steamworks API coverage and methods

The package now exposes all Steamworks API interface families through friendly Go accessors. Interfaces are either:

  • fully/partially typed wrappers (method-by-method Go bindings), or
  • handle-backed wrappers exposing native Go structs with Ptr() uintptr and Valid() bool.

General

  • RestartAppIfNecessary(appID uint32) bool
  • Init() error
  • RunCallbacks()
  • Shutdown()
  • IsSteamRunning() bool
  • GetSteamInstallPath() string
  • ReleaseCurrentThreadMemory()

ISteamApps (SteamApps() ISteamApps) — typed wrappers

  • BGetDLCDataByIndex(iDLC int) (appID AppId_t, available bool, name string, success bool)
  • BIsSubscribed() bool
  • BIsLowViolence() bool
  • BIsCybercafe() bool
  • BIsVACBanned() bool
  • BIsDlcInstalled(appID AppId_t) bool
  • BIsSubscribedApp(appID AppId_t) bool
  • BIsSubscribedFromFreeWeekend() bool
  • BIsSubscribedFromFamilySharing() bool
  • BIsTimedTrial() (allowedSeconds, playedSeconds uint32, ok bool)
  • BIsAppInstalled(appID AppId_t) bool
  • GetAvailableGameLanguages() string
  • GetEarliestPurchaseUnixTime(appID AppId_t) uint32
  • GetAppInstallDir(appID AppId_t) string
  • GetCurrentGameLanguage() string
  • GetDLCCount() int32
  • GetCurrentBetaName() (string, bool)
  • GetInstalledDepots(appID AppId_t) []DepotId_t
  • GetAppOwner() CSteamID
  • GetLaunchQueryParam(key string) string
  • GetDlcDownloadProgress(appID AppId_t) (downloaded, total uint64, ok bool)
  • GetAppBuildId() int32
  • GetFileDetails(filename string) SteamAPICall_t
  • GetLaunchCommandLine(bufferSize int) string
  • GetNumBetas() (total int, available int, private int)
  • GetBetaInfo(index int) (flags uint32, buildID uint32, name string, description string, ok bool)
  • InstallDLC(appID AppId_t)
  • UninstallDLC(appID AppId_t)
  • RequestAppProofOfPurchaseKey(appID AppId_t)
  • RequestAllProofOfPurchaseKeys()
  • MarkContentCorrupt(missingFilesOnly bool) bool
  • SetDlcContext(appID AppId_t) bool
  • SetActiveBeta(name string) bool

ISteamAppTicket (SteamAppTicket() ISteamAppTicket) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamClient (SteamClient() ISteamClient) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamController (SteamController() ISteamController) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamFriends (SteamFriends() ISteamFriends) — typed wrappers

  • GetPersonaName() string
  • GetPersonaState() EPersonaState
  • GetFriendCount(flags EFriendFlags) int
  • GetFriendByIndex(index int, flags EFriendFlags) CSteamID
  • GetFriendRelationship(friend CSteamID) EFriendRelationship
  • GetFriendPersonaState(friend CSteamID) EPersonaState
  • GetFriendPersonaName(friend CSteamID) string
  • GetFriendPersonaNameHistory(friend CSteamID, index int) string
  • GetFriendSteamLevel(friend CSteamID) int
  • GetSmallFriendAvatar(friend CSteamID) int32
  • GetMediumFriendAvatar(friend CSteamID) int32
  • GetLargeFriendAvatar(friend CSteamID) int32
  • SetRichPresence(key, value string) bool
  • GetFriendGamePlayed(friend CSteamID) (FriendGameInfo, bool)
    • Returns FriendGameInfo mapped from SDK FriendGameInfo_t (see field breakdown below).
  • InviteUserToGame(friend CSteamID, connectString string) bool
  • ActivateGameOverlay(dialog string)
  • ActivateGameOverlayToUser(dialog string, steamID CSteamID)
  • ActivateGameOverlayToWebPage(url string, mode EActivateGameOverlayToWebPageMode)
  • ActivateGameOverlayToStore(appID AppId_t, flag EOverlayToStoreFlag)
  • ActivateGameOverlayInviteDialog(lobbyID CSteamID)
  • ActivateGameOverlayInviteDialogConnectString(connectString string)

Returned structure details:

  • FriendGameInfo (SDK FriendGameInfo_t) fields:
    • GameID CGameID
    • GameIP uint32
    • GamePort uint16
    • QueryPort uint16
    • LobbySteamID CSteamID

ISteamGameCoordinator (SteamGameCoordinator() ISteamGameCoordinator) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamGameServer (SteamGameServer() ISteamGameServer) — typed wrappers

  • AssociateWithClan(clanID CSteamID) SteamAPICall_t
  • BeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResult
  • BLoggedOn() bool
  • BSecure() bool
  • BUpdateUserData(steamIDUser CSteamID, playerName string, score uint32) bool
  • CancelAuthTicket(authTicket HAuthTicket)
  • ClearAllKeyValues()
  • ComputeNewPlayerCompatibility(steamIDNewPlayer CSteamID, steamIDPlayers []CSteamID, steamIDPlayersInGame []CSteamID, steamIDTeamPlayers []CSteamID) SteamAPICall_t
  • CreateUnauthenticatedUserConnection() CSteamID
  • EnableHeartbeats(active bool)
  • EndAuthSession(steamID CSteamID)
  • ForceHeartbeat()
  • GetAuthSessionTicket(authTicket []byte) (ticket HAuthTicket, size uint32)
  • GetGameplayStats()
  • GetNextOutgoingPacket(dest []byte) (size int32, ip uint32, port uint16)
  • GetPublicIP() uint32
  • GetServerReputation() SteamAPICall_t
  • GetSteamID() CSteamID
  • HandleIncomingPacket(data []byte, ip uint32, port uint16) bool
  • InitGameServer(ip uint32, steamPort uint16, gamePort uint16, queryPort uint16, serverMode uint32, versionString string) bool
  • LogOff()
  • LogOn(token string)
  • LogOnAnonymous()
  • RequestUserGroupStatus(steamIDUser CSteamID, steamIDGroup CSteamID) bool
  • SendUserConnectAndAuthenticate(ipClient uint32, authBlob []byte) (steamIDUser CSteamID, ok bool)
  • SendUserDisconnect(steamIDUser CSteamID)
  • SetBotPlayerCount(botPlayers int32)
  • SetDedicatedServer(dedicated bool)
  • SetGameData(gameData string)
  • SetGameDescription(description string)
  • SetGameTags(gameTags string)
  • SetHeartbeatInterval(interval int)
  • SetKeyValue(key string, value string)
  • SetMapName(mapName string)
  • SetMaxPlayerCount(playersMax int32)
  • SetModDir(modDir string)
  • SetPasswordProtected(passwordProtected bool)
  • SetProduct(product string)
  • SetRegion(region string)
  • SetServerName(serverName string)
  • SetSpectatorPort(spectatorPort uint16)
  • SetSpectatorServerName(spectatorServerName string)
  • UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResult
  • WasRestartRequested() bool

ISteamGameServerStats (SteamGameServerStats() ISteamGameServerStats) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamHTMLSurface (SteamHTMLSurface() ISteamHTMLSurface) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamHTTP (SteamHTTP() ISteamHTTP) — typed wrappers

  • CreateHTTPRequest(method EHTTPMethod, absoluteURL string) HTTPRequestHandle
  • SetHTTPRequestHeaderValue(request HTTPRequestHandle, headerName, headerValue string) bool
  • SendHTTPRequest(request HTTPRequestHandle) (SteamAPICall_t, bool)
  • GetHTTPResponseBodySize(request HTTPRequestHandle) (uint32, bool)
  • GetHTTPResponseBodyData(request HTTPRequestHandle, buffer []byte) bool
  • ReleaseHTTPRequest(request HTTPRequestHandle) bool

ISteamInput (SteamInput() ISteamInput) — typed wrappers

  • GetConnectedControllers() []InputHandle_t
  • GetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputType
  • Init(bExplicitlyCallRunFrame bool) bool
  • Shutdown()
  • RunFrame()
  • EnableDeviceCallbacks()
  • GetActionSetHandle(actionSetName string) InputActionSetHandle_t
  • ActivateActionSet(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
  • GetCurrentActionSet(inputHandle InputHandle_t) InputActionSetHandle_t
  • ActivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
  • DeactivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
  • DeactivateAllActionSetLayers(inputHandle InputHandle_t)
  • GetActiveActionSetLayers(inputHandle InputHandle_t, handles []InputActionSetHandle_t) int
  • GetDigitalActionHandle(actionName string) InputDigitalActionHandle_t
  • GetDigitalActionData(inputHandle InputHandle_t, actionHandle InputDigitalActionHandle_t) InputDigitalActionData
    • Returns InputDigitalActionData mapped from SDK InputDigitalActionData_t.
  • GetDigitalActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputDigitalActionHandle_t, origins []EInputActionOrigin) int
  • GetAnalogActionHandle(actionName string) InputAnalogActionHandle_t
  • GetAnalogActionData(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t) InputAnalogActionData
    • Returns InputAnalogActionData mapped from SDK InputAnalogActionData_t.
  • GetAnalogActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputAnalogActionHandle_t, origins []EInputActionOrigin) int
  • StopAnalogActionMomentum(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t)
  • GetMotionData(inputHandle InputHandle_t) InputMotionData
    • Returns InputMotionData mapped from SDK InputMotionData_t.
  • TriggerVibration(inputHandle InputHandle_t, leftSpeed, rightSpeed uint16)
  • TriggerVibrationExtended(inputHandle InputHandle_t, leftSpeed, rightSpeed, leftTriggerSpeed, rightTriggerSpeed uint16)
  • TriggerSimpleHapticEvent(inputHandle InputHandle_t, pad ESteamControllerPad, durationMicroSec, offMicroSec, repeat uint16)
  • SetLEDColor(inputHandle InputHandle_t, red, green, blue uint8, flags ESteamInputLEDFlag)
  • ShowBindingPanel(inputHandle InputHandle_t) bool
  • GetControllerForGamepadIndex(index int) InputHandle_t
  • GetGamepadIndexForController(inputHandle InputHandle_t) int
  • GetStringForActionOrigin(origin EInputActionOrigin) string
  • GetGlyphForActionOrigin(origin EInputActionOrigin) string
  • GetRemotePlaySessionID(inputHandle InputHandle_t) uint32

Returned structure details:

  • InputDigitalActionData (SDK InputDigitalActionData_t) fields:
    • State bool
    • Active bool
  • InputAnalogActionData (SDK InputAnalogActionData_t) fields:
    • Mode EInputSourceMode
    • X float32
    • Y float32
    • Active bool
  • InputMotionData (SDK InputMotionData_t) fields:
    • RotQuatX float32, RotQuatY float32, RotQuatZ float32, RotQuatW float32
    • PosAccelX float32, PosAccelY float32, PosAccelZ float32
    • RotVelX float32, RotVelY float32, RotVelZ float32

ISteamInventory (SteamInventory() ISteamInventory) — typed wrappers

  • GetResultStatus(result SteamInventoryResult_t) EResult
  • GetResultItems(result SteamInventoryResult_t, outItems []SteamItemDetails) (int, bool)
    • Populates outItems with SteamItemDetails entries mapped from SDK SteamItemDetails_t.
  • DestroyResult(result SteamInventoryResult_t)

Returned structure details:

  • SteamItemDetails (SDK SteamItemDetails_t) fields:
    • ItemID SteamItemInstanceID_t
    • Definition SteamItemDef_t
    • Quantity uint16
    • Flags uint16

ISteamMatchmaking (SteamMatchmaking() ISteamMatchmaking) — typed wrappers

  • GetFavoriteGameCount() int
  • GetFavoriteGame(index int) (FavoriteGame, bool)
  • AddFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags, lastPlayedOnServerTime uint32) int
  • RemoveFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags uint32) bool
  • RequestLobbyList() SteamAPICall_t
  • AddRequestLobbyListStringFilter(key, value string, comparisonType ELobbyComparison)
  • AddRequestLobbyListNumericalFilter(key string, value int, comparisonType ELobbyComparison)
  • AddRequestLobbyListNearValueFilter(key string, value int)
  • AddRequestLobbyListFilterSlotsAvailable(slotsAvailable int)
  • AddRequestLobbyListDistanceFilter(distanceFilter ELobbyDistanceFilter)
  • AddRequestLobbyListResultCountFilter(maxResults int)
  • AddRequestLobbyListCompatibleMembersFilter(lobbyID CSteamID)
  • GetLobbyByIndex(index int) CSteamID
  • CreateLobby(lobbyType ELobbyType, maxMembers int) SteamAPICall_t
  • JoinLobby(lobbyID CSteamID) SteamAPICall_t
  • LeaveLobby(lobbyID CSteamID)
  • InviteUserToLobby(lobbyID, invitee CSteamID) bool
  • SetLobbyMemberLimit(lobbyID CSteamID, maxMembers int) bool
  • GetLobbyMemberLimit(lobbyID CSteamID) int
  • SetLobbyType(lobbyID CSteamID, lobbyType ELobbyType) bool
  • SetLobbyJoinable(lobbyID CSteamID, joinable bool) bool
  • GetLobbyOwner(lobbyID CSteamID) CSteamID
  • SetLobbyOwner(lobbyID, owner CSteamID) bool
  • SetLinkedLobby(lobbyID, lobbyDependent CSteamID) bool
  • GetNumLobbyMembers(lobbyID CSteamID) int
  • GetLobbyMemberByIndex(lobbyID CSteamID, memberIndex int) CSteamID
  • SetLobbyData(lobbyID CSteamID, key, value string) bool
  • GetLobbyData(lobbyID CSteamID, key string) string
  • DeleteLobbyData(lobbyID CSteamID, key string) bool
  • GetLobbyDataCount(lobbyID CSteamID) int
  • GetLobbyDataByIndex(lobbyID CSteamID, lobbyDataIndex int) (key, value string, ok bool)
  • SetLobbyMemberData(lobbyID CSteamID, key, value string)
  • GetLobbyMemberData(lobbyID, user CSteamID, key string) string
  • SendLobbyChatMsg(lobbyID CSteamID, msgBody []byte) bool
  • GetLobbyChatEntry(lobbyID CSteamID, chatID int, data []byte) (user CSteamID, entryType EChatEntryType, bytesCopied int)
  • RequestLobbyData(lobbyID CSteamID) bool
  • SetLobbyGameServer(lobbyID CSteamID, ip uint32, port uint16, server CSteamID)
  • GetLobbyGameServer(lobbyID CSteamID) (ip uint32, port uint16, server CSteamID, ok bool)
  • CheckForPSNGameBootInvite(lobbyID *CSteamID) bool

ISteamMatchmakingServers (SteamMatchmakingServers() ISteamMatchmakingServers) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.
  • RequestFavoritesServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest
  • RequestFriendsServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest
  • RequestHistoryServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest
  • RequestInternetServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest
  • RequestLANServerList(appID AppId_t, response uintptr) HServerListRequest
  • RequestSpectatorServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest
  • ReleaseRequest(request HServerListRequest)
  • GetServerDetails(request HServerListRequest, server int) uintptr
  • CancelQuery(request HServerListRequest)
  • RefreshQuery(request HServerListRequest)
  • IsRefreshing(request HServerListRequest) bool
  • GetServerCount(request HServerListRequest) int
  • RefreshServer(request HServerListRequest, server int)
  • PingServer(ip uint32, port uint16, response uintptr) HServerQuery
  • PlayerDetails(ip uint32, port uint16, response uintptr) HServerQuery
  • ServerRules(ip uint32, port uint16, response uintptr) HServerQuery
  • CancelServerQuery(query HServerQuery)

ISteamMusic (SteamMusic() ISteamMusic) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamNetworking (SteamNetworking() ISteamNetworking) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamNetworkingMessages (SteamNetworkingMessages() ISteamNetworkingMessages) — typed wrappers

  • SendMessageToUser(identity *SteamNetworkingIdentity, data []byte, sendFlags SteamNetworkingSendFlags, remoteChannel int) EResult
  • ReceiveMessagesOnChannel(channel int, maxMessages int) []*SteamNetworkingMessage
    • Returns a slice of *SteamNetworkingMessage wrappers over SDK SteamNetworkingMessage_t.
  • AcceptSessionWithUser(identity *SteamNetworkingIdentity) bool
  • CloseSessionWithUser(identity *SteamNetworkingIdentity) bool
  • CloseChannelWithUser(identity *SteamNetworkingIdentity, channel int) bool

Returned structure details:

  • SteamNetworkingIdentity fields:
    • IdentityType int32
    • Reserved [3]int32
    • Data [128]byte
  • SteamNetworkingMessage (SDK SteamNetworkingMessage_t) pointer wrapper:
    • Data uintptr
    • Size int32
    • Conn HSteamNetConnection
    • IdentityPeer SteamNetworkingIdentity
    • ConnUserData int64
    • TimeReceived int64
    • MessageNumber int64
    • ReleaseFunc uintptr (invoked by Release())

ISteamNetworkingSockets (SteamNetworkingSockets() ISteamNetworkingSockets) — typed wrappers

  • CreateListenSocketIP(localAddress *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamListenSocket
  • CreateListenSocketP2P(localVirtualPort int, options []SteamNetworkingConfigValue) HSteamListenSocket
  • ConnectByIPAddress(address *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamNetConnection
  • ConnectP2P(identity *SteamNetworkingIdentity, remoteVirtualPort int, options []SteamNetworkingConfigValue) HSteamNetConnection
  • AcceptConnection(connection HSteamNetConnection) EResult
  • CloseConnection(connection HSteamNetConnection, reason int, debug string, enableLinger bool) bool
  • CloseListenSocket(socket HSteamListenSocket) bool
  • SendMessageToConnection(connection HSteamNetConnection, data []byte, sendFlags SteamNetworkingSendFlags) (EResult, int64)
  • ReceiveMessagesOnConnection(connection HSteamNetConnection, maxMessages int) []*SteamNetworkingMessage
    • Returns a slice of *SteamNetworkingMessage wrappers over SDK SteamNetworkingMessage_t.
  • CreatePollGroup() HSteamNetPollGroup
  • DestroyPollGroup(group HSteamNetPollGroup) bool
  • SetConnectionPollGroup(connection HSteamNetConnection, group HSteamNetPollGroup) bool
  • ReceiveMessagesOnPollGroup(group HSteamNetPollGroup, maxMessages int) []*SteamNetworkingMessage
    • Returns a slice of *SteamNetworkingMessage wrappers over SDK SteamNetworkingMessage_t.

Returned structure details:

  • SteamNetworkingIPAddr fields:
    • IP [16]byte
    • Port uint16
  • SteamNetworkingIdentity fields:
    • IdentityType int32
    • Reserved [3]int32
    • Data [128]byte
  • SteamNetworkingMessage (SDK SteamNetworkingMessage_t) pointer wrapper:
    • Data uintptr
    • Size int32
    • Conn HSteamNetConnection
    • IdentityPeer SteamNetworkingIdentity
    • ConnUserData int64
    • TimeReceived int64
    • MessageNumber int64
    • ReleaseFunc uintptr (invoked by Release())

ISteamNetworkingUtils (SteamNetworkingUtils() ISteamNetworkingUtils) — typed wrappers

  • AllocateMessage(size int) *SteamNetworkingMessage
    • Returns a *SteamNetworkingMessage wrapper over SDK SteamNetworkingMessage_t.
  • InitRelayNetworkAccess()
  • GetLocalTimestamp() SteamNetworkingMicroseconds

ISteamRemotePlay (SteamRemotePlay() ISteamRemotePlay) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamRemoteStorage (SteamRemoteStorage() ISteamRemoteStorage) — typed wrappers

  • FileWrite(file string, data []byte) bool
  • FileRead(file string, data []byte) int32
  • FileDelete(file string) bool
  • GetFileSize(file string) int32

ISteamScreenshots (SteamScreenshots() ISteamScreenshots) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamTimeline (SteamTimeline() ISteamTimeline) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

ISteamUGC (SteamUGC() ISteamUGC) — typed wrappers

  • GetNumSubscribedItems(includeLocallyDisabled bool) uint32
  • GetSubscribedItems(includeLocallyDisabled bool) []PublishedFileId_t

ISteamUser (SteamUser() ISteamUser) — typed wrappers

  • AdvertiseGame(gameServerSteamID CSteamID, ip uint32, port uint16)
  • BeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResult
  • BIsBehindNAT() bool
  • BIsPhoneIdentifying() bool
  • BIsPhoneRequiringVerification() bool
  • BIsPhoneVerified() bool
  • BIsTwoFactorEnabled() bool
  • BLoggedOn() bool
  • BSetDurationControlOnlineState(newState EDurationControlOnlineState) bool
  • CancelAuthTicket(authTicket HAuthTicket)
  • DecompressVoice(compressedData []byte, destBuffer []byte, desiredSampleRate uint32) (bytesWritten uint32, result EVoiceResult)
  • EndAuthSession(steamID CSteamID)
  • GetAuthSessionTicket(authTicket []byte, identityRemote *SteamNetworkingIdentity) (ticket HAuthTicket, size uint32)
  • GetAuthTicketForWebApi(identity string) HAuthTicket
  • GetAvailableVoice() (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)
  • GetDurationControl() (control DurationControl, ok bool)
  • GetEncryptedAppTicket(ticket []byte) (ticketSize uint32, ok bool)
  • GetGameBadgeLevel(series int32, foil bool) int32
  • GetHSteamUser() HSteamUser
  • GetPlayerSteamLevel() int32
  • GetSteamID() CSteamID
  • GetUserDataFolder() (path string, ok bool)
  • GetVoice(wantCompressed bool, compressedData []byte, wantUncompressed bool, uncompressedData []byte, desiredSampleRate uint32) (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)
  • GetVoiceOptimalSampleRate() uint32
  • InitiateGameConnection(authBlob []byte, steamIDGameServer CSteamID, ipServer uint32, portServer uint16, secure bool) int32
  • RequestEncryptedAppTicket(dataToInclude []byte) SteamAPICall_t
  • RequestStoreAuthURL(redirectURL string) SteamAPICall_t
  • StartVoiceRecording()
  • StopVoiceRecording()
  • TerminateGameConnection(ipServer uint32, portServer uint16)
  • TrackAppUsageEvent(gameID CGameID, eventCode int32, extraInfo string)
  • UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResult

ISteamUserStats (SteamUserStats() ISteamUserStats) — typed wrappers

  • GetAchievement(name string) (achieved, success bool)
  • SetAchievement(name string) bool
  • ClearAchievement(name string) bool
  • StoreStats() bool

ISteamUtils (SteamUtils() ISteamUtils) — typed wrappers

  • GetSecondsSinceAppActive() uint32
  • GetSecondsSinceComputerActive() uint32
  • GetConnectedUniverse() EUniverse
  • GetServerRealTime() uint32
  • GetIPCountry() string
  • GetImageSize(image int) (width, height uint32, ok bool)
  • GetImageRGBA(image int, dest []byte) bool
  • GetCurrentBatteryPower() uint8
  • GetAppID() uint32
  • IsOverlayEnabled() bool
  • BOverlayNeedsPresent() bool
  • IsSteamRunningOnSteamDeck() bool
  • SetOverlayNotificationPosition(position ENotificationPosition)
  • SetOverlayNotificationInset(horizontal, vertical int32)
  • IsAPICallCompleted(call SteamAPICall_t) (failed bool, ok bool)
  • GetAPICallFailureReason(call SteamAPICall_t) ESteamAPICallFailure
  • GetAPICallResult(call SteamAPICall_t, callback uintptr, callbackSize int32, expectedCallback int32) (failed bool, ok bool)
  • GetIPCCallCount() uint32
  • ShowFloatingGamepadTextInput(...) bool

ISteamVideo (SteamVideo() ISteamVideo) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

SteamEncryptedAppTicket — typed utility wrappers

  • SteamEncryptedAppTicketBDecryptTicket(ticket, decrypted, key []byte) (decryptedSize uint32, ok bool)
  • SteamEncryptedAppTicketBIsTicketForApp(decryptedTicket []byte, appID AppId_t) bool
  • SteamEncryptedAppTicketGetTicketIssueTime(decryptedTicket []byte) uint32
  • SteamEncryptedAppTicketGetTicketSteamID(decryptedTicket []byte) (CSteamID, bool)

steam_api (SteamAPIClient() ISteamAPIClient) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.

steam_gameserver (SteamAPIGameServer() ISteamAPIGameServer) — handle-backed

  • Returned wrapper struct shape: { ptr uintptr } with methods Ptr() uintptr and Valid() bool.
Additional raw symbol helpers (purego/ffi)

Raw helpers return concrete Go wrapper structs per interface family; use Ptr() for FFI call entry and Valid() before invocation.

Interface raw helpers resolve the SteamAPI_* exported factory symbol and invoke it (zero-arg) to obtain the actual ISteam* instance pointer. If purego.Dlsym cannot resolve the factory symbol, the package attempts an ffi-based fallback lookup via github.com/jupiterrider/ffi.

  • SteamAppTicketRaw() ISteamAppTicket (ISteamAppTicket)
  • SteamClientRaw() ISteamClient (ISteamClient)
  • SteamControllerRaw() ISteamController (ISteamController)
  • SteamGameCoordinatorRaw() ISteamGameCoordinator (ISteamGameCoordinator)
  • SteamGameServerStatsRaw() ISteamGameServerStats (ISteamGameServerStats)
  • SteamHTMLSurfaceRaw() ISteamHTMLSurface (ISteamHTMLSurface)
  • SteamMatchmakingServersRaw() ISteamMatchmakingServers (ISteamMatchmakingServers)
  • SteamMusicRaw() ISteamMusic (ISteamMusic)
  • SteamNetworkingRaw() ISteamNetworking (ISteamNetworking)
  • SteamRemotePlayRaw() ISteamRemotePlay (ISteamRemotePlay)
  • SteamScreenshotsRaw() ISteamScreenshots (ISteamScreenshots)
  • SteamTimelineRaw() ISteamTimeline (ISteamTimeline)
  • SteamVideoRaw() ISteamVideo (ISteamVideo)
  • SteamAPIClientRaw() ISteamAPIClient (steam_api foundation; wrapped by SteamAPIClient())
  • SteamAPIGameServerRaw() ISteamAPIGameServer (steam_gameserver foundation; wrapped by SteamAPIGameServer())

Encrypted ticket utilities are also exposed with direct symbol wrappers:

  • SteamEncryptedAppTicketBDecryptTicket(ticket, decrypted, key []byte) (decryptedSize uint32, ok bool)
  • SteamEncryptedAppTicketBIsTicketForApp(decryptedTicket []byte, appID AppId_t) bool
  • SteamEncryptedAppTicketGetTicketIssueTime(decryptedTicket []byte) uint32
  • SteamEncryptedAppTicketGetTicketSteamID(decryptedTicket []byte) (CSteamID, bool)
Raw symbol access

To access newer or unsupported Steamworks SDK methods, you can call raw symbols directly:

// Look up a symbol and call it directly (advanced usage).
ptr, err := steamworks.LookupSymbol("SteamAPI_ISteamFriends_GetPersonaName")
if err != nil {
	panic(err)
}
result := steamworks.CallSymbolPtr(ptr)
_ = result

Or use CallSymbol to combine lookup + call:

result, err := steamworks.CallSymbol("SteamAPI_SteamApps_v008")
if err != nil {
	panic(err)
}
_ = result

License

All the source code files are licensed under Apache License 2.0.

Resources

Documentation

Overview

Package steamworks provides Go bindings for a subset of the Steamworks SDK.

The package expects the Steam redistributables to be available at runtime. See the README for setup details and example usage.

Index

Constants

View Source
const SDKVersion = "163"

SDKVersion is the Steamworks SDK version this repository targets.

Variables

View Source
var (
	ErrAPICallNotReady = errors.New("steamworks: api call result not ready")
	ErrAPICallTooLarge = errors.New("steamworks: api call result size exceeds int32")
)

Functions

func CallSymbol

func CallSymbol(name string, args ...uintptr) (uintptr, error)

CallSymbol looks up a Steamworks SDK symbol and invokes it with the provided arguments. Callers are responsible for providing the correct argument and return types.

func CallSymbolPtr

func CallSymbolPtr(ptr uintptr, args ...uintptr) uintptr

CallSymbolPtr invokes a Steamworks SDK function pointer with the provided arguments. Callers are responsible for providing the correct argument and return types.

func GetSteamInstallPath added in v1.63.1

func GetSteamInstallPath() string

GetSteamInstallPath returns the Steam installation directory, if available.

func Init

func Init() error

func IsSteamRunning added in v1.63.1

func IsSteamRunning() bool

IsSteamRunning reports whether the Steam client is currently running.

func Load

func Load() error

Load initializes the Steamworks shared library and registers function pointers. It is safe to call Load multiple times.

func LookupSymbol

func LookupSymbol(name string) (uintptr, error)

LookupSymbol returns the raw address of a Steamworks SDK symbol for advanced usage. Callers are responsible for providing the correct argument and return types.

func RegisterCallback

func RegisterCallback[T any](d *CallbackDispatcher, id CallbackID, handler func(T))

RegisterCallback registers a typed handler for a callback ID.

func ReleaseCurrentThreadMemory added in v1.63.1

func ReleaseCurrentThreadMemory()

ReleaseCurrentThreadMemory releases per-thread memory used by the Steamworks API.

func RestartAppIfNecessary

func RestartAppIfNecessary(appID uint32) bool

func RunCallbacks

func RunCallbacks()

func Shutdown added in v1.63.1

func Shutdown()

Shutdown shuts down the Steamworks API.

func SteamEncryptedAppTicketBDecryptTicket added in v1.63.12

func SteamEncryptedAppTicketBDecryptTicket(ticket []byte, decrypted []byte, key []byte) (decryptedSize uint32, ok bool)

SteamEncryptedAppTicketBDecryptTicket decrypts an encrypted app ticket.

func SteamEncryptedAppTicketBIsTicketForApp added in v1.63.12

func SteamEncryptedAppTicketBIsTicketForApp(decryptedTicket []byte, appID AppId_t) bool

SteamEncryptedAppTicketBIsTicketForApp checks whether a decrypted ticket matches an app ID.

func SteamEncryptedAppTicketGetTicketIssueTime added in v1.63.12

func SteamEncryptedAppTicketGetTicketIssueTime(decryptedTicket []byte) uint32

SteamEncryptedAppTicketGetTicketIssueTime returns the issue timestamp from a decrypted ticket.

Types

type AppId_t

type AppId_t uint32

type CGameID

type CGameID uint64

type CSteamID

type CSteamID uint64

func SteamEncryptedAppTicketGetTicketSteamID added in v1.63.12

func SteamEncryptedAppTicketGetTicketSteamID(decryptedTicket []byte) (CSteamID, bool)

SteamEncryptedAppTicketGetTicketSteamID returns the ticket owner SteamID from a decrypted ticket.

type CallResult

type CallResult[T any] struct {
	// contains filtered or unexported fields
}

CallResult wraps a SteamAPICall_t with typed result helpers.

func NewCallResult

func NewCallResult[T any](call SteamAPICall_t, expectedCallback int32) *CallResult[T]

NewCallResult constructs a typed call result helper for a SteamAPICall_t.

func (*CallResult[T]) IsComplete

func (c *CallResult[T]) IsComplete() (failed bool, ok bool)

IsComplete reports whether the call has completed and whether it failed.

func (*CallResult[T]) Result

func (c *CallResult[T]) Result() (result T, failed bool, err error)

Result returns the typed call result if it is ready.

func (*CallResult[T]) Wait

func (c *CallResult[T]) Wait(ctx context.Context, pollInterval time.Duration) (result T, failed bool, err error)

Wait blocks until the call completes or the context is done.

func (*CallResult[T]) WaitAndDispatch

func (c *CallResult[T]) WaitAndDispatch(ctx context.Context, pollInterval time.Duration, handler func(T, bool)) error

WaitAndDispatch waits for completion and invokes handler with the typed result.

type CallbackDispatcher

type CallbackDispatcher struct {
	// contains filtered or unexported fields
}

CallbackDispatcher stores typed callback handlers keyed by callback ID. It is intended for use with manual dispatch flows.

func NewCallbackDispatcher

func NewCallbackDispatcher() *CallbackDispatcher

NewCallbackDispatcher constructs a new dispatcher.

func (*CallbackDispatcher) Dispatch

func (d *CallbackDispatcher) Dispatch(id CallbackID, data unsafe.Pointer) bool

Dispatch invokes the registered handler for the callback ID, if any.

func (*CallbackDispatcher) ExpectedSize

func (d *CallbackDispatcher) ExpectedSize(id CallbackID) (uintptr, bool)

ExpectedSize returns the expected payload size for the callback ID, if known.

type CallbackID

type CallbackID int32

CallbackID represents a Steam callback identifier.

const (
	CallbackIDLobbyDataUpdate CallbackID = 505
	CallbackIDLobbyChatUpdate CallbackID = 506
	CallbackIDLobbyChatMsg    CallbackID = 507
)

Steam matchmaking callback IDs for lobby events.

type DepotId_t

type DepotId_t uint32

type DurationControl added in v1.63.13

type DurationControl struct {
	Progress         EDurationControlProgress
	Notification     EDurationControlNotification
	OnlineState      EDurationControlOnlineState
	SecondsRemaining uint32
	SecondsPlayed    uint32
}

type EActivateGameOverlayToWebPageMode

type EActivateGameOverlayToWebPageMode int32
const (
	EActivateGameOverlayToWebPageMode_Default EActivateGameOverlayToWebPageMode = 0
	EActivateGameOverlayToWebPageMode_Modal   EActivateGameOverlayToWebPageMode = 1
)

type EBeginAuthSessionResult added in v1.63.13

type EBeginAuthSessionResult int32

type EChatEntryType added in v1.63.13

type EChatEntryType int32
const (
	EChatEntryTypeInvalid          EChatEntryType = 0
	EChatEntryTypeChatMsg          EChatEntryType = 1
	EChatEntryTypeTyping           EChatEntryType = 2
	EChatEntryTypeInviteGame       EChatEntryType = 3
	EChatEntryTypeEmote            EChatEntryType = 4
	EChatEntryTypeLeftConversation EChatEntryType = 6
	EChatEntryTypeEntered          EChatEntryType = 7
	EChatEntryTypeWasKicked        EChatEntryType = 8
	EChatEntryTypeWasBanned        EChatEntryType = 9
	EChatEntryTypeDisconnected     EChatEntryType = 10
	EChatEntryTypeHistoricalChat   EChatEntryType = 11
	EChatEntryTypeLinkBlocked      EChatEntryType = 14
)

type EDurationControlNotification added in v1.63.13

type EDurationControlNotification int32

type EDurationControlOnlineState added in v1.63.13

type EDurationControlOnlineState int32

type EDurationControlProgress added in v1.63.13

type EDurationControlProgress int32

type EFloatingGamepadTextInputMode

type EFloatingGamepadTextInputMode int32
const (
	EFloatingGamepadTextInputMode_ModeSingleLine    EFloatingGamepadTextInputMode = 0
	EFloatingGamepadTextInputMode_ModeMultipleLines EFloatingGamepadTextInputMode = 1
	EFloatingGamepadTextInputMode_ModeEmail         EFloatingGamepadTextInputMode = 2
	EFloatingGamepadTextInputMode_ModeNumeric       EFloatingGamepadTextInputMode = 3
)

type EFriendFlags

type EFriendFlags int32
const (
	EFriendFlagNone                 EFriendFlags = 0x00
	EFriendFlagBlocked              EFriendFlags = 0x01
	EFriendFlagFriendshipRequested  EFriendFlags = 0x02
	EFriendFlagImmediate            EFriendFlags = 0x04
	EFriendFlagClanMember           EFriendFlags = 0x08
	EFriendFlagOnGameServer         EFriendFlags = 0x10
	EFriendFlagRequestingFriendship EFriendFlags = 0x80
	EFriendFlagRequestingInfo       EFriendFlags = 0x100
	EFriendFlagIgnored              EFriendFlags = 0x200
	EFriendFlagIgnoredFriend        EFriendFlags = 0x400
	EFriendFlagChatMember           EFriendFlags = 0x1000
	EFriendFlagAll                  EFriendFlags = 0xFFFF
)

type EFriendRelationship

type EFriendRelationship int32
const (
	EFriendRelationshipNone                EFriendRelationship = 0
	EFriendRelationshipBlocked             EFriendRelationship = 1
	EFriendRelationshipRequestRecipient    EFriendRelationship = 2
	EFriendRelationshipFriend              EFriendRelationship = 3
	EFriendRelationshipRequestInitiator    EFriendRelationship = 4
	EFriendRelationshipIgnored             EFriendRelationship = 5
	EFriendRelationshipIgnoredFriend       EFriendRelationship = 6
	EFriendRelationshipSuggestedDeprecated EFriendRelationship = 7
	EFriendRelationshipMax                 EFriendRelationship = 8
)

type EHTTPMethod

type EHTTPMethod int32
const (
	EHTTPMethodInvalid EHTTPMethod = 0
	EHTTPMethodGET     EHTTPMethod = 1
	EHTTPMethodHEAD    EHTTPMethod = 2
	EHTTPMethodPOST    EHTTPMethod = 3
	EHTTPMethodPUT     EHTTPMethod = 4
	EHTTPMethodDELETE  EHTTPMethod = 5
	EHTTPMethodOPTIONS EHTTPMethod = 6
	EHTTPMethodPATCH   EHTTPMethod = 7
)

type EInputActionOrigin added in v1.63.1

type EInputActionOrigin int32
const (
	EInputActionOrigin_None                                EInputActionOrigin = 0
	EInputActionOrigin_SteamController_A                   EInputActionOrigin = 1
	EInputActionOrigin_SteamController_B                   EInputActionOrigin = 2
	EInputActionOrigin_SteamController_X                   EInputActionOrigin = 3
	EInputActionOrigin_SteamController_Y                   EInputActionOrigin = 4
	EInputActionOrigin_SteamController_LeftBumper          EInputActionOrigin = 5
	EInputActionOrigin_SteamController_RightBumper         EInputActionOrigin = 6
	EInputActionOrigin_SteamController_LeftGrip            EInputActionOrigin = 7
	EInputActionOrigin_SteamController_RightGrip           EInputActionOrigin = 8
	EInputActionOrigin_SteamController_Start               EInputActionOrigin = 9
	EInputActionOrigin_SteamController_Back                EInputActionOrigin = 10
	EInputActionOrigin_SteamController_LeftPad_Touch       EInputActionOrigin = 11
	EInputActionOrigin_SteamController_LeftPad_Swipe       EInputActionOrigin = 12
	EInputActionOrigin_SteamController_LeftPad_Click       EInputActionOrigin = 13
	EInputActionOrigin_SteamController_LeftPad_DPadNorth   EInputActionOrigin = 14
	EInputActionOrigin_SteamController_LeftPad_DPadSouth   EInputActionOrigin = 15
	EInputActionOrigin_SteamController_LeftPad_DPadWest    EInputActionOrigin = 16
	EInputActionOrigin_SteamController_LeftPad_DPadEast    EInputActionOrigin = 17
	EInputActionOrigin_SteamController_RightPad_Touch      EInputActionOrigin = 18
	EInputActionOrigin_SteamController_RightPad_Swipe      EInputActionOrigin = 19
	EInputActionOrigin_SteamController_RightPad_Click      EInputActionOrigin = 20
	EInputActionOrigin_SteamController_RightPad_DPadNorth  EInputActionOrigin = 21
	EInputActionOrigin_SteamController_RightPad_DPadSouth  EInputActionOrigin = 22
	EInputActionOrigin_SteamController_RightPad_DPadWest   EInputActionOrigin = 23
	EInputActionOrigin_SteamController_RightPad_DPadEast   EInputActionOrigin = 24
	EInputActionOrigin_SteamController_LeftTrigger_Pull    EInputActionOrigin = 25
	EInputActionOrigin_SteamController_LeftTrigger_Click   EInputActionOrigin = 26
	EInputActionOrigin_SteamController_RightTrigger_Pull   EInputActionOrigin = 27
	EInputActionOrigin_SteamController_RightTrigger_Click  EInputActionOrigin = 28
	EInputActionOrigin_SteamController_LeftStick_Move      EInputActionOrigin = 29
	EInputActionOrigin_SteamController_LeftStick_Click     EInputActionOrigin = 30
	EInputActionOrigin_SteamController_LeftStick_DPadNorth EInputActionOrigin = 31
	EInputActionOrigin_SteamController_LeftStick_DPadSouth EInputActionOrigin = 32
	EInputActionOrigin_SteamController_LeftStick_DPadWest  EInputActionOrigin = 33
	EInputActionOrigin_SteamController_LeftStick_DPadEast  EInputActionOrigin = 34
	EInputActionOrigin_SteamController_Gyro_Move           EInputActionOrigin = 35
	EInputActionOrigin_SteamController_Gyro_Pitch          EInputActionOrigin = 36
	EInputActionOrigin_SteamController_Gyro_Yaw            EInputActionOrigin = 37
	EInputActionOrigin_SteamController_Gyro_Roll           EInputActionOrigin = 38
)

type EInputSourceMode added in v1.63.1

type EInputSourceMode int32
const (
	EInputSourceMode_None           EInputSourceMode = 0
	EInputSourceMode_Dpad           EInputSourceMode = 1
	EInputSourceMode_Buttons        EInputSourceMode = 2
	EInputSourceMode_FourButtons    EInputSourceMode = 3
	EInputSourceMode_AbsoluteMouse  EInputSourceMode = 4
	EInputSourceMode_RelativeMouse  EInputSourceMode = 5
	EInputSourceMode_JoystickMove   EInputSourceMode = 6
	EInputSourceMode_JoystickCamera EInputSourceMode = 7
	EInputSourceMode_ScrollWheel    EInputSourceMode = 8
	EInputSourceMode_Trigger        EInputSourceMode = 9
	EInputSourceMode_TouchMenu      EInputSourceMode = 10
	EInputSourceMode_MouseJoystick  EInputSourceMode = 11
	EInputSourceMode_MouseRegion    EInputSourceMode = 12
	EInputSourceMode_RadialMenu     EInputSourceMode = 13
	EInputSourceMode_SingleButton   EInputSourceMode = 14
	EInputSourceMode_Switches       EInputSourceMode = 15
)

type ELobbyComparison added in v1.63.13

type ELobbyComparison int32
const (
	ELobbyComparisonEqualToOrLessThan    ELobbyComparison = -2
	ELobbyComparisonLessThan             ELobbyComparison = -1
	ELobbyComparisonEqual                ELobbyComparison = 0
	ELobbyComparisonGreaterThan          ELobbyComparison = 1
	ELobbyComparisonEqualToOrGreaterThan ELobbyComparison = 2
	ELobbyComparisonNotEqual             ELobbyComparison = 3
)

type ELobbyDistanceFilter added in v1.63.13

type ELobbyDistanceFilter int32
const (
	ELobbyDistanceFilterClose      ELobbyDistanceFilter = 0
	ELobbyDistanceFilterDefault    ELobbyDistanceFilter = 1
	ELobbyDistanceFilterFar        ELobbyDistanceFilter = 2
	ELobbyDistanceFilterWorldwide  ELobbyDistanceFilter = 3
	ELobbyDistanceFilterCompatible ELobbyDistanceFilter = 4
)

type ELobbyType

type ELobbyType int32
const (
	ELobbyType_Private     ELobbyType = 0
	ELobbyType_FriendsOnly ELobbyType = 1
	ELobbyType_Public      ELobbyType = 2
	ELobbyType_Invisible   ELobbyType = 3
)

type ENotificationPosition

type ENotificationPosition int32
const (
	ENotificationPositionInvalid     ENotificationPosition = -1
	ENotificationPositionTopLeft     ENotificationPosition = 0
	ENotificationPositionTopRight    ENotificationPosition = 1
	ENotificationPositionBottomLeft  ENotificationPosition = 2
	ENotificationPositionBottomRight ENotificationPosition = 3
)

type EOverlayToStoreFlag

type EOverlayToStoreFlag int32
const (
	EOverlayToStoreFlag_None             EOverlayToStoreFlag = 0
	EOverlayToStoreFlag_AddToCart        EOverlayToStoreFlag = 1
	EOverlayToStoreFlag_AddToCartAndShow EOverlayToStoreFlag = 2
)

type EPersonaState

type EPersonaState int32
const (
	EPersonaStateOffline        EPersonaState = 0
	EPersonaStateOnline         EPersonaState = 1
	EPersonaStateBusy           EPersonaState = 2
	EPersonaStateAway           EPersonaState = 3
	EPersonaStateSnooze         EPersonaState = 4
	EPersonaStateLookingToTrade EPersonaState = 5
	EPersonaStateLookingToPlay  EPersonaState = 6
	EPersonaStateInvisible      EPersonaState = 7
	EPersonaStateMax            EPersonaState = 8
)

type EResult

type EResult int32
const (
	EResultNone         EResult = 0
	EResultOK           EResult = 1
	EResultFail         EResult = 2
	EResultNoConnection EResult = 3
	EResultInvalidParam EResult = 8
	EResultBusy         EResult = 10
	EResultTimeout      EResult = 16
)

type ESteamAPICallFailure

type ESteamAPICallFailure int32
const (
	ESteamAPICallFailureNone               ESteamAPICallFailure = -1
	ESteamAPICallFailureSteamGone          ESteamAPICallFailure = 0
	ESteamAPICallFailureNetworkFailure     ESteamAPICallFailure = 1
	ESteamAPICallFailureInvalidHandle      ESteamAPICallFailure = 2
	ESteamAPICallFailureMismatchedCallback ESteamAPICallFailure = 3
)

type ESteamAPIInitResult

type ESteamAPIInitResult int32
const (
	ESteamAPIInitResult_OK              ESteamAPIInitResult = 0
	ESteamAPIInitResult_FailedGeneric   ESteamAPIInitResult = 1
	ESteamAPIInitResult_NoSteamClient   ESteamAPIInitResult = 2
	ESteamAPIInitResult_VersionMismatch ESteamAPIInitResult = 3
)

type ESteamControllerPad added in v1.63.1

type ESteamControllerPad int32
const (
	ESteamControllerPad_Left  ESteamControllerPad = 0
	ESteamControllerPad_Right ESteamControllerPad = 1
)

type ESteamInputLEDFlag added in v1.63.1

type ESteamInputLEDFlag uint32
const (
	ESteamInputLEDFlag_SetColor           ESteamInputLEDFlag = 0x01
	ESteamInputLEDFlag_RestoreUserDefault ESteamInputLEDFlag = 0x02
)

type ESteamInputType

type ESteamInputType int32
const (
	ESteamInputType_Unknown              ESteamInputType = 0
	ESteamInputType_SteamController      ESteamInputType = 1
	ESteamInputType_XBox360Controller    ESteamInputType = 2
	ESteamInputType_XBoxOneController    ESteamInputType = 3
	ESteamInputType_GenericXInput        ESteamInputType = 4
	ESteamInputType_PS4Controller        ESteamInputType = 5
	ESteamInputType_AppleMFiController   ESteamInputType = 6 // Unused
	ESteamInputType_AndroidController    ESteamInputType = 7 // Unused
	ESteamInputType_SwitchJoyConPair     ESteamInputType = 8 // Unused
	ESteamInputType_SwitchJoyConSingle   ESteamInputType = 9 // Unused
	ESteamInputType_SwitchProController  ESteamInputType = 10
	ESteamInputType_MobileTouch          ESteamInputType = 11
	ESteamInputType_PS3Controller        ESteamInputType = 12
	ESteamInputType_PS5Controller        ESteamInputType = 13
	ESteamInputType_SteamDeckController  ESteamInputType = 14
	ESteamInputType_Count                ESteamInputType = 15
	ESteamInputType_MaximumPossibleValue ESteamInputType = 255
)

type ESteamNetworkingIdentityType

type ESteamNetworkingIdentityType int32
const (
	SteamNetworkingIdentity_Invalid       ESteamNetworkingIdentityType = 0
	SteamNetworkingIdentity_SteamID       ESteamNetworkingIdentityType = 16
	SteamNetworkingIdentity_IPAddress     ESteamNetworkingIdentityType = 1
	SteamNetworkingIdentity_GenericString ESteamNetworkingIdentityType = 2
	SteamNetworkingIdentity_GenericBytes  ESteamNetworkingIdentityType = 3
)

type EUniverse

type EUniverse int32
const (
	EUniverseInvalid  EUniverse = 0
	EUniversePublic   EUniverse = 1
	EUniverseBeta     EUniverse = 2
	EUniverseInternal EUniverse = 3
	EUniverseDev      EUniverse = 4
	EUniverseMax      EUniverse = 5
)

type EUserHasLicenseForAppResult added in v1.63.13

type EUserHasLicenseForAppResult int32

type EVoiceResult added in v1.63.13

type EVoiceResult int32

type FavoriteGame added in v1.63.13

type FavoriteGame struct {
	AppID                  AppId_t
	IP                     uint32
	ConnectionPort         uint16
	QueryPort              uint16
	Flags                  uint32
	LastPlayedOnServerTime uint32
}

type FriendGameInfo

type FriendGameInfo struct {
	GameID       CGameID
	GameIP       uint32
	GamePort     uint16
	QueryPort    uint16
	LobbySteamID CSteamID
}

type HAuthTicket added in v1.63.13

type HAuthTicket uint32

type HServerListRequest added in v1.63.13

type HServerListRequest uintptr

type HServerQuery added in v1.63.13

type HServerQuery int32

type HSteamListenSocket

type HSteamListenSocket uint32

type HSteamNetConnection

type HSteamNetConnection uint32

type HSteamNetPollGroup

type HSteamNetPollGroup uint32

type HSteamUser added in v1.63.13

type HSteamUser int32

type HTTPCookieContainerHandle

type HTTPCookieContainerHandle uint32

type HTTPRequestHandle

type HTTPRequestHandle uint32

type ISteamAPIClient added in v1.63.12

type ISteamAPIClient struct {
	// contains filtered or unexported fields
}

func SteamAPIClient added in v1.63.12

func SteamAPIClient() ISteamAPIClient

func SteamAPIClientRaw added in v1.63.12

func SteamAPIClientRaw() ISteamAPIClient

SteamAPIClientRaw returns the steam_api client foundation handle for purego/ffi calls.

func (ISteamAPIClient) Ptr added in v1.63.12

func (i ISteamAPIClient) Ptr() uintptr

func (ISteamAPIClient) Valid added in v1.63.12

func (i ISteamAPIClient) Valid() bool

type ISteamAPIGameServer added in v1.63.12

type ISteamAPIGameServer struct {
	// contains filtered or unexported fields
}

func SteamAPIGameServer added in v1.63.12

func SteamAPIGameServer() ISteamAPIGameServer

func SteamAPIGameServerRaw added in v1.63.12

func SteamAPIGameServerRaw() ISteamAPIGameServer

SteamAPIGameServerRaw returns the steam_gameserver foundation handle for purego/ffi calls.

func (ISteamAPIGameServer) Ptr added in v1.63.12

func (i ISteamAPIGameServer) Ptr() uintptr

func (ISteamAPIGameServer) Valid added in v1.63.12

func (i ISteamAPIGameServer) Valid() bool

type ISteamAppTicket added in v1.63.12

type ISteamAppTicket struct {
	// contains filtered or unexported fields
}

func SteamAppTicket added in v1.63.12

func SteamAppTicket() ISteamAppTicket

func SteamAppTicketRaw added in v1.63.12

func SteamAppTicketRaw() ISteamAppTicket

SteamAppTicketRaw returns the ISteamAppTicket interface pointer for purego/ffi calls.

func (ISteamAppTicket) Ptr added in v1.63.12

func (i ISteamAppTicket) Ptr() uintptr

func (ISteamAppTicket) Valid added in v1.63.12

func (i ISteamAppTicket) Valid() bool

type ISteamApps

type ISteamApps interface {
	BGetDLCDataByIndex(iDLC int) (appID AppId_t, available bool, pchName string, success bool)
	BIsSubscribed() bool
	BIsLowViolence() bool
	BIsCybercafe() bool
	BIsVACBanned() bool
	BIsDlcInstalled(appID AppId_t) bool
	BIsSubscribedApp(appID AppId_t) bool
	BIsSubscribedFromFreeWeekend() bool
	BIsSubscribedFromFamilySharing() bool
	BIsTimedTrial() (allowedSeconds, playedSeconds uint32, ok bool)
	BIsAppInstalled(appID AppId_t) bool
	GetAvailableGameLanguages() string
	GetEarliestPurchaseUnixTime(appID AppId_t) uint32
	GetAppInstallDir(appID AppId_t) string
	GetCurrentGameLanguage() string
	GetDLCCount() int32
	GetCurrentBetaName() (string, bool)
	GetInstalledDepots(appID AppId_t) []DepotId_t
	GetAppOwner() CSteamID
	GetLaunchQueryParam(key string) string
	GetDlcDownloadProgress(appID AppId_t) (downloaded, total uint64, ok bool)
	GetAppBuildId() int32
	GetFileDetails(filename string) SteamAPICall_t
	GetLaunchCommandLine(bufferSize int) string
	GetNumBetas() (total int, available int, private int)
	GetBetaInfo(index int) (flags uint32, buildID uint32, name string, description string, ok bool)
	InstallDLC(appID AppId_t)
	UninstallDLC(appID AppId_t)
	RequestAppProofOfPurchaseKey(appID AppId_t)
	RequestAllProofOfPurchaseKeys()
	MarkContentCorrupt(missingFilesOnly bool) bool
	SetDlcContext(appID AppId_t) bool
	SetActiveBeta(name string) bool
}

func SteamApps

func SteamApps() ISteamApps

func SteamAppsV008

func SteamAppsV008() ISteamApps

SteamAppsV008 returns the v008 apps interface.

type ISteamClient added in v1.63.12

type ISteamClient struct {
	// contains filtered or unexported fields
}

func SteamClient added in v1.63.12

func SteamClient() ISteamClient

func SteamClientRaw added in v1.63.12

func SteamClientRaw() ISteamClient

SteamClientRaw returns the ISteamClient interface pointer for purego/ffi calls.

func (ISteamClient) Ptr added in v1.63.12

func (i ISteamClient) Ptr() uintptr

func (ISteamClient) Valid added in v1.63.12

func (i ISteamClient) Valid() bool

type ISteamController added in v1.63.12

type ISteamController struct {
	// contains filtered or unexported fields
}

func SteamController added in v1.63.12

func SteamController() ISteamController

func SteamControllerRaw added in v1.63.12

func SteamControllerRaw() ISteamController

SteamControllerRaw returns the ISteamController interface pointer for purego/ffi calls.

func (ISteamController) Ptr added in v1.63.12

func (i ISteamController) Ptr() uintptr

func (ISteamController) Valid added in v1.63.12

func (i ISteamController) Valid() bool

type ISteamFriends

type ISteamFriends interface {
	GetPersonaName() string
	GetPersonaState() EPersonaState
	GetFriendCount(flags EFriendFlags) int
	GetFriendByIndex(index int, flags EFriendFlags) CSteamID
	Friends(flags EFriendFlags) iter.Seq[CSteamID]
	GetFriendRelationship(friend CSteamID) EFriendRelationship
	GetFriendPersonaState(friend CSteamID) EPersonaState
	GetFriendPersonaName(friend CSteamID) string
	GetFriendPersonaNameHistory(friend CSteamID, index int) string
	GetFriendSteamLevel(friend CSteamID) int
	GetSmallFriendAvatar(friend CSteamID) int32
	GetMediumFriendAvatar(friend CSteamID) int32
	GetLargeFriendAvatar(friend CSteamID) int32
	SetRichPresence(string, string) bool
	GetFriendGamePlayed(friend CSteamID) (FriendGameInfo, bool)
	InviteUserToGame(friend CSteamID, connectString string) bool
	ActivateGameOverlay(dialog string)
	ActivateGameOverlayToUser(dialog string, steamID CSteamID)
	ActivateGameOverlayToWebPage(url string, mode EActivateGameOverlayToWebPageMode)
	ActivateGameOverlayToStore(appID AppId_t, flag EOverlayToStoreFlag)
	ActivateGameOverlayInviteDialog(lobbyID CSteamID)
	ActivateGameOverlayInviteDialogConnectString(connectString string)
}

func SteamFriends

func SteamFriends() ISteamFriends

func SteamFriendsV018

func SteamFriendsV018() ISteamFriends

SteamFriendsV018 returns the v018 friends interface.

type ISteamGameCoordinator added in v1.63.12

type ISteamGameCoordinator struct {
	// contains filtered or unexported fields
}

func SteamGameCoordinator added in v1.63.12

func SteamGameCoordinator() ISteamGameCoordinator

func SteamGameCoordinatorRaw added in v1.63.12

func SteamGameCoordinatorRaw() ISteamGameCoordinator

SteamGameCoordinatorRaw returns the ISteamGameCoordinator interface pointer for purego/ffi calls.

func (ISteamGameCoordinator) Ptr added in v1.63.12

func (ISteamGameCoordinator) Valid added in v1.63.12

func (i ISteamGameCoordinator) Valid() bool

type ISteamGameServer

type ISteamGameServer interface {
	AssociateWithClan(clanID CSteamID) SteamAPICall_t
	BeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResult
	BLoggedOn() bool
	BSecure() bool
	BUpdateUserData(steamIDUser CSteamID, playerName string, score uint32) bool
	CancelAuthTicket(authTicket HAuthTicket)
	ClearAllKeyValues()
	ComputeNewPlayerCompatibility(steamIDNewPlayer CSteamID, steamIDPlayers []CSteamID, steamIDPlayersInGame []CSteamID, steamIDTeamPlayers []CSteamID) SteamAPICall_t
	CreateUnauthenticatedUserConnection() CSteamID
	EnableHeartbeats(active bool)
	EndAuthSession(steamID CSteamID)
	ForceHeartbeat()
	GetAuthSessionTicket(authTicket []byte) (ticket HAuthTicket, size uint32)
	GetGameplayStats()
	GetNextOutgoingPacket(dest []byte) (size int32, ip uint32, port uint16)
	GetPublicIP() uint32
	GetServerReputation() SteamAPICall_t
	GetSteamID() CSteamID
	HandleIncomingPacket(data []byte, ip uint32, port uint16) bool
	InitGameServer(ip uint32, steamPort uint16, gamePort uint16, queryPort uint16, serverMode uint32, versionString string) bool
	LogOff()
	LogOn(token string)
	LogOnAnonymous()
	RequestUserGroupStatus(steamIDUser CSteamID, steamIDGroup CSteamID) bool
	SendUserConnectAndAuthenticate(ipClient uint32, authBlob []byte) (steamIDUser CSteamID, ok bool)
	SendUserDisconnect(steamIDUser CSteamID)
	SetBotPlayerCount(botPlayers int32)
	SetDedicatedServer(dedicated bool)
	SetGameData(gameData string)
	SetGameDescription(description string)
	SetGameTags(gameTags string)
	SetHeartbeatInterval(interval int)
	SetKeyValue(key string, value string)
	SetMapName(mapName string)
	SetMaxPlayerCount(playersMax int32)
	SetModDir(modDir string)
	SetPasswordProtected(passwordProtected bool)
	SetProduct(product string)
	SetRegion(region string)
	SetServerName(serverName string)
	SetSpectatorPort(spectatorPort uint16)
	SetSpectatorServerName(spectatorServerName string)
	UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResult
	WasRestartRequested() bool
}

func SteamGameServer

func SteamGameServer() ISteamGameServer

func SteamGameServerV015

func SteamGameServerV015() ISteamGameServer

SteamGameServerV015 returns the v015 game server interface.

type ISteamGameServerStats added in v1.63.12

type ISteamGameServerStats struct {
	// contains filtered or unexported fields
}

func SteamGameServerStats added in v1.63.12

func SteamGameServerStats() ISteamGameServerStats

func SteamGameServerStatsRaw added in v1.63.12

func SteamGameServerStatsRaw() ISteamGameServerStats

SteamGameServerStatsRaw returns the ISteamGameServerStats interface pointer for purego/ffi calls.

func (ISteamGameServerStats) Ptr added in v1.63.12

func (ISteamGameServerStats) Valid added in v1.63.12

func (i ISteamGameServerStats) Valid() bool

type ISteamHTMLSurface added in v1.63.12

type ISteamHTMLSurface struct {
	// contains filtered or unexported fields
}

func SteamHTMLSurface added in v1.63.12

func SteamHTMLSurface() ISteamHTMLSurface

func SteamHTMLSurfaceRaw added in v1.63.12

func SteamHTMLSurfaceRaw() ISteamHTMLSurface

SteamHTMLSurfaceRaw returns the ISteamHTMLSurface interface pointer for purego/ffi calls.

func (ISteamHTMLSurface) Ptr added in v1.63.12

func (i ISteamHTMLSurface) Ptr() uintptr

func (ISteamHTMLSurface) Valid added in v1.63.12

func (i ISteamHTMLSurface) Valid() bool

type ISteamHTTP

type ISteamHTTP interface {
	CreateHTTPRequest(method EHTTPMethod, absoluteURL string) HTTPRequestHandle
	SetHTTPRequestHeaderValue(request HTTPRequestHandle, headerName, headerValue string) bool
	SendHTTPRequest(request HTTPRequestHandle) (SteamAPICall_t, bool)
	GetHTTPResponseBodySize(request HTTPRequestHandle) (uint32, bool)
	GetHTTPResponseBodyData(request HTTPRequestHandle, buffer []byte) bool
	ReleaseHTTPRequest(request HTTPRequestHandle) bool
}

func SteamHTTP

func SteamHTTP() ISteamHTTP

func SteamHTTPV003

func SteamHTTPV003() ISteamHTTP

SteamHTTPV003 returns the v003 HTTP interface.

type ISteamInput

type ISteamInput interface {
	GetConnectedControllers() []InputHandle_t
	ConnectedControllers() iter.Seq[InputHandle_t]
	GetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputType
	Init(bExplicitlyCallRunFrame bool) bool
	Shutdown()
	RunFrame()
	EnableDeviceCallbacks()
	GetActionSetHandle(actionSetName string) InputActionSetHandle_t
	ActivateActionSet(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
	GetCurrentActionSet(inputHandle InputHandle_t) InputActionSetHandle_t
	ActivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
	DeactivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)
	DeactivateAllActionSetLayers(inputHandle InputHandle_t)
	GetActiveActionSetLayers(inputHandle InputHandle_t, handles []InputActionSetHandle_t) int
	GetDigitalActionHandle(actionName string) InputDigitalActionHandle_t
	GetDigitalActionData(inputHandle InputHandle_t, actionHandle InputDigitalActionHandle_t) InputDigitalActionData
	GetDigitalActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputDigitalActionHandle_t, origins []EInputActionOrigin) int
	GetAnalogActionHandle(actionName string) InputAnalogActionHandle_t
	GetAnalogActionData(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t) InputAnalogActionData
	GetAnalogActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputAnalogActionHandle_t, origins []EInputActionOrigin) int
	StopAnalogActionMomentum(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t)
	GetMotionData(inputHandle InputHandle_t) InputMotionData
	TriggerVibration(inputHandle InputHandle_t, leftSpeed, rightSpeed uint16)
	TriggerVibrationExtended(inputHandle InputHandle_t, leftSpeed, rightSpeed, leftTriggerSpeed, rightTriggerSpeed uint16)
	TriggerSimpleHapticEvent(inputHandle InputHandle_t, pad ESteamControllerPad, durationMicroSec, offMicroSec, repeat uint16)
	SetLEDColor(inputHandle InputHandle_t, red, green, blue uint8, flags ESteamInputLEDFlag)
	ShowBindingPanel(inputHandle InputHandle_t) bool
	GetControllerForGamepadIndex(index int) InputHandle_t
	GetGamepadIndexForController(inputHandle InputHandle_t) int
	GetStringForActionOrigin(origin EInputActionOrigin) string
	GetGlyphForActionOrigin(origin EInputActionOrigin) string
	GetRemotePlaySessionID(inputHandle InputHandle_t) uint32
}

func SteamInput

func SteamInput() ISteamInput

func SteamInputV006

func SteamInputV006() ISteamInput

SteamInputV006 returns the v006 input interface.

type ISteamInventory

type ISteamInventory interface {
	GetResultStatus(result SteamInventoryResult_t) EResult
	GetResultItems(result SteamInventoryResult_t, outItems []SteamItemDetails) (int, bool)
	DestroyResult(result SteamInventoryResult_t)
}

func SteamInventory

func SteamInventory() ISteamInventory

func SteamInventoryV003

func SteamInventoryV003() ISteamInventory

SteamInventoryV003 returns the v003 inventory interface.

type ISteamMatchmaking

type ISteamMatchmaking interface {
	GetFavoriteGameCount() int
	GetFavoriteGame(index int) (FavoriteGame, bool)
	AddFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags, lastPlayedOnServerTime uint32) int
	RemoveFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags uint32) bool

	RequestLobbyList() SteamAPICall_t
	AddRequestLobbyListStringFilter(key, value string, comparisonType ELobbyComparison)
	AddRequestLobbyListNumericalFilter(key string, value int, comparisonType ELobbyComparison)
	AddRequestLobbyListNearValueFilter(key string, value int)
	AddRequestLobbyListFilterSlotsAvailable(slotsAvailable int)
	AddRequestLobbyListDistanceFilter(distanceFilter ELobbyDistanceFilter)
	AddRequestLobbyListResultCountFilter(maxResults int)
	AddRequestLobbyListCompatibleMembersFilter(lobbyID CSteamID)

	GetLobbyByIndex(index int) CSteamID
	CreateLobby(lobbyType ELobbyType, maxMembers int) SteamAPICall_t
	JoinLobby(lobbyID CSteamID) SteamAPICall_t
	LeaveLobby(lobbyID CSteamID)
	InviteUserToLobby(lobbyID, invitee CSteamID) bool
	SetLobbyMemberLimit(lobbyID CSteamID, maxMembers int) bool
	GetLobbyMemberLimit(lobbyID CSteamID) int
	SetLobbyType(lobbyID CSteamID, lobbyType ELobbyType) bool
	SetLobbyJoinable(lobbyID CSteamID, joinable bool) bool
	GetLobbyOwner(lobbyID CSteamID) CSteamID
	SetLobbyOwner(lobbyID, owner CSteamID) bool
	SetLinkedLobby(lobbyID, lobbyDependent CSteamID) bool

	GetNumLobbyMembers(lobbyID CSteamID) int
	GetLobbyMemberByIndex(lobbyID CSteamID, memberIndex int) CSteamID
	LobbyMembers(lobbyID CSteamID) iter.Seq[CSteamID]
	SetLobbyData(lobbyID CSteamID, key, value string) bool
	GetLobbyData(lobbyID CSteamID, key string) string
	DeleteLobbyData(lobbyID CSteamID, key string) bool
	GetLobbyDataCount(lobbyID CSteamID) int
	GetLobbyDataByIndex(lobbyID CSteamID, lobbyDataIndex int) (key, value string, ok bool)
	SetLobbyMemberData(lobbyID CSteamID, key, value string)
	GetLobbyMemberData(lobbyID, user CSteamID, key string) string
	SendLobbyChatMsg(lobbyID CSteamID, msgBody []byte) bool
	GetLobbyChatEntry(lobbyID CSteamID, chatID int, data []byte) (user CSteamID, entryType EChatEntryType, bytesCopied int)
	RequestLobbyData(lobbyID CSteamID) bool

	SetLobbyGameServer(lobbyID CSteamID, ip uint32, port uint16, server CSteamID)
	GetLobbyGameServer(lobbyID CSteamID) (ip uint32, port uint16, server CSteamID, ok bool)
	CheckForPSNGameBootInvite(lobbyID *CSteamID) bool
}

func SteamMatchmaking

func SteamMatchmaking() ISteamMatchmaking

func SteamMatchmakingV009

func SteamMatchmakingV009() ISteamMatchmaking

SteamMatchmakingV009 returns the v009 matchmaking interface.

type ISteamMatchmakingServers added in v1.63.12

type ISteamMatchmakingServers struct {
	// contains filtered or unexported fields
}

func SteamMatchmakingServers added in v1.63.12

func SteamMatchmakingServers() ISteamMatchmakingServers

func SteamMatchmakingServersRaw added in v1.63.12

func SteamMatchmakingServersRaw() ISteamMatchmakingServers

SteamMatchmakingServersRaw returns the ISteamMatchmakingServers interface pointer for purego/ffi calls.

func (ISteamMatchmakingServers) CancelQuery added in v1.63.13

func (s ISteamMatchmakingServers) CancelQuery(request HServerListRequest)

func (ISteamMatchmakingServers) CancelServerQuery added in v1.63.13

func (s ISteamMatchmakingServers) CancelServerQuery(query HServerQuery)

func (ISteamMatchmakingServers) GetServerCount added in v1.63.13

func (s ISteamMatchmakingServers) GetServerCount(request HServerListRequest) int

func (ISteamMatchmakingServers) GetServerDetails added in v1.63.13

func (s ISteamMatchmakingServers) GetServerDetails(request HServerListRequest, server int) uintptr

func (ISteamMatchmakingServers) IsRefreshing added in v1.63.13

func (s ISteamMatchmakingServers) IsRefreshing(request HServerListRequest) bool

func (ISteamMatchmakingServers) PingServer added in v1.63.13

func (s ISteamMatchmakingServers) PingServer(ip uint32, port uint16, response uintptr) HServerQuery

func (ISteamMatchmakingServers) PlayerDetails added in v1.63.13

func (s ISteamMatchmakingServers) PlayerDetails(ip uint32, port uint16, response uintptr) HServerQuery

func (ISteamMatchmakingServers) Ptr added in v1.63.12

func (ISteamMatchmakingServers) RefreshQuery added in v1.63.13

func (s ISteamMatchmakingServers) RefreshQuery(request HServerListRequest)

func (ISteamMatchmakingServers) RefreshServer added in v1.63.13

func (s ISteamMatchmakingServers) RefreshServer(request HServerListRequest, server int)

func (ISteamMatchmakingServers) ReleaseRequest added in v1.63.13

func (s ISteamMatchmakingServers) ReleaseRequest(request HServerListRequest)

func (ISteamMatchmakingServers) RequestFavoritesServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestFavoritesServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) RequestFriendsServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestFriendsServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) RequestHistoryServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestHistoryServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) RequestInternetServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestInternetServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) RequestLANServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestLANServerList(appID AppId_t, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) RequestSpectatorServerList added in v1.63.13

func (s ISteamMatchmakingServers) RequestSpectatorServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequest

func (ISteamMatchmakingServers) ServerRules added in v1.63.13

func (s ISteamMatchmakingServers) ServerRules(ip uint32, port uint16, response uintptr) HServerQuery

func (ISteamMatchmakingServers) Valid added in v1.63.12

func (i ISteamMatchmakingServers) Valid() bool

type ISteamMusic added in v1.63.12

type ISteamMusic struct {
	// contains filtered or unexported fields
}

func SteamMusic added in v1.63.12

func SteamMusic() ISteamMusic

func SteamMusicRaw added in v1.63.12

func SteamMusicRaw() ISteamMusic

SteamMusicRaw returns the ISteamMusic interface pointer for purego/ffi calls.

func (ISteamMusic) Ptr added in v1.63.12

func (i ISteamMusic) Ptr() uintptr

func (ISteamMusic) Valid added in v1.63.12

func (i ISteamMusic) Valid() bool

type ISteamNetworking added in v1.63.12

type ISteamNetworking struct {
	// contains filtered or unexported fields
}

func SteamNetworking added in v1.63.12

func SteamNetworking() ISteamNetworking

func SteamNetworkingRaw added in v1.63.12

func SteamNetworkingRaw() ISteamNetworking

SteamNetworkingRaw returns the legacy ISteamNetworking interface pointer for purego/ffi calls.

func (ISteamNetworking) Ptr added in v1.63.12

func (i ISteamNetworking) Ptr() uintptr

func (ISteamNetworking) Valid added in v1.63.12

func (i ISteamNetworking) Valid() bool

type ISteamNetworkingMessages

type ISteamNetworkingMessages interface {
	SendMessageToUser(identity *SteamNetworkingIdentity, data []byte, sendFlags SteamNetworkingSendFlags, remoteChannel int) EResult
	ReceiveMessagesOnChannel(channel int, maxMessages int) []*SteamNetworkingMessage
	AcceptSessionWithUser(identity *SteamNetworkingIdentity) bool
	CloseSessionWithUser(identity *SteamNetworkingIdentity) bool
	CloseChannelWithUser(identity *SteamNetworkingIdentity, channel int) bool
}

func SteamNetworkingMessages

func SteamNetworkingMessages() ISteamNetworkingMessages

func SteamNetworkingMessagesV002

func SteamNetworkingMessagesV002() ISteamNetworkingMessages

SteamNetworkingMessagesV002 returns the v002 networking messages interface.

type ISteamNetworkingSockets

type ISteamNetworkingSockets interface {
	CreateListenSocketIP(localAddress *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamListenSocket
	CreateListenSocketP2P(localVirtualPort int, options []SteamNetworkingConfigValue) HSteamListenSocket
	ConnectByIPAddress(address *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamNetConnection
	ConnectP2P(identity *SteamNetworkingIdentity, remoteVirtualPort int, options []SteamNetworkingConfigValue) HSteamNetConnection
	AcceptConnection(connection HSteamNetConnection) EResult
	CloseConnection(connection HSteamNetConnection, reason int, debug string, enableLinger bool) bool
	CloseListenSocket(socket HSteamListenSocket) bool
	SendMessageToConnection(connection HSteamNetConnection, data []byte, sendFlags SteamNetworkingSendFlags) (EResult, int64)
	ReceiveMessagesOnConnection(connection HSteamNetConnection, maxMessages int) []*SteamNetworkingMessage
	CreatePollGroup() HSteamNetPollGroup
	DestroyPollGroup(group HSteamNetPollGroup) bool
	SetConnectionPollGroup(connection HSteamNetConnection, group HSteamNetPollGroup) bool
	ReceiveMessagesOnPollGroup(group HSteamNetPollGroup, maxMessages int) []*SteamNetworkingMessage
}

func SteamNetworkingSockets

func SteamNetworkingSockets() ISteamNetworkingSockets

func SteamNetworkingSocketsV012

func SteamNetworkingSocketsV012() ISteamNetworkingSockets

SteamNetworkingSocketsV012 returns the v012 networking sockets interface.

type ISteamNetworkingUtils

type ISteamNetworkingUtils interface {
	AllocateMessage(size int) *SteamNetworkingMessage
	InitRelayNetworkAccess()
	GetLocalTimestamp() SteamNetworkingMicroseconds
}

func SteamNetworkingUtils

func SteamNetworkingUtils() ISteamNetworkingUtils

func SteamNetworkingUtilsV004

func SteamNetworkingUtilsV004() ISteamNetworkingUtils

SteamNetworkingUtilsV004 returns the v004 networking utils interface.

type ISteamRemotePlay added in v1.63.12

type ISteamRemotePlay struct {
	// contains filtered or unexported fields
}

func SteamRemotePlay added in v1.63.12

func SteamRemotePlay() ISteamRemotePlay

func SteamRemotePlayRaw added in v1.63.12

func SteamRemotePlayRaw() ISteamRemotePlay

SteamRemotePlayRaw returns the ISteamRemotePlay interface pointer for purego/ffi calls.

func (ISteamRemotePlay) Ptr added in v1.63.12

func (i ISteamRemotePlay) Ptr() uintptr

func (ISteamRemotePlay) Valid added in v1.63.12

func (i ISteamRemotePlay) Valid() bool

type ISteamRemoteStorage

type ISteamRemoteStorage interface {
	FileWrite(file string, data []byte) bool
	FileRead(file string, data []byte) int32
	FileDelete(file string) bool
	GetFileSize(file string) int32
}

func SteamRemoteStorage

func SteamRemoteStorage() ISteamRemoteStorage

func SteamRemoteStorageV016

func SteamRemoteStorageV016() ISteamRemoteStorage

SteamRemoteStorageV016 returns the v016 remote storage interface.

type ISteamScreenshots added in v1.63.12

type ISteamScreenshots struct {
	// contains filtered or unexported fields
}

func SteamScreenshots added in v1.63.12

func SteamScreenshots() ISteamScreenshots

func SteamScreenshotsRaw added in v1.63.12

func SteamScreenshotsRaw() ISteamScreenshots

SteamScreenshotsRaw returns the ISteamScreenshots interface pointer for purego/ffi calls.

func (ISteamScreenshots) Ptr added in v1.63.12

func (i ISteamScreenshots) Ptr() uintptr

func (ISteamScreenshots) Valid added in v1.63.12

func (i ISteamScreenshots) Valid() bool

type ISteamTimeline added in v1.63.12

type ISteamTimeline struct {
	// contains filtered or unexported fields
}

func SteamTimeline added in v1.63.12

func SteamTimeline() ISteamTimeline

func SteamTimelineRaw added in v1.63.12

func SteamTimelineRaw() ISteamTimeline

SteamTimelineRaw returns the ISteamTimeline interface pointer for purego/ffi calls.

func (ISteamTimeline) Ptr added in v1.63.12

func (i ISteamTimeline) Ptr() uintptr

func (ISteamTimeline) Valid added in v1.63.12

func (i ISteamTimeline) Valid() bool

type ISteamUGC

type ISteamUGC interface {
	GetNumSubscribedItems(includeLocallyDisabled bool) uint32
	GetSubscribedItems(includeLocallyDisabled bool) []PublishedFileId_t
}

func SteamUGC

func SteamUGC() ISteamUGC

func SteamUGCV021

func SteamUGCV021() ISteamUGC

SteamUGCV021 returns the v021 UGC interface.

type ISteamUser

type ISteamUser interface {
	AdvertiseGame(gameServerSteamID CSteamID, ip uint32, port uint16)
	BeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResult
	BIsBehindNAT() bool
	BIsPhoneIdentifying() bool
	BIsPhoneRequiringVerification() bool
	BIsPhoneVerified() bool
	BIsTwoFactorEnabled() bool
	BLoggedOn() bool
	BSetDurationControlOnlineState(newState EDurationControlOnlineState) bool
	CancelAuthTicket(authTicket HAuthTicket)
	DecompressVoice(compressedData []byte, destBuffer []byte, desiredSampleRate uint32) (bytesWritten uint32, result EVoiceResult)
	EndAuthSession(steamID CSteamID)
	GetAuthSessionTicket(authTicket []byte, identityRemote *SteamNetworkingIdentity) (ticket HAuthTicket, size uint32)
	GetAuthTicketForWebApi(identity string) HAuthTicket
	GetAvailableVoice() (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)
	GetDurationControl() (control DurationControl, ok bool)
	GetEncryptedAppTicket(ticket []byte) (ticketSize uint32, ok bool)
	GetGameBadgeLevel(series int32, foil bool) int32
	GetHSteamUser() HSteamUser
	GetPlayerSteamLevel() int32
	GetSteamID() CSteamID
	GetUserDataFolder() (path string, ok bool)
	GetVoice(wantCompressed bool, compressedData []byte, wantUncompressed bool, uncompressedData []byte, desiredSampleRate uint32) (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)
	GetVoiceOptimalSampleRate() uint32
	InitiateGameConnection(authBlob []byte, steamIDGameServer CSteamID, ipServer uint32, portServer uint16, secure bool) int32
	RequestEncryptedAppTicket(dataToInclude []byte) SteamAPICall_t
	RequestStoreAuthURL(redirectURL string) SteamAPICall_t
	StartVoiceRecording()
	StopVoiceRecording()
	TerminateGameConnection(ipServer uint32, portServer uint16)
	TrackAppUsageEvent(gameID CGameID, eventCode int32, extraInfo string)
	UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResult
}

func SteamUser

func SteamUser() ISteamUser

func SteamUserV023

func SteamUserV023() ISteamUser

SteamUserV023 returns the v023 user interface.

type ISteamUserStats

type ISteamUserStats interface {
	GetAchievement(name string) (achieved, success bool)
	SetAchievement(name string) bool
	ClearAchievement(name string) bool
	StoreStats() bool
}

func SteamUserStats

func SteamUserStats() ISteamUserStats

func SteamUserStatsV013

func SteamUserStatsV013() ISteamUserStats

SteamUserStatsV013 returns the v013 user stats interface.

type ISteamUtils

type ISteamUtils interface {
	GetSecondsSinceAppActive() uint32
	GetSecondsSinceComputerActive() uint32
	GetConnectedUniverse() EUniverse
	GetServerRealTime() uint32
	GetIPCountry() string
	GetImageSize(image int) (width, height uint32, ok bool)
	GetImageRGBA(image int, dest []byte) bool
	GetCurrentBatteryPower() uint8
	GetAppID() uint32
	IsOverlayEnabled() bool
	BOverlayNeedsPresent() bool
	IsSteamRunningOnSteamDeck() bool
	SetOverlayNotificationPosition(position ENotificationPosition)
	SetOverlayNotificationInset(horizontal, vertical int32)
	IsAPICallCompleted(call SteamAPICall_t) (failed bool, ok bool)
	GetAPICallFailureReason(call SteamAPICall_t) ESteamAPICallFailure
	GetAPICallResult(call SteamAPICall_t, callback uintptr, callbackSize int32, expectedCallback int32) (failed bool, ok bool)
	GetIPCCallCount() uint32
	ShowFloatingGamepadTextInput(keyboardMode EFloatingGamepadTextInputMode, textFieldXPosition, textFieldYPosition, textFieldWidth, textFieldHeight int32) bool
}

func SteamUtils

func SteamUtils() ISteamUtils

func SteamUtilsV010

func SteamUtilsV010() ISteamUtils

SteamUtilsV010 returns the v010 utils interface.

type ISteamVideo added in v1.63.12

type ISteamVideo struct {
	// contains filtered or unexported fields
}

func SteamVideo added in v1.63.12

func SteamVideo() ISteamVideo

func SteamVideoRaw added in v1.63.12

func SteamVideoRaw() ISteamVideo

SteamVideoRaw returns the ISteamVideo interface pointer for purego/ffi calls.

func (ISteamVideo) Ptr added in v1.63.12

func (i ISteamVideo) Ptr() uintptr

func (ISteamVideo) Valid added in v1.63.12

func (i ISteamVideo) Valid() bool

type InputActionSetHandle_t added in v1.63.1

type InputActionSetHandle_t uint64

type InputAnalogActionData added in v1.63.1

type InputAnalogActionData struct {
	Mode   EInputSourceMode
	X      float32
	Y      float32
	Active bool
}

type InputAnalogActionHandle_t added in v1.63.1

type InputAnalogActionHandle_t uint64

type InputDigitalActionData added in v1.63.1

type InputDigitalActionData struct {
	State  bool
	Active bool
}

type InputDigitalActionHandle_t added in v1.63.1

type InputDigitalActionHandle_t uint64

type InputHandle_t

type InputHandle_t uint64

type InputMotionData added in v1.63.1

type InputMotionData struct {
	RotQuatX  float32
	RotQuatY  float32
	RotQuatZ  float32
	RotQuatW  float32
	PosAccelX float32
	PosAccelY float32
	PosAccelZ float32
	RotVelX   float32
	RotVelY   float32
	RotVelZ   float32
}

type LobbyChatMsg added in v1.63.15

type LobbyChatMsg struct {
	LobbySteamID  CSteamID
	UserSteamID   CSteamID
	ChatEntryType uint8

	ChatID int32
	// contains filtered or unexported fields
}

LobbyChatMsg mirrors Steam's LobbyChatMsg_t callback payload.

func (LobbyChatMsg) EntryType added in v1.63.15

func (m LobbyChatMsg) EntryType() EChatEntryType

EntryType returns the callback's chat entry type as EChatEntryType.

type LobbyChatUpdate added in v1.63.15

type LobbyChatUpdate struct {
	LobbySteamID          CSteamID
	UserChangedSteamID    CSteamID
	MakingChangeSteamID   CSteamID
	ChatMemberStateChange uint32
}

LobbyChatUpdate mirrors Steam's LobbyChatUpdate_t callback payload.

type LobbyDataUpdate added in v1.63.15

type LobbyDataUpdate struct {
	LobbySteamID  CSteamID
	MemberSteamID CSteamID
	Success       uint8
}

LobbyDataUpdate mirrors Steam's LobbyDataUpdate_t callback payload.

type PublishedFileId_t

type PublishedFileId_t uint64

type SteamAPICall_t

type SteamAPICall_t uint64

type SteamInventoryResult_t

type SteamInventoryResult_t int32

type SteamItemDef_t

type SteamItemDef_t int32

type SteamItemDetails

type SteamItemDetails struct {
	ItemID     SteamItemInstanceID_t
	Definition SteamItemDef_t
	Quantity   uint16
	Flags      uint16
}

type SteamItemInstanceID_t

type SteamItemInstanceID_t uint64

type SteamNetworkingConfigValue

type SteamNetworkingConfigValue struct {
	Value    int32
	DataType int32
	Data     uint64
}

type SteamNetworkingIPAddr

type SteamNetworkingIPAddr struct {
	// contains filtered or unexported fields
}

func (*SteamNetworkingIPAddr) SetIPv4 added in v1.63.1

func (a *SteamNetworkingIPAddr) SetIPv4(ip uint32, port uint16)

func (*SteamNetworkingIPAddr) SetIPv6 added in v1.63.1

func (a *SteamNetworkingIPAddr) SetIPv6(ip [16]byte, port uint16)

type SteamNetworkingIdentity

type SteamNetworkingIdentity struct {
	// contains filtered or unexported fields
}

func (*SteamNetworkingIdentity) SetIPv4Addr

func (i *SteamNetworkingIdentity) SetIPv4Addr(ip uint32, port uint16)

func (*SteamNetworkingIdentity) SetSteamID

func (i *SteamNetworkingIdentity) SetSteamID(steamID CSteamID)

func (*SteamNetworkingIdentity) SetSteamID64

func (i *SteamNetworkingIdentity) SetSteamID64(steamID uint64)

type SteamNetworkingMessage

type SteamNetworkingMessage struct {
	Data          uintptr
	Size          int32
	Connection    HSteamNetConnection
	IdentityPeer  SteamNetworkingIdentity
	ConnUserData  int64
	TimeReceived  SteamNetworkingMicroseconds
	MessageNumber int64
	FreeDataFunc  uintptr
	ReleaseFunc   uintptr
	Channel       int32
	Flags         int32
	UserData      int64
	Lane          uint16
	// contains filtered or unexported fields
}

func (*SteamNetworkingMessage) Release

func (m *SteamNetworkingMessage) Release()

type SteamNetworkingMicroseconds

type SteamNetworkingMicroseconds int64

type SteamNetworkingSendFlags

type SteamNetworkingSendFlags int32
const (
	SteamNetworkingSend_Unreliable               SteamNetworkingSendFlags = 0
	SteamNetworkingSend_NoNagle                  SteamNetworkingSendFlags = 1
	SteamNetworkingSend_NoDelay                  SteamNetworkingSendFlags = 4
	SteamNetworkingSend_Reliable                 SteamNetworkingSendFlags = 8
	SteamNetworkingSend_UseCurrentThread         SteamNetworkingSendFlags = 16
	SteamNetworkingSend_AutoRestartBrokenSession SteamNetworkingSendFlags = 32
)

Directories

Path Synopsis
examples
basic command
profile command
profile_raw command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL