game/server/gate/cmd/cmd.go

36 lines
769 B
Go
Raw Normal View History

2025-05-25 20:34:08 +08:00
package cmd
import (
"fmt"
"game/server/gate/config"
"game/server/gate/server"
"github.com/fox/fox/log"
"os"
"os/signal"
"syscall"
)
func initRepo() {
// model.InitUserDB(&config.Config.DBConfig)
// model.InitConfigDB(&config.Config.DBConfig)
// model.InitRedis(&config.Config.Redis)
// model.InitStub()
// RobotMgr.Load()
// ClubRobotMgr.Load()
// //log.Debug(fmt.Sprintf("%+v", stub.GGlobal))
}
func Run(version string) {
config.LoadConfig()
log.Info(fmt.Sprintf("版本信息.%v", version))
// initRepo()
server.Init()
// 截获 SIGINT 和 SIGTERM 信号
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
sig := <-c
// handler.StopService()
log.Info(fmt.Sprintf("received %s, initiating shutdown...", sig))
}