rpc

package
v0.0.0-...-9022a88 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableSpawnerForGame

func GetAvailableSpawnerForGame(gameId shared.GameIDType) (models.Spawner, error)

GetAvailableSpawnerForGame returns the best available spawner for the given game ID. Spawners are attempted to be load balanced by capacity, so this function should return a spawner with the most capacity.

func RegisterSpawner

func RegisterSpawner(spawner models.Spawner)

RegisterSpawner adds the given spawner to the database.

func SendCheckStatusRequest

func SendCheckStatusRequest(spawner models.Spawner) (*hotel_pb.SpawnerStatus, error)

SendCheckStatusRequest asks the given spawner to report its current status.

func SendSpawnServerRequest

func SendSpawnServerRequest(spawner models.Spawner) (*hotel_pb.SpawnServerResponse, error)

SendSpawnServerRequest makes an RPC to a spawner to spawn a game server instance.

func SpawnServerForGame

func SpawnServerForGame(spawner models.Spawner, gameId shared.GameIDType) (models.GameServer, error)

SpawnServerForGame asks the given spawner to spawn a game server for the given game ID. If successful, a GameServer representing the newly running server is returned (or the expected game server that is being started).

Types

type MasterService

type MasterService struct{}

MasterService contains RPC implementations for the master service.

func (*MasterService) RegisterSpawner

RegisterSpawner adds the requesting spawner to the database and makes it available to clients for requesting spawns.

Jump to

Keyboard shortcuts

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