新版日周常

This commit is contained in:
wh_zcy 2023-04-03 19:20:19 +08:00
parent 6550da4cc0
commit d1dcc03e3a
6 changed files with 53 additions and 37 deletions

View File

@ -729,7 +729,7 @@
"lockend": 5,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 111,
"des": 1,
"icon": "",
"task_Tname": {
@ -765,7 +765,7 @@
"lockend": 5,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 112,
"des": 1,
"icon": "",
"task_Tname": {
@ -801,7 +801,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 113,
"des": 1,
"icon": "",
"task_Tname": {
@ -837,7 +837,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 114,
"des": 1,
"icon": "",
"task_Tname": {
@ -873,7 +873,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 115,
"des": 1,
"icon": "",
"task_Tname": {
@ -909,7 +909,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 110,
"group": 116,
"des": 1,
"icon": "",
"task_Tname": {
@ -981,7 +981,7 @@
"lockend": 5,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 411,
"des": 4,
"icon": "",
"task_Tname": {
@ -1017,7 +1017,7 @@
"lockend": 5,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 412,
"des": 4,
"icon": "",
"task_Tname": {
@ -1053,7 +1053,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 413,
"des": 4,
"icon": "",
"task_Tname": {
@ -1089,7 +1089,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 414,
"des": 4,
"icon": "",
"task_Tname": {
@ -1125,7 +1125,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 415,
"des": 4,
"icon": "",
"task_Tname": {
@ -1161,7 +1161,7 @@
"lockend": 20,
"ontxe": 20010,
"id_after": 0,
"group": 410,
"group": 416,
"des": 4,
"icon": "",
"task_Tname": {

View File

@ -321,7 +321,8 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
}
stime := time.Now()
// this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType)
ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
// ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
ctx := context.Background()
if len(serviceTag) == 0 {
// this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType)
if err = this.gateway.Service().RpcCall(ctx, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil {

View File

@ -58,8 +58,9 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
session.SendMsg(string(a.module.GetType()), "accept", rsp)
//判断是否要结束任务
if (len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0 ||
len(curTaskConf.Completetask) == 0) && curTaskConf.DeliverNpc == 0 {
if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
len(curTaskConf.Completetask) == 0) &&
curTaskConf.DeliverNpc == 0 {
//结束任务
a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf)
a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf)

View File

@ -30,8 +30,8 @@ func (this *apiComp) CompleteCondi(session comm.IUserSession, req *pb.WorldtaskC
code = pb.ErrorCode_ConfigNoFound
return
}
if (len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0 ||
len(curTaskConf.Completetask) == 0) && curTaskConf.DeliverNpc == 0 {
if (len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
len(curTaskConf.Completetask) == 0 {
code = pb.ErrorCode_WorldtaskNoProcess
return
}

View File

@ -4,10 +4,16 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
"google.golang.org/protobuf/proto"
)
var (
dailyDes int32 = 1
weekDes int32 = 4
)
// 我的世界任务
func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.WorldtaskMineReq) (code pb.ErrorCode) {
return
@ -33,31 +39,39 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
myWorldtask.CurrentTask = make(map[int32]*pb.Worldtask)
}
now := configure.Now().Unix()
update := make(map[string]interface{})
// 日常
dailyIds := this.module.randomTask(user.Lv, 1, myWorldtask)
for _, v := range dailyIds {
gwtd, err := this.module.configure.getWorldtaskById(v)
if err != nil || gwtd == nil {
continue
}
myWorldtask.CurrentTask[gwtd.Group] = &pb.Worldtask{
TaskId: v,
TaskType: gwtd.Des,
if now-myWorldtask.DaliyRefreshTime >= 3600*24 {
dailyIds := this.module.randomTask(user.Lv, dailyDes, myWorldtask)
for _, v := range dailyIds {
gwtd, err := this.module.configure.getWorldtaskById(v)
if err != nil || gwtd == nil {
continue
}
myWorldtask.CurrentTask[gwtd.Group] = &pb.Worldtask{
TaskId: v,
TaskType: gwtd.Des,
}
}
update["daliyRefreshTime"] = configure.Now().Unix()
}
//周常
weekIds := this.module.randomTask(user.Lv, 2, myWorldtask)
for _, v := range weekIds {
gwtd, err := this.module.configure.getWorldtaskById(v)
if err != nil || gwtd == nil {
continue
}
myWorldtask.CurrentTask[gwtd.Group] = &pb.Worldtask{
TaskId: v,
TaskType: gwtd.Des,
if now-myWorldtask.WeekRefreshTime >= 3600*24*7 {
weekIds := this.module.randomTask(user.Lv, weekDes, myWorldtask)
for _, v := range weekIds {
gwtd, err := this.module.configure.getWorldtaskById(v)
if err != nil || gwtd == nil {
continue
}
myWorldtask.CurrentTask[gwtd.Group] = &pb.Worldtask{
TaskId: v,
TaskType: gwtd.Des,
}
}
update["weekRefreshTime"] = configure.Now().Unix()
}
update["currentTask"] = myWorldtask.CurrentTask

View File

@ -279,7 +279,7 @@ func (this *ModelWorldtask) taskFinish(session comm.IUserSession, groupId, taskI
}
func (this *Worldtask) filterTask(userLv, des int32, wt *pb.DBWorldtask) (taskIds []int32) {
if des != 1 || des != 4 {
if des != 1 && des != 4 {
return
}
gwt, err := this.configure.getWorldtaskCfg()
@ -291,7 +291,7 @@ func (this *Worldtask) filterTask(userLv, des int32, wt *pb.DBWorldtask) (taskId
// 主角等级
if v.Des == des && userLv >= v.Lock && userLv <= v.Lockend {
if v.Ontxe != 0 {
//前置
//寻找前置
if _, ok := utils.Findx(wt.TaskList, v.Ontxe); ok {
taskIds = append(taskIds, v.Key)
}