players

package
v0.0.0-...-63c973b Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GAME_MODE_SESSION = "mode.session"
)

Variables

This section is empty.

Functions

func CreateDoubleArgs

func CreateDoubleArgs() map[string]float64

func CreateStringArgs

func CreateStringArgs() map[string]string

func TagFromFloatSlice

func TagFromFloatSlice(tags []float64) float64

func TagFromStringSlice

func TagFromStringSlice(tags []string) string

Types

type MatchRequest

type MatchRequest struct {
	Ticket     *pb.Ticket
	Tags       []string
	StringArgs map[string]string
	DoubleArgs map[string]float64
}

type Player

type Player struct {
	UID          string
	MatchRequest *MatchRequest
}

type RequestMatchFunc

type RequestMatchFunc func(ctx context.Context, ticket *pb.CreateTicketRequest, opts ...grpc.CallOption) (*pb.Ticket, error)

type TimeIntervalPlayerSimulator

type TimeIntervalPlayerSimulator struct {
	Interval         time.Duration
	PlayersPool      int
	RequestMatchFunc RequestMatchFunc
	Players          []*Player
	// contains filtered or unexported fields
}

- Create pool of players - Request match on a interval basis

func NewTimeIntervalPlayerSimulator

func NewTimeIntervalPlayerSimulator(interval string, playersPool int, requestMatchFunc RequestMatchFunc) (*TimeIntervalPlayerSimulator, error)

func (*TimeIntervalPlayerSimulator) AddPlayers

func (p *TimeIntervalPlayerSimulator) AddPlayers(players []*Player)

func (*TimeIntervalPlayerSimulator) CreateMatchmakingRequests

func (p *TimeIntervalPlayerSimulator) CreateMatchmakingRequests()

func (*TimeIntervalPlayerSimulator) CreatePlayers

func (p *TimeIntervalPlayerSimulator) CreatePlayers(count int) ([]*Player, error)

func (*TimeIntervalPlayerSimulator) RequestMatchForPlayers

func (p *TimeIntervalPlayerSimulator) RequestMatchForPlayers(players []*Player) error

func (*TimeIntervalPlayerSimulator) Run

Jump to

Keyboard shortcuts

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