Documentation ¶
Index ¶
- Variables
- func AddPlayResult(sv grpcserv.IService, pr *sgc7pb.ReplyPlay, results []*sgc7game.PlayResult)
- func Hash(data []byte) string
- func ProcCheat(plugin sgc7plugin.IPlugin, cheat string) error
- type Client
- func (client *Client) GetGameConfig(ctx context.Context, gameCode string) (*sgc7pb.ReplyGameConfig, error)
- func (client *Client) InitGame(ctx context.Context, gameCode string, data string) (*sgc7pb.ReplyInitGame, error)
- func (client *Client) InitializeGamePlayer(ctx context.Context, gameCode string) (*sgc7pb.ReplyInitializeGamePlayer, error)
- func (client *Client) PlayGame(ctx context.Context, gameCode string, ps *sgc7pb.PlayerState, cheat string, ...) (*sgc7pb.ReplyPlayGame, error)
- type GameData
- type GameMgr
- func (mgr *GameMgr) GetGameConfig(gameCode string) (*sgc7game.Config, error)
- func (mgr *GameMgr) InitGame(gameCode string, data []byte) error
- func (mgr *GameMgr) InitializeGamePlayer(gameCode string) (*sgc7pb.PlayerState, error)
- func (mgr *GameMgr) PlayGame(gameCode string, req *sgc7pb.RequestPlay) (*sgc7pb.ReplyPlay, error)
- type Serv
- func (serv *Serv) GetGameConfig(ctx context.Context, req *sgc7pb.RequestGameConfig) (*sgc7pb.ReplyGameConfig, error)
- func (serv *Serv) InitGame(ctx context.Context, req *sgc7pb.RequestInitGame) (*sgc7pb.ReplyInitGame, error)
- func (serv *Serv) InitializeGamePlayer(ctx context.Context, req *sgc7pb.RequestInitializeGamePlayer) (*sgc7pb.ReplyInitializeGamePlayer, error)
- func (serv *Serv) PlayGame(req *sgc7pb.RequestPlayGame, stream sgc7pb.GameLogicCollection_PlayGameServer) error
- func (serv *Serv) PlayGame2(ctx context.Context, req *sgc7pb.RequestPlayGame) (*sgc7pb.ReplyPlayGame, error)
- func (serv *Serv) Start(ctx context.Context) error
- func (serv *Serv) Stop()
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidGameCode - invalid gameCode ErrInvalidGameCode = errors.New("invalid gameCode") // ErrInvalidGameParams - invalid GameParams ErrInvalidGameParams = errors.New("invalid GameParams") )
Functions ¶
func AddPlayResult ¶
AddPlayResult - []*sgc7game.PlayResult => *PlayResult
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - GameLogicCollectionClient
func (*Client) GetGameConfig ¶
func (client *Client) GetGameConfig(ctx context.Context, gameCode string) (*sgc7pb.ReplyGameConfig, error)
GetGameConfig - get config
func (*Client) InitGame ¶
func (client *Client) InitGame(ctx context.Context, gameCode string, data string) (*sgc7pb.ReplyInitGame, error)
InitGame - init game
func (*Client) InitializeGamePlayer ¶
func (client *Client) InitializeGamePlayer(ctx context.Context, gameCode string) (*sgc7pb.ReplyInitializeGamePlayer, error)
InitializeGamePlayer - initialize a player
type GameData ¶
type GameData struct { GameCode string HashCode string Data []byte Game *lowcode.Game Service grpcserv.IService }
func NewGameDataWithHash ¶
type GameMgr ¶
func NewGameMgr ¶
func NewGameMgr() *GameMgr
func (*GameMgr) GetGameConfig ¶
func (*GameMgr) InitializeGamePlayer ¶
func (mgr *GameMgr) InitializeGamePlayer(gameCode string) (*sgc7pb.PlayerState, error)
type Serv ¶
type Serv struct { sgc7pb.UnimplementedGameLogicCollectionServer // contains filtered or unexported fields }
Serv - Service
func (*Serv) GetGameConfig ¶
func (serv *Serv) GetGameConfig(ctx context.Context, req *sgc7pb.RequestGameConfig) (*sgc7pb.ReplyGameConfig, error)
GetGameConfig - get game config
func (*Serv) InitGame ¶
func (serv *Serv) InitGame(ctx context.Context, req *sgc7pb.RequestInitGame) (*sgc7pb.ReplyInitGame, error)
initGame - initial game
func (*Serv) InitializeGamePlayer ¶
func (serv *Serv) InitializeGamePlayer(ctx context.Context, req *sgc7pb.RequestInitializeGamePlayer) (*sgc7pb.ReplyInitializeGamePlayer, error)
InitializeGamePlayer - initialize a player
func (*Serv) PlayGame ¶
func (serv *Serv) PlayGame(req *sgc7pb.RequestPlayGame, stream sgc7pb.GameLogicCollection_PlayGameServer) error
PlayGame - play game
func (*Serv) PlayGame2 ¶
func (serv *Serv) PlayGame2(ctx context.Context, req *sgc7pb.RequestPlayGame) (*sgc7pb.ReplyPlayGame, error)
PlayGame2 - play game
type Service ¶
type Service struct {
*grpcserv.BasicService2
}
Service - service
func NewService ¶
func NewService() *Service
func (*Service) BuildPBGameModParam ¶
BuildPBGameModParam - interface{} -> *any.Any
Source Files ¶
Click to show internal directories.
Click to hide internal directories.