mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
init commit
This commit is contained in:
29
service/game-hk4e/rpc/rpc.go
Normal file
29
service/game-hk4e/rpc/rpc.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"flswld.com/gate-hk4e-api/gm"
|
||||
"flswld.com/light"
|
||||
)
|
||||
|
||||
type RpcManager struct {
|
||||
hk4eGatewayConsumer *light.Consumer
|
||||
}
|
||||
|
||||
func NewRpcManager(hk4eGatewayConsumer *light.Consumer) (r *RpcManager) {
|
||||
r = new(RpcManager)
|
||||
r.hk4eGatewayConsumer = hk4eGatewayConsumer
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *RpcManager) SendKickPlayerToHk4eGateway(userId uint32) {
|
||||
info := new(gm.KickPlayerInfo)
|
||||
info.UserId = userId
|
||||
// 客户端提示信息为服务器断开连接
|
||||
info.Reason = uint32(5)
|
||||
var result bool
|
||||
ok := r.hk4eGatewayConsumer.CallFunction("RpcManager", "KickPlayer", &info, &result)
|
||||
if ok == true && result == true {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user