go_dreamfactory/modules/gm/api_cmd.go
2022-11-18 17:05:17 +08:00

43 lines
1.2 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"
"google.golang.org/protobuf/proto"
)
/* GM 在控制台输入的字符串类型
//bingo:item,10001,1
//bingo:attr,gold,1000000
//bingo:equi,xxx,1 // xxx 装备id
2、修改主线关卡进度bingo:mapid,102102代表关卡位置
3、修改心魔塔进度bingo:pataid,1010代表层数
4、修改玩家经验值bingo:attr,exp,10001000代表新增的经验值 //
5、跳过随机任务 bingo:worldtask,1,1001
6、bingo:Iamyoudad
7、bingo:vip,yueka_1,1 // 月卡类型
*/
//参数校验
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {
if len(req.Cmod) == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
///解析GM 指令
func (this *apiComp) Cmd(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode, data proto.Message) {
if code = this.CmdCheck(session, req); code != pb.ErrorCode_Success {
return
}
this.module.CreateCmd(session, req.Cmod)
//this.module.ModuleHero.GetSpecifiedHero(session.GetUserId(), heroid, star, lv)
session.SendMsg(string(this.module.GetType()), "cmd", &pb.GMCmdResp{IsSucc: false})
return
}