api

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	common.NakamaApi
}

func NewAccount

func NewAccount(token string) *Account

func (*Account) ChangeAccount

func (a *Account) ChangeAccount(email string, password string, url string, mode string) error

ChangeAccount 修改邮箱密码

func (*Account) DeleteAccount

func (a *Account) DeleteAccount(url string, mode string) error

DeleteAccount 删除账户

func (*Account) DeleteFriend

func (a *Account) DeleteFriend(url string, mode string) error

DeleteFriend 删除好友

func (*Account) Disable

func (a *Account) Disable(url string, mode string) error

func (*Account) Enable

func (a *Account) Enable(url string, mode string) error

func (*Account) GetAccountBanList

func (a *Account) GetAccountBanList(apiUrl string, UserID string, UserName string, Offset int, Limit int, mode string) ([]BanPlayer, error)

GetAccountBanList 获取用用列表

func (*Account) GetAccountDetail

func (a *Account) GetAccountDetail(id string, url string, mode string) (AccountInfo, error)

GetAccountDetail 获取用户详情

func (*Account) GetAccountList

func (a *Account) GetAccountList(apiUrl string, filter string, cursor string, mode string) (Accounts, error)

GetAccountList 获取用户列表

func (*Account) GetFriends

func (a *Account) GetFriends(url string, mode string) (FriendResponse, error)

GetFriends 获取账户朋友

func (a *Account) Unlink(url string, mode string) error

Unlink account unlink

func (*Account) UpdateAccount

func (a *Account) UpdateAccount(id string, params []byte, url string, mode string) (string, error)

type AccountData

type AccountData struct {
	User        User   `json:"user"`
	Wallet      string `json:"wallet"`
	Email       string `json:"email"`
	Devices     []any  `json:"devices"`
	CustomID    string `json:"custom_id"`
	VerifyTime  any    `json:"verify_time"`
	DisableTime string `json:"disable_time"`
}

type AccountInfo

type AccountInfo struct {
	Account     AccountData `json:"account"`
	DisableTime any         `json:"disable_time"`
}

type Accounts

type Accounts struct {
	Users      []User `json:"users"`
	TotalCount int    `json:"total_count"`
	NextCursor string `json:"next_cursor"`
}

type BanPlayer

type BanPlayer struct {
	ID          string     `json:"id"`
	Username    string     `json:"username"`
	DisplayName string     `json:"display_name"`
	AvatarURL   string     `json:"avatar_url"`
	LangTag     string     `json:"lang_tag"`
	Metadata    string     `json:"metadata"`
	EdgeCount   int        `json:"edge_count"`
	CreateTime  CreateTime `json:"create_time"`
	UpdateTime  UpdateTime `json:"update_time"`
	SteamID     string     `json:"steam_id,omitempty"`
}

type Count

type Count struct {
	common.NakamaApi
}

func NewCount

func NewCount(token string) *Count

func (*Count) GetGameServerInfo

func (a *Count) GetGameServerInfo(apiUrl string, mode string) (CountResponse, error)

type CountResponse

type CountResponse struct {
	Nodes     []Node    `json:"nodes"`
	Timestamp time.Time `json:"timestamp"`
}

type CreateTime

type CreateTime struct {
	Seconds int `json:"seconds"`
}

type Encoder

type Encoder struct{}

type FriendResponse

type FriendResponse struct {
	Friends []Friends `json:"friends"`
	Cursor  string    `json:"cursor"`
}

type Friends

type Friends struct {
	State      int       `json:"state"`
	UpdateTime time.Time `json:"update_time"`
	User       User      `json:"user,omitempty"`
}

type Headers

type Headers struct {
	NormalizedNames NormalizedNames   `json:"normalizedNames"`
	LazyUpdate      []LazyUpdate      `json:"lazyUpdate"`
	Headers         map[string]string `json:"headers"`
	LazyInit        LazyInit          `json:"lazyInit"`
}

type LazyInit

type LazyInit struct {
	NormalizedNames NormalizedNames   `json:"normalizedNames"`
	LazyUpdate      any               `json:"lazyUpdate"`
	Headers         map[string]string `json:"headers"`
}

type LazyUpdate

type LazyUpdate struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Op    string `json:"op"`
}

type Leaderboard

type Leaderboard struct {
	common.NakamaApi
}

func NewLeaderboard

func NewLeaderboard(token string) *Leaderboard

func (*Leaderboard) DeleteLeaderboard

func (a *Leaderboard) DeleteLeaderboard(url string, mode string) error

DeleteLeaderboard 删除排行榜

func (*Leaderboard) GetLeaderboardDetail

func (a *Leaderboard) GetLeaderboardDetail(url string, mode string) (LeaderboardInfo, error)

GetLeaderboardDetail 获取排行榜详情

func (*Leaderboard) GetLeaderboardList

func (a *Leaderboard) GetLeaderboardList(url string, mode string) (LeaderboardList, error)

GetLeaderboardList 获取排行榜列表

func (*Leaderboard) GetLeaderboardRecord

func (a *Leaderboard) GetLeaderboardRecord(url string, mode string) (LeaderboardRecord, error)

