This commit is contained in:
sk 2024-05-23 16:05:38 +08:00
parent a6c1b37e0c
commit 898f915542
2 changed files with 7 additions and 10 deletions

View File

@ -44,6 +44,12 @@
"AppId": "5c56d1644966f078bfb90c71", "AppId": "5c56d1644966f078bfb90c71",
"IsDevMode": true "IsDevMode": true
}, },
"etcd": {
"Url": ["127.0.0.1:2379"],
"UserName": "",
"Password": "",
"DialTimeout": 60
},
"costum": { "costum": {
"MgoRpcCliNet": "tcp", "MgoRpcCliNet": "tcp",
"MgoRpcCliAddr": "127.0.0.1:8999", "MgoRpcCliAddr": "127.0.0.1:8999",
@ -51,11 +57,6 @@
"RMQExchange": "win88", "RMQExchange": "win88",
"RMQQosPrefetchCount": 2, "RMQQosPrefetchCount": 2,
"RMQQosPrefetchSize": 0, "RMQQosPrefetchSize": 0,
"RMQQosGlobal": true, "RMQQosGlobal": true
"etcdurl": [
"127.0.0.1:2379"
],
"etcduser": "",
"etcdpwd": ""
} }
} }

View File

@ -5,7 +5,6 @@ import (
"net" "net"
"net/http" "net/http"
"net/rpc" "net/rpc"
"time"
"mongo.games.com/goserver/core" "mongo.games.com/goserver/core"
"mongo.games.com/goserver/core/module" "mongo.games.com/goserver/core/module"
@ -13,7 +12,6 @@ import (
_ "mongo.games.com/game" _ "mongo.games.com/game"
"mongo.games.com/game/common" "mongo.games.com/game/common"
"mongo.games.com/game/dbproxy/svc" "mongo.games.com/game/dbproxy/svc"
"mongo.games.com/game/etcd"
"mongo.games.com/game/model" "mongo.games.com/game/model"
"mongo.games.com/game/mq" "mongo.games.com/game/mq"
) )
@ -26,7 +24,6 @@ func main() {
core.LoadPackages("config.json") core.LoadPackages("config.json")
// core hook // core hook
core.RegisteHook(core.HOOK_BEFORE_START, func() error { core.RegisteHook(core.HOOK_BEFORE_START, func() error {
etcd.Start(common.CustomConfig.GetStrings("etcdurl"), common.CustomConfig.GetString("etcduser"), common.CustomConfig.GetString("etcdpwd"), time.Minute)
mq.StartConsumer(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true) mq.StartConsumer(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true)
mq.StartPublisher(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true, common.CustomConfig.GetInt("RMQPublishBacklog")) mq.StartPublisher(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true, common.CustomConfig.GetInt("RMQPublishBacklog"))
// 尝试初始化玩家id // 尝试初始化玩家id
@ -41,7 +38,6 @@ func main() {
return nil return nil
}) })
core.RegisteHook(core.HOOK_AFTER_STOP, func() error { core.RegisteHook(core.HOOK_AFTER_STOP, func() error {
etcd.Close()
mq.StopConsumer() mq.StopConsumer()
mq.StopPublisher() mq.StopPublisher()
return nil return nil