pb

package
v0.2.0-alpha-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pb is a generated protocol buffer package.

It is generated from these files:

api/protobuf-spec/backend.proto
api/protobuf-spec/frontend.proto
api/protobuf-spec/mmlogic.proto
api/protobuf-spec/messages.proto

It has these top-level messages:

Group
PlayerId
MatchObject
Roster
Filter
Stats
PlayerPool
Player
Result
IlInput
ConnectionInfo
Assignments

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBackendServer

func RegisterBackendServer(s *grpc.Server, srv BackendServer)

func RegisterFrontendServer

func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)

func RegisterMmLogicServer

func RegisterMmLogicServer(s *grpc.Server, srv MmLogicServer)

Types

type Assignments

type Assignments struct {
	Rosters        []*Roster       `protobuf:"bytes,1,rep,name=rosters" json:"rosters,omitempty"`
	ConnectionInfo *ConnectionInfo `protobuf:"bytes,2,opt,name=connection_info,json=connectionInfo" json:"connection_info,omitempty"`
}

func (*Assignments) Descriptor

func (*Assignments) Descriptor() ([]byte, []int)

func (*Assignments) GetConnectionInfo

func (m *Assignments) GetConnectionInfo() *ConnectionInfo

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 BackendClient

type BackendClient interface {
	// Run MMF once.  Return a matchobject that fits this profile.
	// INPUT: MatchObject message with these fields populated:
	//  - id
	//  - properties
	//  - [optional] roster, any fields you fill are available to your MMF.
	//  - [optional] pools, any fields you fill are available to your MMF.
	// OUTPUT: MatchObject message with these fields populated:
	//  - id
	//  - properties
	//  - error. Empty if no error was encountered
	//  - rosters, if you choose to fill them in your MMF. (Recommended)
	//  - pools, if you used the MMLogicAPI in your MMF. (Recommended, and provides stats)
	CreateMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*MatchObject, error)
	// Continually run MMF and stream matchobjects that fit this profile until
	// client closes the connection.  Same inputs/outputs as CreateMatch.
	ListMatches(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (Backend_ListMatchesClient, error)
	// Delete a matchobject from state storage manually. (Matchobjects in state
	// storage will also automatically expire after a while)
	// INPUT: MatchObject message with the 'id' field populated.
	// (All other fields are ignored.)
	DeleteMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*Result, error)
	// Write the connection info for the list of players in the
	// Assignments.messages.Rosters to state storage.  The FrontendAPI is
	// responsible for sending anything sent here to the game clients.
	// Sending a player to this function kicks off a process that removes
	// the player from future matchmaking functions by adding them to the
	// 'deindexed' player list and then deleting their player ID from state storage
	// indexes.
	// INPUT: Assignments message with these fields populated:
	//  - connection_info, anything you write to this string is sent to Frontend API
	//  - rosters. You can send any number of rosters, containing any number of
	//     player messages. All players from all rosters will be sent the connection_info.
	//     The only field in the Player object that is used by CreateAssignments is
	//     the id field.  All others are silently ignored.
	CreateAssignments(ctx context.Context, in *Assignments, opts ...grpc.CallOption) (*Result, error)
	// Remove DGS connection info from state storage for players.
	// INPUT: Roster message with the 'players' field populated.
	//    The only field in the Player object that is used by
	//    DeleteAssignments is the 'id' field.  All others are silently ignored.  If
	//    you need to delete multiple rosters, make multiple calls.
	DeleteAssignments(ctx context.Context, in *Roster, opts ...grpc.CallOption) (*Result, error)
}

func NewBackendClient

func NewBackendClient(cc *grpc.ClientConn) BackendClient

type BackendServer

