fix(session): 调整会话保存时长为1小时

将会话保存时长从24小时调整为1小时,以提高会话安全性。

feat(socket): 添加强制踢出功能

在QuitSelf方法中增加强制踢出参数,当参数不为0时强制踢出所有玩家。
This commit is contained in:
2025-10-26 15:12:29 +08:00
parent 03aea8ae6c
commit 2678cd9685
2 changed files with 9 additions and 5 deletions

View File

@@ -12,15 +12,19 @@ func (h *Server) KickPerson(a int) error {
return player.KickPlayer(uint32(a))
}
// 参数不为0是强制踢出
func (h *Server) QuitSelf(a int) error {
//TODO 这里待退出
fmt.Println("检测到退出请求")
h.quit = true
if a != 0 {
player.Mainplayer.Range(func(key uint32, value *player.Player) bool {
value.Kick()
return true
})
}
player.Mainplayer.Range(func(key uint32, value *player.Player) bool {
value.Kick()
return true
})
return nil
}