Open Match Client
The Open Match Client represents the technical interface through which this server can communicate with Open Match and allows hooking into matchmaking process. This client allows interaction with the Open Match frontend within the cluster to create and manage Tickets and Backfills. The internal services (query, backend, matchmaking-function, etc.) cannot be contacted directly. For more advanced modifications on the matchmaking process, another implementation of the gRPC interface must be used.
Open Match does not work with persistent resources within Kubernetes, which is why changes are immediately visible after the gRPC operation was finished through any of the other interface methods. This also applies to modifications that have been performed by other clients and therefore are only read passively by this client. Those changes are not cached and are directly transferred to the frontend of Open Match.
All interfaces are executed asynchronously (through coroutines) and return their results after the response from OM has been recorded. Interfaces that work with streams of data are also executed asynchronously and are wrapped into flows to be compatible with the coroutines. Errors will always be returned immediately if they are discovered and the operation will only be automatically retried, if the returned condition can be recovered from.
The signatures of the endpoints of the frontend service of Open Match may have been slightly modified to better fit our structure but generally adhere to the official interface definitions. The client will always be kept compatible with the latest official recommendations and should therefore be used directly, since the individual steps are designed to be atomic.
See also
Samples
fun main() {
//sampleStart
// host and port are supplied by the default environment variables
val client = GrpcOpenMatchClient()
// any request can be performed on the client while it is open
client.deleteTicket("ticket-id")
//sampleEnd
}
Inheritors
Functions
Notifies Open Match about the Assignment or address information of the respective game server. This starts the assignment process and searches for tickets that can be assigned to this Backfill. The retrieved tickets are included in the return value and can be connected to the corresponding server. If the corresponding Backfill does not exist, a NoSuchElementException is thrown.
Closes all open resources that are associated with the Open Match Client. After this operation, this instance of the Open Match Client may no longer be used, as all connections are no longer usable. This method is idempotent and can therefore be called any number of times without changing its behaviour. It is guaranteed, that after this call all open connections and allocated resources will be closed or released. Although not all implementations have such resources, the method should still always be called (for example, within a Try-With_Resources block or a use method) to cleanly terminate resource usage.
Creates a new Backfill within Open Match with the metadata of a specific TicketTemplate. The identifier and the creation moment are generated and assigned by Open Match. The game server assignment is subsequently determined by acknowledgeBackfill.
Creates a new Ticket within Open Match with the metadata of a specific TicketTemplate. The identifier and creation moment are generated and assigned by Open Match. The game server assignment is determined by the Director after this Ticket has been assigned to a match. The status of the assignment can be observed using watchAssignments.
Deletes an existing Backfill with a specific identifier within Open Match. If this Backfill has already been assigned to a match, this operation has no effect. However, the Backfill is immediately excluded from further assignment considerations. If no Backfill with such an ID exists, this method does not cause any changes within Open Match.
Deletes an existing Ticket with a specific identifier within Open Match. If this Ticket has already been assigned to a match, this operation has no effect. However, the Ticket is immediately excluded from further match creation considerations. If no Ticket with such an ID exists, this method does not cause any changes within Open Match.
Retrieves an existing Backfill with a specific identifier within Open Match and returns it. If no Backfill exists with this ID, null
is returned instead. The Backfill is always queried in its current valid state from Open Match, so it may contain changes that were not made by this client.
Retrieves an existing Ticket with a specific identifier within Open Match and returns it. If no Ticket exists with this ID, null
is returned instead. The Ticket is always queried in its currently valid state from Open Match, and therefore it may contain changes not made by this client.
Updates the metadata associated with a Backfill and returns the new Backfill. The passed Backfill must have the identifier set. The metadata from the object is completely overwritten, replacing the current metadata of the Backfill. The creation moment is not updated, but the generation is incremented. This returns all tickets waiting on this Backfill back to the active pool, making them no longer pending.
Subscribes to changes of the game server assignment of an individual Ticket with a specific identifier. The Flow receives a new item, whenever a change is made to the Assignment. For changes triggered by this client as well as for external changes applied by other clients or other components of the Open Match matchmaking process. The item always contains the most recent state of the Assignment.