func main() { logger.Info("start fight server") var cfg config.SvrConfig if err := config.ReadConfig(*svrConfigFile, &cfg); err != nil { logger.Fatal("load config failed, error is: %v", err) return } fightserver.StartServices(&cfg, fightServerId) handler := func(s os.Signal, arg interface{}) { logger.Info("handle signal: %v\n", s) logger.Info("stop game server") os.Exit(0) } handlerArray := []os.Signal{syscall.SIGINT, syscall.SIGILL, syscall.SIGFPE, syscall.SIGSEGV, syscall.SIGTERM, syscall.SIGABRT} common.WatchSystemSignal(&handlerArray, handler) logger.Info("stop fight server") }
func main() { logger.Info("start auth server") var authcfg config.AuthConfig if err := config.ReadConfig(*authConfigFile, &authcfg); err != nil { logger.Fatal("load config failed, error is: %v", err) return } server.CreateServices(authcfg) common.WatchSystemSignal() logger.Info("stop auth server") }
func main() { logger.Info("start db server") var dbcfg config.DBConfig if err := config.ReadConfig(*dbConfigFile, &dbcfg); err != nil { logger.Fatal("load config failed, error is: %v", err) return } server.CreateServices(dbcfg) common.WatchSystemSignal() logger.Info("stop db server") }
func main() { logger.Info("start game server") var cfg config.SvrConfig if err := config.ReadConfig(*svrConfigFile, &cfg); err != nil { logger.Fatal("load config failed, error is: %v", err) return } server.CreateConnectorServerForClient(cfg) common.WatchSystemSignal() //script.DefaultLuaScript().ExecuteScriptFile("script/runtime/gameserver/main.lua") logger.Info("stop game server") }
func Register_lua_common_WatchSystemSignal(L *lua.LState) int { common.WatchSystemSignal() return 0 }