refactor: 调整 QuitSelf 函数中的 goroutine 退出逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user