type BackendServer interface {
	// Run MMF once.  Return a matchobject that fits this profile.
	// INPUT: MatchObject message with these fields populated:
	//  - id
	//  - properties
	//  - [optional] roster, any fields you fill are available to your MMF.
	//  - [optional] pools, any fields you fill are available to your MMF.
	// OUTPUT: MatchObject message with these fields populated:
	//  - id
	//  - properties
	//  - error. Empty if no error was encountered
	//  - rosters, if you choose to fill them in your MMF. (Recommended)
	//  - pools, if you used the MMLogicAPI in your MMF. (Recommended, and provides stats)
	CreateMatch(context.Context, *MatchObject) (*MatchObject, error)
	// Continually run MMF and stream matchobjects that fit this profile until
	// client closes the connection.  Same inputs/outputs as CreateMatch.
	ListMatches(*MatchObject, Backend_ListMatchesServer) error
	// Delete a matchobject from state storage manually. (Matchobjects in state
	// storage will also automatically expire after a while)
	// INPUT: MatchObject message with the 'id' field populated.
	// (All other fields are ignored.)
	DeleteMatch(context.Context, *MatchObject) (*Result, error)
	// Write the connection info for the list of players in the
	// Assignments.messages.Rosters to state storage.  The FrontendAPI is
	// responsible for sending anything sent here to the game clients.
	// Sending a player to this function kicks off a process that removes
	// the player from future matchmaking functions by adding them to the
	// 'deindexed' player list and then deleting their player ID from state storage
	// indexes.
	// INPUT: Assignments message with these fields populated:
	//  - connection_info, anything you write to this string is sent to Frontend API
	//  - rosters. You can send any number of rosters, containing any number of
	//     player messages. All players from all rosters will be sent the connection_info.
	//     The only field in the Player object that is used by CreateAssignments is
	//     the id field.  All others are silently ignored.
	CreateAssignments(context.Context, *Assignments) (*Result, error)
	// Remove DGS connection info from state storage for players.
	// INPUT: Roster message with the 'players' field populated.
	//    The only field in the Player object that is used by
	//    DeleteAssignments is the 'id' field.  All others are silently ignored.  If
	//    you need to delete multiple rosters, make multiple calls.
	DeleteAssignments(context.Context, *Roster) (*Result, error)
}

type Backend_ListMatchesClient

type Backend_ListMatchesClient interface {
	Recv() (*MatchObject, error)
	grpc.ClientStream
}

type Backend_ListMatchesServer

type Backend_ListMatchesServer interface {
	Send(*MatchObject) error
	grpc.ServerStream
}

type ConnectionInfo

type ConnectionInfo struct {
	ConnectionString string `protobuf:"bytes,1,opt,name=connection_string,json=connectionString" json:"connection_string,omitempty"`
}

Simple message used to pass the connection string for the DGS to the player. DEPRECATED: Likely to be integrated into another protobuf message in a future version.

func (*ConnectionInfo) Descriptor

func (*ConnectionInfo) Descriptor() ([]byte, []int)

func (*ConnectionInfo) GetConnectionString

func (m *ConnectionInfo) GetConnectionString() string

func (*ConnectionInfo) ProtoMessage

func (*ConnectionInfo) ProtoMessage()

func (*ConnectionInfo) Reset

func (m *ConnectionInfo) Reset()

func (*ConnectionInfo) String

func (m *ConnectionInfo) 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) Descriptor() ([]byte, []int)

func (*Filter) GetAttribute

func (m *Filter) GetAttribute() string

func (*Filter) GetMaxv

func (m *Filter) GetMaxv() int64

func (*Filter) GetMinv

func (m *Filter) GetMinv() int64

func (*Filter) GetName

func (m *Filter) GetName() string

func (*Filter) GetStats

func (m *Filter) GetStats() *Stats

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) String

func (m *Filter) String() string

type FrontendClient

type FrontendClient interface {
	CreateRequest(ctx context.Context, in *Group, opts ...grpc.CallOption) (*Result, error)
	DeleteRequest(ctx context.Context, in *Group, opts ...grpc.CallOption) (*Result, error)
	GetAssignment(ctx context.Context, in *PlayerId, opts ...grpc.CallOption) (*ConnectionInfo, error)
	DeleteAssignment(ctx context.Context, in *PlayerId, opts ...grpc.CallOption) (*Result, error)
}

func NewFrontendClient

func NewFrontendClient(cc *grpc.ClientConn) FrontendClient

type FrontendServer

type FrontendServer interface {
	CreateRequest(context.Context, *Group) (*Result, error)
	DeleteRequest(context.Context, *Group) (*Result, error)
	GetAssignment(context.Context, *PlayerId) (*ConnectionInfo, error)
	DeleteAssignment(context.Context, *PlayerId) (*Result, error)
}

type Group

