feat(cool): 添加Redis发布功能并实现巅峰赛匹配加入逻辑 新增RedisDo函数用于向Redis频道发布消息,并在巅峰赛场匹配 中添加玩家加入队列的功能。同时修复了socket连接关闭时资源 泄露问题,确保MsgChan正确关闭。 BREAKING CHANGE: 新增的RedisDo函数会直接panic处理错误, 需要调用方注意
This commit is contained in:
@@ -88,6 +88,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
|
||||
|
||||
//v.LF.Close()
|
||||
// v.LF.Close()
|
||||
close(v.MsgChan)
|
||||
if v.Player != nil {
|
||||
v.Player.Save() //保存玩家数据
|
||||
|
||||
|
||||
Reference in New Issue
Block a user