This commit is contained in:
wh_zcy 2023-06-06 15:09:08 +08:00
commit efab828c47
2 changed files with 66 additions and 77 deletions

View File

@ -78,14 +78,14 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
}
return
}
code = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
errdata = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
{
A: datas[0],
T: datas[1],
N: int32(num),
},
}, true)
if code == pb.ErrorCode_Success { // 成功直接返回
if errdata == nil { // 成功直接返回
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true})
}
this.Debug("使用bingo命令",
@ -107,7 +107,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
}
return
}
code = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
errdata = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
@ -146,9 +146,9 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
N: 100,
})
}
code = this.DispenseRes(session, res, true)
errdata = this.DispenseRes(session, res, true)
if errdata != nil {
this.Errorf("资源发放失败,%v", code)
this.Errorf("资源发放失败,%v", errdata)
}
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
@ -187,7 +187,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
code = module1.(comm.IHero).GetAllMaxHero(session)
errdata = module1.(comm.IHero).GetAllMaxHero(session)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
@ -196,7 +196,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
} else if len(datas) == 1 && (datas[0] == "viking") { // 解锁远征所有难度
@ -205,7 +204,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
code = module1.(comm.IViking).CompleteAllLevel(session)
errdata = module1.(comm.IViking).CompleteAllLevel(session)
this.Debug("使用bingo命令:uid = %s ", log.Field{Key: "uid", Value: session.GetUserId()})
} else if len(datas) == 1 && (datas[0] == "hunting") { // 解锁狩猎所有难度
module1, err := this.service.GetModule(comm.ModuleHunting)
@ -213,7 +212,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
code = module1.(comm.IHunting).CompleteAllLevel(session)
errdata = module1.(comm.IHunting).CompleteAllLevel(session)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]})
@ -231,7 +230,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
code = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
@ -244,12 +243,11 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
}
module1.(comm.IMoonFantasy).TriggerMF(session, datas[1])
code = pb.ErrorCode_Success
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
)
code = pb.ErrorCode_Success
} else if len(datas) == 2 && (datas[0] == "arena") { // 设置竞技场用户积分
module1, err := this.service.GetModule(comm.ModuleArena)
if err != nil {
@ -264,7 +262,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
module1.(comm.IArena).SetUserIntegral(session, int32(num))
code = pb.ErrorCode_Success
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
@ -283,7 +280,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
module1.(comm.ISociaty).BingoSetExp(session, int32(num))
code = pb.ErrorCode_Success
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
@ -302,7 +298,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
module1.(comm.ISociaty).BingoSetActivity(session, int32(num))
code = pb.ErrorCode_Success
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
@ -334,9 +329,9 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
})
}
code = this.DispenseRes(session, res, true)
errdata = this.DispenseRes(session, res, true)
if errdata != nil {
this.Errorf("资源发放失败,%v", code)
this.Errorf("资源发放失败,%v", errdata)
}
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
@ -357,7 +352,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil {
code = pb.ErrorCode_Success
}
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
@ -417,14 +411,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 2 && (datas[0] == "chat") {
// num, err := strconv.Atoi(datas[1])
// if err != nil {
// errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
// return
// }
if module, err := this.service.GetModule(comm.ModuleChat); err == nil {
if errdata = module.(comm.IChat).SendSysChatToWorld(comm.ChatSystem10, nil, 5, 0, "xxx", "25001"); errdata != nil {
return
@ -460,7 +447,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
N: int32(num2),
}
if errdata = this.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], code)
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)
}
}
this.Debug("使用bingo命令:uid = %s ",
@ -483,7 +470,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
return
}
if err = module1.(comm.IUser).BingoSetUserVipLv(session, int32(num)); err == nil {
code = pb.ErrorCode_Success
}
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},

View File

@ -9,7 +9,10 @@ import (
// 图鉴任务奖励领取
func (this *apiComp) TaskAwardCheck(session comm.IUserSession, req *pb.SmithyTaskAwardReq) (errdata *pb.ErrorData) {
if req.TaskId == 0 {
return pb.ErrorCode_ReqParameterError
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
return
}