bingo 命令扩展 清理背包
模拟充值
This commit is contained in:
parent
c81ca67c5f
commit
d21a7ab716
@ -32,6 +32,9 @@ import (
|
||||
16、bingo:alltask // bingo所有任务
|
||||
16、bingo:allhero // bingo所有英雄
|
||||
17、bingo:allgrowtask // 完成所有成长任务
|
||||
18、bingo:lv,50
|
||||
19、bingo:recharge,10
|
||||
20、bingo:cleanitem
|
||||
*/
|
||||
//参数校验
|
||||
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {
|
||||
|
@ -342,7 +342,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
|
||||
log.Field{Key: "param", Value: datas[0]},
|
||||
log.Field{Key: "res", Value: res},
|
||||
)
|
||||
} else if len(datas) == 2 && (datas[0] == "userlv") { // 玩家等级
|
||||
} else if len(datas) == 2 && (datas[0] == "lv") { // 玩家等级
|
||||
module1, err := this.service.GetModule(comm.ModuleUser)
|
||||
if err != nil {
|
||||
return
|
||||
@ -360,6 +360,41 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
log.Field{Key: "N", Value: int32(num)},
|
||||
)
|
||||
} else if len(datas) == 2 && (datas[0] == "recharge") { // 充值次数
|
||||
module1, err := this.service.GetModule(comm.ModulePay)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
for i := 0; i < num; i++ {
|
||||
if code = module1.(comm.IPay).ModulePayDelivery(session, "8", 64800); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
log.Field{Key: "N", Value: int32(num)},
|
||||
)
|
||||
} else if len(datas) == 1 && (datas[0] == "cleanitem") { // 充值次数
|
||||
module1, err := this.service.GetModule(comm.ModuleItems)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if code = module1.(comm.IItems).CleanItems(session); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user