This commit is contained in:
meixiongfeng 2023-03-14 18:23:09 +08:00
commit acc409c6b7
10 changed files with 385 additions and 674 deletions

View File

@ -1,14 +1,14 @@
[
{
"id": 1,
"unlock_condition": 6000001
"unlock_condition": 20010
},
{
"id": 2,
"unlock_condition": 6000002
"unlock_condition": 20011
},
{
"id": 3,
"unlock_condition": 6000003
"unlock_condition": 20012
}
]

View File

@ -623,8 +623,8 @@
{
"id": 170,
"type": 1,
"data1": 44006,
"data2": 0,
"data1": 1,
"data2": 44006,
"data3": 0,
"data4": 0,
"data5": 0

View File

@ -1,444 +1,4 @@
[
{
"key": 30001,
"lock": 1,
"ontxe": 0,
"id_after": 30002,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenes_boundary_01",
"旧时光1-指挥部杰克",
"150"
],
"receivenpc": [
"scenes_boundary_01",
"旧时光1-指挥部杰克",
"150"
],
"getafter_event": [
2,
300001
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30002,
"lock": 1,
"ontxe": 30001,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"display_platform_04_02",
"旧时光1-住所主角",
"715"
],
"receivenpc": [
"display_platform_04_02",
"旧时光1-住所主角",
"715"
],
"getafter_event": [
2,
300003
],
"completetask": 0,
"auto_accept": 1,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30003,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"display_platform_04_02",
"旧时光1-住所平先生",
"715"
],
"receivenpc": [
"display_platform_04_02",
"旧时光1-住所平先生",
"715"
],
"getafter_event": [
2,
300004
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30004,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"display_platform_04_02",
"旧时光1-住所平先生",
"715"
],
"receivenpc": [
"display_platform_04_02",
"旧时光1-住所平先生",
"715"
],
"getafter_event": [
2,
300005
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30005,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部阿宝",
"150"
],
"receivenpc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部阿宝",
"150"
],
"getafter_event": [
2,
300008
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30006,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部杰克",
"150"
],
"receivenpc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部杰克",
"150"
],
"getafter_event": [
2,
300011
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30007,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"dreamwork_jungle_playershow_01",
"旧时光1-森林小道阿宝",
"717"
],
"receivenpc": [
"dreamwork_jungle_playershow_01",
"旧时光1-森林小道阿宝",
"717"
],
"getafter_event": [
2,
300012
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30008,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"dreamwork_jungle_playershow_01",
"旧时光1-森林小道 阿宝",
"717"
],
"receivenpc": [
"dreamwork_jungle_playershow_01",
"旧时光1-森林小道 阿宝",
"717"
],
"getafter_event": [
2,
300013
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30009,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenesfight_03_02",
"旧时光1-竹林豺狼小怪",
"716"
],
"receivenpc": [
"scenesfight_03_02",
"旧时光1-竹林豺狼小怪",
"716"
],
"getafter_event": [
2,
300014
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30010,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenesfight_03_02",
"旧时光1-竹林阿宝",
"716"
],
"receivenpc": [
"scenesfight_03_02",
"旧时光1-竹林阿宝",
"716"
],
"getafter_event": [
2,
300015
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 30011,
"lock": 1,
"ontxe": 0,
"id_after": 0,
"group": 101,
"des": 3,
"icon": "",
"task_Tname": {
"key": "story_80",
"text": "旧时光"
},
"task_name": {
"key": "story_80",
"text": "阿宝学功夫"
},
"task_display": {
"key": "story_80",
"text": "新剧情"
},
"npc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部杰克",
"150"
],
"receivenpc": [
"scenes_boundary_01_recordtask",
"旧时光1-指挥部杰克",
"150"
],
"getafter_event": [
2,
300019
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
"reword": [],
"module": []
},
{
"key": 20010,
"lock": 1,
@ -464,20 +24,22 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
401
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
401
],
"completetask": 0,
"auto_accept": 1,
"overtips": 1,
"reword": [],
"module": []
"module": [
"practice"
]
},
{
"key": 20011,
@ -504,20 +66,22 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
402
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
402
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
"reword": [],
"module": []
"module": [
"practice"
]
},
{
"key": 20012,
@ -544,20 +108,22 @@
"1.新手引导-花朵-中轴城",
"901"
],
"getafter_event": [
2,
403
],
"receivenpc": [
"bossfight_pt_02",
"1.新手引导-花朵-中轴城",
"901"
],
"getafter_event": [
2,
403
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
"reword": [],
"module": []
"module": [
"practice"
]
},
{
"key": 20020,
@ -584,15 +150,15 @@
"1.新手引导-花朵-中轴城",
"901"
],
"getafter_event": [
2,
404
],
"receivenpc": [
"bossfight_pt_02",
"1.新手引导-花朵-中轴城",
"901"
],
"getafter_event": [
2,
404
],
"completetask": 0,
"auto_accept": 1,
"overtips": 1,
@ -624,15 +190,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
406
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
406
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -664,15 +230,15 @@
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
407
],
"receivenpc": [
"bossfight_pt_02",
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
407
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -704,15 +270,15 @@
"2新手引导-邦尼兔-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
408
],
"receivenpc": [
"bossfight_pt_02",
"2新手引导-邦尼兔-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
408
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -750,15 +316,15 @@
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
410
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-右屏圣树1",
"901"
],
"getafter_event": [
2,
410
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -790,15 +356,15 @@
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
411
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-右屏圣树2",
"901"
],
"getafter_event": [
2,
411
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -830,15 +396,15 @@
"新手引导-豺狼人-右屏圣树",
"901"
],
"getafter_event": [
2,
412
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-豺狼人-右屏圣树",
"901"
],
"getafter_event": [
2,
412
],
"completetask": 174,
"auto_accept": 0,
"overtips": 1,
@ -876,15 +442,15 @@
"新手引导-豺狼人-右屏圣树",
"901"
],
"getafter_event": [
2,
413
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-豺狼人-右屏圣树",
"901"
],
"getafter_event": [
2,
413
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -916,15 +482,15 @@
"新手引导-圣树下的黑洞",
"901"
],
"getafter_event": [
4,
166
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-犀牛守卫",
"901"
],
"getafter_event": [
4,
166
],
"completetask": 301,
"auto_accept": 0,
"overtips": 1,
@ -962,15 +528,15 @@
"新手引导-波比-犀牛守卫",
"901"
],
"getafter_event": [
2,
416
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-犀牛守卫",
"901"
],
"getafter_event": [
2,
416
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1002,15 +568,15 @@
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
9,
1
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-右屏圣树3",
"901"
],
"getafter_event": [
9,
1
],
"completetask": 0,
"auto_accept": 0,
"overtips": 0,
@ -1042,15 +608,15 @@
"3新手引导-波比-正常待机-中轴城",
"901"
],
"getafter_event": [
2,
420
],
"receivenpc": [
"bossfight_pt_02",
"新手引导-波比-右屏圣树3",
"901"
],
"getafter_event": [
2,
420
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1082,15 +648,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
422
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
422
],
"completetask": 161,
"auto_accept": 0,
"overtips": 1,
@ -1122,15 +688,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
423
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
423
],
"completetask": 0,
"auto_accept": 1,
"overtips": 1,
@ -1162,15 +728,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
425
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
425
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1202,15 +768,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
426
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
426
],
"completetask": 0,
"auto_accept": 1,
"overtips": 1,
@ -1248,15 +814,15 @@
"暴夫纳特铁匠铺",
"139"
],
"getafter_event": [
2,
427
],
"receivenpc": [
"scenes_smithy_01",
"暴夫纳特铁匠铺",
"901"
],
"getafter_event": [
2,
427
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1288,15 +854,15 @@
"暴夫纳特铁匠铺",
"139"
],
"getafter_event": [
2,
428
],
"receivenpc": [
"scenes_smithy_01",
"暴夫纳特铁匠铺",
"901"
],
"getafter_event": [
2,
428
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1328,15 +894,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
429
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
429
],
"completetask": 0,
"auto_accept": 0,
"overtips": 1,
@ -1368,15 +934,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
430
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
430
],
"completetask": 302,
"auto_accept": 0,
"overtips": 1,
@ -1408,15 +974,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
431
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
431
],
"completetask": 303,
"auto_accept": 0,
"overtips": 1,
@ -1448,15 +1014,15 @@
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
432
],
"receivenpc": [
"bossfight_pt_02",
"0新手引导-杰克-中轴城常驻待机",
"901"
],
"getafter_event": [
2,
432
],
"completetask": 114,
"auto_accept": 0,
"overtips": 1,

