Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
efab828c47
@ -72,20 +72,20 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
datas[0] == comm.HeroType || datas[0] == comm.EquipmentType || datas[0] == comm.VipType || datas[0] == comm.AtlasType || datas[0] == comm.PandaType || datas[0] == comm.MountsType) {
|
||||
num, err := strconv.Atoi(datas[2])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
code = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
|
||||
errdata = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
|
||||
{
|
||||
A: datas[0],
|
||||
T: datas[1],
|
||||
N: int32(num),
|
||||
},
|
||||
}, true)
|
||||
if code == pb.ErrorCode_Success { // 成功直接返回
|
||||
if errdata == nil { // 成功直接返回
|
||||
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true})
|
||||
}
|
||||
this.Debug("使用bingo命令",
|
||||
@ -101,13 +101,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
code = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
|
||||
errdata = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
@ -146,9 +146,9 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
N: 100,
|
||||
})
|
||||
}
|
||||
code = this.DispenseRes(session, res, true)
|
||||
errdata = this.DispenseRes(session, res, true)
|
||||
if errdata != nil {
|
||||
this.Errorf("资源发放失败,%v", code)
|
||||
this.Errorf("资源发放失败,%v", errdata)
|
||||
}
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
@ -187,17 +187,16 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
return
|
||||
}
|
||||
|
||||
code = module1.(comm.IHero).GetAllMaxHero(session)
|
||||
errdata = module1.(comm.IHero).GetAllMaxHero(session)
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
)
|
||||
} else if len(datas) == 2 && (datas[0] == "season") { // 赛季塔跳转
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
}
|
||||
return
|
||||
} else if len(datas) == 1 && (datas[0] == "viking") { // 解锁远征所有难度
|
||||
module1, err := this.service.GetModule(comm.ModuleViking)
|
||||
@ -205,7 +204,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
return
|
||||
}
|
||||
|
||||
code = module1.(comm.IViking).CompleteAllLevel(session)
|
||||
errdata = module1.(comm.IViking).CompleteAllLevel(session)
|
||||
this.Debug("使用bingo命令:uid = %s ", log.Field{Key: "uid", Value: session.GetUserId()})
|
||||
} else if len(datas) == 1 && (datas[0] == "hunting") { // 解锁狩猎所有难度
|
||||
module1, err := this.service.GetModule(comm.ModuleHunting)
|
||||
@ -213,7 +212,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
return
|
||||
}
|
||||
|
||||
code = module1.(comm.IHunting).CompleteAllLevel(session)
|
||||
errdata = module1.(comm.IHunting).CompleteAllLevel(session)
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]})
|
||||
@ -224,14 +223,14 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num1, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
code = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
|
||||
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
|
||||
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
@ -244,12 +243,11 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
|
||||
module1.(comm.IMoonFantasy).TriggerMF(session, datas[1])
|
||||
code = pb.ErrorCode_Success
|
||||
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[1]},
|
||||
)
|
||||
code = pb.ErrorCode_Success
|
||||
} else if len(datas) == 2 && (datas[0] == "arena") { // 设置竞技场用户积分
|
||||
module1, err := this.service.GetModule(comm.ModuleArena)
|
||||
if err != nil {
|
||||
@ -257,14 +255,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
module1.(comm.IArena).SetUserIntegral(session, int32(num))
|
||||
code = pb.ErrorCode_Success
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[1]},
|
||||
@ -276,14 +273,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
module1.(comm.ISociaty).BingoSetExp(session, int32(num))
|
||||
code = pb.ErrorCode_Success
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[1]},
|
||||
@ -295,14 +291,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
module1.(comm.ISociaty).BingoSetActivity(session, int32(num))
|
||||
code = pb.ErrorCode_Success
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[1]},
|
||||
@ -334,9 +329,9 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
})
|
||||
|
||||
}
|
||||
code = this.DispenseRes(session, res, true)
|
||||
errdata = this.DispenseRes(session, res, true)
|
||||
if errdata != nil {
|
||||
this.Errorf("资源发放失败,%v", code)
|
||||
this.Errorf("资源发放失败,%v", errdata)
|
||||
}
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
@ -350,14 +345,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil {
|
||||
code = pb.ErrorCode_Success
|
||||
}
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
@ -371,10 +365,10 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
for i := 0; i < num; i++ {
|
||||
@ -417,14 +411,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
log.Field{Key: "0", Value: datas[0]},
|
||||
)
|
||||
} else if len(datas) == 2 && (datas[0] == "chat") {
|
||||
// num, err := strconv.Atoi(datas[1])
|
||||
// if err != nil {
|
||||
// errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
// return
|
||||
// }
|
||||
|
||||
if module, err := this.service.GetModule(comm.ModuleChat); err == nil {
|
||||
if errdata = module.(comm.IChat).SendSysChatToWorld(comm.ChatSystem10, nil, 5, 0, "xxx", "25001"); errdata != nil {
|
||||
return
|
||||
@ -438,18 +425,18 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
} 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(),
|
||||
}
|
||||
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(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
_data := this.configure.GetItemConfigureByType(int32(num1))
|
||||
@ -460,7 +447,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
N: int32(num2),
|
||||
}
|
||||
if errdata = this.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
|
||||
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], code)
|
||||
this.Debugf("DispenseRes err :uid = %s,code = %d", datas[0], errdata)
|
||||
}
|
||||
}
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
@ -476,14 +463,13 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
}
|
||||
num, err := strconv.Atoi(datas[1])
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if err = module1.(comm.IUser).BingoSetUserVipLv(session, int32(num)); err == nil {
|
||||
code = pb.ErrorCode_Success
|
||||
}
|
||||
this.Debug("使用bingo命令:uid = %s ",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
|
@ -9,7 +9,10 @@ import (
|
||||
// 图鉴任务奖励领取
|
||||
func (this *apiComp) TaskAwardCheck(session comm.IUserSession, req *pb.SmithyTaskAwardReq) (errdata *pb.ErrorData) {
|
||||
if req.TaskId == 0 {
|
||||
return pb.ErrorCode_ReqParameterError
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user