steamid

package
v0.0.0-...-3dc26c4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPlayerID = errors.New("invalid player id")
	ErrInvalidClanID   = errors.New("invalid clan id")
	ErrInvalidChatID   = errors.New("invalid chat id")
	ErrInvalidGroupID  = errors.New("invalid group id")
)
View Source
var (
	RegexpPlayerID1  = regexp.MustCompile(`^STEAM_([0-5]):([01]):(\d+)$`)              // Universe ID, Lowest bit, Highest bit
	RegexpPlayerID3  = regexp.MustCompile(`^\[?([a-zA-Z])\:([0-5])\:(\d+)\]?$`)        // Account type character, Universe ID, Account ID
	RegexpPlayerID3I = regexp.MustCompile(`^\[?([a-zA-Z])\:([0-5])\:(\d+)\:(\d+)\]?$`) // Account type character, Universe ID, Account ID, Instance ID
	RegexpPlayerID32 = regexp.MustCompile(`^\d{1,16}$`)                                // Account ID
	RegexpPlayerID64 = regexp.MustCompile(`^\d{17}$`)                                  // ID
)

noinspection RegExpRedundantEscape

View Source
var (
	RegexpGroupID64 = regexp.MustCompile(`^\d{18}$`)   // ID
	RegexpGroupID   = regexp.MustCompile(`^\d{1,17}$`) // Account ID
)

Functions

This section is empty.

Types

type AccountID

type AccountID uint32

type AccountType

type AccountType uint8
const (
	AccountTypeInvalid        AccountType = 0
	AccountTypeIndividual     AccountType = 1
	AccountTypeMultiseat      AccountType = 2
	AccountTypeGameServer     AccountType = 3
	AccountTypeAnonGameServer AccountType = 4
	AccountTypePending        AccountType = 5
	AccountTypeContentServer  AccountType = 6
	AccountTypeClan           AccountType = 7
	AccountTypeChat           AccountType = 8
	AccountTypeConsoleUser    AccountType = 9
	AccountTypeAnonUser       AccountType = 10
	AccountTypeMax            AccountType = 11
)

noinspection GoUnusedConst

type ChatInstanceID

type ChatInstanceID InstanceID
const (
	ChatInstanceClan     ChatInstanceID = 0x100000 >> 1
	ChatInstanceLobby    ChatInstanceID = 0x100000 >> 2
	ChatInstanceMMSLobby ChatInstanceID = 0x100000 >> 3
)

noinspection GoUnusedConst

type ID

type ID uint64

func NewID

func NewID(universe UniverseID, accountType AccountType, instance InstanceID, accountId AccountID) (id ID)

func ParseGroupID

func ParseGroupID(id string) (out ID, err error)

func ParsePlayerID

func ParsePlayerID(id string) (out ID, err error)

func (ID) ChatToClan

func (id ID) ChatToClan() error

func (ID) ClanToChat

func (id ID) ClanToChat() error

Clan / Chat

func (ID) GetAccountID

func (id ID) GetAccountID() AccountID

Account ID

func (ID) GetAccountType

func (id ID) GetAccountType() AccountType

Account Type

func (ID) GetInstanceID

func (id ID) GetInstanceID() InstanceID

Instance ID

func (ID) GetUniverseID

func (id ID) GetUniverseID() UniverseID

Universe ID

func (*ID) SetAccountID

func (id *ID) SetAccountID(accountID AccountID)

func (*ID) SetAccountType

func (id *ID) SetAccountType(accountType AccountType)

func (*ID) SetInstanceID

func (id *ID) SetInstanceID(instanceID InstanceID)

func (*ID) SetUniverseID

func (id *ID) SetUniverseID(universeID UniverseID)

func (ID) String

func (id ID) String() string

type InstanceID

type InstanceID uint32
const (
	InstanceAll     InstanceID = 0
	InstanceDesktop InstanceID = 1
	InstanceConsole InstanceID = 2
	InstanceWeb     InstanceID = 3
)

noinspection GoUnusedConst

type UniverseID

type UniverseID uint8
const (
	UniverseInvalid  UniverseID = 0
	UniversePublic   UniverseID = 1
	UniverseBeta     UniverseID = 2
	UniverseInternal UniverseID = 3
	UniverseDev      UniverseID = 4
	UniverseMax      UniverseID = 5
)

noinspection GoUnusedConst

Jump to

Keyboard shortcuts

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