SteamID
public struct SteamID
extension SteamID: Hashable, Comparable, CustomStringConvertible, Sendable
The globally unique identifier for all Steam accounts, Steam groups, lobbies, and chat rooms.
Steamworks CSteamID
. Methods and interface style to follow Steamworks, see docs there.
Topics
Properties
var universe: Universe
var universe: Universe
var accountType: AccountType
var accountType: AccountType
var accountInstance: Int
var accountInstance: Int
var accountID: AccountID
var accountID: AccountID
var asUInt64: UInt64
var asUInt64: UInt64
Converts steam ID to its 64-bit representation
Declaration
public var asUInt64: UInt64 { get }
var staticAccountKey: UInt64
var staticAccountKey: UInt64
Converts the static parts of a steam ID to a 64-bit representation.
For multiseat accounts, all instances of that account will have the same static account key, so they can be grouped together by the static account key.
Declaration
public var staticAccountKey: UInt64 { get }
Queries
var isValid: Bool
var isValid: Bool
var isBlankAnonAccount: Bool
var isBlankAnonAccount: Bool
Is this an anonymous game server login that will be filled in?
Declaration
public var isBlankAnonAccount: Bool { get }
var isGameServerAccount: Bool
var isGameServerAccount: Bool
Is this a game server account id? (Either persistent or anonymous)
Declaration
public var isGameServerAccount: Bool { get }
var isPersistentGameServerAccount: Bool
var isPersistentGameServerAccount: Bool
Is this a persistent (not anonymous) game server account id?
Declaration
public var isPersistentGameServerAccount: Bool { get }
var isAnonGameServerAccount: Bool
var isAnonGameServerAccount: Bool
Is this an anonymous game server account id?
Declaration
public var isAnonGameServerAccount: Bool { get }
var isContentServerAccount: Bool
var isContentServerAccount: Bool
Is this a content server account id?
Declaration
public var isContentServerAccount: Bool { get }
var isClanAccount: Bool
var isClanAccount: Bool
var isChatAccount: Bool
var isChatAccount: Bool
var isLobby: Bool
var isLobby: Bool
var isIndividualAccount: Bool
var isIndividualAccount: Bool
Is this an individual user account id?
Declaration
public var isIndividualAccount: Bool { get }
var isAnonAccount: Bool
var isAnonAccount: Bool
var isAnonUserAccount: Bool
var isAnonUserAccount: Bool
Is this an anonymous user account? ( used to create an account or reset a password )
Declaration
public var isAnonUserAccount: Bool { get }
var isConsoleUserAccount: Bool
var isConsoleUserAccount: Bool
Is this a faked up Steam ID for a PSN friend account?
Declaration
public var isConsoleUserAccount: Bool { get }
Initializers
init()
init()
Create a fresh invalid SteamID.
Declaration
public init()
init(accountID: AccountID, universe: Universe, accountType: AccountType)
init(accountID: AccountID, universe: Universe, accountType: AccountType)
Create a Steam ID using the default instance.
Declaration
public init(accountID: AccountID, universe: Universe, accountType: AccountType)
init(accountID: AccountID, accountInstance: Int, universe: Universe, accountType: AccountType)
init(accountID: AccountID, accountInstance: Int, universe: Universe, accountType: AccountType)
Create a Steam ID with an instance.
Declaration
public init(
accountID: AccountID, accountInstance: Int, universe: Universe,
accountType: AccountType)
init(UInt64)
init(UInt64)
Compound Setters
func set(accountID: AccountID, universe: Universe, accountType: AccountType)
func set(accountID: AccountID, universe: Universe, accountType: AccountType)
Set parameters for steam ID
Declaration
public mutating func set(
accountID: AccountID, universe: Universe, accountType: AccountType)
func instancedSet(accountID: AccountID, accountInstance: Int, universe: Universe, accountType: AccountType)
func instancedSet(accountID: AccountID, accountInstance: Int, universe: Universe, accountType: AccountType)
Set parameters for steam ID
Declaration
public mutating func instancedSet(
accountID: AccountID, accountInstance: Int, universe: Universe,
accountType: AccountType)
func fullSet(identifier: UInt64, universe: Universe, accountType: AccountType)
func fullSet(identifier: UInt64, universe: Universe, accountType: AccountType)
Initialize a steam ID from its 52 bit parts and universe/type
Declaration
public mutating func fullSet(
identifier: UInt64, universe: Universe, accountType: AccountType)
func setFromUInt64(UInt64)
func setFromUInt64(UInt64)
Initialize a steam ID from its 64-bit representation
Declaration
public mutating func setFromUInt64(_ steamID: UInt64)
func clear()
func clear()
Clear all fields, leaving an invalid ID.
Declaration
public mutating func clear()
func createBlankAnonLogon(universe: Universe)
func createBlankAnonLogon(universe: Universe)
Create an anonymous game server login to be filled in by the AM
Declaration
public mutating func createBlankAnonLogon(universe: Universe)
func createBlankAnonUserLogon(universe: Universe)
func createBlankAnonUserLogon(universe: Universe)
Create an anonymous game server login to be filled in by the AM
Declaration
public mutating func createBlankAnonUserLogon(universe: Universe)
Well-known Steam IDs
static var nil: SteamID
static var nil: SteamID
static var outOfDateGS: SteamID
static var outOfDateGS: SteamID
This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol to provide its steamID
Declaration
public static let outOfDateGS: SteamID
static var lanModeGS: SteamID
static var lanModeGS: SteamID
This steamID comes from a user game connection to an sv_lan GS
Declaration
public static let lanModeGS: SteamID
static var notInitYetGS: SteamID
static var notInitYetGS: SteamID
This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized its steam3 component and started logging on.
Declaration
public static let notInitYetGS: SteamID
static var nonSteamGS: SteamID
static var nonSteamGS: SteamID
This steamID can come from a user game connection to a GS that isn’t using the steam authentication system but still wants to support the “Join Game” option in the friends list
Declaration
public static let nonSteamGS: SteamID
Conformances
static func <(lhs: SteamID, rhs: SteamID) -> Bool
static func <(lhs: SteamID, rhs: SteamID) -> Bool
var description: String
var description: String
A human-readable description of the Steam ID
Declaration
public var description: String { get }