GetLeaderboardRecord 获取排行榜记录

type LeaderboardInfo

type LeaderboardInfo struct {
	ID            string `json:"id"`
	Title         string `json:"title"`
	Description   string `json:"description"`
	Category      int    `json:"category"`
	SortOrder     int    `json:"sort_order"`
	Size          int    `json:"size"`
	MaxSize       int    `json:"max_size"`
	MaxNumScore   int    `json:"max_num_score"`
	Operator      int    `json:"operator"`
	EndActive     int    `json:"end_active"`
	ResetSchedule string `json:"reset_schedule"`
	Metadata      string `json:"metadata"`
	CreateTime    any    `json:"create_time"`
	StartTime     any    `json:"start_time"`
	EndTime       any    `json:"end_time"`
	Duration      int    `json:"duration"`
	StartActive   int    `json:"start_active"`
	JoinRequired  bool   `json:"join_required"`
	Authoritative bool   `json:"authoritative"`
	Tournament    bool   `json:"tournament"`
}

type LeaderboardList

type LeaderboardList struct {
	Leaderboards []LeaderboardInfo `json:"leaderboards"`
}

type LeaderboardRecord

type LeaderboardRecord struct {
	Records      []Records `json:"records"`
	OwnerRecords []any     `json:"owner_records"`
	NextCursor   string    `json:"next_cursor"`
	PrevCursor   string    `json:"prev_cursor"`
}

type Match

type Match struct {
	common.NakamaApi
}

func NewMatch

func NewMatch(token string) *Match

func (*Match) GetMatchList

func (a *Match) GetMatchList(url string, mode string) (MatchList, error)

func (*Match) GetState

func (a *Match) GetState(url string, mode string) (MatchState, error)

GetState 比赛状态

type MatchList

type MatchList struct {
	Matches []Matches `json:"matches"`
}

type MatchState

type MatchState struct {
	Presences []Presences `json:"presences"`
	Tick      string      `json:"tick"`
	State     string      `json:"state"`
}

type Matches

type Matches struct {
	MatchID       string `json:"match_id"`
	Authoritative bool   `json:"authoritative"`
	Label         string `json:"label"`
	Size          int    `json:"size"`
	TickRate      int    `json:"tick_rate"`
	HandlerName   string `json:"handler_name"`
}

type Node

type Node struct {
	Name           string  `json:"name"`
	Health         int     `json:"health"`
	SessionCount   int     `json:"session_count"`
	PresenceCount  int     `json:"presence_count"`
	MatchCount     int     `json:"match_count"`
	GoroutineCount int     `json:"goroutine_count"`
	AvgLatencyMs   float64 `json:"avg_latency_ms"`
	AvgRateSec     float64 `json:"avg_rate_sec"`
	AvgInputKbs    float64 `json:"avg_input_kbs"`
	AvgOutputKbs   float64 `json:"avg_output_kbs"`
}

type NormalizedNames

type NormalizedNames struct{}

type Params

type Params struct {
	Updates   any     `json:"updates"`
	CloneFrom any     `json:"cloneFrom"`
	Encoder   Encoder `json:"encoder"`
	Map       any     `json:"map"`
}

type Payload

type Payload struct {
	Params  Params  `json:"params"`
	Headers Headers `json:"headers"`
}

type Presences

type Presences struct {
	UserID      string `json:"user_id"`
	SessionID   string `json:"session_id"`
	Username    string `json:"username"`
	Persistence bool   `json:"persistence"`
	Status      any    `json:"status"`
}

type Records

type Records struct {
	LeaderboardID string    `json:"leaderboard_id"`
	OwnerID       string    `json:"owner_id"`
	Username      string    `json:"username"`
	Score         string    `json:"score"`
	Subscore      string    `json:"subscore"`
	NumScore      int       `json:"num_score"`
	Metadata      string    `json:"metadata"`
	CreateTime    time.Time `json:"create_time"`
	UpdateTime    time.Time `json:"update_time"`
	ExpiryTime    any       `json:"expiry_time"`
	Rank          string    `json:"rank"`
	MaxNumScore   int       `json:"max_num_score"`
}

type UpdateTime

type UpdateTime struct {
	Seconds int `json:"seconds"`
}

type User

type User struct {
	ID                    string    `json:"id"`
	Username              string    `json:"username"`
	DisplayName           string    `json:"display_name"`
	AvatarURL             string    `json:"avatar_url"`
	LangTag               string    `json:"lang_tag"`
	Location              string    `json:"location"`
	Timezone              string    `json:"timezone"`
	Metadata              string    `json:"metadata"`
	FacebookID            string    `json:"facebook_id"`
	GoogleID              string    `json:"google_id"`
	GamecenterID          string    `json:"gamecenter_id"`
	SteamID               string    `json:"steam_id"`
	Online                bool      `json:"online"`
	EdgeCount             int       `json:"edge_count"`
	CreateTime            time.Time `json:"create_time"`
	UpdateTime            time.Time `json:"update_time"`
	FacebookInstantGameID string    `json:"facebook_instant_game_id"`
	AppleID               string    `json:"apple_id"`
}

Jump to

Keyboard shortcuts

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