struct Steam::ID

Overview

A Steam ID is an encoded 64 bit integer that contains various metadata about a Steam account.

A given ID does not uniquely identify an account, as encoded IDs may be missing certain pieces of metadata if it was decoded from certain formats (see Steam::ID::Format for more info).

Defined in:

formatter.cr
mask.cr
parser.cr
steam_id.cr

Constant Summary

VERSION = "0.2.0"

Constructors

Instance Method Summary

Constructor Detail

def self.new(string : String, format : Format) #

Parses a string as the given Format. Raises Error if parsing fails.


[View source]
def self.new(value : UInt64) #

Create a Steam ID from a 64 bit value


[View source]
def self.new(string : String) #

Attempts to parse the given string as an ID of any of Format. Raises Error if no format parses well.


[View source]

Instance Method Detail

def account_id(with_lowest_bit : Bool = false) #

The account ID this ID represents


[View source]
def account_type #

The AccountType this ID represents


[View source]
def account_type=(new_value : AccountType) #

Re-encodes this ID with an updated AccountType


[View source]
def instance #

The instance of this account


[View source]
def instance=(new_value : UInt64) #

Re-encodes this ID with an updated instance value


[View source]
def lowest_bit #

The lowest bit value of this ID. Used for encoding an ID into a string of a given Format


[View source]
def to_s(format : Format = Format::Community64) #

Serializes this ID as the given Format


[View source]
def to_s(io : IO, format : Format = Format::Community64) #

Serializes this ID as the given Format, writing to the given IO


[View source]
def to_u64 : UInt64 #

[View source]
def universe #

The Universe this ID belongs to


[View source]
def universe=(new_value : Universe) #

Re-encodes this ID with an updated Universe


[View source]