服务器玩家在线信息同步

This commit is contained in:
flswld
2023-03-17 14:30:49 +08:00
parent 658b577c20
commit 7de1d2e765
19 changed files with 286 additions and 77 deletions

View File

@@ -8,6 +8,8 @@ import (
"syscall"
"hk4e/common/config"
"hk4e/common/mq"
"hk4e/node/api"
"hk4e/node/service"
"hk4e/pkg/logger"
@@ -30,7 +32,12 @@ func Run(ctx context.Context, configFile string) error {
return err
}
defer conn.Close()
s, err := service.NewService(conn)
// 只用来监听全服广播
messageQueue := mq.NewMessageQueue(api.NODE, "node", nil)
defer messageQueue.Close()
s, err := service.NewService(conn, messageQueue)
if err != nil {
return err
}