server

package
v0.0.0-...-d3cc92b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGame

func CreateGame(gameURL string, public, protected bool, config any) (gameID, joinSecret string, err error)

func CreatePlayer

func CreatePlayer(gameURL, gameID, username, joinSecret string) (playerID, playerSecret string, err error)

func FetchCGEFile

func FetchCGEFile(gameURL string) (io.ReadCloser, error)

func FetchPlayers

func FetchPlayers(gameURL, gameID string) (map[string]string, error)

func FetchUsername

func FetchUsername(gameURL, gameID, playerID string) (string, error)

Types

type Game

type Game struct {
	ID        string `json:"id"`
	Players   int    `json:"players"`
	Protected bool   `json:"protected"`
}

func FetchGame

func FetchGame(gameURL, gameID string) (Game, error)

func FetchGames

func FetchGames(gameURL string, allowProtected bool) (private int, public []Game, err error)

type GameInfo

type GameInfo struct {
	Name          string           `json:"name"`
	CGVersion     versions.Version `json:"cg_version"`
	DisplayName   string           `json:"display_name,omitempty"`
	Description   string           `json:"description,omitempty"`
	Version       string           `json:"version,omitempty"`
	RepositoryURL string           `json:"repository_url,omitempty"`
}

func FetchGameInfo

func FetchGameInfo(gameURL string) (GameInfo, error)

Jump to

Keyboard shortcuts

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