修改gm命令

This commit is contained in:
liwei 2023-08-09 20:37:27 +08:00
parent b5e6db289f
commit 22969820e1

View File

@ -433,28 +433,28 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 3 && (datas[0] == "itemtype") {
num1, err := strconv.Atoi(datas[1])
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
return
}
num2, err := strconv.Atoi(datas[2])
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
return
}
_data := this.configure.GetItemConfigureByType(int32(num1))
// num1, err := strconv.Atoi(datas[1])
// if err != nil {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_ReqParameterError,
// Title: pb.ErrorCode_ReqParameterError.ToString(),
// }
// return
// }
// num2, err := strconv.Atoi(datas[2])
// if err != nil {
// errdata = &pb.ErrorData{
// Code: pb.ErrorCode_ReqParameterError,
// Title: pb.ErrorCode_ReqParameterError.ToString(),
// }
// return
// }
_data := this.configure.GetAllItemConfigure()
for _, v := range _data {
res := &cfg.Gameatn{
A: "item",
T: v.Id,
N: int32(num2),
N: 100,
}
if errdata = this.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)