refactor: 调整 QuitSelf 函数中的 goroutine 退出逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-01 19:16:38 +08:00
committed by cnb
parent 911c1d7ec2
commit 49c15e26d3

View File

@@ -50,6 +50,7 @@ func (s *Server) QuitSelf(a int) error {
return false
})
} else {
go func() {
player.Mainplayer.Range(func(key uint32, value *player.Player) bool {
if value != nil {
@@ -63,9 +64,10 @@ func (s *Server) QuitSelf(a int) error {
if value != nil {
value.Kick(true)
}
os.Exit(0)
return false
})
os.Exit(0)
}()
}