modulepackage
0.0.0-20220306183851-3877f0a7002d
Repository: https://github.com/noxworld-dev/lobby.git
Documentation: pkg.go.dev
# README
Nox lobby server
This project provides a Nox game lobby which exposes a simple HTTP API for both listing and registering Nox game servers.
XWIS games will also appear in the list returned by the API, so the lobby is backward-compatible. Due to technical limitations, however, games registered via HTTP won't be registered on XWIS.
The main use case for the lobby is to support OpenNox, but the API can also be used for bots that want to notify players about currently active Nox games.
Public lobby
To get a list of games on the public lobby:
curl 'http://nox.nwca.xyz:8088/api/v0/games/list'
A Go client library for HTTP API is also available (see docs).
Running locally
The simplest way to run the lobby server locally is via Docker:
docker run -d --restart always --name nox-lobby -p 8080:80 ghcr.io/noxworld-dev/lobby
To get a list of games via local lobby:
curl 'http://127.0.0.1:8080/api/v0/games/list'
# Packages
No description provided by the author
# Functions
Cache creates a cache over a game Lister.
GameFromXWIS convert xwis.GameInfo to Game type defined by lobby.
KeepRegistered keeps registering server so that it doesn't expire.
NewClient will create new client for our server.
NewClientWith accepts URL and custom HTTP client to use.
NewLobby creates a new in-memory Lobby.
NewServer creates a new http.Handler from a Lobby implementation.
NewXWISWithClient creates a Lister for a Nox XWIS lobby using an existing xwis.Client.
Overlay one lobby implementation over a second one.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
DefaultGamePort is a default UDP port for Nox games.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Client is an HTTP Nox lobby client.
Game is an information about the Nox game, as provided by the server hosting it.
GameInfo is a full information for a registered Nox game, as returned by the Lobby.
IPResp represents a response to the address request.
PlayerInfo is an information about a specific player.
PlayersInfo is an information about players in a specific game.
QuestInfo is additional information for Nox Quest game mode.
Resolution is a max resolution used for the game.
Response wraps all other HTTP responses to separate errors from the rest of the response.
Server is an HTTP Nox lobby server.
Service is an in-memory implementation of a Lobby.
# Interfaces
GameHost is an interface for the game server.
Lister is an interface for listing Nox games registered on lobby server.
Lobby is a Nox game lobby for listing and registering games.
Registerer is an interface for registering Nox games on lobby server.
# Type aliases
GameAccess specifies access for the game (open, password-protected, etc).
GameMode is a Nox game mode.
ServerListResp represents a response to the server list request.