Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
b65e44ee95
@ -127,6 +127,15 @@ var (
|
||||
robot.addBuilders(tcs)
|
||||
}
|
||||
},
|
||||
}, {
|
||||
desc: "GM",
|
||||
mainType: "gm",
|
||||
subType: "cmd",
|
||||
req: &pb.GMCmdReq{
|
||||
Cmod: "bingo:attr,gold,100",
|
||||
},
|
||||
rsp: &pb.GMCmdResp{},
|
||||
enabled: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
@ -24,14 +24,14 @@ func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code
|
||||
|
||||
///解析GM 指令
|
||||
func (this *apiComp) Cmd(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode, data proto.Message) {
|
||||
if code = this.CmdCheck(session, req); code == pb.ErrorCode_Success {
|
||||
if code = this.CmdCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
keys := strings.Split(req.Cmod, ":")
|
||||
if len(keys) == 2 {
|
||||
if keys[0] == "bingo" {
|
||||
datas := strings.Split(keys[1], ",")
|
||||
if len(datas) != 3 {
|
||||
if len(datas) == 3 {
|
||||
num, err := strconv.Atoi(datas[2])
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
|
Loading…
Reference in New Issue
Block a user