steamworks

package module
v1.63.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

go-steamworks

Go bindings for a subset of the Steamworks SDK.

[!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.
Supported APIs and methods

This binding exposes a subset of the Steamworks SDK via Go interfaces. The implemented methods include:

General

  • RestartAppIfNecessary(appID uint32) bool
  • Init() error
  • RunCallbacks()

ISteamApps (steamworks.SteamApps())

  • 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

ISteamFriends (steamworks.SteamFriends())

  • 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
  • SetRichPresence(key, value 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)

ISteamInput (steamworks.SteamInput())

  • GetConnectedControllers() []InputHandle_t
  • GetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputType
  • Init(bExplicitlyCallRunFrame bool) bool
  • RunFrame()

ISteamMatchmaking (steamworks.SteamMatchmaking())

  • RequestLobbyList() SteamAPICall_t
  • GetLobbyByIndex(index int) CSteamID
  • CreateLobby(lobbyType ELobbyType, maxMembers int) SteamAPICall_t
  • JoinLobby(lobbyID CSteamID) SteamAPICall_t
  • LeaveLobby(lobbyID CSteamID)
  • InviteUserToLobby(lobbyID, invitee CSteamID) bool
  • GetNumLobbyMembers(lobbyID CSteamID) int
  • GetLobbyMemberByIndex(lobbyID CSteamID, memberIndex int) CSteamID
  • GetLobbyData(lobbyID CSteamID, key string) string
  • SetLobbyData(lobbyID CSteamID, key, value string) bool
  • GetLobbyOwner(lobbyID CSteamID) CSteamID
  • SetLobbyOwner(lobbyID, owner CSteamID) bool
  • SetLobbyGameServer(lobbyID CSteamID, ip uint32, port uint16, server CSteamID)
  • GetLobbyGameServer(lobbyID CSteamID) (ip uint32, port uint16, server CSteamID, ok bool)
  • SetLobbyJoinable(lobbyID CSteamID, joinable bool) bool
  • SetLobbyMemberLimit(lobbyID CSteamID, maxMembers int) bool
  • SetLobbyType(lobbyID CSteamID, lobbyType ELobbyType) bool

ISteamHTTP (steamworks.SteamHTTP())

  • 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

ISteamUGC (steamworks.SteamUGC())

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

ISteamInventory (steamworks.SteamInventory())

  • GetResultStatus(result SteamInventoryResult_t) EResult
  • GetResultItems(result SteamInventoryResult_t, outItems []SteamItemDetails) (int, bool)
  • DestroyResult(result SteamInventoryResult_t)

ISteamNetworkingMessages (steamworks.SteamNetworkingMessages())

  • 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

ISteamNetworkingUtils (steamworks.SteamNetworkingUtils())

  • AllocateMessage(size int) *SteamNetworkingMessage
  • InitRelayNetworkAccess()
  • GetLocalTimestamp() SteamNetworkingMicroseconds

ISteamNetworkingSockets (steamworks.SteamNetworkingSockets())

  • CreateListenSocketP2P(localVirtualPort int, options []SteamNetworkingConfigValue) HSteamListenSocket
  • 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

ISteamGameServer (steamworks.SteamGameServer())

  • SetProduct(product string)
  • SetGameDescription(description string)
  • LogOnAnonymous()
  • LogOff()
  • BLoggedOn() bool
  • GetSteamID() CSteamID

ISteamRemoteStorage (steamworks.SteamRemoteStorage())

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

ISteamUser (steamworks.SteamUser())

  • GetSteamID() CSteamID

ISteamUserStats (steamworks.SteamUserStats())

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

ISteamUtils (steamworks.SteamUtils())

  • 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
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 Init

func Init() error

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 RestartAppIfNecessary

func RestartAppIfNecessary(appID uint32) bool

func RunCallbacks

func RunCallbacks()

Types

type AppId_t

type AppId_t uint32

type CGameID

type CGameID uint64

type CSteamID

type CSteamID uint64

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.

type DepotId_t

type DepotId_t uint32

type EActivateGameOverlayToWebPageMode

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

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 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 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 FriendGameInfo

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

type HSteamListenSocket

type HSteamListenSocket uint32

type HSteamNetConnection

type HSteamNetConnection uint32

type HSteamNetPollGroup

type HSteamNetPollGroup uint32

type HTTPCookieContainerHandle

type HTTPCookieContainerHandle uint32

type HTTPRequestHandle

type HTTPRequestHandle uint32

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 ISteamFriends

type ISteamFriends interface {
	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
	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 ISteamGameServer

type ISteamGameServer interface {
	SetProduct(product string)
	SetGameDescription(description string)
	LogOnAnonymous()
	LogOff()
	BLoggedOn() bool
	GetSteamID() CSteamID
}

func SteamGameServer

func SteamGameServer() ISteamGameServer

func SteamGameServerV015

func SteamGameServerV015() ISteamGameServer

SteamGameServerV015 returns the v015 game server interface.

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
	GetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputType
	Init(bExplicitlyCallRunFrame bool) bool
	RunFrame()
}

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 {
	RequestLobbyList() SteamAPICall_t
	GetLobbyByIndex(index int) CSteamID
	CreateLobby(lobbyType ELobbyType, maxMembers int) SteamAPICall_t
	JoinLobby(lobbyID CSteamID) SteamAPICall_t
	LeaveLobby(lobbyID CSteamID)
	InviteUserToLobby(lobbyID, invitee CSteamID) bool
	GetNumLobbyMembers(lobbyID CSteamID) int
	GetLobbyMemberByIndex(lobbyID CSteamID, memberIndex int) CSteamID
	GetLobbyData(lobbyID CSteamID, key string) string
	SetLobbyData(lobbyID CSteamID, key, value string) bool
	GetLobbyOwner(lobbyID CSteamID) CSteamID
	SetLobbyOwner(lobbyID, owner CSteamID) bool
	SetLobbyGameServer(lobbyID CSteamID, ip uint32, port uint16, server CSteamID)
	GetLobbyGameServer(lobbyID CSteamID) (ip uint32, port uint16, server CSteamID, ok bool)
	SetLobbyJoinable(lobbyID CSteamID, joinable bool) bool
	SetLobbyMemberLimit(lobbyID CSteamID, maxMembers int) bool
	SetLobbyType(lobbyID CSteamID, lobbyType ELobbyType) bool
}

func SteamMatchmaking

func SteamMatchmaking() ISteamMatchmaking

func SteamMatchmakingV009

func SteamMatchmakingV009() ISteamMatchmaking

SteamMatchmakingV009 returns the v009 matchmaking interface.

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 {
	CreateListenSocketP2P(localVirtualPort int, options []SteamNetworkingConfigValue) HSteamListenSocket
	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 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 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 {
	GetSteamID() CSteamID
}

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 InputHandle_t

type InputHandle_t uint64

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
}

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