go_dreamfactory/modules/gm/api_cmd.go
2023-06-06 09:52:44 +08:00

65 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package gm
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
/* GM 在控制台输入的字符串类型
//bingo:item,10001,1
//bingo:attr,gold,1000000
//bingo:equi,xxx,1 // xxx 装备id
3、修改心魔塔进度bingo:pataid,1010代表层数
4、修改玩家经验值bingo:attr,exp,10001000代表新增的经验值 //
5、跳过随机任务 bingo:worldtask,1,1001
6、bingo:Iamyoudad
7、bingo:vip,yueka_1,1 // 月卡类型
8、bingo:manhero // 获取所有满星满级满觉醒的英雄
9、bingo:season,10 赛季塔层数
10、bingo:viking // 解锁维京所有难度
11、bingo:hunting // 解锁狩猎所有难度
12、bingo:mainline,1100104 // mainstage 关卡ID
13、bingo:moon,1 // 触发月之秘境
14、bingo:arena,100 // 设置竞技场用户积分
15、bingo:sociatyexp,100 // 设置工会经验
15、bingo:sociatyactivity,100 // 设置工会活跃
16、bingo:alltask // bingo所有任务
16、bingo:allhero // bingo所有英雄
17、bingo:allgrowtask // 完成所有成长任务
18、bingo:lv,50
19、bingo:recharge,10
20、bingo:cleanitem
21、bingo:allequip
21、bingo:chat,1
22、bingo:itemtype,1,1 // 获取某种类型所有道具(道具类型,数量)
23、bingo:viplv,50
24、bingo:cleannpc
*/
//参数校验
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) {
if len(req.Cmod) == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
///解析GM 指令
func (this *apiComp) Cmd(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) {
if code = this.CmdCheck(session, req); code != pb.ErrorCode_Success {
return
}
var (
isOk bool
)
if code = this.module.CreateCmd(session, req.Cmod); code == pb.ErrorCode_Success {
isOk = true
}
session.SendMsg(string(this.module.GetType()), "cmd", &pb.GMCmdResp{IsSucc: isOk})
return
}