leader

package
v0.0.0-...-6f4faed Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugLog

func DebugLog(msg ...string)

func DebugLogf

func DebugLogf(msg string, a ...interface{})

func FailOnError

func FailOnError(err error, msg string)

func InitLogger

func InitLogger(fileName string)

func LeaderToPlayerServer

func LeaderToPlayerServer()

main server for player functionality

func Leader_go

func Leader_go()

main leader function

func ProcessUserInput

func ProcessUserInput() bool

func PublishDeadPlayer

func PublishDeadPlayer(playerId *uint32, stage *uint32)

Send player death to Pool via RabbitMQ

func RabbitMqSetup

func RabbitMqSetup()

setup dial to mqrabbit server (with global struct var)

func RequestPlayerHistory

func RequestPlayerHistory(gamedata *GameData, grpcdata *GrpcData, playerId uint32) *[]uint32

request player history from namenode

func RequestPrize

func RequestPrize(ctx context.Context, client pb.PrizeClient) uint32

request current accumulated prize to pool node

func SendPlayerMoves

func SendPlayerMoves(grpcdata *GrpcData, gamedata *GameData)

send player moves to namenode

func ShowPlayerHistory

func ShowPlayerHistory(playerId uint32, history *[]uint32)

Prints player history to console

Types

type DebugLogger

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

DEBUG TESTING --

type GameData

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

type GrpcData

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

holds required data for a succesful grpc preamble dial

type Player

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

func GetLivingPlayers

func GetLivingPlayers() (players []Player)

Check the list of players, and return only the ones alive

type PlayerGroup

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

type PlayerState

type PlayerState struct {
	Dead, Alive, NotPlaying uint32
}

should work as struct

type RabbitMqData

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

type UserInput

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

func GetUserInput

func GetUserInput() (UserInput, error)

Jump to

Keyboard shortcuts

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