34 lines
558 B
Go
34 lines
558 B
Go
package socket
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/logic/service/player"
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
func (h *Server) KickPerson(a int) error {
|
|
cool.Loger.Info(context.TODO(), "检测到踢人请求", a)
|
|
if a == 0 {
|
|
return nil
|
|
}
|
|
|
|
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
|
|
})
|
|
}
|
|
|
|
return nil
|
|
}
|