Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBackfillApprove is an error which denotes that backfill approval process has failed. ErrBackfillApprove = errors.New("failed to approve backfill ticket") // ErrNotAllocated is an error which denotes the action cannot be performed as the server is not yet allocated. ErrNotAllocated = errors.New("server is not allocated") )
Functions ¶
This section is empty.
Types ¶
type BackfillTicket ¶
type BackfillTicket struct { // ID represents the backfill ticket ID. ID string `json:"id"` // Connection represents the IP address and port of the server that creates the backfill. // The IP address format is ip:port. Connection string `json:"connection"` // Attributes represents an object that holds a dictionary of attributes (number or string), // indexed by the attribute name. The attributes are compared against the corresponding filters // defined in the matchmaking config and used to segment the ticket population into pools. // The default pool is used if a pool isn't provided. Attributes map[string]float64 `json:"attributes"` }
BackfillTicket represents a backfill ticket. Documentation: https://services.docs.unity.com/matchmaker/v2/index.html#tag/Backfill/operation/approveBackfillTicket
type Server ¶
Server represents an instance of a game server which also handles matchmaker backfill requests.
func (*Server) Start ¶
Start starts the server, opening the configured query port which responds with the configured protocol. The event loop will also listen for changes to the `server.json` configuration file, publishing any changes in the form of allocation or de-allocation messages. The server will also keep any backfill state alive on the allocation ID the server is using. As the server can start in an allocated state, make sure that another goroutine is consuming messages from at least the `OnAllocated()` channel before calling this method.
func (*Server) Stop ¶
Stop stops the game, pushing a de-allocation message and closing the query port.
func (*Server) WaitUntilTerminated ¶
WaitUntilTerminated waits until the server receives a termination signal from the platform. The Unity Gaming Services process management daemon will signal the game server to stop. A graceful stop signal (SIGTERM) will be sent if the game server fleet has been configured to support it.