gslt

package module
v0.0.0-...-892d9ce Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 6 Imported by: 1

README

GSLT-Go

About

This is GSLT(GameServerLoginToken) Management package for Golang.
https://partner.steamgames.com/doc/webapi/IGameServersService
You can check examples to learn how to use it.
go run ./example/example.go -apikey=YOUR_STEAM_WEB_API_KEY -appid=730 -memo=GO_TEST

To add your package,execute go get github.com/FlowingSPDG/gslt-go and import it like this :

import (
	"github.com/FlowingSPDG/gslt-go"
	"fmt"
)

Author

Shugo FlowingSPDG Kawamura

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteGSLTBySteamID

func DeleteGSLTBySteamID(token string, steamid SteamID64) error

DeleteGSLTBySteamID Deletes specified GSLT. Returns error if GSLT was invalid

func DeleteGSLTByToken

func DeleteGSLTByToken(token string, gslt string) error

DeleteGSLTByToken Lists and Deletes specified GSLT. Returns error if GSLT was invalid. High API Usage.

func ResetLoginTokenBySteamID

func ResetLoginTokenBySteamID(token string, steamid SteamID64) (string, error)

ResetLoginTokenBySteamID Resets specified GSLT's token. Returns error if GSLT was invalid. login_token will not be changed if its never used

func SetMemo

func SetMemo(token string, steamid SteamID64, memo string) error

SetMemo Sets/Updates specified GSLT's memo. Returns error if GSLT was invalid

Types

type GSLT

type GSLT struct {
	Steamid     SteamID64 `json:"steamid"`
	Appid       uint32    `json:"appid"`
	LoginToken  string    `json:"login_token"`
	Memo        string    `json:"memo"`
	IsDeleted   bool      `json:"is_deleted"`
	IsExpired   bool      `json:"is_expired"`
	RtLastLogon int       `json:"rt_last_logon"`

	APIToken string `json:"-"`
}

GSLT GSLT Struct.

func GetGSLT

func GetGSLT(token string, memo string, appid uint32) (*GSLT, error)

GetGSLT Generates GSLT. You can use Manager or this function

func ListGSLT

func ListGSLT(token string) ([]*GSLT, error)

ListGSLT Get GSLT Account list

func (*GSLT) Delete

func (g *GSLT) Delete() error

Delete Deletes a persistent game server account

func (*GSLT) GetAccountPublicInfo

func (g *GSLT) GetAccountPublicInfo() (*PublicInfoJSON, error)

GetAccountPublicInfo Gets public information about a given game server account

func (*GSLT) QueryLoginToken

func (g *GSLT) QueryLoginToken() (*QueryInfoJSON, error)

QueryLoginToken Queries the status of the specified token, which must be owned by you

func (*GSLT) ResetLoginToken

func (g *GSLT) ResetLoginToken() error

ResetLoginToken Generates a new login token for the specified game server

func (*GSLT) SetMemo

func (g *GSLT) SetMemo(memo string) error

SetMemo This method changes the memo associated with the game server account. Memos do not affect the account in any way. The memo shows up in the GetAccountList response and serves only as a reminder of what the account is used for.

type Manager

type Manager struct {
	APIToken string
	Servers  []*GSLT
}

Manager GSLT Manager.

func NewManager

func NewManager(token string) Manager

NewManager Get new manager

func (*Manager) Generate

func (m *Manager) Generate(memo string, appid uint32) (*GSLT, error)

Generate Creates a persistent game server account

func (*Manager) GetList

func (m *Manager) GetList() error

GetList Gets a list of game server accounts with their logon tokens

type PublicInfoJSON

type PublicInfoJSON struct {
	// contains filtered or unexported fields
}

PublicInfoJSON Response Struct for generating GSLT. private

func GetAccountPublicInfo

func GetAccountPublicInfo(token string, steamid SteamID64) (*PublicInfoJSON, error)

GetAccountPublicInfo Gets GSLT Account's public information

type QueryInfoJSON

type QueryInfoJSON struct {
	// contains filtered or unexported fields
}

QueryInfoJSON Response Struct for generating GSLT. private

func QueryLoginToken

func QueryLoginToken(token string, logintoken string) (*QueryInfoJSON, error)

QueryLoginToken Queries login token info

type SteamID64

type SteamID64 uint64

SteamID64 is uint64 format

func (SteamID64) String

func (m SteamID64) String() string

func (*SteamID64) UnmarshalJSON

func (m *SteamID64) UnmarshalJSON(b []byte) error

UnmarshalJSON Unmarshalizes SteamID64 to uint64

Directories

Path Synopsis
example
gen

Jump to

Keyboard shortcuts

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