修改gm命令
This commit is contained in:
parent
b5e6db289f
commit
22969820e1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user