This commit is contained in:
@@ -27,12 +27,10 @@ func (*ServerHandler) Kick(_ context.Context, userid uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cl, ok := cool.GetClient(useid1)
|
cl, ok := cool.GetClient(useid1)
|
||||||
if ok {
|
if !ok {
|
||||||
err := cl.KickPerson(userid) //实现指定服务器踢人
|
return fmt.Errorf("server not found", err)
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("踢人失败", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
cl.KickPerson(userid) //实现指定服务器踢人
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,13 @@ func (h Controller) Login(data *user.MAIN_LOGIN_IN, c gnet.Conn) (result *user.L
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Maincontroller.RPCClient.Kick(data.Head.UserID) //通知其他服务器踢人
|
error := Maincontroller.RPCClient.Kick(data.Head.UserID) //通知其他服务器踢人
|
||||||
|
if error != nil {
|
||||||
|
cool.Logger.Error(context.Background(), "踢人失败", err)
|
||||||
|
|
||||||
|
defer c.Close()
|
||||||
|
return
|
||||||
|
}
|
||||||
currentPlayer := player.GetPlayer(c, data.Head.UserID)
|
currentPlayer := player.GetPlayer(c, data.Head.UserID)
|
||||||
if currentPlayer == nil {
|
if currentPlayer == nil {
|
||||||
cool.Logger.Error(context.Background(), "获取玩家失败", data.Head.UserID)
|
cool.Logger.Error(context.Background(), "获取玩家失败", data.Head.UserID)
|
||||||
|
|||||||
Reference in New Issue
Block a user