修改日志模块

This commit is contained in:
huangxiaolei
2022-12-13 16:52:06 +08:00
parent 9dc864ff69
commit 662b058327
19 changed files with 134 additions and 82 deletions

View File

@@ -3,37 +3,43 @@ package config
import (
"fmt"
"hk4e/pkg/logger"
"github.com/BurntSushi/toml"
)
var CONF *Config = nil
// 配置
// Config 配置
type Config struct {
HttpPort int `toml:"http_port"`
Logger logger.Config `toml:"logger"`
Database Database `toml:"database"`
Hk4e Hk4e `toml:"hk4e"`
MQ MQ `toml:"mq"`
HttpPort int32 `toml:"http_port"`
Logger Logger `toml:"logger"`
Database Database `toml:"database"`
Hk4e Hk4e `toml:"hk4e"`
MQ MQ `toml:"mq"`
}
// 数据库配置
// Logger 日志
type Logger struct {
Level string `toml:"level"`
Mode string `toml:"mode"`
Track bool `toml:"track"`
MaxSize int32 `toml:"max_size"`
}
// Database 数据库配置
type Database struct {
Url string `toml:"url"`
}
// 原神相关
// Hk4e 原神相关
type Hk4e struct {
KcpPort int `toml:"kcp_port"`
KcpPort int32 `toml:"kcp_port"`
KcpAddr string `toml:"kcp_addr"`
ResourcePath string `toml:"resource_path"`
GameDataConfigPath string `toml:"game_data_config_path"`
GachaHistoryServer string `toml:"gacha_history_server"`
}
// 消息队列
// MQ 消息队列
type MQ struct {
NatsUrl string `toml:"nats_url"`
}

View File

@@ -33,7 +33,7 @@ func LoadRsaKey() (signRsaKey []byte, encRsaKeyMap map[string][]byte, pwdRsaKey
return signRsaKey, encRsaKeyMap, pwdRsaKey
}
func InitRegion(kcpAddr string, kcpPort int) (*proto.QueryCurrRegionHttpRsp, *proto.QueryRegionListHttpRsp, *random.Ec2b) {
func InitRegion(kcpAddr string, kcpPort int32) (*proto.QueryCurrRegionHttpRsp, *proto.QueryRegionListHttpRsp, *random.Ec2b) {
dispatchEc2b := random.NewEc2b()
dispatchEc2bData := dispatchEc2b.Bytes()
dispatchXorKey := dispatchEc2b.XorKey()