Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
34307b6b72
@ -33,13 +33,13 @@ var (
|
|||||||
mainType: string(comm.ModuleHero),
|
mainType: string(comm.ModuleHero),
|
||||||
subType: hero.StrengthenUplv,
|
subType: hero.StrengthenUplv,
|
||||||
req: &pb.HeroStrengthenUplvReq{
|
req: &pb.HeroStrengthenUplvReq{
|
||||||
HeroObjID: "62da0353ebe27f9446dd4a1d",
|
HeroObjID: "62da4e1ecd19e620141eed75",
|
||||||
ExpCards: map[string]int32{
|
ExpCards: map[string]int32{
|
||||||
"62da19017944b60fd473df61": 1,
|
"62da4e40cd19e620141eedeb": 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rsp: &pb.HeroStrengthenUplvResp{},
|
rsp: &pb.HeroStrengthenUplvResp{},
|
||||||
// enabled: true,
|
enabled: true,
|
||||||
}
|
}
|
||||||
tcs = append(tcs, tc)
|
tcs = append(tcs, tc)
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ var (
|
|||||||
subType: task.TaskSubTypeList,
|
subType: task.TaskSubTypeList,
|
||||||
req: &pb.TaskListReq{
|
req: &pb.TaskListReq{
|
||||||
//设置任务类型
|
//设置任务类型
|
||||||
TaskTag: int32(comm.TASK_DAILY), //每天任务
|
// TaskTag: int32(comm.TASK_DAILY), //每天任务
|
||||||
// TaskTag: int32(comm.TASK_WEEKLY), //周任务
|
// TaskTag: int32(comm.TASK_WEEKLY), //周任务
|
||||||
// TaskTag: int32(comm.TASK_ACHIEVE),
|
// TaskTag: int32(comm.TASK_ACHIEVE),
|
||||||
// TaskTag: int32(comm.TASK_STRATEGY),
|
// TaskTag: int32(comm.TASK_STRATEGY),
|
||||||
@ -29,24 +29,24 @@ var (
|
|||||||
fmt.Printf("%v \n", v)
|
fmt.Printf("%v \n", v)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
enabled: true,
|
// enabled: true,
|
||||||
next: func(robot *Robot, rsp proto.Message) {
|
next: func(robot *Robot, rsp proto.Message) {
|
||||||
tcs := []*TestCase{}
|
tcs := []*TestCase{}
|
||||||
if v, ok := rsp.(*pb.TaskListResp); ok {
|
if _, ok := rsp.(*pb.TaskListResp); ok {
|
||||||
for _, tt := range v.List {
|
// for _, tt := range v.List {
|
||||||
tc := &TestCase{
|
tc := &TestCase{
|
||||||
desc: "领取任务奖励",
|
desc: "领取任务奖励",
|
||||||
mainType: string(comm.ModuleTask),
|
mainType: string(comm.ModuleTask),
|
||||||
subType: task.TaskSubTypeReceive,
|
subType: task.TaskSubTypeReceive,
|
||||||
req: &pb.TaskReceiveReq{
|
req: &pb.TaskReceiveReq{
|
||||||
TaskTag: int32(comm.TASK_DAILY),
|
TaskTag: int32(comm.TASK_DAILY),
|
||||||
Id: tt.Id,
|
Id: "62da4e20cd19e620141eed7b",
|
||||||
},
|
},
|
||||||
rsp: &pb.TaskReceiveResp{},
|
rsp: &pb.TaskReceiveResp{},
|
||||||
// enabled: true,
|
// enabled: true,
|
||||||
}
|
|
||||||
tcs = append(tcs, tc)
|
|
||||||
}
|
}
|
||||||
|
tcs = append(tcs, tc)
|
||||||
|
// }
|
||||||
robot.addBuilders(tcs)
|
robot.addBuilders(tcs)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -64,7 +64,7 @@ var (
|
|||||||
fmt.Printf("%v 活跃值:%v\n", v, out.Active)
|
fmt.Printf("%v 活跃值:%v\n", v, out.Active)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// enabled: true,
|
enabled: true,
|
||||||
}, {
|
}, {
|
||||||
desc: "活跃度领取",
|
desc: "活跃度领取",
|
||||||
mainType: string(comm.ModuleTask),
|
mainType: string(comm.ModuleTask),
|
||||||
|
@ -32,7 +32,7 @@ var user_builders = []*TestCase{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
rsp: &pb.UserAddResResp{},
|
rsp: &pb.UserAddResResp{},
|
||||||
//enabled: true,
|
// enabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "添加资源",
|
desc: "添加资源",
|
||||||
|
@ -82,6 +82,8 @@ type (
|
|||||||
InitTaskAll(uid string)
|
InitTaskAll(uid string)
|
||||||
//清空任务
|
//清空任务
|
||||||
ResetTask(uid string, taskTag TaskTag)
|
ResetTask(uid string, taskTag TaskTag)
|
||||||
|
//监听任务
|
||||||
|
ListenTask()
|
||||||
//任务通知
|
//任务通知
|
||||||
SendToTask(session IUserSession, taskType TaskType, param *pb.TaskParam) (code pb.ErrorCode)
|
SendToTask(session IUserSession, taskType TaskType, param *pb.TaskParam) (code pb.ErrorCode)
|
||||||
// 清理玩家任务数据
|
// 清理玩家任务数据
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -35,11 +36,8 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
rsp := &pb.HeroDrawCardResp{}
|
rsp := &pb.HeroDrawCardResp{}
|
||||||
this.module.Debugf("当前4星抽卡没中次数:%d, 当前5星抽卡没中次数:%d", curStar4Count, curStar5Count)
|
this.module.Debugf("当前4星抽卡没中次数:%d, 当前5星抽卡没中次数:%d", curStar4Count, curStar5Count)
|
||||||
|
|
||||||
rst, err := this.module.modelHero.GetUserRecord(session.GetUserId())
|
rst, _ := this.module.modelHero.GetUserRecord(session.GetUserId())
|
||||||
if err != nil {
|
if req.DrawType%2 == 0 { // 转成对应阵营信息 1~5
|
||||||
|
|
||||||
}
|
|
||||||
if req.DrawType%2 == 0 { // 转成对应阵营信息
|
|
||||||
race = int32((int(req.DrawType)) / 2)
|
race = int32((int(req.DrawType)) / 2)
|
||||||
} else {
|
} else {
|
||||||
race = int32(int(req.DrawType+1) / 2)
|
race = int32(int(req.DrawType+1) / 2)
|
||||||
@ -60,24 +58,24 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
curStar4Count = rst.Race4.H4
|
curStar4Count = rst.Race4.H4
|
||||||
curStar5Count = rst.Race4.H5
|
curStar5Count = rst.Race4.H5
|
||||||
}
|
}
|
||||||
|
|
||||||
// 抽卡相关
|
|
||||||
// 获取配置文件的权重信息
|
// 获取配置文件的权重信息
|
||||||
_conf, err := this.module.configure.GetHeroDrawConfig(race)
|
_conf, err := this.module.configure.GetHeroDrawConfig(race)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_DrawCardTypeNotFound // 抽卡类型不匹配
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_costConf, err := this.module.configure.GetDrawCostConfigByID(req.DrawType)
|
_costConf, err := this.module.configure.GetDrawCostConfigByID(req.DrawType) // 抽卡消耗
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
config4Count = _costConf.Floor4 // 4星保底次数
|
config4Count = _costConf.Floor4 // 4星保底次数
|
||||||
config5Count = _costConf.Floor5 // 五星保底次数
|
config5Count = _costConf.Floor5 // 5星保底次数
|
||||||
if config4Count == 0 || config5Count == 0 { // 数量为0 设置最大
|
if config4Count == 0 { // 数量为0 设置最大
|
||||||
config5Count = math.MaxInt32
|
config5Count = math.MaxInt32
|
||||||
|
}
|
||||||
|
if config5Count == 0 {
|
||||||
config4Count = math.MaxInt32
|
config4Count = math.MaxInt32
|
||||||
}
|
}
|
||||||
sz := make([]*cfg.Game_atn, 0)
|
sz := make([]*cfg.Game_atn, 0)
|
||||||
@ -166,23 +164,15 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
H5: curStar5Count,
|
H5: curStar5Count,
|
||||||
}
|
}
|
||||||
// 更新record 配置信息
|
// 更新record 配置信息
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{}
|
||||||
"race0": raceData,
|
|
||||||
}
|
|
||||||
|
|
||||||
if race == 0 { // 获取4,5星抽取次数
|
update["race"+strconv.Itoa(int(race)-1)] = raceData
|
||||||
update["race0"] = raceData
|
|
||||||
} else if race == 1 {
|
|
||||||
update["race1"] = raceData
|
|
||||||
} else if race == 2 {
|
|
||||||
update["race2"] = raceData
|
|
||||||
} else if race == 3 {
|
|
||||||
update["race3"] = raceData
|
|
||||||
} else if race == 4 {
|
|
||||||
update["race4"] = raceData
|
|
||||||
}
|
|
||||||
this.module.modelHero.ChangeUserRecord(session.GetUserId(), update)
|
this.module.modelHero.ChangeUserRecord(session.GetUserId(), update)
|
||||||
|
// 消耗道具
|
||||||
|
code = this.module.ConsumeRes(session, sz, true)
|
||||||
|
if code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
if err := this.module.modelHero.createMultiHero(session.GetUserId(), szCards...); err != nil {
|
if err := this.module.modelHero.createMultiHero(session.GetUserId(), szCards...); err != nil {
|
||||||
code = pb.ErrorCode_HeroCreate
|
code = pb.ErrorCode_HeroCreate
|
||||||
return
|
return
|
||||||
|
@ -182,7 +182,7 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren
|
|||||||
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}})
|
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}})
|
||||||
session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero})
|
session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero})
|
||||||
if iLvUp > 0 { // 升级了 统计任务
|
if iLvUp > 0 { // 升级了 统计任务
|
||||||
this.module.ModuleTask.SendToTask(session, comm.TaskTypeUpHeroLevel, &pb.TaskParam{First: iLvUp})
|
this.module.ModuleTask.SendToTask(session, comm.TaskTypeUpHeroLevel, &pb.TaskParam{Second: iLvUp})
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -115,7 +115,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId, count int32) (he
|
|||||||
this.ChanageUserExpand(uid, initUpdate)
|
this.ChanageUserExpand(uid, initUpdate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hero.SameCount += count
|
hero.SameCount = count
|
||||||
if err = this.moduleHero.modelHero.AddList(uid, hero.Id, hero); err != nil {
|
if err = this.moduleHero.modelHero.AddList(uid, hero.Id, hero); err != nil {
|
||||||
this.moduleHero.Errorf("%v", err)
|
this.moduleHero.Errorf("%v", err)
|
||||||
return
|
return
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
//领取
|
//任务奖励领取
|
||||||
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.TaskReceiveReq) (code pb.ErrorCode) {
|
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.TaskReceiveReq) (code pb.ErrorCode) {
|
||||||
if req.TaskTag == 0 || req.Id == "" {
|
if req.TaskTag == 0 || req.Id == "" {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
@ -49,7 +49,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//奖励
|
//奖励
|
||||||
if code = this.moduleTask.ConsumeRes(session, conf.Reword, true); code != pb.ErrorCode_Success {
|
if code = this.moduleTask.DispenseRes(session, conf.Reword, true); code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,21 +40,27 @@ func (this *ModelTaskActive) initActiveReward(uid string) {
|
|||||||
RId: conf.Key,
|
RId: conf.Key,
|
||||||
}
|
}
|
||||||
if err := this.moduleTask.modelTaskActive.AddList(uid, ta.Id, ta); err != nil {
|
if err := this.moduleTask.modelTaskActive.AddList(uid, ta.Id, ta); err != nil {
|
||||||
log.Errorf("uid:%v tag:%v initActiv add err %v", uid, err)
|
log.Errorf("uid:%v tag:%v initActiv add err %v", uid, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取玩家活跃度列表
|
//获取玩家活跃度列表
|
||||||
func (this *ModelTaskActive) getUserActiveList(uid string, taskTag comm.TaskTag) []*pb.DBTaskActive {
|
func (this *ModelTaskActive) getUserActiveList(uid string, taskTag comm.TaskTag) (list []*pb.DBTaskActive) {
|
||||||
al := []*pb.DBTaskActive{}
|
al := []*pb.DBTaskActive{}
|
||||||
if err := this.GetList(uid, &al); err != nil {
|
if err := this.GetList(uid, &al); err != nil {
|
||||||
log.Errorf("getUserActiveList err:%v", err)
|
log.Errorf("getUserActiveList err:%v", err)
|
||||||
return al
|
return al
|
||||||
}
|
}
|
||||||
|
|
||||||
return al
|
for _, v := range al {
|
||||||
|
if v.Tag == int32(taskTag) {
|
||||||
|
list = append(list, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取玩家活跃记录 id 唯一ID
|
//获取玩家活跃记录 id 唯一ID
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package task
|
package task
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
@ -19,6 +18,7 @@ const ( //Redis
|
|||||||
type ModelTask struct {
|
type ModelTask struct {
|
||||||
modules.MCompModel
|
modules.MCompModel
|
||||||
moduleTask *ModuleTask
|
moduleTask *ModuleTask
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelTask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *ModelTask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
@ -44,15 +44,36 @@ func (this *ModelTask) getTaskList(uid string, taskTag comm.TaskTag) (newlist []
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *ModelTask) getTaskTypeList(uid string, taskType comm.TaskType) (newlist []*pb.DBTask) {
|
||||||
|
list := []*pb.DBTask{}
|
||||||
|
if err := this.GetList(uid, &list); err != nil {
|
||||||
|
log.Errorf("getTaskList err %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range list {
|
||||||
|
if v.TypeId == int32(taskType) {
|
||||||
|
newlist = append(newlist, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//任务处理器注册
|
||||||
|
|
||||||
//初始化任务
|
//初始化任务
|
||||||
func (this *ModelTask) initTask(uid string) error {
|
func (this *ModelTask) initTask(uid string) error {
|
||||||
if data, err := this.moduleTask.configure.getTaskList(); err == nil {
|
if data, err := this.moduleTask.configure.getTaskList(); err == nil {
|
||||||
for _, cnf := range data {
|
for _, cnf := range data {
|
||||||
|
//注册任务处理器
|
||||||
|
|
||||||
|
//初始玩家任务数据
|
||||||
objId := primitive.NewObjectID().Hex()
|
objId := primitive.NewObjectID().Hex()
|
||||||
task := &pb.DBTask{
|
task := &pb.DBTask{
|
||||||
Id: objId,
|
Id: objId,
|
||||||
Tag: cnf.IdTag,
|
Tag: cnf.IdTag,
|
||||||
Uid: uid,
|
Uid: uid,
|
||||||
|
TypeId: cnf.TypeId,
|
||||||
TaskId: cnf.Key,
|
TaskId: cnf.Key,
|
||||||
Active: cnf.Active,
|
Active: cnf.Active,
|
||||||
Progress: cnf.ConditionSecond,
|
Progress: cnf.ConditionSecond,
|
||||||
@ -77,8 +98,8 @@ func (this *ModelTask) getUserTask(uid string, taskId string) *pb.DBTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取未完成的任务列表
|
//获取未完成的任务列表
|
||||||
func (this *ModelTask) getUnFinishTaskList(uid string, taskTag comm.TaskTag) (list []*pb.DBTask) {
|
func (this *ModelTask) getUnFinishTaskList(uid string, taskType comm.TaskType) (list []*pb.DBTask) {
|
||||||
taskList := this.getTaskList(uid, taskTag)
|
taskList := this.getTaskTypeList(uid, taskType)
|
||||||
for _, v := range taskList {
|
for _, v := range taskList {
|
||||||
if v.Status == 0 {
|
if v.Status == 0 {
|
||||||
list = append(list, v)
|
list = append(list, v)
|
||||||
@ -100,7 +121,7 @@ func (this *ModelTask) countActive(uid string, taskTag comm.TaskTag) (total int3
|
|||||||
|
|
||||||
//检查任务进度 返回未完成的
|
//检查任务进度 返回未完成的
|
||||||
func (this *ModelTask) checkTaskProgress(uid string, config *cfg.Game_taskRoundData) (*pb.DBTask, bool) {
|
func (this *ModelTask) checkTaskProgress(uid string, config *cfg.Game_taskRoundData) (*pb.DBTask, bool) {
|
||||||
taskList := this.getUnFinishTaskList(uid, comm.TaskTag(config.IdTag))
|
taskList := this.getUnFinishTaskList(uid, comm.TaskType(config.TypeId))
|
||||||
for _, v := range taskList {
|
for _, v := range taskList {
|
||||||
if config.Key == v.TaskId && v.Status == 0 {
|
if config.Key == v.TaskId && v.Status == 0 {
|
||||||
return v, true
|
return v, true
|
||||||
@ -120,14 +141,14 @@ func (this *ModelTask) modifyUserTask(uid string, taskId string, data map[string
|
|||||||
}
|
}
|
||||||
|
|
||||||
//任务处理
|
//任务处理
|
||||||
func (this *ModelTask) taskHandle(uid string, taskType comm.TaskType, taskParam *pb.TaskParam) (*pb.DBTask, error) {
|
func (this *ModelTask) taskHandle(uid string, taskType comm.TaskType, taskParam *pb.TaskParam) (tasks []*pb.DBTask, err error) {
|
||||||
data, err := this.moduleTask.configure.getTasks(int32(taskType))
|
data, err := this.moduleTask.configure.getTasks(int32(taskType))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("taskHandle err %v", err)
|
log.Errorf("taskHandle err %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, conf := range data {
|
for _, conf := range data {
|
||||||
if conf.RestrictiveCondition != 0 {
|
if conf.RestrictiveCondition != 0 {
|
||||||
//不满足限定条件
|
//不满足限定条件
|
||||||
if taskParam.First < conf.RestrictiveCondition {
|
if taskParam.First < conf.RestrictiveCondition {
|
||||||
@ -135,40 +156,43 @@ func (this *ModelTask) taskHandle(uid string, taskType comm.TaskType, taskParam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if taskParam.Second < conf.ConditionSecond {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
//检查进度,执行处理器
|
//检查进度,执行处理器
|
||||||
if v, ok := this.checkTaskProgress(uid, conf); ok {
|
if v, ok := this.checkTaskProgress(uid, conf); ok {
|
||||||
if tt, err := this.finishHandle(v, conf); err != nil {
|
if tt, err := this.finishHandle(v, conf, taskParam.Second); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
return tt, nil
|
tasks = append(tasks, tt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil, nil
|
return tasks, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//任务完成处理
|
//任务完成处理
|
||||||
func (this *ModelTask) finishHandle(userTask *pb.DBTask, config *cfg.Game_taskRoundData) (*pb.DBTask, error) {
|
func (this *ModelTask) finishHandle(userTask *pb.DBTask, config *cfg.Game_taskRoundData, count int32) (*pb.DBTask, error) {
|
||||||
progress := userTask.Progress - 1
|
var progress int32
|
||||||
if progress < 0 {
|
if count >= userTask.Progress {
|
||||||
return nil, fmt.Errorf("uid %s task[%s] was finished", userTask.Uid, userTask.Id)
|
progress = 0
|
||||||
}
|
}
|
||||||
//修改玩家任务状态和进度
|
|
||||||
|
|
||||||
update := map[string]interface{}{
|
|
||||||
"progress": progress,
|
|
||||||
}
|
|
||||||
if progress == 0 {
|
if progress == 0 {
|
||||||
|
//修改玩家任务状态和进度
|
||||||
|
update := map[string]interface{}{
|
||||||
|
"progress": progress,
|
||||||
|
}
|
||||||
update["status"] = 1
|
update["status"] = 1
|
||||||
|
if err := this.modifyUserTask(userTask.Uid, userTask.Id, update); err != nil {
|
||||||
|
log.Errorf("err %v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
userTask.Progress = progress
|
||||||
|
userTask.Status = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := this.modifyUserTask(userTask.Uid, userTask.Id, update); err != nil {
|
|
||||||
log.Errorf("err %v", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
userTask.Progress = progress
|
|
||||||
userTask.Status = 1
|
|
||||||
return userTask, nil
|
return userTask, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,11 +67,11 @@ func (this *ModuleTask) ResetTask(uid string, taskTag comm.TaskTag) {
|
|||||||
|
|
||||||
//任务处理
|
//任务处理
|
||||||
func (this *ModuleTask) SendToTask(session comm.IUserSession, taskType comm.TaskType, taskPram *pb.TaskParam) (code pb.ErrorCode) {
|
func (this *ModuleTask) SendToTask(session comm.IUserSession, taskType comm.TaskType, taskPram *pb.TaskParam) (code pb.ErrorCode) {
|
||||||
if task, err := this.modelTask.taskHandle(session.GetUserId(), taskType, taskPram); err != nil {
|
if tasks, err := this.modelTask.taskHandle(session.GetUserId(), taskType, taskPram); err != nil {
|
||||||
code = pb.ErrorCode_TaskHandle
|
code = pb.ErrorCode_TaskHandle
|
||||||
} else {
|
} else {
|
||||||
if task != nil {
|
for _, t := range tasks {
|
||||||
if err := session.SendMsg(string(comm.ModuleTask), TaskSubTypeFinishedPush, &pb.TaskFinishedPush{TaskId: task.TaskId}); err != nil {
|
if err := session.SendMsg(string(comm.ModuleTask), TaskSubTypeFinishedPush, &pb.TaskFinishedPush{TaskId: t.TaskId}); err != nil {
|
||||||
this.modelTask.moduleTask.Errorf("SendToTask sendmsg err:%v", err)
|
this.modelTask.moduleTask.Errorf("SendToTask sendmsg err:%v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,4 +97,4 @@ func (this *ModuleTask) CleanData(uid string) {
|
|||||||
|
|
||||||
this.modelTaskActive.clearTask(uid, comm.TASK_DAILY)
|
this.modelTaskActive.clearTask(uid, comm.TASK_DAILY)
|
||||||
this.modelTaskActive.clearTask(uid, comm.TASK_WEEKLY)
|
this.modelTaskActive.clearTask(uid, comm.TASK_WEEKLY)
|
||||||
}
|
}
|
@ -26,3 +26,10 @@ func (this *ModelSession) getUserSession(uid string) (cuser *pb.CacheUser) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//清除session缓存
|
||||||
|
func (this *ModelSession) cleanSession(uid string) {
|
||||||
|
if err := this.Del(uid); err != nil {
|
||||||
|
log.Errorf("clean session err: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/lego/sys/event"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -33,6 +34,12 @@ func (this *User) Init(service core.IService, module core.IModule, options core.
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *User) Start() (err error) {
|
||||||
|
err = this.ModuleBase.Start()
|
||||||
|
event.RegisterGO(comm.EventUserOffline, this.CleanSession)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (this *User) OnInstallComp() {
|
func (this *User) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
@ -59,6 +66,11 @@ func (this *User) GetUserSession(uid string) *pb.CacheUser {
|
|||||||
return cuser
|
return cuser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清除session
|
||||||
|
func (this *User) CleanSession(session comm.IUserSession) {
|
||||||
|
this.modelSession.cleanSession(session.GetUserId())
|
||||||
|
}
|
||||||
|
|
||||||
//查询用户属性值 例如 金币 经验
|
//查询用户属性值 例如 金币 经验
|
||||||
func (this *User) QueryAttributeValue(uid string, attr string) (value int32) {
|
func (this *User) QueryAttributeValue(uid string, attr string) (value int32) {
|
||||||
user := this.modelUser.GetUser(uid)
|
user := this.modelUser.GetUser(uid)
|
||||||
|
@ -827,7 +827,8 @@ type TaskParam struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
First int32 `protobuf:"varint,1,opt,name=first,proto3" json:"first"` //限定条件
|
First int32 `protobuf:"varint,1,opt,name=first,proto3" json:"first"` //限定条件
|
||||||
|
Second int32 `protobuf:"varint,2,opt,name=second,proto3" json:"second"` //次数
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TaskParam) Reset() {
|
func (x *TaskParam) Reset() {
|
||||||
@ -869,6 +870,13 @@ func (x *TaskParam) GetFirst() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *TaskParam) GetSecond() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Second
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
var File_comm_proto protoreflect.FileDescriptor
|
var File_comm_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_comm_proto_rawDesc = []byte{
|
var file_comm_proto_rawDesc = []byte{
|
||||||
@ -963,14 +971,16 @@ var file_comm_proto_rawDesc = []byte{
|
|||||||
0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x41, 0x18, 0x01,
|
0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x41, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x41, 0x12, 0x0c, 0x0a, 0x01, 0x54, 0x18, 0x02, 0x20, 0x01,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x41, 0x12, 0x0c, 0x0a, 0x01, 0x54, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x28, 0x09, 0x52, 0x01, 0x54, 0x12, 0x0c, 0x0a, 0x01, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
0x28, 0x09, 0x52, 0x01, 0x54, 0x12, 0x0c, 0x0a, 0x01, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x52, 0x01, 0x4e, 0x22, 0x21, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
0x52, 0x01, 0x4e, 0x22, 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x2a, 0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74,
|
0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
|
||||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2a, 0x43,
|
||||||
0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a,
|
0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
|
||||||
0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10,
|
0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03,
|
||||||
0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72, 0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12, 0x09,
|
||||||
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72, 0x69,
|
||||||
|
0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -75,28 +75,29 @@ const (
|
|||||||
ErrorCode_ItemsGirdAmountUpper ErrorCode = 1203 //背包格子容量已达上限
|
ErrorCode_ItemsGirdAmountUpper ErrorCode = 1203 //背包格子容量已达上限
|
||||||
ErrorCode_ItemsUseNotSupported ErrorCode = 1204 //暂不支持使用
|
ErrorCode_ItemsUseNotSupported ErrorCode = 1204 //暂不支持使用
|
||||||
// hero
|
// hero
|
||||||
ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在
|
ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在
|
||||||
ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足
|
ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足
|
||||||
ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级
|
ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级
|
||||||
ErrorCode_HeroInitCreat ErrorCode = 1303 //初始化英雄
|
ErrorCode_HeroInitCreat ErrorCode = 1303 //初始化英雄
|
||||||
ErrorCode_HeroColorErr ErrorCode = 1304 // 品质不匹配
|
ErrorCode_HeroColorErr ErrorCode = 1304 // 品质不匹配
|
||||||
ErrorCode_HeroSkillUpErr ErrorCode = 1305 // 技能升级失败
|
ErrorCode_HeroSkillUpErr ErrorCode = 1305 // 技能升级失败
|
||||||
ErrorCode_HeroMaxResonate ErrorCode = 1306 // 达到最大共鸣次数
|
ErrorCode_HeroMaxResonate ErrorCode = 1306 // 达到最大共鸣次数
|
||||||
ErrorCode_HeroNoResonate ErrorCode = 1307 // 没有共鸣
|
ErrorCode_HeroNoResonate ErrorCode = 1307 // 没有共鸣
|
||||||
ErrorCode_HeroNotNeedResonate ErrorCode = 1308 // 不需要重置共鸣
|
ErrorCode_HeroNotNeedResonate ErrorCode = 1308 // 不需要重置共鸣
|
||||||
ErrorCode_HeroNoEnergy ErrorCode = 1309 // 没有能量点数
|
ErrorCode_HeroNoEnergy ErrorCode = 1309 // 没有能量点数
|
||||||
ErrorCode_HeroCreate ErrorCode = 1310 // 创建卡失败
|
ErrorCode_HeroCreate ErrorCode = 1310 // 创建卡失败
|
||||||
ErrorCode_HeroEquipUpdate ErrorCode = 1311 // 更新装备失败
|
ErrorCode_HeroEquipUpdate ErrorCode = 1311 // 更新装备失败
|
||||||
ErrorCode_HeroMaxAwaken ErrorCode = 1312 // 达到最大觉醒等级
|
ErrorCode_HeroMaxAwaken ErrorCode = 1312 // 达到最大觉醒等级
|
||||||
ErrorCode_HeroIsLock ErrorCode = 1313 // 英雄被锁定不能被消耗
|
ErrorCode_HeroIsLock ErrorCode = 1313 // 英雄被锁定不能被消耗
|
||||||
ErrorCode_HeroMaxCount ErrorCode = 1314 // 英雄达到最大数量
|
ErrorCode_HeroMaxCount ErrorCode = 1314 // 英雄达到最大数量
|
||||||
ErrorCode_HeroCostTypeErr ErrorCode = 1315 // 消耗英雄参数不匹配
|
ErrorCode_HeroCostTypeErr ErrorCode = 1315 // 消耗英雄参数不匹配
|
||||||
ErrorCode_HeroStarErr ErrorCode = 1316 // 不满足升星条件
|
ErrorCode_HeroStarErr ErrorCode = 1316 // 不满足升星条件
|
||||||
ErrorCode_HeroTypeErr ErrorCode = 1317 // 升级英雄类型不对
|
ErrorCode_HeroTypeErr ErrorCode = 1317 // 升级英雄类型不对
|
||||||
ErrorCode_HeroExpTypeErr ErrorCode = 1318 // 技能升级卡类型不对
|
ErrorCode_HeroExpTypeErr ErrorCode = 1318 // 技能升级卡类型不对
|
||||||
ErrorCode_HeroAddMaxExp ErrorCode = 1319 // 升级经验卡溢出 检查传入的数量
|
ErrorCode_HeroAddMaxExp ErrorCode = 1319 // 升级经验卡溢出 检查传入的数量
|
||||||
ErrorCode_HeroStarLvErr ErrorCode = 1320 // 升星等级不够
|
ErrorCode_HeroStarLvErr ErrorCode = 1320 // 升星等级不够
|
||||||
ErrorCode_HeroMaxStarLv ErrorCode = 1321 // 达到最大升星等级
|
ErrorCode_HeroMaxStarLv ErrorCode = 1321 // 达到最大升星等级
|
||||||
|
ErrorCode_DrawCardTypeNotFound ErrorCode = 1322 // 抽卡类型不匹配
|
||||||
// equipment
|
// equipment
|
||||||
ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器
|
ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器
|
||||||
ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限
|
ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限
|
||||||
@ -192,6 +193,7 @@ var (
|
|||||||
1319: "HeroAddMaxExp",
|
1319: "HeroAddMaxExp",
|
||||||
1320: "HeroStarLvErr",
|
1320: "HeroStarLvErr",
|
||||||
1321: "HeroMaxStarLv",
|
1321: "HeroMaxStarLv",
|
||||||
|
1322: "DrawCardTypeNotFound",
|
||||||
1400: "EquipmentOnFoundEquipment",
|
1400: "EquipmentOnFoundEquipment",
|
||||||
1401: "EquipmentLvlimitReached",
|
1401: "EquipmentLvlimitReached",
|
||||||
1500: "MainlineNotFindChapter",
|
1500: "MainlineNotFindChapter",
|
||||||
@ -281,6 +283,7 @@ var (
|
|||||||
"HeroAddMaxExp": 1319,
|
"HeroAddMaxExp": 1319,
|
||||||
"HeroStarLvErr": 1320,
|
"HeroStarLvErr": 1320,
|
||||||
"HeroMaxStarLv": 1321,
|
"HeroMaxStarLv": 1321,
|
||||||
|
"DrawCardTypeNotFound": 1322,
|
||||||
"EquipmentOnFoundEquipment": 1400,
|
"EquipmentOnFoundEquipment": 1400,
|
||||||
"EquipmentLvlimitReached": 1401,
|
"EquipmentLvlimitReached": 1401,
|
||||||
"MainlineNotFindChapter": 1500,
|
"MainlineNotFindChapter": 1500,
|
||||||
@ -332,7 +335,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_errorcode_proto_rawDesc = []byte{
|
var file_errorcode_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x2a, 0xa8, 0x0e, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
0x6f, 0x2a, 0xc3, 0x0e, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||||
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
||||||
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
||||||
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
@ -422,32 +425,34 @@ var file_errorcode_proto_rawDesc = []byte{
|
|||||||
0x61, 0x78, 0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f,
|
0x61, 0x78, 0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f,
|
||||||
0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d,
|
0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d,
|
||||||
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a,
|
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a,
|
||||||
0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46,
|
0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65,
|
||||||
0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a,
|
0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45,
|
||||||
0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c,
|
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45,
|
||||||
0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x1b,
|
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45,
|
||||||
0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e,
|
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52,
|
||||||
0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d,
|
0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
|
||||||
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10,
|
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70,
|
||||||
0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f,
|
0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69,
|
||||||
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69,
|
0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a,
|
||||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64,
|
0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
|
||||||
0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52,
|
0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65,
|
||||||
0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b,
|
0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19,
|
||||||
0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
|
0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
|
||||||
0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54,
|
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
|
||||||
0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61,
|
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77,
|
||||||
0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61,
|
0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e,
|
||||||
0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54,
|
0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73,
|
||||||
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13,
|
0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e,
|
||||||
0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74,
|
0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
|
||||||
0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76,
|
0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73,
|
||||||
0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54,
|
0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16,
|
||||||
0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67,
|
0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f,
|
||||||
0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69,
|
0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
|
||||||
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73,
|
0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12,
|
||||||
0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, 0x04,
|
0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
|
||||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69,
|
||||||
|
0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -92,4 +92,5 @@ message UserAssets {
|
|||||||
|
|
||||||
message TaskParam {
|
message TaskParam {
|
||||||
int32 first = 1; //限定条件
|
int32 first = 1; //限定条件
|
||||||
|
int32 second = 2; //次数
|
||||||
}
|
}
|
@ -80,6 +80,7 @@ enum ErrorCode {
|
|||||||
HeroAddMaxExp = 1319; // 升级经验卡溢出 检查传入的数量
|
HeroAddMaxExp = 1319; // 升级经验卡溢出 检查传入的数量
|
||||||
HeroStarLvErr = 1320; // 升星等级不够
|
HeroStarLvErr = 1320; // 升星等级不够
|
||||||
HeroMaxStarLv = 1321; // 达到最大升星等级
|
HeroMaxStarLv = 1321; // 达到最大升星等级
|
||||||
|
DrawCardTypeNotFound = 1322; // 抽卡类型不匹配
|
||||||
|
|
||||||
// equipment
|
// equipment
|
||||||
EquipmentOnFoundEquipment = 1400; // 未找到武器
|
EquipmentOnFoundEquipment = 1400; // 未找到武器
|
||||||
|
@ -10,12 +10,13 @@ message DBTask {
|
|||||||
int32 active = 6; //@go_tags(`bson:"active"`) 活跃度
|
int32 active = 6; //@go_tags(`bson:"active"`) 活跃度
|
||||||
int32 status = 7; //@go_tags(`bson:"status"`) 任务状态 默认0未完成 1已完成
|
int32 status = 7; //@go_tags(`bson:"status"`) 任务状态 默认0未完成 1已完成
|
||||||
int32 received = 8; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
|
int32 received = 8; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
|
||||||
|
int32 typeId = 9; //@go_tags(`bson:"typeId"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
message DBTaskActive {
|
message DBTaskActive {
|
||||||
string id = 1; //@go_tags(`bson:"_id"`) ID
|
string id = 1; //@go_tags(`bson:"_id"`) ID
|
||||||
string uid = 2; //@go_tags(`bson:"uid"`) 用户ID
|
string uid = 2; //@go_tags(`bson:"uid"`) 用户ID
|
||||||
int32 rId = 3; //@go_tags(`bson:"taskId"`) rewardId
|
int32 rId = 3; //@go_tags(`bson:"taskId"`) rewardId
|
||||||
int32 tag = 4; //@go_tags(`bson:"tag"`) 标签
|
int32 tag = 4; //@go_tags(`bson:"tag"`) 标签
|
||||||
int32 received = 5; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
|
int32 received = 5; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
|
||||||
}
|
}
|
@ -33,6 +33,7 @@ type DBTask struct {
|
|||||||
Active int32 `protobuf:"varint,6,opt,name=active,proto3" json:"active" bson:"active"` //活跃度
|
Active int32 `protobuf:"varint,6,opt,name=active,proto3" json:"active" bson:"active"` //活跃度
|
||||||
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status" bson:"status"` // 任务状态 默认0未完成 1已完成
|
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status" bson:"status"` // 任务状态 默认0未完成 1已完成
|
||||||
Received int32 `protobuf:"varint,8,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
|
Received int32 `protobuf:"varint,8,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
|
||||||
|
TypeId int32 `protobuf:"varint,9,opt,name=typeId,proto3" json:"typeId" bson:"typeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBTask) Reset() {
|
func (x *DBTask) Reset() {
|
||||||
@ -123,6 +124,13 @@ func (x *DBTask) GetReceived() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBTask) GetTypeId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TypeId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type DBTaskActive struct {
|
type DBTaskActive struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -206,7 +214,7 @@ var File_task_task_db_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_task_task_db_proto_rawDesc = []byte{
|
var file_task_task_db_proto_rawDesc = []byte{
|
||||||
0x0a, 0x12, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
0x0a, 0x12, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x12,
|
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x12,
|
||||||
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||||
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
|
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
|
||||||
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
@ -218,15 +226,16 @@ var file_task_task_db_proto_rawDesc = []byte{
|
|||||||
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||||
0x76, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
0x76, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||||
0x76, 0x65, 0x64, 0x22, 0x70, 0x0a, 0x0c, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74,
|
0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20,
|
||||||
0x69, 0x76, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x0c, 0x44,
|
||||||
0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x42, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||||
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75,
|
||||||
0x28, 0x05, 0x52, 0x03, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04,
|
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63,
|
0x03, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x49, 0x64, 0x12,
|
||||||
0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63,
|
0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61,
|
||||||
0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x06, 0x5a,
|
||||||
|
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user