package main import ( "dcg/config" "dcg/game/msg_transfer" "dcg/game/svc" "dcg/pkg/logger" "git.noahlan.cn/northlan/ngs" "git.noahlan.cn/northlan/ngs/serialize/protobuf" ) func main() { _ = logger.InitLogger(&config.Config.Log.File, &config.Config.Log.Console) defer logger.Sync() ctx := svc.NewServiceContext() msg_transfer.Init(ctx) msg_transfer.Run() opts := make([]ngs.Option, 0) opts = append(opts, ngs.WithComponents(ctx.Services)) opts = append(opts, ngs.WithSerializer(protobuf.NewSerializer())) if config.Config.Server.Debug { ngs.WithDebugMode() } ngs.Listen(config.Config.Server.Listen, opts...) }