center.go 708 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "github.com/mhaya"
  4. mhayaCron "github.com/mhaya/components/cron"
  5. mhayaMongo "github.com/mhaya/components/mongo"
  6. "github.com/mhaya/game/game_cluster/internal/data"
  7. "github.com/mhaya/game/game_cluster/internal/mdb"
  8. "github.com/mhaya/game/game_cluster/nodes/center/module/account"
  9. "github.com/mhaya/game/game_cluster/nodes/center/module/ops"
  10. )
  11. func main() {
  12. app := mhaya.Configure(
  13. "./game/config/profile-gc.json",
  14. "m-center",
  15. false,
  16. mhaya.Cluster,
  17. )
  18. app.Register(mhayaCron.New())
  19. app.Register(data.New())
  20. // 注册db组件
  21. app.Register(mhayaMongo.NewComponent())
  22. app.AddActors(
  23. &account.ActorAccount{},
  24. &ops.ActorOps{},
  25. &mdb.ActorDB{},
  26. )
  27. app.Startup()
  28. }