支线任务优化

This commit is contained in:
wh_zcy 2023-01-03 14:05:53 +08:00
parent 15936f15c0
commit 7f2db5b932
3 changed files with 23 additions and 21 deletions

View File

@ -2,7 +2,7 @@
{ {
"key": 10100, "key": 10100,
"lock": 1, "lock": 1,
"ontxe": 0, "ontxe": 999999,
"id_after": 10101, "id_after": 10101,
"group": 1, "group": 1,
"des": 2, "des": 2,
@ -17,7 +17,7 @@
1001 1001
], ],
"completetask": 0, "completetask": 0,
"auto_accept": 1, "auto_accept": 0,
"overtips": 1, "overtips": 1,
"reword": [ "reword": [
{ {
@ -1730,9 +1730,9 @@
}, },
{ {
"key": 30001, "key": 30001,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 30002,
"group": 101, "group": 101,
"des": 3, "des": 3,
"icon": "", "icon": "",
@ -1775,7 +1775,7 @@
{ {
"key": 30003, "key": 30003,
"lock": 1, "lock": 1,
"ontxe": 30001, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
"des": 3, "des": 3,
@ -1796,7 +1796,7 @@
}, },
{ {
"key": 30004, "key": 30004,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1818,7 +1818,7 @@
}, },
{ {
"key": 30005, "key": 30005,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1840,7 +1840,7 @@
}, },
{ {
"key": 30006, "key": 30006,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1856,13 +1856,13 @@
300011 300011
], ],
"completetask": 0, "completetask": 0,
"auto_accept": 1, "auto_accept": 0,
"overtips": 1, "overtips": 1,
"reword": [] "reword": []
}, },
{ {
"key": 30007, "key": 30007,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1884,7 +1884,7 @@
}, },
{ {
"key": 30008, "key": 30008,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1906,7 +1906,7 @@
}, },
{ {
"key": 30009, "key": 30009,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1928,7 +1928,7 @@
}, },
{ {
"key": 30010, "key": 30010,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,
@ -1950,7 +1950,7 @@
}, },
{ {
"key": 30011, "key": 30011,
"lock": 999, "lock": 1,
"ontxe": 0, "ontxe": 0,
"id_after": 0, "id_after": 0,
"group": 101, "group": 101,

View File

@ -165,9 +165,11 @@ func (this *User) CleanSession(session comm.IUserSession) {
// 在线玩家列表 // 在线玩家列表
func (this *User) UserOnlineList() ([]*pb.CacheUser, error) { func (this *User) UserOnlineList() ([]*pb.CacheUser, error) {
var cache []*pb.CacheUser var cache []*pb.CacheUser
if !this.IsCross() {
if err := this.modelSession.GetList(comm.RDS_EMPTY, &cache); err != nil { if err := this.modelSession.GetList(comm.RDS_EMPTY, &cache); err != nil {
return nil, err return nil, err
} }
}
return cache, nil return cache, nil
} }

View File

@ -50,7 +50,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
} }
// 判断玩家等级要求 // 判断玩家等级要求
if user.Lv < curTaskConf.Lock { if curTaskConf.Des == 2 && user.Lv < curTaskConf.Lock {
code = pb.ErrorCode_WorldtaskLvNotEnough code = pb.ErrorCode_WorldtaskLvNotEnough
return return
} }
@ -80,15 +80,14 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
hero = make([]string, 0) hero = make([]string, 0)
newhero = make([]string, 0) newhero = make([]string, 0)
var nextTaskId int32 var nextTaskId int32
nextTaskId = curTaskConf.IdAfter
finishRsp := func() { finishRsp := func() {
if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeFinish, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), WorldtaskSubtypeFinish, rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError
return return
} }
if curTaskConf.IdAfter != 0 {
// 世界任务类型 nextTaskId = curTaskConf.IdAfter
if curTaskConf.Des == 2 {
// 任务完成推送 // 任务完成推送
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{ if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
NextTaskId: nextTaskId, NextTaskId: nextTaskId,
@ -97,6 +96,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
return return
} }
} }
} }
finishCall := func() { finishCall := func() {