type Group struct {
	Id         string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Properties string `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
}

Data structure for a group of players to pass to the matchmaking function. Obviously, the group can be a group of one!

func (*Group) Descriptor

func (*Group) Descriptor() ([]byte, []int)

func (*Group) GetId

func (m *Group) GetId() string

func (*Group) GetProperties

func (m *Group) GetProperties() string

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) Reset

func (m *Group) Reset()

func (*Group) String

func (m *Group) String() string

type IlInput

type IlInput struct {
}

IlInput is an empty message reserved for future use.

func (*IlInput) Descriptor

func (*IlInput) Descriptor() ([]byte, []int)

func (*IlInput) ProtoMessage

func (*IlInput) ProtoMessage()

func (*IlInput) Reset

func (m *IlInput) Reset()

func (*IlInput) String

func (m *IlInput) String() string

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 MmLogicClient

type MmLogicClient interface {
	//  Send GetProfile a match object with the ID field populated, it will return a
	//  'filled' one.
	//  Note: filters are assumed to have been checked for validity by the
	//  backendapi  when accepting a profile
	GetProfile(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*MatchObject, error)
	// CreateProposal is called by MMFs that wish to write their results to
	// a proposed MatchObject, that can be sent out the Backend API once it has
	// been approved (by default, by the evaluator process).
	//  - adds all players in all Rosters to the proposed player ignore list
	//  - writes the proposed match to the provided key
	//  - adds that key to the list of proposals to be considered
	// INPUT:
	//  * TO RETURN A MATCHOBJECT AFTER A SUCCESSFUL MMF RUN
	//    To create a match MatchObject message with these fields populated:
	//      - id, set to the value of the MMF_PROPOSAL_ID env var
	//      - properties
	//      - error.  You must explicitly set this to an empty string if your MMF
	//      - roster, with the playerIDs filled in the 'players' repeated field.
	//      - [optional] pools, set to the output from the 'GetPlayerPools' call,
	//        will populate the pools with stats about how many players the filters
	//        matched and how long the filters took to run, which will be sent out
	//        the backend api along with your match results.
	//        was successful.
	//  * TO RETURN AN ERROR
	//    To report a failure or error, send a MatchObject message with these
	//    these fields populated:
	//      - id, set to the value of the MMF_ERROR_ID env var.
	//      - error, set to a string value describing the error your MMF encountered.
	//      - [optional] properties, anything you put here is returned to the
	//        backend along with your error.
	//      - [optional] rosters, anything you put here is returned to the
	//        backend along with your error.
	//      - [optional] pools, set to the output from the 'GetPlayerPools' call,
	//        will populate the pools with stats about how many players the filters
	//        matched and how long the filters took to run, which will be sent out
	//        the backend api along with your match results.
	// OUTPUT: a Result message with a boolean success value and an error string
	// if an error was encountered
	CreateProposal(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*Result, error)
	// Player listing and filtering functions
	//
	// RetrievePlayerPool gets the list of players that match every Filter in the
	// PlayerPool, and then removes all players it finds in the ignore list.  It
	// combines the results, and returns the resulting player pool.
	GetPlayerPool(ctx context.Context, in *PlayerPool, opts ...grpc.CallOption) (MmLogic_GetPlayerPoolClient, error)
	// Ignore List functions
	//
	// IlInput is an empty message reserved for future use.
	GetAllIgnoredPlayers(ctx context.Context, in *IlInput, opts ...grpc.CallOption) (*Roster, error)
	// RetrieveIgnoreList retrieves players from the ignore list specified in the
	// config file under 'ignoreLists.proposedPlayers.key'.
	ListIgnoredPlayers(ctx context.Context, in *IlInput, opts ...grpc.CallOption) (*Roster, error)
}

func NewMmLogicClient

func NewMmLogicClient(cc *grpc.ClientConn) MmLogicClient

type MmLogicServer

type MmLogicServer interface {
	//  Send GetProfile a match object with the ID field populated, it will return a
	//  'filled' one.
	//  Note: filters are assumed to have been checked for validity by the
	//  backendapi  when accepting a profile
	GetProfile(context.Context, *MatchObject) (*MatchObject, error)
	// CreateProposal is called by MMFs that wish to write their results to
	// a proposed MatchObject, that can be sent out the Backend API once it has
	// been approved (by default, by the evaluator process).
	//  - adds all players in all Rosters to the proposed player ignore list
	//  - writes the proposed match to the provided key
	//  - adds that key to the list of proposals to be considered
	// INPUT:
	//  * TO RETURN A MATCHOBJECT AFTER A SUCCESSFUL MMF RUN
	//    To create a match MatchObject message with these fields populated:
	//      - id, set to the value of the MMF_PROPOSAL_ID env var
	//      - properties
	//      - error.  You must explicitly set this to an empty string if your MMF
	//      - roster, with the playerIDs filled in the 'players' repeated field.
	//      - [optional] pools, set to the output from the 'GetPlayerPools' call,
	//        will populate the pools with stats about how many players the filters
	//        matched and how long the filters took to run, which will be sent out
	//        the backend api along with your match results.
	//        was successful.
	//  * TO RETURN AN ERROR
	//    To report a failure or error, send a MatchObject message with these
	//    these fields populated:
	//      - id, set to the value of the MMF_ERROR_ID env var.
	//      - error, set to a string value describing the error your MMF encountered.
	//      - [optional] properties, anything you put here is returned to the
	//        backend along with your error.
	//      - [optional] rosters, anything you put here is returned to the
	//        backend along with your error.
	//      - [optional] pools, set to the output from the 'GetPlayerPools' call,
	//        will populate the pools with stats about how many players the filters
	//        matched and how long the filters took to run, which will be sent out
	//        the backend api along with your match results.
	// OUTPUT: a Result message with a boolean success value and an error string
	// if an error was encountered
	CreateProposal(context.Context, *MatchObject) (*Result, error)
	// Player listing and filtering functions
	//
	// RetrievePlayerPool gets the list of players that match every Filter in the
	// PlayerPool, and then removes all players it finds in the ignore list.  It
	// combines the results, and returns the resulting player pool.
	GetPlayerPool(*PlayerPool, MmLogic_GetPlayerPoolServer) error
	// Ignore List functions
	//
	// IlInput is an empty message reserved for future use.
	GetAllIgnoredPlayers(context.Context, *IlInput) (*Roster, error)
	// RetrieveIgnoreList retrieves players from the ignore list specified in the
	// config file under 'ignoreLists.proposedPlayers.key'.
	ListIgnoredPlayers(context.Context, *IlInput) (*Roster, error)
}

type MmLogic_GetPlayerPoolClient

type MmLogic_GetPlayerPoolClient interface {
	Recv() (*PlayerPool, error)
	grpc.ClientStream
}

type MmLogic_GetPlayerPoolServer

type MmLogic_GetPlayerPoolServer interface {
	Send(*PlayerPool) error
	grpc.ServerStream
}

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"`
}

