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) {
|
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])
|
num, err := strconv.Atoi(datas[2])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
code = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
|
errdata = this.DispenseRes(session, []*cfg.Gameatn{ // 添加资源
|
||||||
{
|
{
|
||||||
A: datas[0],
|
A: datas[0],
|
||||||
T: datas[1],
|
T: datas[1],
|
||||||
N: int32(num),
|
N: int32(num),
|
||||||
},
|
},
|
||||||
}, true)
|
}, true)
|
||||||
if code == pb.ErrorCode_Success { // 成功直接返回
|
if errdata == nil { // 成功直接返回
|
||||||
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true})
|
session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true})
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令",
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
code = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
|
errdata = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num))
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[0]},
|
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,
|
N: 100,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
code = this.DispenseRes(session, res, true)
|
errdata = this.DispenseRes(session, res, true)
|
||||||
if errdata != nil {
|
if errdata != nil {
|
||||||
this.Errorf("资源发放失败,%v", code)
|
this.Errorf("资源发放失败,%v", errdata)
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
@ -187,17 +187,16 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
code = module1.(comm.IHero).GetAllMaxHero(session)
|
errdata = module1.(comm.IHero).GetAllMaxHero(session)
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[0]},
|
log.Field{Key: "0", Value: datas[0]},
|
||||||
)
|
)
|
||||||
} else if len(datas) == 2 && (datas[0] == "season") { // 赛季塔跳转
|
} else if len(datas) == 2 && (datas[0] == "season") { // 赛季塔跳转
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
Message: err.Error(),
|
}
|
||||||
}
|
|
||||||
return
|
return
|
||||||
} else if len(datas) == 1 && (datas[0] == "viking") { // 解锁远征所有难度
|
} else if len(datas) == 1 && (datas[0] == "viking") { // 解锁远征所有难度
|
||||||
module1, err := this.service.GetModule(comm.ModuleViking)
|
module1, err := this.service.GetModule(comm.ModuleViking)
|
||||||
@ -205,7 +204,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
|||||||
return
|
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()})
|
this.Debug("使用bingo命令:uid = %s ", log.Field{Key: "uid", Value: session.GetUserId()})
|
||||||
} else if len(datas) == 1 && (datas[0] == "hunting") { // 解锁狩猎所有难度
|
} else if len(datas) == 1 && (datas[0] == "hunting") { // 解锁狩猎所有难度
|
||||||
module1, err := this.service.GetModule(comm.ModuleHunting)
|
module1, err := this.service.GetModule(comm.ModuleHunting)
|
||||||
@ -213,7 +212,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
code = module1.(comm.IHunting).CompleteAllLevel(session)
|
errdata = module1.(comm.IHunting).CompleteAllLevel(session)
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[0]})
|
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])
|
num1, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
code = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
|
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
|
||||||
|
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
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])
|
module1.(comm.IMoonFantasy).TriggerMF(session, datas[1])
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[1]},
|
log.Field{Key: "0", Value: datas[1]},
|
||||||
)
|
)
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
} else if len(datas) == 2 && (datas[0] == "arena") { // 设置竞技场用户积分
|
} else if len(datas) == 2 && (datas[0] == "arena") { // 设置竞技场用户积分
|
||||||
module1, err := this.service.GetModule(comm.ModuleArena)
|
module1, err := this.service.GetModule(comm.ModuleArena)
|
||||||
if err != nil {
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
module1.(comm.IArena).SetUserIntegral(session, int32(num))
|
module1.(comm.IArena).SetUserIntegral(session, int32(num))
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[1]},
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
module1.(comm.ISociaty).BingoSetExp(session, int32(num))
|
module1.(comm.ISociaty).BingoSetExp(session, int32(num))
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[1]},
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
module1.(comm.ISociaty).BingoSetActivity(session, int32(num))
|
module1.(comm.ISociaty).BingoSetActivity(session, int32(num))
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||||
log.Field{Key: "0", Value: datas[1]},
|
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 {
|
if errdata != nil {
|
||||||
this.Errorf("资源发放失败,%v", code)
|
this.Errorf("资源发放失败,%v", errdata)
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令",
|
this.Debug("使用bingo命令",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil {
|
if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil {
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for i := 0; i < num; i++ {
|
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]},
|
log.Field{Key: "0", Value: datas[0]},
|
||||||
)
|
)
|
||||||
} else if len(datas) == 2 && (datas[0] == "chat") {
|
} 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 module, err := this.service.GetModule(comm.ModuleChat); err == nil {
|
||||||
if errdata = module.(comm.IChat).SendSysChatToWorld(comm.ChatSystem10, nil, 5, 0, "xxx", "25001"); errdata != nil {
|
if errdata = module.(comm.IChat).SendSysChatToWorld(comm.ChatSystem10, nil, 5, 0, "xxx", "25001"); errdata != nil {
|
||||||
return
|
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") {
|
} else if len(datas) == 3 && (datas[0] == "itemtype") {
|
||||||
num1, err := strconv.Atoi(datas[1])
|
num1, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
num2, err := strconv.Atoi(datas[2])
|
num2, err := strconv.Atoi(datas[2])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_data := this.configure.GetItemConfigureByType(int32(num1))
|
_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),
|
N: int32(num2),
|
||||||
}
|
}
|
||||||
if errdata = this.DispenseRes(session, []*cfg.Gameatn{res}, true); errdata != nil {
|
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 ",
|
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])
|
num, err := strconv.Atoi(datas[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err = module1.(comm.IUser).BingoSetUserVipLv(session, int32(num)); err == nil {
|
if err = module1.(comm.IUser).BingoSetUserVipLv(session, int32(num)); err == nil {
|
||||||
code = pb.ErrorCode_Success
|
|
||||||
}
|
}
|
||||||
this.Debug("使用bingo命令:uid = %s ",
|
this.Debug("使用bingo命令:uid = %s ",
|
||||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
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) {
|
func (this *apiComp) TaskAwardCheck(session comm.IUserSession, req *pb.SmithyTaskAwardReq) (errdata *pb.ErrorData) {
|
||||||
if req.TaskId == 0 {
|
if req.TaskId == 0 {
|
||||||
return pb.ErrorCode_ReqParameterError
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user