View File

@ -49,40 +49,39 @@ const (
ModuleShop core.M_Modules = "shop" //商店模块
ModuleTask core.M_Modules = "task" //任务模块
ModuleNotify core.M_Modules = "notify" //公告模块
ModuleChat core.M_Modules = "chat" //聊天模块
ModuleGM core.M_Modules = "gm" //gm模块
ModulePagoda core.M_Modules = "pagoda" //魔塔模块
ModuleMartialhall core.M_Modules = "martialhall" //武馆模块
ModuleGourmet core.M_Modules = "gourmet" //美食馆
ModuleRtask core.M_Modules = "rtask" //随机任务
ModuleSmithy core.M_Modules = "smithy" //铁匠铺
ModuleTimer core.M_Modules = "timer" //定时任务模块
ModuleViking core.M_Modules = "viking" //维京远征
ModuleMoonfantasy core.M_Modules = "moonfantasy" //月之秘境模块
ModuleHunting core.M_Modules = "hunting" //狩猎
ModuleLinestory core.M_Modules = "linestory" //支线剧情
ModuleBattle core.M_Modules = "battle" //战斗
ModuleLibrary core.M_Modules = "library" //藏书馆
ModuleArena core.M_Modules = "arena" //竞技场
ModuleTroll core.M_Modules = "troll" //巨怪商队
ModuleHoroscope core.M_Modules = "horoscope" //星座图
ModuleSociaty core.M_Modules = "sociaty" //公会
ModulePay core.M_Modules = "pay" //支付
ModuleAcademy core.M_Modules = "academy" //联盟学院
ModulePrivilege core.M_Modules = "privilege" //特权
ModuleGrowtask core.M_Modules = "growtask" //成长任务
ModuleWorldtask core.M_Modules = "worldtask" //世界任务
ModuleReddot core.M_Modules = "reddot" //红点
ModuleCombat core.M_Modules = "combat" //关卡编辑
ModuleEnchant core.M_Modules = "enchant" //附魔
ModuleAutoBattle core.M_Modules = "autobattle" //自动战斗
ModuleMline core.M_Modules = "mline" //主线模块
ModulePvp core.M_Modules = "pvp" //实时pvp
ModulePandaTakekan core.M_Modules = "pandatakekan" //熊猫武馆
ModuleDispatch core.M_Modules = "dispatch" //武馆派遣
ModulePractice core.M_Modules = "practice" //熊猫武馆 练功系统
ModulePandaAtlas core.M_Modules = "atlas" //熊猫图鉴
ModuleNotify core.M_Modules = "notify" //公告模块
ModuleChat core.M_Modules = "chat" //聊天模块
ModuleGM core.M_Modules = "gm" //gm模块
ModulePagoda core.M_Modules = "pagoda" //魔塔模块
ModuleMartialhall core.M_Modules = "martialhall" //武馆模块
ModuleGourmet core.M_Modules = "gourmet" //美食馆
ModuleRtask core.M_Modules = "rtask" //随机任务
ModuleSmithy core.M_Modules = "smithy" //铁匠铺
ModuleTimer core.M_Modules = "timer" //定时任务模块
ModuleViking core.M_Modules = "viking" //维京远征
ModuleMoonfantasy core.M_Modules = "moonfantasy" //月之秘境模块
ModuleHunting core.M_Modules = "hunting" //狩猎
ModuleLinestory core.M_Modules = "linestory" //支线剧情
ModuleBattle core.M_Modules = "battle" //战斗
ModuleLibrary core.M_Modules = "library" //藏书馆
ModuleArena core.M_Modules = "arena" //竞技场
ModuleTroll core.M_Modules = "troll" //巨怪商队
ModuleHoroscope core.M_Modules = "horoscope" //星座图
ModuleSociaty core.M_Modules = "sociaty" //公会
ModulePay core.M_Modules = "pay" //支付
ModuleAcademy core.M_Modules = "academy" //联盟学院
ModulePrivilege core.M_Modules = "privilege" //特权
ModuleGrowtask core.M_Modules = "growtask" //成长任务
ModuleWorldtask core.M_Modules = "worldtask" //世界任务
ModuleReddot core.M_Modules = "reddot" //红点
ModuleCombat core.M_Modules = "combat" //关卡编辑
ModuleEnchant core.M_Modules = "enchant" //附魔
ModuleAutoBattle core.M_Modules = "autobattle" //自动战斗
ModuleMline core.M_Modules = "mline" //主线模块
ModulePvp core.M_Modules = "pvp" //实时pvp
ModuleDispatch core.M_Modules = "dispatch" //武馆派遣
ModulePractice core.M_Modules = "practice" //熊猫武馆 练功系统
ModulePandaAtlas core.M_Modules = "atlas" //熊猫图鉴
)
// 数据表名定义处

