config

package
v0.0.0-...-656f6e7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	LogLevel:           "Info",
	MysqlDsn:           "root:password@tcp(127.0.0.1:3306)/MariGS?charset=utf8mb4&parseTime=True&loc=Local",
	GameDataConfigPath: "data",
	Dispatch: []Dispatch{
		{
			Name:        "os_usa",
			Title:       "MariGS",
			Type:        "os_usa",
			DispatchUrl: "http://127.0.0.1:8080/query_cur_region",
		},
	},
	Account: &Account{
		AutoCreate: true,
		MaxPlayer:  -1,
	},
	Http: &Http{
		Addr: "0.0.0.0",
		Port: 8080,
	},
	Game: &Game{
		Addr:             "127.0.0.1",
		Port:             22102,
		IsInitialization: true,
	},
}
View Source
var FileNotExist = errors.New("config file not found")

Functions

func LoadConfig

func LoadConfig() error

Types

type Account

type Account struct {
	AutoCreate bool  `json:"autoCreate"`
	MaxPlayer  int64 `json:"maxPlayer"`
}

type Config

type Config struct {
	LogLevel           string `json:"logLevel"`
	MysqlDsn           string `json:"MysqlDsn"`
	GameDataConfigPath string `json:"GameDataConfigPath"`
	SignRsaKey         []byte
	EncRsaKeyMap       map[string][]byte
	PwdRsaKey          []byte
	Dispatch           []Dispatch
	Account            *Account
	Http               *Http
	Game               *Game
	Ec2b               *random.Ec2b `json:"Ec2B"`
}
var CONF *Config = nil

func GetConfig

func GetConfig() *Config

type Dispatch

type Dispatch struct {
	Name        string
	Title       string
	Type        string
	DispatchUrl string
}

type Game

type Game struct {
	Addr             string `json:"addr"`
	Port             uint32 `json:"port"`
	IsInitialization bool   `json:"isInitialization"`
}

type Http

type Http struct {
	Addr string `json:"addr"`
	Port int64  `json:"port"`
}

Jump to

Keyboard shortcuts

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