mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-13 17:12:27 +08:00
Ai世界玩家人数超过4人测试
This commit is contained in:
@@ -66,10 +66,10 @@ func Run(ctx context.Context, configFile string) error {
|
||||
logger.Warn("gate start, appid: %v", APPID)
|
||||
|
||||
messageQueue := mq.NewMessageQueue(api.GATE, APPID, client)
|
||||
defer messageQueue.Close()
|
||||
|
||||
connectManager := net.NewKcpConnectManager(messageQueue, client.Discovery)
|
||||
connectManager.Start()
|
||||
defer connectManager.Stop()
|
||||
defer connectManager.Close()
|
||||
|
||||
go func() {
|
||||
outputChan := connectManager.GetKcpEventOutputChan()
|
||||
|
||||
@@ -64,10 +64,11 @@ func NewKcpConnectManager(messageQueue *mq.MessageQueue, discovery *rpc.Discover
|
||||
r.localMsgOutput = make(chan *ProtoMsg, 1000)
|
||||
r.createSessionChan = make(chan *Session, 1000)
|
||||
r.destroySessionChan = make(chan *Session, 1000)
|
||||
r.run()
|
||||
return r
|
||||
}
|
||||
|
||||
func (k *KcpConnectManager) Start() {
|
||||
func (k *KcpConnectManager) run() {
|
||||
// 读取密钥相关文件
|
||||
k.signRsaKey, k.encRsaKeyMap, _ = region.LoadRsaKey()
|
||||
// key
|
||||
@@ -97,7 +98,7 @@ func (k *KcpConnectManager) Start() {
|
||||
go k.acceptHandle(listener)
|
||||
}
|
||||
|
||||
func (k *KcpConnectManager) Stop() {
|
||||
func (k *KcpConnectManager) Close() {
|
||||
k.closeAllKcpConn()
|
||||
time.Sleep(time.Second * 3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user