dtserv

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidBasicPlayerState - invalid BasicPlayerState
	ErrInvalidBasicPlayerState = errors.New("invalid BasicPlayerState")
)

Functions

func AddPlayResult

func AddPlayResult(sv IService, pr *sgc7pb.ReplyPlay, results []*sgc7game.PlayResult)

AddPlayResult - []*sgc7game.PlayResult => *PlayResult

func BuildPBGameConfig added in v0.5.10

func BuildPBGameConfig(cfg *sgc7game.Config) *sgc7pb.GameConfig

BuildPBGameConfig - *sgc7game.Config -> *sgc7pb.GameConfig

func BuildPBGameScene added in v0.5.10

func BuildPBGameScene(gs *sgc7game.GameScene) *sgc7pb.GameScene

BuildPBGameScene - *sgc7game.GameScene -> *sgc7pb.GameScene

func BuildPBGameScenePlayResult added in v0.5.5

func BuildPBGameScenePlayResult(r *sgc7game.Result) *sgc7pb.GameScenePlayResult

BuildPBGameScenePlayResult - *sgc7game.Result -> *sgc7pb.GameScenePlayResult

func BuildPBLineData added in v0.5.10

func BuildPBLineData(ld *sgc7game.LineData) *sgc7pb.LinesData

BuildPBLineData - *sgc7game.LineData -> *sgc7pb.LinesData

func BuildPBPayTables added in v0.5.10

func BuildPBPayTables(pt *sgc7game.PayTables) map[int32]*sgc7pb.Row

BuildPBPayTables - *sgc7game.PayTables -> map[int32]*Row

func BuildPBReelsData added in v0.5.10

func BuildPBReelsData(rd *sgc7game.ReelsData) *sgc7pb.ReelsData

BuildPBReelsData - *sgc7game.ReelsData -> *sgc7pb.ReelsData

func BuildPBRngs added in v0.5.5

func BuildPBRngs(rngs []*sgc7utils.RngInfo) []*sgc7pb.RngInfo

BuildPBRngs - []*sgc7utils.RngInfo => []*sgc7pb.RngInfo

func BuildStake added in v0.5.5

func BuildStake(stake *sgc7pb.Stake) *sgc7game.Stake

BuildStake - PlayerState => sgc7game.IPlayerState

func MergeReplyPlay added in v0.5.7

func MergeReplyPlay(dst *sgc7pb.ReplyPlay, src *sgc7pb.ReplyPlay)

MergeReplyPlay - merge ReplyPlay

Types

type BasicService

type BasicService struct {
}

BasicService - BasicService

func NewBasicService

func NewBasicService() *BasicService

NewBasicService - new BasicService

func (*BasicService) BuildPBPlayerState

func (bs *BasicService) BuildPBPlayerState(ps sgc7game.IPlayerState) (*sgc7pb.PlayerState, error)

BuildPBPlayerState - sgc7game.IPlayerState -> *sgc7pb.PlayerState

func (*BasicService) BuildPlayerStateFromPB

func (bs *BasicService) BuildPlayerStateFromPB(ps *sgc7pb.PlayerState) (sgc7game.IPlayerState, error)

BuildPlayerStateFromPB - *sgc7pb.PlayerState -> sgc7game.IPlayerState

type Client

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

Client - DTGameLogicClient

func NewClient

func NewClient(servAddr string) (*Client, error)

NewClient - new DTGameLogicClient

func (*Client) GetConfig

func (client *Client) GetConfig(ctx context.Context) (*sgc7pb.GameConfig, error)

GetConfig - get config

func (*Client) Initialize

func (client *Client) Initialize(ctx context.Context) (*sgc7pb.PlayerState, error)

Initialize - initialize a player

func (*Client) Play

func (client *Client) Play(ctx context.Context, ps *sgc7pb.PlayerState,
	cheat string,
	stake *sgc7pb.Stake,
	clientParams string,
	cmd string) (*sgc7pb.ReplyPlay, error)

Play - play game

type IService

type IService interface {
	// BuildPlayerStateFromPB - *sgc7pb.PlayerState -> sgc7game.IPlayerState
	BuildPlayerStateFromPB(ps *sgc7pb.PlayerState) (sgc7game.IPlayerState, error)
	// BuildPBPlayerState - sgc7game.IPlayerState -> *sgc7pb.PlayerState
	BuildPBPlayerState(ps sgc7game.IPlayerState) (*sgc7pb.PlayerState, error)
	// BuildPBGameModParam - interface{} -> *any.Any
	BuildPBGameModParam(gp interface{}) (*any.Any, error)
}

IService - service

type Serv

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

Serv - DreamTech Service

func NewServ

func NewServ(service IService, game sgc7game.IGame, bindaddr string, version string) (*Serv, error)

NewServ -

func (*Serv) GetConfig

func (serv *Serv) GetConfig(ctx context.Context, req *sgc7pb.RequestConfig) (*sgc7pb.GameConfig, error)

GetConfig - get config

func (*Serv) Initialize

func (serv *Serv) Initialize(ctx context.Context, req *sgc7pb.RequestInitialize) (*sgc7pb.PlayerState, error)

Initialize - initialize a player

func (*Serv) Play

func (serv *Serv) Play(req *sgc7pb.RequestPlay, stream sgc7pb.DTGameLogic_PlayServer) error

Play - play game

func (*Serv) ProcCheat

func (serv *Serv) ProcCheat(plugin sgc7plugin.IPlugin, cheat string) error

ProcCheat - process cheat

func (*Serv) Start

func (serv *Serv) Start(ctx context.Context) error

Start - start a service

func (*Serv) Stop

func (serv *Serv) Stop()

Stop - stop service

Jump to

Keyboard shortcuts

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