不推送gm 操作成功还是失败,客户端监听物品变化即可

This commit is contained in:
meixiongfeng 2022-09-19 11:00:15 +08:00
parent 53dda66f46
commit 70935119a4

View File

@ -44,6 +44,7 @@ func (this *GM) OnInstallComp() {
}
func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorCode) {
code = pb.ErrorCode_ReqParameterError
keys := strings.Split(cmd, ":")
if len(keys) == 2 {
if keys[0] == "bingo" {
@ -61,14 +62,9 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
N: int32(num),
},
}, true)
if code == pb.ErrorCode_Success { // 成功直接返回
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true})
return
}
}
}
}
code = pb.ErrorCode_ReqParameterError
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: false})
return
}