View File

@ -30,6 +30,6 @@ func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGy
code = pb.ErrorCode_ConfigNoFound
return
}
session.SendMsg(string(this.module.GetType()), "buff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id})
session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id})
return
}

View File

@ -19,6 +19,6 @@ func (this *apiComp) GymConfirm(session comm.IUserSession, req *pb.PracticeGymCo
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"globalbuff": req.Buffid,
})
session.SendMsg(string(this.module.GetType()), "confirm", &pb.PracticeGymConfirmResp{Buffid: req.Buffid})
session.SendMsg(string(this.module.GetType()), "gymconfirm", &pb.PracticeGymConfirmResp{Buffid: req.Buffid})
return
}

View File

@ -43,6 +43,6 @@ func (this *apiComp) NPCDialog(session comm.IUserSession, req *pb.PracticeNPCDia
"npcstate": room.Npcstate,
"refresh": room.Refresh,
})
session.SendMsg(string(this.module.GetType()), "npcdialog", &pb.PracticeInfoResp{Info: room})
session.SendMsg(string(this.module.GetType()), "npcdialog", &pb.PracticeNPCDialogResp{Issucc: true})
return
}

View File

@ -15,6 +15,7 @@ import (
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db"
"go_dreamfactory/utils"
"sync"
"github.com/pkg/errors"
)
@ -40,8 +41,8 @@ type ModuleRtask struct {
modelRtaskRecord *ModelRtaskRecord
api *apiComp
configure *configureComp
handleMap map[int32]*rtaskCondi //任务校验处理器
lock sync.Mutex
handleMap map[int32]*rtaskCondi //任务校验处理器
}
func NewModule() core.IModule {
@ -57,7 +58,7 @@ func (this *ModuleRtask) GetType() core.M_Modules {
func (this *ModuleRtask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService)
this.initRtaskVerifyHandle()
// this.initRtaskVerifyHandle()
return
}
func (this *ModuleRtask) Start() (err error) {
@ -75,12 +76,198 @@ func (this *ModuleRtask) OnInstallComp() {
}
func (this *ModuleRtask) registerVerifyHandle(condiId int32, condi *rtaskCondi) {
if _, ok := this.handleMap[condiId]; !ok {
this.handleMap[condiId] = condi
// if _, ok := this.handleMap[condiId]; !ok {
// this.handleMap[condiId] = condi
// }
this.lock.Lock()
defer this.lock.Unlock()
this.handleMap[condiId] = condi
}
func (this *ModuleRtask) getHandle(tt comm.TaskType) (condis []*rtaskCondi) {
for _, v := range this.configure.getRtaskCondis(int32(tt)) {
switch tt {
case comm.Rtype1:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype1,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype2:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype2,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype3:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype3,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype4:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype4,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype5:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype5,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype6:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype6,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype8:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype8,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype9:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype9,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype10:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype10,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype11, comm.Rtype84, comm.Rtype85:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.lessEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype18:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.greatEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15,
comm.Rtype19, comm.Rtype21, comm.Rtype24,
comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53,
comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60,
comm.Rtype62, comm.Rtype64, comm.Rtype69, comm.Rtype72, comm.Rtype88, comm.Rtype104,
comm.Rtype96, comm.Rtype105, comm.Rtype128, comm.Rtype130, comm.Rtype131,
comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146,
comm.Rtype147, comm.Rtype149, comm.Rtype153, comm.Rtype154, comm.Rtype155, comm.Rtype156:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.lessEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype20:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype20,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype22, comm.Rtype109:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtaskRecord.verifyFirstEqualParam,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype63:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype63,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype16, comm.Rtype17,
comm.Rtype35, comm.Rtype44,
comm.Rtype59, comm.Rtype61, comm.Rtype70:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.equalParams,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype23, comm.Rtype25, comm.Rtype29, comm.Rtype30, comm.Rtype31,
comm.Rtype32, comm.Rtype33, comm.Rtype34, comm.Rtype36,
comm.Rtype37, comm.Rtype40, comm.Rtype41,
comm.Rtype42, comm.Rtype43, comm.Rtype45,
comm.Rtype46, comm.Rtype47, comm.Rtype48, comm.Rtype49,
comm.Rtype52, comm.Rtype55, comm.Rtype56,
comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype140:
condi := &rtaskCondi{
condId: v.Id,
find: this.modelRtaskRecord.lessThanParams,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
default:
log.Warnf("rtaskType[%v] not register", tt)
}
}
return
}
// 条件校验初始
// Deprecated
func (this *ModuleRtask) initRtaskVerifyHandle() {
conf, err := this.configure.getRtaskCondiCfg()
if err != nil {
@ -236,36 +423,13 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
}
return
}
for _, codiConf := range this.configure.getRtaskCondis(int32(rtaskType)) {
v, ok := this.handleMap[codiConf.Id]
if !ok {
this.Warn("未注册事件处理器",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "condiId", Value: codiConf.Id},
)
code = pb.ErrorCode_RtaskCondiNoFound
return
}
if v.find == nil {
this.Warn("未设置find Handle",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "condiId", Value: codiConf.Id},
)
return
}
if condiId, _ := v.find(codiConf, params...); condiId != 0 {
v.condId = codiConf.Id
condis = append(condis, v)
}
}
condis = this.getHandle(rtaskType)
// update
for _, v := range condis {
conf, err := this.configure.getRtaskTypeById(v.condId)
if err != nil {
log.Errorf("get condId conf err:%v", err)
log.Debug("任务配置未找到", log.Field{Key: "condId", Value: v.condId})
code = pb.ErrorCode_RtaskCondiNoFound
return
}
@ -274,6 +438,7 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
if err := v.update(uid, conf, params...); err != nil {
log.Errorf("update task:%v", err)
code = pb.ErrorCode_DBError
return
}
}
@ -281,13 +446,6 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
if code = this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success {
module, err := this.service.GetModule(comm.ModuleWorldtask)
if err == nil {
// go func() {
// defer func() {
// if r := recover(); r != nil {
// log.Errorf("[worldtask ] err:%v ", r)
// }
// }()
if worldtask, ok := module.(comm.IWorldtask); ok {
if err := worldtask.TaskcondNotify(session, conf.Id); err != nil {
log.Error("任务条件达成通知",
@ -297,16 +455,9 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
)
}
}
// }()
}
userModule, err := this.service.GetModule(comm.ModuleUser)
if err == nil {
// go func() {
// defer func() { //程序异常 收集异常信息传递给前端显示
// if r := recover(); r != nil {
// log.Errorf("[sociatytask ] err:%v ", r)
// }
// }()
// 公会
if user, ok := userModule.(comm.IUser); ok {
ex, err := user.GetUserExpand(uid)
@ -325,15 +476,9 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
)
}
this.processOneTask(session, comm.Rtype156, 1)
// if module, err := this.service.GetModule(comm.ModuleRtask); err == nil {
// if iRtask, ok := module.(comm.IRtask); ok {
// iRtask.SendToRtask(session, comm.Rtype156, 1)
// }
// }
}
}
}
// }()
}
}
@ -368,30 +513,32 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
condis []*rtaskCondi
)
for _, codiConf := range this.configure.getRtaskCondis(int32(rtaskType)) {
v, ok := this.handleMap[codiConf.Id]
if !ok {
this.Warn("未注册事件处理器",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "condiId", Value: codiConf.Id},
)
code = pb.ErrorCode_RtaskCondiNoFound
return
}
condis = this.getHandle(rtaskType)
if v.find == nil {
this.Warn("未设置find Handle",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "condiId", Value: codiConf.Id},
)
return
}
// for _, codiConf := range this.configure.getRtaskCondis(int32(rtaskType)) {
// v, ok := this.handleMap[codiConf.Id]
// if !ok {
// this.Warn("未注册事件处理器",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "condiId", Value: codiConf.Id},
// )
// code = pb.ErrorCode_RtaskCondiNoFound
// return
// }
if condiId, _ := v.find(codiConf, params...); condiId != 0 {
v.condId = codiConf.Id
condis = append(condis, v)
}
}
// if v.find == nil {
// this.Warn("未设置find Handle",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "condiId", Value: codiConf.Id},
// )
// return
// }
// if condiId, _ := v.find(codiConf, params...); condiId != 0 {
// v.condId = codiConf.Id
// condis = append(condis, v)
// }
// }
// update
for _, v := range condis {
@ -496,10 +643,11 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam)
}
for _, tp := range taskParams {
if code := this.processOneTask(session, tp.TT, tp.Params...); code != pb.ErrorCode_Success {
this.Debug("任务处理",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "taskType", Value: tp.TT},
log.Field{Key: "params", Value: tp.Params})
// this.Debug("任务处理",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "taskType", Value: tp.TT},
// log.Field{Key: "params", Value: tp.Params},
// log.Field{Key: "code", Value: code})
}
session.Push()
comm.PuttaskParam(tp)
@ -511,6 +659,7 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam)
// 任务条件校验
func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCode) {
if _, ok := this.modelRtask.checkCondi(uid, condiId); !ok {
// this.Debug("任务条件未达到", log.Field{Key: "uid", Value: uid}, log.Field{Key: "condiId", Value: condiId})
code = pb.ErrorCode_RtaskCondiNoReach
}
return

View File

@ -2,6 +2,7 @@
package rtask
import (
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
@ -37,6 +38,11 @@ func (this *ModelRtaskRecord) overrideUpdate(uid string, cfg *cfg.GameRdtaskCond
if v, ok := record.Vals[cfg.Id]; ok {
v.Data = hasUpdateData(paramLen, v, vals...)
if len(v.Data) > 0 {
this.moduleRtask.Debug("打印V",
log.Field{Key: "v", Value: v.Data},
log.Field{Key: "paramLen", Value: paramLen},
log.Field{Key: "vals", Value: vals},
)
update := map[string]interface{}{
"vals": v,
}
@ -60,8 +66,6 @@ func (this *ModelRtaskRecord) overrideUpdate(uid string, cfg *cfg.GameRdtaskCond
return
}
}
// log.Debug("覆盖数值更新", log.Fields{"uid": uid, "condiId": cfg.Id, "params": vals, "updated": record.Vals[cfg.Id]})
// this.listenTask(uid, cfg.Id)
return
}
@ -107,12 +111,5 @@ func (this *ModelRtaskRecord) addUpdate(uid string, cfg *cfg.GameRdtaskCondiData
}
err = this.Change(uid, update)
}
// log.Debug("累计次数更新",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "condiId", Value: cfg.Id},
// log.Field{Key: "params", Value: vals},
// log.Field{Key: "updated", Value: record.Vals[cfg.Id]},
// )
return
}

View File

@ -240,10 +240,10 @@ type TaskParams struct {
// 任务条件达成通知
func (this *Sociaty) TaskcondNotify(uid, sociatyId string, condId int32) error {
log.Debug("公会任务",
log.Field{Key: "uid", Value: uid},
log.Field{Key: "sociatyId", Value: sociatyId},
log.Field{Key: "condId", Value: condId})
// log.Debug("公会任务",
// log.Field{Key: "uid", Value: uid},
// log.Field{Key: "sociatyId", Value: sociatyId},
// log.Field{Key: "condId", Value: condId})
dt := &pb.DBSociatyTask{}
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),