service

package
v0.0.0-...-055e899 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyPlayer server.ContextKey = "player"
)
View Source
const (
	StatusInvalidPassword = iota + 1000
)

Variables

This section is empty.

Functions

func NewContextFromPlayer

func NewContextFromPlayer(parent context.Context, player *Player) context.Context

Types

type AuxiliaryService

type AuxiliaryService struct {
	common.MonickerGenerator
	Config *config.Config
	// contains filtered or unexported fields
}

func (*AuxiliaryService) CollectServerStatus

func (s *AuxiliaryService) CollectServerStatus() *ServerStatus

func (*AuxiliaryService) GatherAllRPCRateMetrics

func (s *AuxiliaryService) GatherAllRPCRateMetrics() map[string]string

func (*AuxiliaryService) GatherOverallRPCRateMetrics

func (s *AuxiliaryService) GatherOverallRPCRateMetrics() map[string]string

type Factory

type Factory struct {
	Player    *PlayerService
	Auxiliary *AuxiliaryService
}

func NewFactory

func NewFactory(
	conf *config.Config,
	sessionMgr *server.SessionManager,
	monickerGenerator common.MonickerGenerator) *Factory

type Player

type Player struct {
	Username string
	Session  *server.Session
}

func PlayerFromContext

func PlayerFromContext(ctx context.Context) (player *Player, ok bool)

type PlayerService

type PlayerService struct {
	// contains filtered or unexported fields
}

func NewPlayerService

func NewPlayerService(conf *config.Config, sessionMgr *server.SessionManager) *PlayerService

func (*PlayerService) Add

func (s *PlayerService) Add(p *Player)

func (*PlayerService) Count

func (s *PlayerService) Count() int

func (*PlayerService) GetBySession

func (s *PlayerService) GetBySession(sessionID string) *Player

func (*PlayerService) GetByUser

func (s *PlayerService) GetByUser(username string) *Player

func (*PlayerService) Kickoff

func (s *PlayerService) Kickoff(p *Player)

func (*PlayerService) Login

func (s *PlayerService) Login(req *proto.LoginRequest, session *server.Session) (*Player, error)

func (*PlayerService) OnSessionTerminatedEvent

func (s *PlayerService) OnSessionTerminatedEvent(e *server.SessionTerminatedEvent)

type ServerStatus

type ServerStatus struct {
	ServerName       string
	Uptime           time.Duration
	NumOnlinePlayers int32
	TotalConnections int32
}

Jump to

Keyboard shortcuts

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