configs

package
v0.0.0-...-74edb40 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBChainConfig

func ExtractBChainConfig(config *BChainConfig, path string, debug bool) (string, error)

ExtractBChainConfig : extract blockchain configuration from file

Types

type BChainConfig

type BChainConfig struct {
	VERSION       string
	IMPORTS       []string
	PORT          string
	SOURCEIPS     []string
	NODE          NodeConfig
	BLOCK         BlockConfig
	MAXUTXO       int
	PROPOSEWINDOW int
}

BChainConfig : struct for the blockchain configuration

func (BChainConfig) Port

func (bcc BChainConfig) Port() string

Port : return the port from the configuration

type BlockConfig

type BlockConfig struct {
	MAXPERMINUTE float64
	MAXBYTES     int
}

BlockConfig : struct of configuration of single block

type GUserTypeConfig

type GUserTypeConfig struct {
	NAME    string
	CODE    byte
	LIFES   byte
	OBJECTS []GameObjectConfig
	RULES   []RuleConfig
}

GUserTypeConfig types of user on this instance

type GameConfig

type GameConfig struct {
	NAME     string
	MAXROOMS int
	CLANS    bool
	GAMEMODS []GameModeConfig
}

GameConfig : config of the game on the server

type GameModeConfig

type GameModeConfig struct {
	NAME       string
	CODE       byte
	MAXPLAYERS int
	LIFES      int
	OBJECTS    []GameObjectConfig
	RULES      []RuleConfig
}

GameModeConfig : config of a gamemode

type GameObjectConfig

type GameObjectConfig struct {
	NAME   string
	CODE   byte
	LIFES  byte
	DAMAGE byte
}

GameObjectConfig : config of a game object in the game

type GameServerConfig

type GameServerConfig struct {
	VERSION string
	IMPORTS []string
	PORT    string
	GAME    GameConfig
	USER    GameUserConfig
}

GameServerConfig : config of the game server

func ExtractGameConfig

func ExtractGameConfig(b []byte) (GameServerConfig, error)

ExtractGameConfig : extracts the confogiguration from a json slice of bytes

type GameUserConfig

type GameUserConfig struct {
	CLAN  bool
	TYPES []GUserTypeConfig
}

GameUserConfig : Configuration ogf a user on this instance

type NodeConfig

type NodeConfig struct {
	MAXCONNECTED int
	MINCONNECTED int
	RETRYTIMEOUT int
}

NodeConfig : struct of configurations about blockchain nodes

type RuleConfig

type RuleConfig struct {
	NAMECODE string
}

RuleConfig : configuration of a rule

Jump to

Keyboard shortcuts

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