Documentation ¶
Overview ¶
Package pb should be a copy of the compiled gRPC protobuf files used by the frontend API. As of 0.2.0-alpha, these are located at {OM_ROOT}/internal/pb/
Index ¶
- func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
- type Assignments
- type Filter
- func (*Filter) Descriptor() ([]byte, []int)
- func (m *Filter) GetAttribute() string
- func (m *Filter) GetMaxv() int64
- func (m *Filter) GetMinv() int64
- func (m *Filter) GetName() string
- func (m *Filter) GetStats() *Stats
- func (*Filter) ProtoMessage()
- func (m *Filter) Reset()
- func (m *Filter) String() string
- type FrontendClient
- type FrontendServer
- type Frontend_GetUpdatesClient
- type Frontend_GetUpdatesServer
- type IlInput
- type MatchObject
- func (*MatchObject) Descriptor() ([]byte, []int)
- func (m *MatchObject) GetError() string
- func (m *MatchObject) GetId() string
- func (m *MatchObject) GetPools() []*PlayerPool
- func (m *MatchObject) GetProperties() string
- func (m *MatchObject) GetRosters() []*Roster
- func (*MatchObject) ProtoMessage()
- func (m *MatchObject) Reset()
- func (m *MatchObject) String() string
- type Player
- func (*Player) Descriptor() ([]byte, []int)
- func (m *Player) GetAssignment() string
- func (m *Player) GetAttributes() []*Player_Attribute
- func (m *Player) GetError() string
- func (m *Player) GetId() string
- func (m *Player) GetPool() string
- func (m *Player) GetProperties() string
- func (m *Player) GetStatus() string
- func (*Player) ProtoMessage()
- func (m *Player) Reset()
- func (m *Player) String() string
- type PlayerPool
- func (*PlayerPool) Descriptor() ([]byte, []int)
- func (m *PlayerPool) GetFilters() []*Filter
- func (m *PlayerPool) GetName() string
- func (m *PlayerPool) GetRoster() *Roster
- func (m *PlayerPool) GetStats() *Stats
- func (*PlayerPool) ProtoMessage()
- func (m *PlayerPool) Reset()
- func (m *PlayerPool) String() string
- type Player_Attribute
- type Result
- type Roster
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFrontendServer ¶
func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
Types ¶
type Assignments ¶
type Assignments struct { Rosters []*Roster `protobuf:"bytes,1,rep,name=rosters" json:"rosters,omitempty"` Assignment string `protobuf:"bytes,10,opt,name=assignment" json:"assignment,omitempty"` }
func (*Assignments) Descriptor ¶
func (*Assignments) Descriptor() ([]byte, []int)
func (*Assignments) GetAssignment ¶
func (m *Assignments) GetAssignment() string
func (*Assignments) GetRosters ¶
func (m *Assignments) GetRosters() []*Roster
func (*Assignments) ProtoMessage ¶
func (*Assignments) ProtoMessage()
func (*Assignments) Reset ¶
func (m *Assignments) Reset()
func (*Assignments) String ¶
func (m *Assignments) String() string
type Filter ¶
type Filter struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Attribute string `protobuf:"bytes,2,opt,name=attribute" json:"attribute,omitempty"` Maxv int64 `protobuf:"varint,3,opt,name=maxv" json:"maxv,omitempty"` Minv int64 `protobuf:"varint,4,opt,name=minv" json:"minv,omitempty"` Stats *Stats `protobuf:"bytes,5,opt,name=stats" json:"stats,omitempty"` }
A 'hard' filter to apply to the player pool.
func (*Filter) Descriptor ¶
func (*Filter) GetAttribute ¶
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
type FrontendClient ¶
type FrontendClient interface { // CreatePlayer will put the player in state storage, and then look // through the 'properties' field for the attributes you have defined as // indices your matchmaker config. If the attributes exist and are valid // integers, they will be indexed. // INPUT: Player message with these fields populated: // - id // - properties // OUTPUT: Result message denoting success or failure (and an error if // necessary) CreatePlayer(ctx context.Context, in *Player, opts ...grpc.CallOption) (*Result, error) // DeletePlayer removes the player from state storage by doing the // following: // 1) Delete player from configured indices. This effectively removes the // player from matchmaking when using recommended MMF patterns. // Everything after this is just cleanup to save stage storage space. // 2) 'Lazily' delete the player's state storage record. This is kicked // off in the background and may take some time to complete. // 2) 'Lazily' delete the player's metadata indicies (like, the timestamp when // they called CreatePlayer, and the last time the record was accessed). This // is also kicked off in the background and may take some time to complete. // INPUT: Player message with the 'id' field populated. // OUTPUT: Result message denoting success or failure (and an error if // necessary) DeletePlayer(ctx context.Context, in *Player, opts ...grpc.CallOption) (*Result, error) // GetUpdates streams matchmaking results from Open Match for the // provided player ID. // INPUT: Player message with the 'id' field populated. // OUTPUT: a stream of player objects with one or more of the following // fields populated, if an update to that field is seen in state storage: // - 'assignment': string that usually contains game server connection information. // - 'status': string to communicate current matchmaking status to the client. // - 'error': string to pass along error information to the client. // // During normal operation, the expectation is that the 'assignment' field // will be updated by a Backend process calling the 'CreateAssignments' Backend API // endpoint. 'Status' and 'Error' are free for developers to use as they see fit. // Even if you had multiple players enter a matchmaking request as a group, the // Backend API 'CreateAssignments' call will write the results to state // storage separately under each player's ID. OM expects you to make all game // clients 'GetUpdates' with their own ID from the Frontend API to get // their results. // // NOTE: This call generates a small amount of load on the Frontend API and state // storage while watching the player record for updates. You are expected // to close the stream from your client after receiving your matchmaking // results (or a reasonable timeout), or you will continue to // generate load on OM until you do! // NOTE: Just bear in mind that every update will send egress traffic from // Open Match to game clients! Frugality is recommended. GetUpdates(ctx context.Context, in *Player, opts ...grpc.CallOption) (Frontend_GetUpdatesClient, error) }
func NewFrontendClient ¶
func NewFrontendClient(cc *grpc.ClientConn) FrontendClient
type FrontendServer ¶
type FrontendServer interface { // CreatePlayer will put the player in state storage, and then look // through the 'properties' field for the attributes you have defined as // indices your matchmaker config. If the attributes exist and are valid // integers, they will be indexed. // INPUT: Player message with these fields populated: // - id // - properties // OUTPUT: Result message denoting success or failure (and an error if // necessary) CreatePlayer(context.Context, *Player) (*Result, error) // DeletePlayer removes the player from state storage by doing the // following: // 1) Delete player from configured indices. This effectively removes the // player from matchmaking when using recommended MMF patterns. // Everything after this is just cleanup to save stage storage space. // 2) 'Lazily' delete the player's state storage record. This is kicked // off in the background and may take some time to complete. // 2) 'Lazily' delete the player's metadata indicies (like, the timestamp when // they called CreatePlayer, and the last time the record was accessed). This // is also kicked off in the background and may take some time to complete. // INPUT: Player message with the 'id' field populated. // OUTPUT: Result message denoting success or failure (and an error if // necessary) DeletePlayer(context.Context, *Player) (*Result, error) // GetUpdates streams matchmaking results from Open Match for the // provided player ID. // INPUT: Player message with the 'id' field populated. // OUTPUT: a stream of player objects with one or more of the following // fields populated, if an update to that field is seen in state storage: // - 'assignment': string that usually contains game server connection information. // - 'status': string to communicate current matchmaking status to the client. // - 'error': string to pass along error information to the client. // // During normal operation, the expectation is that the 'assignment' field // will be updated by a Backend process calling the 'CreateAssignments' Backend API // endpoint. 'Status' and 'Error' are free for developers to use as they see fit. // Even if you had multiple players enter a matchmaking request as a group, the // Backend API 'CreateAssignments' call will write the results to state // storage separately under each player's ID. OM expects you to make all game // clients 'GetUpdates' with their own ID from the Frontend API to get // their results. // // NOTE: This call generates a small amount of load on the Frontend API and state // storage while watching the player record for updates. You are expected // to close the stream from your client after receiving your matchmaking // results (or a reasonable timeout), or you will continue to // generate load on OM until you do! // NOTE: Just bear in mind that every update will send egress traffic from // Open Match to game clients! Frugality is recommended. GetUpdates(*Player, Frontend_GetUpdatesServer) error }
type Frontend_GetUpdatesClient ¶
type Frontend_GetUpdatesClient interface { Recv() (*Player, error) grpc.ClientStream }
type Frontend_GetUpdatesServer ¶
type Frontend_GetUpdatesServer interface { Send(*Player) error grpc.ServerStream }
type IlInput ¶
type IlInput struct { }
IlInput is an empty message reserved for future use.
func (*IlInput) Descriptor ¶
func (*IlInput) ProtoMessage ¶
func (*IlInput) ProtoMessage()
type MatchObject ¶
type MatchObject struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Properties string `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"` Error string `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"` Rosters []*Roster `protobuf:"bytes,4,rep,name=rosters" json:"rosters,omitempty"` Pools []*PlayerPool `protobuf:"bytes,5,rep,name=pools" json:"pools,omitempty"` }
Open Match's internal representation and wire protocol format for "MatchObjects". In order to request a match using the Backend API, your backend code should generate a new MatchObject with an ID and properties filled in (for more details about valid values for these fields, see the documentation). Open Match then sends the Match Object through to your matchmaking function, where you add players to 'rosters' and store any schemaless data you wish in the 'properties' field. The MatchObject is then sent, populated, out through the Backend API to your backend code.
MatchObjects contain a number of fields, but many gRPC calls that take a MatchObject as input only require a few of them to be filled in. Check the gRPC function in question for more details.
func (*MatchObject) Descriptor ¶
func (*MatchObject) Descriptor() ([]byte, []int)
func (*MatchObject) GetError ¶
func (m *MatchObject) GetError() string
func (*MatchObject) GetId ¶
func (m *MatchObject) GetId() string
func (*MatchObject) GetPools ¶
func (m *MatchObject) GetPools() []*PlayerPool
func (*MatchObject) GetProperties ¶
func (m *MatchObject) GetProperties() string
func (*MatchObject) GetRosters ¶
func (m *MatchObject) GetRosters() []*Roster
func (*MatchObject) ProtoMessage ¶
func (*MatchObject) ProtoMessage()
func (*MatchObject) Reset ¶
func (m *MatchObject) Reset()
func (*MatchObject) String ¶
func (m *MatchObject) String() string
type Player ¶
type Player struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Properties string `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"` Pool string `protobuf:"bytes,3,opt,name=pool" json:"pool,omitempty"` Attributes []*Player_Attribute `protobuf:"bytes,4,rep,name=attributes" json:"attributes,omitempty"` Assignment string `protobuf:"bytes,5,opt,name=assignment" json:"assignment,omitempty"` Status string `protobuf:"bytes,6,opt,name=status" json:"status,omitempty"` Error string `protobuf:"bytes,7,opt,name=error" json:"error,omitempty"` }
Open Match's internal representation and wire protocol format for "Players". In order to enter matchmaking using the Frontend API, your client code should generate a consistent (same result for each client every time they launch) with an ID and properties filled in (for more details about valid values for these fields, see the documentation). Players contain a number of fields, but the gRPC calls that take a Player as input only require a few of them to be filled in. Check the gRPC function in question for more details.
func (*Player) Descriptor ¶
func (*Player) GetAssignment ¶
func (*Player) GetAttributes ¶
func (m *Player) GetAttributes() []*Player_Attribute
func (*Player) GetProperties ¶
func (*Player) ProtoMessage ¶
func (*Player) ProtoMessage()
type PlayerPool ¶
type PlayerPool struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Filters []*Filter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"` Roster *Roster `protobuf:"bytes,3,opt,name=roster" json:"roster,omitempty"` Stats *Stats `protobuf:"bytes,4,opt,name=stats" json:"stats,omitempty"` }
PlayerPools are defined by a set of 'hard' filters, and can be filled in with the players that match those filters.
PlayerPools contain a number of fields, but many gRPC calls that take a PlayerPool as input only require a few of them to be filled in. Check the gRPC function in question for more details.
func (*PlayerPool) Descriptor ¶
func (*PlayerPool) Descriptor() ([]byte, []int)
func (*PlayerPool) GetFilters ¶
func (m *PlayerPool) GetFilters() []*Filter
func (*PlayerPool) GetName ¶
func (m *PlayerPool) GetName() string
func (*PlayerPool) GetRoster ¶
func (m *PlayerPool) GetRoster() *Roster
func (*PlayerPool) GetStats ¶
func (m *PlayerPool) GetStats() *Stats
func (*PlayerPool) ProtoMessage ¶
func (*PlayerPool) ProtoMessage()
func (*PlayerPool) Reset ¶
func (m *PlayerPool) Reset()
func (*PlayerPool) String ¶
func (m *PlayerPool) String() string
type Player_Attribute ¶
type Player_Attribute struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` }
func (*Player_Attribute) Descriptor ¶
func (*Player_Attribute) Descriptor() ([]byte, []int)
func (*Player_Attribute) GetName ¶
func (m *Player_Attribute) GetName() string
func (*Player_Attribute) GetValue ¶
func (m *Player_Attribute) GetValue() int64
func (*Player_Attribute) ProtoMessage ¶
func (*Player_Attribute) ProtoMessage()
func (*Player_Attribute) Reset ¶
func (m *Player_Attribute) Reset()
func (*Player_Attribute) String ¶
func (m *Player_Attribute) String() string
type Result ¶
type Result struct { Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"` }
Simple message to return success/failure and error status.
func (*Result) Descriptor ¶
func (*Result) GetSuccess ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
type Roster ¶
type Roster struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Players []*Player `protobuf:"bytes,2,rep,name=players" json:"players,omitempty"` }
Data structure to hold a list of players in a match.
func (*Roster) Descriptor ¶
func (*Roster) GetPlayers ¶
func (*Roster) ProtoMessage ¶
func (*Roster) ProtoMessage()
type Stats ¶
type Stats struct { Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` Elapsed float64 `protobuf:"fixed64,2,opt,name=elapsed" json:"elapsed,omitempty"` }
Holds statistics
func (*Stats) Descriptor ¶
func (*Stats) GetElapsed ¶
func (*Stats) ProtoMessage ¶
func (*Stats) ProtoMessage()