From 3445674bd1448ccbca3ffbad22ec47a0b0df63f6 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Mon, 30 May 2022 14:58:04 +0800 Subject: [PATCH] fix: del --- cmd/gameserver/service/game.go | 1 - cmd/httpserver/service/http.go | 8 -------- common/conf.go | 28 +++++++++------------------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/cmd/gameserver/service/game.go b/cmd/gameserver/service/game.go index 1201ed0..f9bfc2f 100644 --- a/cmd/gameserver/service/game.go +++ b/cmd/gameserver/service/game.go @@ -89,7 +89,6 @@ func (s *GameServer) Stop() { mongoproxy.CloseMongo() redisproxy.CloseRedis() - //etcd.CloseEtcd() } func (s *GameServer) OnConnection(conn components.IConnection) { diff --git a/cmd/httpserver/service/http.go b/cmd/httpserver/service/http.go index fdbdcf9..597bd88 100644 --- a/cmd/httpserver/service/http.go +++ b/cmd/httpserver/service/http.go @@ -30,13 +30,6 @@ func (s *AccountServer) Init(sconf *common.SConf) error { return err } - //Etcd 初始化 - //err = etcd.NewEtcdClient(common.GlobalConf.Etcd) - //if err != nil { - // return err - //} - //etcd.PutWithLeasePrefix(sconf.Name, fmt.Sprintf("%d", sconf.ID), fmt.Sprintf("%s:%d", sconf.IP, sconf.Port), 5) - models.NewDBSeed(sconf.ID).InitServerDatabase(models.AccountModels()) models.DBSeedS().InitAutoIncreUidTable(models.AccountModels()) return nil @@ -62,5 +55,4 @@ func (s *AccountServer) Start() error { func (s *AccountServer) Stop() { s.IHttp.Stop() - //etcd.CloseEtcd() } diff --git a/common/conf.go b/common/conf.go index f6294cc..6512cd2 100644 --- a/common/conf.go +++ b/common/conf.go @@ -16,11 +16,6 @@ type RedisConf struct { DB int `json:"db"` } -type Etcd struct { - Endpoints []string `json:"endpoints"` - DialTimeout int `json:"dialtimeout"` -} - type MongoConf struct { User string `yaml:"user"` Password string `yaml:"password"` @@ -86,22 +81,20 @@ type GameService struct { } type ServerConf struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - WorkerID int64 `yaml:"workerid"` - DatacenterID int64 `yaml:"datacenterid"` - AccountConf *SConf `yaml:"server_account"` - GameConf *SConf `yaml:"server_game"` - LogConf *LogConf `yaml:"logconf" json:"logconf"` - TestClient *TestClient `yaml:"test_client"` - //Etcd *Etcd `yaml:"etcd"` - GameService *GameService `yaml:"server_list"` + ID string `yaml:"id"` + Name string `yaml:"name"` + WorkerID int64 `yaml:"workerid"` + DatacenterID int64 `yaml:"datacenterid"` + AccountConf *SConf `yaml:"server_account"` + GameConf *SConf `yaml:"server_game"` + LogConf *LogConf `yaml:"logconf" json:"logconf"` + TestClient *TestClient `yaml:"test_client"` + GameService *GameService `yaml:"server_list"` } var ( GlobalConf ServerConf GlobalSconf *SConf - //SnowFlack *snow.Snowflake ) func init() { @@ -140,7 +133,4 @@ func init() { fmt.Errorf("log conf %v", err) return } - - //初始化雪花算法 - //SnowFlack = snow.NewSnowflake(GlobalConf.WorkerID, GlobalConf.DatacenterID) } -- libgit2 0.21.2