Documentation ¶
Overview ¶
Package api0gameserver interacts with game servers using the original master server api.
Index ¶
Constants ¶
View Source
const VerifyText = "I am a northstar server!"
VerifyText is the expected server response for /verify.
Variables ¶
View Source
var ( ErrInvalidResponse = errors.New("invalid response") ErrAuthFailed = errors.New("authentication failed") )
Functions ¶
func AuthenticateIncomingPlayer ¶
func AuthenticateIncomingPlayer(ctx context.Context, auth netip.AddrPort, uid uint64, username, connToken, serverToken string, pdata []byte) error
AuthenticateIncomingPlayer checks if a player can connect to a game server, registers a one-time connection token, and sends the player's pdata. If the authentication request returns invalid JSON, err is ErrInvalidResponse. If the authentication response .success is false, err is ErrAuthFailed.
Types ¶
type ConnectionRejectedError ¶
type ConnectionRejectedError string
func (ConnectionRejectedError) Error ¶
func (c ConnectionRejectedError) Error() string
func (ConnectionRejectedError) Reason ¶
func (c ConnectionRejectedError) Reason() string
Click to show internal directories.
Click to hide internal directories.