steam

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Profile info by digit-based SteamID (e.g. "76561197968575517")
	PROFILE_PAGE_STEAMID = "https://steamcommunity.com/profiles/%s/?xml=1"
	// Profile info by user-defined custom URL (e.g. "ChetFaliszek")
	PROFILE_PAGE_CUSTOM_URL = "https://steamcommunity.com/id/%s/?xml=1"
	// Ignore other part of the proof post, only take signature part.
	MATCH_TEMPLATE = "NextID proof: (.+?):"
)

Variables

View Source
var (

	// Base64|CreatedAtTimestamp|UUID|Previous
	POST_STRUCT = map[string]string{
		"default": "NextID proof: %%SIG_BASE64%%:%d:%s:%s",
	}
)

Functions

func ExtractSteamID

func ExtractSteamID(idInDecimal string) (universe uint, userID uint, y uint, err error)

See also: https://developer.valvesoftware.com/wiki/SteamID

func Init

func Init()

Types

type Steam

type Steam struct {
	*validator.Base
}

func (*Steam) GeneratePostPayload

func (steam *Steam) GeneratePostPayload() (post map[string]string)

func (*Steam) GenerateSignPayload

func (steam *Steam) GenerateSignPayload() (payload string)

func (*Steam) GetUserInfo

func (steam *Steam) GetUserInfo() (err error)

GetUserInfo returns user info from steam profile page XML, will also refresh `self`'s `Identity`, `AltID` and `Text`.

func (*Steam) Validate

func (steam *Steam) Validate() (err error)

type SteamErrorResponse

type SteamErrorResponse struct {
	XMLName xml.Name `xml:"response"`
	Error   string   `xml:"error"`
}

type SteamResponse

type SteamResponse struct {
	XMLName          xml.Name `xml:"profile"`
	SteamID64        string   `xml:"steamID64"`
	SteamID          string   `xml:"steamID"`
	StateMessage     string   `xml:"stateMessage"`
	PrivacyState     string   `xml:"privacyState"`
	VisibilityState  string   `xml:"visibilityState"`
	AvatarIcon       string   `xml:"avatarIcon"`
	AvatarMedium     string   `xml:"avatarMedium"`
	AvatarFull       string   `xml:"avatarFull"`
	VacBanned        string   `xml:"vacBanned"`
	TradeBanState    string   `xml:"tradeBanState"`
	IsLimitedAccount string   `xml:"isLimitedAccount"`
	CustomURL        string   `xml:"customURL"`
	MemberSince      string   `xml:"memberSince"`
	SteamRating      string   `xml:"steamRating"`
	HoursPlayed2Wk   string   `xml:"hoursPlayed2Wk"`
	Headline         string   `xml:"headline"`
	Location         string   `xml:"location"`
	Realname         string   `xml:"realname"`
	Summary          string   `xml:"summary"`
}

Jump to

Keyboard shortcuts

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