Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
b156e9d4f1
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) (
|
|||||||
var (
|
var (
|
||||||
equip *pb.DB_Equipment
|
equip *pb.DB_Equipment
|
||||||
conf *cfg.GameEquipData
|
conf *cfg.GameEquipData
|
||||||
attrlibrarys []*cfg.GameEquipAttrlibraryData
|
attrlibrarys []*cfg.GameEquipAttrlibrarySData
|
||||||
adverbEntry []*pb.EquipmentAttributeEntry
|
adverbEntry []*pb.EquipmentAttributeEntry
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
@ -35,7 +35,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
this.MCompConfigure.Init(service, module, comp, options)
|
this.MCompConfigure.Init(service, module, comp, options)
|
||||||
this.module = module.(*Equipment)
|
this.module = module.(*Equipment)
|
||||||
this.LoadConfigure(game_equip, cfg.NewGameEquip)
|
this.LoadConfigure(game_equip, cfg.NewGameEquip)
|
||||||
this.LoadConfigure(equip_attrlibrary, cfg.NewGameEquipAttrlibrary)
|
this.LoadConfigure(equip_attrlibrary, cfg.NewGameEquipAttrlibraryS)
|
||||||
this.LoadConfigure(equip_intensify, cfg.NewGameEquipIntensify)
|
this.LoadConfigure(equip_intensify, cfg.NewGameEquipIntensify)
|
||||||
this.LoadConfigure(equip_suit, cfg.NewGameEquipSuit)
|
this.LoadConfigure(equip_suit, cfg.NewGameEquipSuit)
|
||||||
this.LoadConfigure(game_equipcompose, cfg.NewGameEquipSCompose)
|
this.LoadConfigure(game_equipcompose, cfg.NewGameEquipSCompose)
|
||||||
@ -136,7 +136,7 @@ func (this *configureComp) GetEquipmentConfigureByIds(equipmentId []string) (con
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取装备属性表
|
//获取装备属性表
|
||||||
func (this *configureComp) GetEquipmentAttrlibraryConfigure() (configure *cfg.GameEquipAttrlibrary, err error) {
|
func (this *configureComp) GetEquipmentAttrlibraryConfigure() (configure *cfg.GameEquipAttrlibraryS, err error) {
|
||||||
var (
|
var (
|
||||||
v interface{}
|
v interface{}
|
||||||
ok bool
|
ok bool
|
||||||
@ -145,7 +145,7 @@ func (this *configureComp) GetEquipmentAttrlibraryConfigure() (configure *cfg.Ga
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
if configure, ok = v.(*cfg.GameEquipAttrlibrary); !ok {
|
if configure, ok = v.(*cfg.GameEquipAttrlibraryS); !ok {
|
||||||
err = fmt.Errorf("%T no is *cfg.Game_equipment", v)
|
err = fmt.Errorf("%T no is *cfg.Game_equipment", v)
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
@ -175,7 +175,7 @@ func (this *configureComp) GetEquipmentAttrlibraryConfigureByKey(key int32) (con
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取属性词列表
|
//获取属性词列表
|
||||||
func (this *configureComp) GetEquipmentAttrlibraryConfigureById(Id int32) (configure []*cfg.GameEquipAttrlibraryData, err error) {
|
func (this *configureComp) GetEquipmentAttrlibraryConfigureById(Id int32) (configure []*cfg.GameEquipAttrlibrarySData, err error) {
|
||||||
var (
|
var (
|
||||||
v interface{}
|
v interface{}
|
||||||
)
|
)
|
||||||
@ -183,8 +183,8 @@ func (this *configureComp) GetEquipmentAttrlibraryConfigureById(Id int32) (confi
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
configure = make([]*cfg.GameEquipAttrlibraryData, 0)
|
configure = make([]*cfg.GameEquipAttrlibrarySData, 0)
|
||||||
for _, v1 := range v.(*cfg.GameEquipAttrlibrary).GetDataList() {
|
for _, v1 := range v.(*cfg.GameEquipAttrlibraryS).GetDataList() {
|
||||||
if v1.Libraryid == Id {
|
if v1.Libraryid == Id {
|
||||||
configure = append(configure, v1)
|
configure = append(configure, v1)
|
||||||
}
|
}
|
||||||
|
@ -249,8 +249,8 @@ func (this *modelEquipmentComp) UpdateByHeroId(uid string, equipments ...*pb.DB_
|
|||||||
//创建新的武器对象
|
//创建新的武器对象
|
||||||
func (this *modelEquipmentComp) newEquipment(uid string, conf *cfg.GameEquipData, dyweight []int32) (equipment *pb.DB_Equipment, err error) {
|
func (this *modelEquipmentComp) newEquipment(uid string, conf *cfg.GameEquipData, dyweight []int32) (equipment *pb.DB_Equipment, err error) {
|
||||||
var (
|
var (
|
||||||
mattr []*cfg.GameEquipAttrlibraryData
|
mattr []*cfg.GameEquipAttrlibrarySData
|
||||||
sattr []*cfg.GameEquipAttrlibraryData
|
sattr []*cfg.GameEquipAttrlibrarySData
|
||||||
equipatt *cfg.GameEquipAttributeData
|
equipatt *cfg.GameEquipAttributeData
|
||||||
weight []int32
|
weight []int32
|
||||||
total int
|
total int
|
||||||
@ -360,8 +360,8 @@ func (this *modelEquipmentComp) upgradeEquipment(equipment *pb.DB_Equipment, equ
|
|||||||
}
|
}
|
||||||
if len(equipment.AdverbEntry) < 4 { //去随机副词条
|
if len(equipment.AdverbEntry) < 4 { //去随机副词条
|
||||||
var (
|
var (
|
||||||
temp []*cfg.GameEquipAttrlibraryData
|
temp []*cfg.GameEquipAttrlibrarySData
|
||||||
sattr []*cfg.GameEquipAttrlibraryData
|
sattr []*cfg.GameEquipAttrlibrarySData
|
||||||
equipatt *cfg.GameEquipAttributeData
|
equipatt *cfg.GameEquipAttributeData
|
||||||
)
|
)
|
||||||
if temp, err = this.module.configure.GetEquipmentAttrlibraryConfigureById(equip.Addlibrary); err != nil {
|
if temp, err = this.module.configure.GetEquipmentAttrlibraryConfigureById(equip.Addlibrary); err != nil {
|
||||||
|
@ -78,12 +78,12 @@ func (this *apiComp) Getall(session comm.IUserSession, req *pb.OldtimesGetallReq
|
|||||||
if levelConf != nil {
|
if levelConf != nil {
|
||||||
chapter := this.module.modelOldtimes.getChatper(levelConf.Group, d)
|
chapter := this.module.modelOldtimes.getChatper(levelConf.Group, d)
|
||||||
if chapter != nil {
|
if chapter != nil {
|
||||||
chapter.Levels = append(chapter.Levels, &pb.Level{Lid: lid})
|
chapter.Levels = append(chapter.Levels, &pb.Level{Lid: lid, Status: int32(unlock)})
|
||||||
} else {
|
} else {
|
||||||
chapter := &pb.Chapter{
|
chapter := &pb.Chapter{
|
||||||
Cid: levelConf.Group,
|
Cid: levelConf.Group,
|
||||||
}
|
}
|
||||||
chapter.Levels = append(chapter.Levels, &pb.Level{Lid: lid})
|
chapter.Levels = append(chapter.Levels, &pb.Level{Lid: lid, Status: int32(unlock)})
|
||||||
d.Chapters = append(d.Chapters, chapter)
|
d.Chapters = append(d.Chapters, chapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,15 +205,3 @@ func soLessEqual(actual, expected int32) (ok bool, err error) {
|
|||||||
ok = true
|
ok = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeDuplicate(arr []int32) []int32 {
|
|
||||||
visited := make(map[int32]bool)
|
|
||||||
result := []int32{}
|
|
||||||
for _, num := range arr {
|
|
||||||
if !visited[num] {
|
|
||||||
visited[num] = true
|
|
||||||
result = append(result, num)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
@ -366,7 +366,7 @@ func (this *ModuleRtask) processTasks(session comm.IUserSession, taskParams ...*
|
|||||||
this.modelRtaskRecord.Change(uid, update)
|
this.modelRtaskRecord.Change(uid, update)
|
||||||
|
|
||||||
//去重
|
//去重
|
||||||
condIds = removeDuplicate(condIds)
|
condIds = utils.RemoveDuplicate(condIds)
|
||||||
//带通知的condIds
|
//带通知的condIds
|
||||||
var condIdsForNotify []int32
|
var condIdsForNotify []int32
|
||||||
for _, condId := range condIds {
|
for _, condId := range condIds {
|
||||||
|
@ -37,7 +37,7 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
// 当前任务配置
|
// 当前任务配置
|
||||||
curTaskConf, err := a.module.configure.getWorldtaskById(req.TaskId)
|
curTaskConf, err := a.module.configure.getWorldtaskById(req.TaskId)
|
||||||
if err != nil || curTaskConf == nil {
|
if err != nil || curTaskConf == nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
log.Error("世界任务配置未找到",
|
log.Error("世界任务配置未找到",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "taskId", Value: req.TaskId},
|
log.Field{Key: "taskId", Value: req.TaskId},
|
||||||
@ -78,15 +78,37 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
|
||||||
|
|
||||||
//判断是否要结束任务
|
//判断是否要结束任务
|
||||||
if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
|
if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
|
||||||
len(curTaskConf.Completetask) == 0) &&
|
len(curTaskConf.Completetask) == 0) && curTaskConf.DeliverNpc == 0 {
|
||||||
curTaskConf.DeliverNpc == 0 {
|
|
||||||
//结束任务
|
//结束任务
|
||||||
a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf)
|
a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf)
|
||||||
a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf)
|
a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf)
|
||||||
|
} else {
|
||||||
|
// 检查任务条件是否已完成
|
||||||
|
rsp.CondiIds = a.checkCurrentCompleteCond(uid, curTaskConf.Completetask, myWorldtask)
|
||||||
|
}
|
||||||
|
|
||||||
|
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查当前任务的完成条件
|
||||||
|
func (this *apiComp) checkCurrentCompleteCond(uid string, completeCondIds []int32, userTask *pb.DBWorldtask) (condIds []int32) {
|
||||||
|
|
||||||
|
for _, condId := range completeCondIds {
|
||||||
|
if condId == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m, err := this.module.service.GetModule(comm.ModuleRtask); err == nil {
|
||||||
|
iwt, ok := m.(comm.IRtask)
|
||||||
|
if ok {
|
||||||
|
if mc := iwt.CheckCondi(uid, condId); mc == pb.ErrorCode_Success {
|
||||||
|
condIds = append(condIds, condId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -77,133 +77,6 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCheckCond := func(userTask *pb.DBWorldtask, nextTaskId int32) *pb.DBWorldtask {
|
|
||||||
//检查下个任务的完成条件
|
|
||||||
nextTaskConf, err := this.module.configure.getWorldtaskById(nextTaskId)
|
|
||||||
if err != nil {
|
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if nextTaskConf == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if nextTaskConf.Des == 1 || nextTaskConf.Des == 4 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if userTask.CurrentTask == nil {
|
|
||||||
userTask.CurrentTask = make(map[int32]*pb.Worldtask)
|
|
||||||
}
|
|
||||||
|
|
||||||
update := make(map[string]interface{})
|
|
||||||
if (len(nextTaskConf.Completetask) == 1 && nextTaskConf.Completetask[0] == 0) ||
|
|
||||||
len(nextTaskConf.Completetask) == 0 {
|
|
||||||
wt := &pb.Worldtask{
|
|
||||||
TaskId: nextTaskId,
|
|
||||||
TaskType: nextTaskConf.Des,
|
|
||||||
CondiIds: []int32{},
|
|
||||||
}
|
|
||||||
userTask.CurrentTask[nextTaskConf.Group] = wt
|
|
||||||
update["currentTask"] = userTask.CurrentTask
|
|
||||||
} else {
|
|
||||||
for _, condiId := range nextTaskConf.Completetask {
|
|
||||||
if condiId == 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
|
||||||
if ok {
|
|
||||||
nwt.TaskId = nextTaskId
|
|
||||||
nwt.TaskType = nextTaskConf.Des
|
|
||||||
} else {
|
|
||||||
nwt = &pb.Worldtask{
|
|
||||||
TaskId: nextTaskId,
|
|
||||||
TaskType: nextTaskConf.Des,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m, err := this.module.service.GetModule(comm.ModuleRtask); err == nil {
|
|
||||||
iwt, ok := m.(comm.IRtask)
|
|
||||||
if ok {
|
|
||||||
if mc := iwt.CheckCondi(uid, condiId); mc != pb.ErrorCode_Success {
|
|
||||||
this.module.Debug("任务完成条件不满足",
|
|
||||||
log.Field{Key: "uid", Value: uid},
|
|
||||||
log.Field{Key: "taskId", Value: nextTaskId},
|
|
||||||
log.Field{Key: "condiId", Value: condiId},
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
if ok {
|
|
||||||
nwt.CondiIds = append(nwt.CondiIds, condiId)
|
|
||||||
} else {
|
|
||||||
condiIds := []int32{condiId}
|
|
||||||
nwt.CondiIds = condiIds
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
|
||||||
update["currentTask"] = userTask.CurrentTask
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(update) > 0 {
|
|
||||||
if err := this.module.modelWorldtask.Change(uid, update); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return userTask
|
|
||||||
}
|
|
||||||
|
|
||||||
finishRsp := func() {
|
|
||||||
this.module.modelWorldtask.updateRandomTask(session.GetUserId(), userTask)
|
|
||||||
|
|
||||||
nextTaskIds := this.module.modelWorldtask.findNextTasks(curTaskConf.Key)
|
|
||||||
this.module.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
|
|
||||||
|
|
||||||
nextTask := make(map[int32]*pb.Worldtask)
|
|
||||||
for _, next := range nextTaskIds {
|
|
||||||
ut := updateCheckCond(userTask, next)
|
|
||||||
if ut != nil {
|
|
||||||
for k, v := range ut.CurrentTask {
|
|
||||||
nextTask[k] = &pb.Worldtask{
|
|
||||||
TaskId: v.TaskId,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeFinish, rsp); err != nil {
|
|
||||||
code = pb.ErrorCode_SystemError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if curTaskConf.IdAfter != 0 {
|
|
||||||
// 任务完成推送
|
|
||||||
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
|
||||||
NextTask: nextTask,
|
|
||||||
FinishedTaskIds: []int32{curTaskConf.Key},
|
|
||||||
}); err != nil {
|
|
||||||
code = pb.ErrorCode_SystemError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 章节完成
|
|
||||||
if _, ok := userTask.Chapters[req.GroupId]; !ok {
|
|
||||||
delete(userTask.CurrentTask, req.GroupId)
|
|
||||||
if userTask.Chapters == nil {
|
|
||||||
userTask.Chapters = make(map[int32]int32)
|
|
||||||
}
|
|
||||||
userTask.Chapters[req.GroupId] = 1 //已解锁待领取
|
|
||||||
update := map[string]interface{}{
|
|
||||||
"chapters": userTask.Chapters,
|
|
||||||
"currentTask": userTask.CurrentTask,
|
|
||||||
}
|
|
||||||
this.module.modelWorldtask.Change(uid, update)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断任务是否已完成
|
//判断任务是否已完成
|
||||||
for _, v := range userTask.TaskList {
|
for _, v := range userTask.TaskList {
|
||||||
if v == req.TaskId {
|
if v == req.TaskId {
|
||||||
@ -211,7 +84,8 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "taskId", Value: req.TaskId},
|
log.Field{Key: "taskId", Value: req.TaskId},
|
||||||
)
|
)
|
||||||
finishRsp()
|
// finishRsp()
|
||||||
|
this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,7 +146,84 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finishRsp()
|
this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *apiComp) updateCheckCond(uid string, userTask *pb.DBWorldtask, nextTaskId int32) *pb.DBWorldtask {
|
||||||
|
//检查下个任务的完成条件
|
||||||
|
nextTaskConf, err := this.module.configure.getWorldtaskById(nextTaskId)
|
||||||
|
if err != nil {
|
||||||
|
this.module.Error("config not found", log.Field{Key: "taskId", Value: nextTaskId})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if nextTaskConf == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if nextTaskConf.Des == 1 || nextTaskConf.Des == 4 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if userTask.CurrentTask == nil {
|
||||||
|
userTask.CurrentTask = make(map[int32]*pb.Worldtask)
|
||||||
|
}
|
||||||
|
|
||||||
|
update := make(map[string]interface{})
|
||||||
|
if (len(nextTaskConf.Completetask) == 1 && nextTaskConf.Completetask[0] == 0) ||
|
||||||
|
len(nextTaskConf.Completetask) == 0 {
|
||||||
|
wt := &pb.Worldtask{
|
||||||
|
TaskId: nextTaskId,
|
||||||
|
TaskType: nextTaskConf.Des,
|
||||||
|
CondiIds: []int32{},
|
||||||
|
}
|
||||||
|
userTask.CurrentTask[nextTaskConf.Group] = wt
|
||||||
|
update["currentTask"] = userTask.CurrentTask
|
||||||
|
} else {
|
||||||
|
for _, condiId := range nextTaskConf.Completetask {
|
||||||
|
if condiId == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
||||||
|
if ok {
|
||||||
|
nwt.TaskId = nextTaskId
|
||||||
|
nwt.TaskType = nextTaskConf.Des
|
||||||
|
} else {
|
||||||
|
nwt = &pb.Worldtask{
|
||||||
|
TaskId: nextTaskId,
|
||||||
|
TaskType: nextTaskConf.Des,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if m, err := this.module.service.GetModule(comm.ModuleRtask); err == nil {
|
||||||
|
iwt, ok := m.(comm.IRtask)
|
||||||
|
if ok {
|
||||||
|
if mc := iwt.CheckCondi(uid, condiId); mc != pb.ErrorCode_Success {
|
||||||
|
this.module.Debug("任务完成条件不满足",
|
||||||
|
log.Field{Key: "uid", Value: uid},
|
||||||
|
log.Field{Key: "taskId", Value: nextTaskId},
|
||||||
|
log.Field{Key: "condiId", Value: condiId},
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if ok {
|
||||||
|
nwt.CondiIds = append(nwt.CondiIds, condiId)
|
||||||
|
} else {
|
||||||
|
condiIds := []int32{condiId}
|
||||||
|
nwt.CondiIds = condiIds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
||||||
|
update["currentTask"] = userTask.CurrentTask
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(update) > 0 {
|
||||||
|
if err := this.module.modelWorldtask.Change(uid, update); err != nil {
|
||||||
|
this.module.Error("DB err", log.Field{Key: "err", Value: err.Error()})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return userTask
|
||||||
|
}
|
||||||
|
@ -167,7 +167,8 @@ type WorldtaskAcceptResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"`
|
Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"`
|
||||||
|
CondiIds []int32 `protobuf:"varint,2,rep,packed,name=condiIds,proto3" json:"condiIds"` //完成条件
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WorldtaskAcceptResp) Reset() {
|
func (x *WorldtaskAcceptResp) Reset() {
|
||||||
@ -209,6 +210,13 @@ func (x *WorldtaskAcceptResp) GetCode() ErrorCode {
|
|||||||
return ErrorCode_Success
|
return ErrorCode_Success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *WorldtaskAcceptResp) GetCondiIds() []int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.CondiIds
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
//任务完成条件推送
|
//任务完成条件推送
|
||||||
type WorldtaskCompletecondisPush struct {
|
type WorldtaskCompletecondisPush struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -982,96 +990,98 @@ var file_worldtask_worldtask_msg_proto_rawDesc = []byte{
|
|||||||
0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75,
|
0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75,
|
||||||
0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
|
0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
|
||||||
0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
|
0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x13, 0x57, 0x6f,
|
0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x13, 0x57, 0x6f,
|
||||||
0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73,
|
0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73,
|
||||||
0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||||
0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64,
|
0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64,
|
||||||
0x65, 0x22, 0x6b, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f,
|
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20,
|
||||||
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x73, 0x50, 0x75, 0x73, 0x68,
|
0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x22, 0x6b, 0x0a,
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x1b, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
|
||||||
0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61,
|
0x74, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07,
|
||||||
0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b,
|
0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67,
|
||||||
0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x18, 0x03,
|
0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||||
0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x22, 0x67,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a,
|
||||||
0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c,
|
0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05,
|
||||||
0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67,
|
0x52, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x73, 0x22, 0x67, 0x0a, 0x19, 0x57, 0x6f,
|
||||||
0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72,
|
0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x43,
|
||||||
0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18,
|
0x6f, 0x6e, 0x64, 0x69, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
|
||||||
0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x1a, 0x57, 0x6f, 0x72, 0x6c, 0x64,
|
0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64,
|
0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64,
|
||||||
0x69, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
|
0x69, 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x1a, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b,
|
||||||
0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52,
|
0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x52, 0x65, 0x73,
|
||||||
0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18,
|
0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64,
|
||||||
0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64,
|
0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a,
|
0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64,
|
||||||
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
0x69, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b,
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
|
0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f,
|
||||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22,
|
0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75,
|
||||||
0x67, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69,
|
0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20,
|
||||||
0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x13, 0x57,
|
||||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,
|
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65,
|
||||||
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18,
|
0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f,
|
||||||
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x22, 0xcc, 0x01, 0x0a, 0x15, 0x57, 0x6f, 0x72,
|
0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
|
||||||
0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x65, 0x78, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x75,
|
0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x73, 0x68, 0x12, 0x40, 0x0a, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x18, 0x01,
|
0x64, 0x69, 0x49, 0x64, 0x22, 0xcc, 0x01, 0x0a, 0x15, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61,
|
||||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b,
|
0x73, 0x6b, 0x4e, 0x65, 0x78, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x75, 0x73, 0x68, 0x12, 0x40,
|
||||||
0x4e, 0x65, 0x78, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x75, 0x73, 0x68, 0x2e, 0x4e, 0x65, 0x78,
|
0x0a, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x74, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74,
|
0x32, 0x24, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x65, 0x78, 0x74,
|
||||||
0x54, 0x61, 0x73, 0x6b, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64,
|
0x74, 0x61, 0x73, 0x6b, 0x50, 0x75, 0x73, 0x68, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73,
|
||||||
0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x66,
|
0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b,
|
||||||
0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x1a, 0x47,
|
0x12, 0x28, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b,
|
||||||
0x0a, 0x0d, 0x4e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
|
0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x69, 0x73,
|
||||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65,
|
0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x1a, 0x47, 0x0a, 0x0d, 0x4e, 0x65,
|
||||||
0x79, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||||
0x32, 0x0a, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61,
|
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a,
|
||||||
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x67, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6c, 0x64,
|
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x57,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52,
|
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||||
0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
0x02, 0x38, 0x01, 0x22, 0x67, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b,
|
||||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x18, 0x01,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x49, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x22, 0x5b, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74,
|
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61,
|
||||||
0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04,
|
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x5b, 0x0a, 0x18,
|
||||||
0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74,
|
0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53,
|
||||||
0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a,
|
0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f,
|
||||||
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49,
|
||||||
0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xb1, 0x01,
|
0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64,
|
||||||
0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43,
|
||||||
0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72,
|
0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xb1, 0x01, 0x0a, 0x18, 0x57, 0x6f,
|
||||||
0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f,
|
0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e,
|
||||||
0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02,
|
0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64,
|
||||||
0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63,
|
0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61,
|
0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69,
|
||||||
0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65,
|
0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74,
|
0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
||||||
0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72,
|
0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74,
|
||||||
0x74, 0x22, 0x53, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61,
|
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52,
|
||||||
0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16,
|
0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x53, 0x0a,
|
||||||
0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
|
0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
|
0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61,
|
||||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,
|
0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b,
|
||||||
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x40, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74,
|
0x49, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
||||||
0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73, 0x68,
|
0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f,
|
||||||
0x12, 0x26, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03,
|
0x64, 0x65, 0x22, 0x40, 0x0a, 0x16, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46,
|
||||||
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08,
|
0x69, 0x6e, 0x69, 0x73, 0x68, 0x49, 0x64, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x08,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c,
|
0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a,
|
||||||
0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x72, 0x65, 0x77, 0x61,
|
0x2e, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b,
|
||||||
0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64,
|
0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22,
|
0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
|
||||||
0x3c, 0x0a, 0x1a, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70,
|
0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x74, 0x65, 0x72, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a,
|
0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x1a, 0x57,
|
||||||
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72,
|
0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x72,
|
||||||
0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a,
|
0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64,
|
||||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43,
|
||||||
|
0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||||
|
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -15,3 +15,15 @@ func ConvertReward(data ...*cfg.Gameatn) (res []*pb.UserAssets) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RemoveDuplicate(arr []int32) []int32 {
|
||||||
|
visited := make(map[int32]bool)
|
||||||
|
result := []int32{}
|
||||||
|
for _, num := range arr {
|
||||||
|
if !visited[num] {
|
||||||
|
visited[num] = true
|
||||||
|
result = append(result, num)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user