Data structure to hold details about a player

func (*Player) Descriptor

func (*Player) Descriptor() ([]byte, []int)

func (*Player) GetAttributes

func (m *Player) GetAttributes() []*Player_Attribute

func (*Player) GetId

func (m *Player) GetId() string

func (*Player) GetPool

func (m *Player) GetPool() string

func (*Player) GetProperties

func (m *Player) GetProperties() string

func (*Player) ProtoMessage

func (*Player) ProtoMessage()

func (*Player) Reset

func (m *Player) Reset()

func (*Player) String

func (m *Player) String() string

type PlayerId

type PlayerId struct {
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

func (*PlayerId) Descriptor

func (*PlayerId) Descriptor() ([]byte, []int)

func (*PlayerId) GetId

func (m *PlayerId) GetId() string

func (*PlayerId) ProtoMessage

func (*PlayerId) ProtoMessage()

func (*PlayerId) Reset

func (m *PlayerId) Reset()

func (*PlayerId) String

func (m *PlayerId) String() string

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) Descriptor() ([]byte, []int)

func (*Result) GetError

func (m *Result) GetError() string

func (*Result) GetSuccess

func (m *Result) GetSuccess() bool

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

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) Descriptor() ([]byte, []int)

func (*Roster) GetName

func (m *Roster) GetName() string

func (*Roster) GetPlayers

func (m *Roster) GetPlayers() []*Player

func (*Roster) ProtoMessage

func (*Roster) ProtoMessage()

func (*Roster) Reset

func (m *Roster) Reset()

func (*Roster) String

func (m *Roster) String() string

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) Descriptor() ([]byte, []int)

func (*Stats) GetCount

func (m *Stats) GetCount() int64

func (*Stats) GetElapsed

func (m *Stats) GetElapsed() float64

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) String

func (m *Stats) String() string

Jump to

Keyboard shortcuts

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