diff --git a/bin/json/game_rdtaskcondi.json b/bin/json/game_rdtaskcondi.json index 90c6b555d..c99e3fcd9 100644 --- a/bin/json/game_rdtaskcondi.json +++ b/bin/json/game_rdtaskcondi.json @@ -7431,7 +7431,7 @@ { "id": 700001, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_438", "text": "浇花1次" @@ -7448,7 +7448,7 @@ { "id": 700002, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_439", "text": "浇花2次" @@ -7465,7 +7465,7 @@ { "id": 700003, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_440", "text": "浇花3次" @@ -7482,7 +7482,7 @@ { "id": 700004, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_441", "text": "将初始英技能升级1次" @@ -7499,7 +7499,7 @@ { "id": 700005, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_442", "text": "将初始英技能升级5次" @@ -7516,7 +7516,7 @@ { "id": 700006, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_443", "text": "升级技能9次" @@ -7533,7 +7533,7 @@ { "id": 700007, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_444", "text": "将任意1个英雄能升满" @@ -7550,7 +7550,7 @@ { "id": 700008, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_445", "text": "升级技能15次" @@ -7567,7 +7567,7 @@ { "id": 700009, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_446", "text": "将任意4个英雄技能升满" @@ -7584,7 +7584,7 @@ { "id": 700010, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_447", "text": "觉醒副本3次" @@ -7601,7 +7601,7 @@ { "id": 700011, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_448", "text": "连续战斗10次" @@ -7618,7 +7618,7 @@ { "id": 700012, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_449", "text": "任意英雄觉醒3阶段" @@ -7635,7 +7635,7 @@ { "id": 700013, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_450", "text": "竞技场5胜" @@ -7652,7 +7652,7 @@ { "id": 700014, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_451", "text": "使用星象1次" @@ -7669,7 +7669,7 @@ { "id": 700015, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_452", "text": "使用好友助战人员1次" @@ -7686,7 +7686,7 @@ { "id": 700016, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_453", "text": "指定英雄(阿宝)觉醒4阶" @@ -7703,7 +7703,7 @@ { "id": 700017, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_454", "text": "A阵营1个英雄觉醒4阶" @@ -7720,7 +7720,7 @@ { "id": 700018, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_455", "text": "B阵营1个英雄觉醒4阶" @@ -7737,7 +7737,7 @@ { "id": 700019, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_456", "text": "C阵营1个英雄觉醒4阶" @@ -7754,7 +7754,7 @@ { "id": 700020, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_457", "text": "将任意3个英雄能升满" @@ -7771,7 +7771,7 @@ { "id": 700021, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_458", "text": "特殊商城金币10000" @@ -7788,7 +7788,7 @@ { "id": 700022, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_459", "text": "A阵营1个觉醒5阶" @@ -7805,7 +7805,7 @@ { "id": 700023, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_460", "text": "B阵营1个觉醒5阶" @@ -7822,7 +7822,7 @@ { "id": 700024, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_461", "text": "C阵营1个觉醒5阶" @@ -7839,7 +7839,7 @@ { "id": 700025, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_462", "text": "5星卡技能升满" @@ -7856,7 +7856,7 @@ { "id": 700026, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_463", "text": "维京远征boss1难度1" @@ -7873,7 +7873,7 @@ { "id": 700027, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_464", "text": "在戈伯处打造3件装备" @@ -7890,7 +7890,7 @@ { "id": 700028, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_465", "text": "在戈伯处打造6件装备" @@ -7907,7 +7907,7 @@ { "id": 700029, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_466", "text": "将炉温拉满1次" @@ -7924,7 +7924,7 @@ { "id": 700030, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_467", "text": "搜集图鉴3个" @@ -7941,7 +7941,7 @@ { "id": 700031, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_468", "text": "搜集图鉴6个" @@ -7958,7 +7958,7 @@ { "id": 700032, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_469", "text": "解锁1个新图纸" @@ -7975,7 +7975,7 @@ { "id": 700033, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_470", "text": "解锁4个新图纸" @@ -7992,7 +7992,7 @@ { "id": 700034, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_471", "text": "解锁6个新图纸" @@ -8009,7 +8009,7 @@ { "id": 700035, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_472", "text": "解锁2阶段装备1个图纸" @@ -8026,7 +8026,7 @@ { "id": 700036, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_473", "text": "解锁3阶段装备1个图纸" @@ -8043,7 +8043,7 @@ { "id": 700037, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_474", "text": "解锁5阶段装备1个图纸" @@ -8060,7 +8060,7 @@ { "id": 700038, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_475", "text": "10件3星装备" @@ -8077,7 +8077,7 @@ { "id": 700039, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_476", "text": "指定武器副本BOSS难度3" @@ -8094,7 +8094,7 @@ { "id": 700040, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_477", "text": "在装备副本使用好友助战1次" @@ -8111,7 +8111,7 @@ { "id": 700041, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_478", "text": "指定A套装强化6" @@ -8128,7 +8128,7 @@ { "id": 700042, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_479", "text": "指定B套装强化6" @@ -8145,7 +8145,7 @@ { "id": 700043, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_480", "text": "获得10件4星装备" @@ -8162,7 +8162,7 @@ { "id": 700044, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_481", "text": "指定武器副本BOSS难度6" @@ -8179,7 +8179,7 @@ { "id": 700045, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_482", "text": "指定饰品副本BOSS难度5" @@ -8196,7 +8196,7 @@ { "id": 700046, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_483", "text": "指定武器副本BOSS难度7" @@ -8213,7 +8213,7 @@ { "id": 700047, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_484", "text": "指定饰品副本BOSS难度6" @@ -8230,7 +8230,7 @@ { "id": 700048, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_485", "text": "12件5星装备" @@ -8247,7 +8247,7 @@ { "id": 700049, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_486", "text": "指定武器BOSS难度8" @@ -8264,7 +8264,7 @@ { "id": 700050, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_487", "text": "指定饰品BOSS难度7" @@ -8281,7 +8281,7 @@ { "id": 700052, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_488", "text": "3件6星装备" @@ -8298,7 +8298,7 @@ { "id": 700053, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_489", "text": "A装备副本难度9" @@ -8315,7 +8315,7 @@ { "id": 700054, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_490", "text": "B装备副本难度8" @@ -8332,7 +8332,7 @@ { "id": 700056, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_491", "text": "8件6星装备" @@ -8349,7 +8349,7 @@ { "id": 700057, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_492", "text": "A装备副本难度10" @@ -8366,7 +8366,7 @@ { "id": 700058, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_493", "text": "B装备副本难度9" @@ -8383,7 +8383,7 @@ { "id": 700060, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_494", "text": "15件6星装备" @@ -8400,7 +8400,7 @@ { "id": 700061, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_495", "text": "自动战斗装备副本难度5" @@ -8417,7 +8417,7 @@ { "id": 700062, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_496", "text": "自动战斗装备副本难度10" @@ -8434,7 +8434,7 @@ { "id": 700064, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_497", "text": "30件6星装备" @@ -8451,7 +8451,7 @@ { "id": 700065, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_498", "text": "解锁木桩1根" @@ -8468,7 +8468,7 @@ { "id": 700066, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_499", "text": "解锁木桩2根" @@ -8485,7 +8485,7 @@ { "id": 700067, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_500", "text": "解锁木桩3根" @@ -8502,7 +8502,7 @@ { "id": 700068, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_501", "text": "抵御踢馆2次" @@ -8519,7 +8519,7 @@ { "id": 700069, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_502", "text": "抵御踢馆4次" @@ -8536,7 +8536,7 @@ { "id": 700070, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_503", "text": "抵御踢馆6次" @@ -8553,7 +8553,7 @@ { "id": 700071, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_504", "text": "去好友武馆踢馆1次" @@ -8570,7 +8570,7 @@ { "id": 700072, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_505", "text": "使用好友武馆木桩1次" @@ -8587,7 +8587,7 @@ { "id": 700073, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_506", "text": "完成一次每日1健" @@ -8604,7 +8604,7 @@ { "id": 700074, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_507", "text": "完成一次每日3健" @@ -8621,7 +8621,7 @@ { "id": 700075, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_508", "text": "完成一次每日5健" @@ -8638,7 +8638,7 @@ { "id": 700076, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_509", "text": "经验副本难度2" @@ -8655,7 +8655,7 @@ { "id": 700077, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_510", "text": "经验副本难度3" @@ -8672,7 +8672,7 @@ { "id": 700078, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_511", "text": "5名25级英雄" @@ -8689,7 +8689,7 @@ { "id": 700079, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_512", "text": "5名40级英雄" @@ -8706,7 +8706,7 @@ { "id": 700080, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_513", "text": "5名50级英雄" @@ -8723,7 +8723,7 @@ { "id": 700081, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_514", "text": "武馆的派遣悬赏3次" @@ -8740,7 +8740,7 @@ { "id": 700082, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_515", "text": "武馆的派遣悬赏8次" @@ -8757,7 +8757,7 @@ { "id": 700083, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_516", "text": "经验副本难度4" @@ -8774,7 +8774,7 @@ { "id": 700084, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_517", "text": "经验副本难度5" @@ -8791,7 +8791,7 @@ { "id": 700085, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_518", "text": "武馆的派遣悬赏10次" @@ -8808,7 +8808,7 @@ { "id": 700086, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_519", "text": "经验副本难度6" @@ -8825,7 +8825,7 @@ { "id": 700087, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_520", "text": "10名50级英雄" @@ -8842,7 +8842,7 @@ { "id": 700088, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_521", "text": "经验副本难度7" @@ -8859,7 +8859,7 @@ { "id": 700089, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_522", "text": "经验副本难度8" @@ -8876,7 +8876,7 @@ { "id": 700090, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_523", "text": "经验副本难度9" @@ -8893,7 +8893,7 @@ { "id": 700091, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_524", "text": "经验副本难度10" @@ -8910,7 +8910,7 @@ { "id": 11187001, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_525", "text": "收集{0}个记忆碎片" @@ -8927,7 +8927,7 @@ { "id": 11187002, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_526", "text": "收集{0}个记忆碎片" @@ -8944,7 +8944,7 @@ { "id": 11187003, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_527", "text": "收集{0}个记忆碎片" @@ -8961,7 +8961,7 @@ { "id": 11187004, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_528", "text": "收集{0}个记忆碎片" @@ -8978,7 +8978,7 @@ { "id": 11187005, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_529", "text": "收集{0}个记忆碎片" @@ -8995,7 +8995,7 @@ { "id": 11187006, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_530", "text": "收集{0}个记忆碎片" @@ -9012,7 +9012,7 @@ { "id": 11187007, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_531", "text": "收集{0}个记忆碎片" @@ -9029,7 +9029,7 @@ { "id": 11187008, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_532", "text": "收集{0}个记忆碎片" @@ -9046,7 +9046,7 @@ { "id": 11187009, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_533", "text": "收集{0}个记忆碎片" @@ -9063,7 +9063,7 @@ { "id": 11187010, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_534", "text": "收集{0}个记忆碎片" @@ -9080,7 +9080,7 @@ { "id": 11187011, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_535", "text": "收集{0}个记忆碎片" @@ -9097,7 +9097,7 @@ { "id": 11187012, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_536", "text": "收集{0}个记忆碎片" @@ -9114,7 +9114,7 @@ { "id": 11187013, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_537", "text": "收集{0}个记忆碎片" @@ -9131,7 +9131,7 @@ { "id": 11187014, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_538", "text": "收集{0}个记忆碎片" @@ -9148,7 +9148,7 @@ { "id": 11187015, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_539", "text": "收集{0}个记忆碎片" @@ -9165,7 +9165,7 @@ { "id": 11187016, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_540", "text": "收集{0}个记忆碎片" @@ -9182,7 +9182,7 @@ { "id": 11187017, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_541", "text": "收集{0}个记忆碎片" @@ -9199,7 +9199,7 @@ { "id": 11187018, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_542", "text": "收集{0}个记忆碎片" @@ -9216,7 +9216,7 @@ { "id": 11187019, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_543", "text": "收集{0}个记忆碎片" @@ -9233,7 +9233,7 @@ { "id": 11187020, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_544", "text": "收集{0}个记忆碎片" @@ -9250,7 +9250,7 @@ { "id": 11187021, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_545", "text": "收集{0}个记忆碎片" @@ -9267,7 +9267,7 @@ { "id": 11187022, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_546", "text": "收集{0}个记忆碎片" @@ -9284,7 +9284,7 @@ { "id": 11187023, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_547", "text": "收集{0}个记忆碎片" @@ -9301,7 +9301,7 @@ { "id": 11187024, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_548", "text": "收集{0}个记忆碎片" @@ -9318,7 +9318,7 @@ { "id": 11187025, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_549", "text": "收集{0}个记忆碎片" @@ -9335,7 +9335,7 @@ { "id": 11187026, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_550", "text": "收集{0}个记忆碎片" @@ -9352,7 +9352,7 @@ { "id": 11187027, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_551", "text": "收集{0}个记忆碎片" @@ -9369,7 +9369,7 @@ { "id": 11187028, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_552", "text": "收集{0}个记忆碎片" @@ -9386,7 +9386,7 @@ { "id": 11187029, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_553", "text": "收集{0}个记忆碎片" @@ -9403,7 +9403,7 @@ { "id": 11187030, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_554", "text": "收集{0}个记忆碎片" @@ -9420,7 +9420,7 @@ { "id": 11187031, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_555", "text": "收集{0}个记忆碎片" @@ -9437,7 +9437,7 @@ { "id": 11187032, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_556", "text": "收集{0}个记忆碎片" @@ -9454,7 +9454,7 @@ { "id": 11187033, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_557", "text": "收集{0}个记忆碎片" @@ -9471,7 +9471,7 @@ { "id": 11187034, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_558", "text": "收集{0}个记忆碎片" @@ -9488,7 +9488,7 @@ { "id": 11187035, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_559", "text": "收集{0}个记忆碎片" @@ -9505,7 +9505,7 @@ { "id": 11187036, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_560", "text": "收集{0}个记忆碎片" @@ -9522,7 +9522,7 @@ { "id": 11187037, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_561", "text": "收集{0}个记忆碎片" @@ -9539,7 +9539,7 @@ { "id": 11187038, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_562", "text": "收集{0}个记忆碎片" @@ -9556,7 +9556,7 @@ { "id": 11187039, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_563", "text": "收集{0}个记忆碎片" @@ -9573,7 +9573,7 @@ { "id": 11187040, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_564", "text": "收集{0}个记忆碎片" @@ -9590,7 +9590,7 @@ { "id": 11187041, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_565", "text": "收集{0}个记忆碎片" @@ -9607,7 +9607,7 @@ { "id": 11187042, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_566", "text": "收集{0}个记忆碎片" @@ -9624,7 +9624,7 @@ { "id": 11187043, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_567", "text": "收集{0}个记忆碎片" @@ -9641,7 +9641,7 @@ { "id": 11187044, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_568", "text": "收集{0}个记忆碎片" @@ -9658,7 +9658,7 @@ { "id": 11187045, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_569", "text": "收集{0}个记忆碎片" @@ -9675,7 +9675,7 @@ { "id": 11187046, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_570", "text": "收集{0}个记忆碎片" @@ -9692,7 +9692,7 @@ { "id": 11187047, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_571", "text": "收集{0}个记忆碎片" @@ -9709,7 +9709,7 @@ { "id": 11187048, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_572", "text": "收集{0}个记忆碎片" @@ -9726,7 +9726,7 @@ { "id": 11187049, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_573", "text": "收集{0}个记忆碎片" @@ -9743,7 +9743,7 @@ { "id": 11187050, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_574", "text": "收集{0}个记忆碎片" @@ -9760,7 +9760,7 @@ { "id": 11187051, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_575", "text": "收集{0}个记忆碎片" @@ -9777,7 +9777,7 @@ { "id": 11187052, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_576", "text": "收集{0}个记忆碎片" @@ -9794,7 +9794,7 @@ { "id": 11187053, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_577", "text": "收集{0}个记忆碎片" @@ -9811,7 +9811,7 @@ { "id": 11187054, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_578", "text": "收集{0}个记忆碎片" @@ -9828,7 +9828,7 @@ { "id": 11187055, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_579", "text": "收集{0}个记忆碎片" @@ -9845,7 +9845,7 @@ { "id": 11187056, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_580", "text": "收集{0}个记忆碎片" @@ -9862,7 +9862,7 @@ { "id": 11187057, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_581", "text": "收集{0}个记忆碎片" @@ -9879,7 +9879,7 @@ { "id": 11187058, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_582", "text": "收集{0}个记忆碎片" @@ -9896,7 +9896,7 @@ { "id": 11187059, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_583", "text": "收集{0}个记忆碎片" @@ -9913,7 +9913,7 @@ { "id": 11187060, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_584", "text": "收集{0}个记忆碎片" @@ -9930,7 +9930,7 @@ { "id": 11187061, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_585", "text": "收集{0}个记忆碎片" @@ -9947,7 +9947,7 @@ { "id": 11187062, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_586", "text": "收集{0}个记忆碎片" @@ -9964,7 +9964,7 @@ { "id": 11187063, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_587", "text": "收集{0}个记忆碎片" @@ -9981,7 +9981,7 @@ { "id": 11187064, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_588", "text": "收集{0}个记忆碎片" @@ -9998,7 +9998,7 @@ { "id": 11187065, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_589", "text": "收集{0}个记忆碎片" @@ -10015,7 +10015,7 @@ { "id": 11187066, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_590", "text": "收集{0}个记忆碎片" @@ -10032,7 +10032,7 @@ { "id": 11187067, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_591", "text": "收集{0}个记忆碎片" @@ -10049,7 +10049,7 @@ { "id": 11187068, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_592", "text": "收集{0}个记忆碎片" @@ -10066,7 +10066,7 @@ { "id": 11187069, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_593", "text": "收集{0}个记忆碎片" @@ -10083,7 +10083,7 @@ { "id": 11187070, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_594", "text": "收集{0}个记忆碎片" @@ -10100,7 +10100,7 @@ { "id": 11187071, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_595", "text": "收集{0}个记忆碎片" @@ -10117,7 +10117,7 @@ { "id": 11187072, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_596", "text": "收集{0}个记忆碎片" @@ -10134,7 +10134,7 @@ { "id": 11187073, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_597", "text": "收集{0}个记忆碎片" @@ -10151,7 +10151,7 @@ { "id": 11187074, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_598", "text": "收集{0}个记忆碎片" @@ -10168,7 +10168,7 @@ { "id": 11187075, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_599", "text": "收集{0}个记忆碎片" @@ -10185,7 +10185,7 @@ { "id": 11187076, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_600", "text": "收集{0}个记忆碎片" @@ -10202,7 +10202,7 @@ { "id": 11187077, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_601", "text": "收集{0}个记忆碎片" @@ -10219,7 +10219,7 @@ { "id": 11187078, "data": 2, - "type_sp": 0, + "type_sp": 1, "tasktxt": { "key": "Localize_Localize_Program_tasktxt_602", "text": "收集{0}个记忆碎片" diff --git a/cmd/v2/ui/views/rtask_testview.go b/cmd/v2/ui/views/rtask_testview.go index fc80e3985..0a460ed68 100644 --- a/cmd/v2/ui/views/rtask_testview.go +++ b/cmd/v2/ui/views/rtask_testview.go @@ -118,7 +118,7 @@ func (this *RtaskTestView) CreateView(t *model.TestCase) fyne.CanvasObject { logrus.Error(err) return } - logrus.Debugf("执行任务 id:%v rtype:%v params:%v", condId, rtype, p) + // logrus.Debugf("执行任务 id:%v rtype:%v params:%v", condId, rtype, p) msgs = append(msgs, fmt.Sprintf("condId:%v rtype:%v params:%v", condId, rtype, p)) }(v.Id, v.Type, p) wg.Wait() @@ -202,9 +202,9 @@ func (this *RtaskTestView) rtestListener() { return } - if !rsp.Flag { - logrus.Debug(fmt.Sprintf("%v", rsp.Flag)) - } + // if !rsp.Flag { + logrus.Debug(fmt.Sprintf("%v - %v", rsp.RtaskType, rsp.Flag)) + // } } }, }) diff --git a/comm/const.go b/comm/const.go index 7622df6a4..6fc628b87 100644 --- a/comm/const.go +++ b/comm/const.go @@ -655,6 +655,7 @@ const ( Rtype184 TaskType = 184 //使用好友武馆木桩X次(接取任务后,每次使用好友的木桩训练英雄一次,进度便加一) Rtype185 TaskType = 185 //完成X次每日1健(接取任务后,每完成1次每日1健,便进度加一) Rtype186 TaskType = 186 + Rtype187 TaskType = 187 ) const ( diff --git a/comm/imodule.go b/comm/imodule.go index 4040a4204..e13c8592f 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -221,6 +221,8 @@ type ( IRtask interface { // 条件校验 CheckCondi(uid string, condiId int32) (code pb.ErrorCode) + // 多条件校验 + CheckCondis(uid string, condiIds ...int32) (condIds []int32) // 远程任务条件校验 RemoteCheckCondi(uid string, condiId int32, rsp *pb.DBRtaskRecord) error // 删除任务条件数据 diff --git a/modules/oldtimes/api_getall.go b/modules/oldtimes/api_getall.go index db62a64a6..4d8799668 100644 --- a/modules/oldtimes/api_getall.go +++ b/modules/oldtimes/api_getall.go @@ -16,6 +16,7 @@ func (this *apiComp) Getall(session comm.IUserSession, req *pb.OldtimesGetallReq rsp := &pb.OldtimesGetallResp{} d := this.module.modelOldtimes.getDBOldtimes(uid) + // 解锁的关卡 var unlockLevelIds []int32 // 更新关卡状态 if imodule, err := this.service.GetModule(comm.ModuleCombat); err == nil { @@ -36,6 +37,7 @@ func (this *apiComp) Getall(session comm.IUserSession, req *pb.OldtimesGetallReq if err := this.module.modelOldtimes.updateOldtimes(uid, d); err != nil { this.module.Error("oldtime更新失败", log.Field{Key: "uid", Value: uid}) + continue } unlockLevelIds = append(unlockLevelIds, level.Lid) } diff --git a/modules/rtask/api_tasktest.go b/modules/rtask/api_tasktest.go index 1bc507377..e65491109 100644 --- a/modules/rtask/api_tasktest.go +++ b/modules/rtask/api_tasktest.go @@ -2,11 +2,9 @@ package rtask import ( "go_dreamfactory/comm" - "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" "strings" - "github.com/pkg/errors" "github.com/spf13/cast" ) @@ -17,9 +15,9 @@ func (this *apiComp) RtestCheck(session comm.IUserSession, req *pb.RtaskTestReq) func (this *apiComp) Rtest(session comm.IUserSession, req *pb.RtaskTestReq) (code pb.ErrorCode, data *pb.ErrorData) { rsp := &pb.RtaskTestResp{Flag: true} if req.CondiId != 0 { - if err, ok := this.moduleRtask.modelRtask.checkCondi(session.GetUserId(), req.CondiId); !ok { + if code = this.moduleRtask.CheckCondi(session.GetUserId(), req.CondiId); code != pb.ErrorCode_Success { rsp.Flag = false - log.Errorf("%v", errors.WithMessage(err, session.GetUserId())) + return } } else if req.GroupId != 0 { // 获取当前玩家 @@ -53,6 +51,7 @@ func (this *apiComp) Rtest(session comm.IUserSession, req *pb.RtaskTestReq) (cod TT: comm.TaskType(req.RtaskType), Params: req.Params, }) + rsp.Flag = true } diff --git a/modules/rtask/condiFindHandle.go b/modules/rtask/condiFindHandle.go deleted file mode 100644 index 3930ee896..000000000 --- a/modules/rtask/condiFindHandle.go +++ /dev/null @@ -1,286 +0,0 @@ -package rtask - -import ( - cfg "go_dreamfactory/sys/configure/structs" - - "github.com/pkg/errors" -) - -func (this *ModelRtaskRecord) equalFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - //只查询参数于配置相等的情况下设置condiId,否则返回0 - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - condiId = cfg.Id - return -} - -func (this *ModelRtaskRecord) greatEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - condiId = cfg.Id - return -} - -// 传递参数小于等于配置参数 -// 适合只比较首个参数(一个参数) -func (this *ModelRtaskRecord) lessEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - condiId = cfg.Id - return -} - -// 与每个参数比较 -func (this *ModelRtaskRecord) equalParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - var ( - paramLen int - ) - if paramLen, err = lenParam(cfg, vals...); err != nil { - return - } - - switch paramLen { - case 1: - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 2: - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 3: - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 4: - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 5: - if ok, err1 := soEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soEqual(vals[4], cfg.Data5); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - default: - return - } - - condiId = cfg.Id - - return -} - -func (this *ModelRtaskRecord) greatThanParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - var ( - paramLen int - ) - if paramLen, err = lenParam(cfg, vals...); err != nil { - return - } - - switch paramLen { - case 1: - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 2: - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 3: - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 4: - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 5: - if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[4], cfg.Data5); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - default: - return - } - - condiId = cfg.Id - return -} - -// 需要累加更新的查询 -func (this *ModelRtaskRecord) lessThanParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { - var ( - paramLen int - ) - if paramLen, err = lenParam(cfg, vals...); err != nil { - return - } - - switch paramLen { - case 1: - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 2: - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 3: - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 4: - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - case 5: - if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - if ok, err1 := soGreatEqual(vals[4], cfg.Data5); !ok { - err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) - return - } - default: - return - } - - condiId = cfg.Id - return -} diff --git a/modules/rtask/model_record.go b/modules/rtask/model_record.go index 3d12536d6..b14d9aaaf 100644 --- a/modules/rtask/model_record.go +++ b/modules/rtask/model_record.go @@ -34,6 +34,7 @@ func (this *ModelRtaskRecord) Init(service core.IService, module core.IModule, c } // 获取玩家待校验数据 +// Deprecated func (this *ModelRtaskRecord) GetVerifyData(uid string, condiId int32) (*pb.RtaskData, error) { record := &pb.DBRtaskRecord{} err := this.Get(uid, record) diff --git a/modules/rtask/model_rtask.go b/modules/rtask/model_rtask.go index eaf4b0f37..dce63268e 100644 --- a/modules/rtask/model_rtask.go +++ b/modules/rtask/model_rtask.go @@ -72,7 +72,7 @@ func (this *ModelRtask) GetRtask(uid string) *pb.DBRtask { // } // 确定选项前的校验 -func (this *ModelRtask) checkCondi(uid string, condiId int32) (err error, ok bool) { +func (this *ModelRtask) checkCondi(uid string, condiId int32, record *pb.DBRtaskRecord) (err error, ok bool) { if condiId <= 0 { return nil, true } @@ -110,7 +110,7 @@ func (this *ModelRtask) checkCondi(uid string, condiId int32) (err error, ok boo return } - if ok, err = condi.verify(uid, conf); !ok { + if ok, err = condi.verify(uid, record, conf); !ok { err = errors.WithMessagef(err, "uid: %v do rtask [condiId:%v] condition not reach", uid, condiId) return } diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 675279266..a9bb15ae1 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -24,14 +24,14 @@ var _ comm.IRtask = (*ModuleRtask)(nil) // 限定条件 type rtaskCondHandle struct { - condId int32 //任务条件配置ID - verify verifyHandle //校验任务条件 - find condiFindHandle //检索任务条件 + condId int32 //任务条件配置ID + verify verifyHandle //校验任务条件 update updateDataHandle //更新任务数据 } -type verifyHandle func(uid string, cfg *cfg.GameRdtaskCondiData) (bool, error) -type condiFindHandle func(cfg *cfg.GameRdtaskCondiData, vals ...int32) (int32, error) +// 任务参数校验 +type verifyHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (bool, error) +// 任务数据更新 type updateDataHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData, vals ...int32) error type ModuleRtask struct { @@ -75,193 +75,117 @@ func (this *ModuleRtask) registerVerifyHandle(condiId int32, condi *rtaskCondHan this.handleMap.Store(condiId, condi) } -func (this *ModuleRtask) getHandle(tt comm.TaskType) (condis []*rtaskCondHandle) { +func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle) { for _, v := range this.configure.getRtaskCondis(int32(tt)) { switch tt { case comm.Rtype1: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.equalFirstParam, - verify: this.modelRtask.verfiyRtype1, + verify: this.modelRtaskRecord.verifyGreatEqual, update: this.modelRtaskRecord.addUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) - case comm.Rtype2: - condi := &rtaskCondHandle{ - condId: v.Id, - find: this.modelRtaskRecord.equalFirstParam, - verify: this.modelRtask.verifyRtype2, - update: this.modelRtaskRecord.overrideUpdate, - } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype3: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ 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 := &rtaskCondHandle{ + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) + case comm.Rtype4, comm.Rtype5, comm.Rtype6, comm.Rtype8, comm.Rtype10: + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.equalFirstParam, - verify: this.modelRtask.verifyRtype4, + verify: this.modelRtaskRecord.verifyGreatEqual, update: this.modelRtaskRecord.overrideUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) - case comm.Rtype5: - condi := &rtaskCondHandle{ - 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 := &rtaskCondHandle{ - 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 := &rtaskCondHandle{ - condId: v.Id, - find: this.modelRtaskRecord.equalFirstParam, - verify: this.modelRtask.verfiyRtype8, - update: this.modelRtaskRecord.overrideUpdate, - } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype9: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ 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 := &rtaskCondHandle{ - 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 := &rtaskCondHandle{ - condId: v.Id, - find: this.modelRtaskRecord.lessEqualFirstParam, - verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, - update: this.modelRtaskRecord.overrideUpdate, - } - - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype18: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.greatEqualFirstParam, verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, update: this.modelRtaskRecord.addUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) 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.Rtype51, comm.Rtype53, - comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60, - comm.Rtype62, comm.Rtype64, comm.Rtype69, comm.Rtype72, comm.Rtype88, comm.Rtype104, + comm.Rtype54, comm.Rtype57, comm.Rtype60, + comm.Rtype62, comm.Rtype64, 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, - comm.Rtype171, comm.Rtype186: - condi := &rtaskCondHandle{ + comm.Rtype171, comm.Rtype186, comm.Rtype187: + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.lessEqualFirstParam, verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, update: this.modelRtaskRecord.addUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype50, comm.Rtype73: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.lessEqualFirstParam, - verify: this.modelRtaskRecord.verifyFromDb, + verify: this.modelRtaskRecord.verifyGreatEqual, update: this.modelRtaskRecord.addUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype20: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ 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 := &rtaskCondHandle{ + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) + case comm.Rtype109: + handle := &rtaskCondHandle{ 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 := &rtaskCondHandle{ - condId: v.Id, - find: this.modelRtaskRecord.equalFirstParam, - verify: this.modelRtask.verifyRtype63, - update: this.modelRtaskRecord.addUpdate, - } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) case comm.Rtype16, comm.Rtype17, - comm.Rtype35, comm.Rtype44, - comm.Rtype59, comm.Rtype61: - condi := &rtaskCondHandle{ + comm.Rtype35, comm.Rtype61: + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.equalParams, - verify: this.modelRtaskRecord.verifyFromDb, + verify: this.modelRtaskRecord.verifyGreatEqual, update: this.modelRtaskRecord.overrideUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) - case comm.Rtype23, comm.Rtype25, comm.Rtype29, comm.Rtype30, comm.Rtype31, + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) + case comm.Rtype23, comm.Rtype25, comm.Rtype30, 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.Rtype42, comm.Rtype43, + comm.Rtype46, comm.Rtype47, comm.Rtype52, comm.Rtype55, comm.Rtype56, comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140: - condi := &rtaskCondHandle{ + handle := &rtaskCondHandle{ condId: v.Id, - find: this.modelRtaskRecord.lessThanParams, - verify: this.modelRtaskRecord.verifyFromDb, + verify: this.modelRtaskRecord.verifyGreatEqual, update: this.modelRtaskRecord.addUpdate, } - condis = append(condis, condi) - this.registerVerifyHandle(v.Id, condi) + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) default: - log.Warnf("rtaskType[%v] not register", tt) + log.Warnf("rtaskType[%v] handle not register", tt) } } return @@ -410,10 +334,30 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam) // 任务条件校验 func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCode) { - // this.Debug("检查任务条件", log.Field{Key: "uid", Value: uid}, log.Field{Key: "condiId", Value: condiId}) - if _, ok := this.modelRtask.checkCondi(uid, condiId); !ok { - code = pb.ErrorCode_RtaskCondiNoReach + record := this.modelRtaskRecord.getRecord(uid) + if record == nil { + code = pb.ErrorCode_DataNotFound + return } + if _, ok := this.modelRtask.checkCondi(uid, condiId, record); !ok { + code = pb.ErrorCode_RtaskCondiNoReach + return + } + return +} + +func (this *ModuleRtask) CheckCondis(uid string, condiIds ...int32) (condIds []int32) { + record := this.modelRtaskRecord.getRecord(uid) + if record == nil { + return + } + + for _, condId := range condIds { + if _, ok := this.modelRtask.checkCondi(uid, condId, record); ok { + condIds = append(condIds, condId) + } + } + return } diff --git a/modules/rtask/verifyHandle.go b/modules/rtask/verifyHandle.go index f6762f294..70dd5a5b7 100644 --- a/modules/rtask/verifyHandle.go +++ b/modules/rtask/verifyHandle.go @@ -11,99 +11,103 @@ import ( "github.com/spf13/cast" ) -func (this *ModelRtaskRecord) verifyFromDb(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { - var rd *pb.RtaskData - if rd, err = this.GetVerifyData(uid, cfg.Id); rd != nil { - if len(rd.Data) == 0 { - err = errors.WithMessagef(err, "玩家参数数据缺失 %v", rd.Data) +// GreatEqual +func (this *ModelRtaskRecord) verifyGreatEqual(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { + if record == nil { + err = errors.WithMessagef(err, "玩家数据DBRtaskRecord空") + return + } + + if v, f := record.Vals[cfg.Id]; f { + if len(v.Data) == 0 { + err = errors.WithMessagef(err, "玩家参数数据缺失 %v", v.Data) return } var paramLen int - if paramLen, err = lenParam(cfg, toArr(rd.Data)...); err == nil { + if paramLen, err = lenParam(cfg, toArr(v.Data)...); err == nil { //参数比较,默认第一个参数soGreateEqual,其它soEqual switch paramLen { case 1: - return soGreatEqual(rd.Data[0], cfg.Data1) + return soGreatEqual(v.Data[0], cfg.Data1) case 2: - if ok, err = soGreatEqual(rd.Data[0], cfg.Data1); !ok { + if ok, err = soGreatEqual(v.Data[0], cfg.Data1); !ok { return } - if ok, err = soEqual(rd.Data[1], cfg.Data2); !ok { + if ok, err = soEqual(v.Data[1], cfg.Data2); !ok { return } case 3: - if ok, err = soGreatEqual(rd.Data[0], cfg.Data1); !ok { + if ok, err = soGreatEqual(v.Data[0], cfg.Data1); !ok { return } - if ok, err = soEqual(rd.Data[1], cfg.Data2); !ok { + if ok, err = soEqual(v.Data[1], cfg.Data2); !ok { return } - if ok, err = soEqual(rd.Data[2], cfg.Data3); !ok { + if ok, err = soEqual(v.Data[2], cfg.Data3); !ok { return } case 4: - if ok, err = soGreatEqual(rd.Data[0], cfg.Data1); !ok { + if ok, err = soGreatEqual(v.Data[0], cfg.Data1); !ok { return } - if ok, err = soEqual(rd.Data[1], cfg.Data2); !ok { + if ok, err = soEqual(v.Data[1], cfg.Data2); !ok { return } - if ok, err = soEqual(rd.Data[2], cfg.Data3); !ok { + if ok, err = soEqual(v.Data[2], cfg.Data3); !ok { return } - if ok, err = soEqual(rd.Data[3], cfg.Data4); !ok { + if ok, err = soEqual(v.Data[3], cfg.Data4); !ok { return } case 5: - if ok, err = soGreatEqual(rd.Data[0], cfg.Data1); !ok { + if ok, err = soGreatEqual(v.Data[0], cfg.Data1); !ok { return } - if ok, err = soEqual(rd.Data[1], cfg.Data2); !ok { + if ok, err = soEqual(v.Data[1], cfg.Data2); !ok { return } - if ok, err = soEqual(rd.Data[2], cfg.Data3); !ok { + if ok, err = soEqual(v.Data[2], cfg.Data3); !ok { return } - if ok, err = soEqual(rd.Data[3], cfg.Data4); !ok { + if ok, err = soEqual(v.Data[3], cfg.Data4); !ok { return } - if ok, err = soEqual(rd.Data[4], cfg.Data5); !ok { + if ok, err = soEqual(v.Data[4], cfg.Data5); !ok { return } } } } + return } -func (this *ModelRtaskRecord) verifyFirstEqualParam(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { - var rd *pb.RtaskData - if rd, err = this.GetVerifyData(uid, cfg.Id); rd != nil { - if len(rd.Data) == 0 { - err = errors.WithMessagef(err, "玩家参数数据缺失 %v", rd.Data) +func (this *ModelRtaskRecord) verifyFirstEqualParam(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { + if v, f := record.Vals[cfg.Id]; f { + if len(v.Data) == 0 { + err = errors.WithMessagef(err, "玩家参数数据缺失 %v", v.Data) return } - - return soEqual(rd.Data[0], cfg.Data1) + return soEqual(v.Data[0], cfg.Data1) } + return } -func (this *ModelRtaskRecord) verifyFirstGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { - var rd *pb.RtaskData - if rd, err = this.GetVerifyData(uid, cfg.Id); rd != nil { - if len(rd.Data) == 0 { - err = errors.WithMessagef(err, "玩家参数数据缺失 %v", rd.Data) +func (this *ModelRtaskRecord) verifyFirstGreatEqualParam(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { + if v, f := record.Vals[cfg.Id]; f { + if len(v.Data) == 0 { + err = errors.WithMessagef(err, "玩家参数数据缺失 %v", v.Data) return } - - return soGreatEqual(rd.Data[0], cfg.Data1) + return soGreatEqual(v.Data[0], cfg.Data1) } + return } // 英雄指定 -func (this *ModelRtask) verfiyRtype1(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verfiyRtype1(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { heroModule, err := this.service.GetModule(comm.ModuleHero) if err != nil { return false, err @@ -121,7 +125,8 @@ func (this *ModelRtask) verfiyRtype1(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 剧情 -func (this *ModelRtask) verifyRtype2(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +// Deprecated +func (this *ModelRtask) verifyRtype2(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleMline) if err != nil { return @@ -135,7 +140,7 @@ func (this *ModelRtask) verifyRtype2(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 每日任务 -func (this *ModelRtask) verifyRtype3(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype3(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleTask) if err != nil { return @@ -153,7 +158,7 @@ func (this *ModelRtask) verifyRtype3(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 指定英雄等级 -func (this *ModelRtask) verifyRtype4(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype4(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleHero) if err != nil { return @@ -180,7 +185,7 @@ func (this *ModelRtask) verifyRtype4(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 指定英雄的指定装备数量 -func (this *ModelRtask) verifyRtype5(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype5(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleHero) if err != nil { return @@ -217,7 +222,7 @@ func (this *ModelRtask) verifyRtype5(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 指定英雄星级 -func (this *ModelRtask) verifyRtype6(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype6(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleHero) if err != nil { return @@ -243,7 +248,7 @@ func (this *ModelRtask) verifyRtype6(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 日常登录一次 -func (this *ModelRtask) verfiyRtype7(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verfiyRtype7(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { userModule, err := this.service.GetModule(comm.ModuleUser) if err != nil { return @@ -258,7 +263,7 @@ func (this *ModelRtask) verfiyRtype7(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 累计登陆xx天 -func (this *ModelRtask) verfiyRtype8(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verfiyRtype8(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { userModule, err := this.service.GetModule(comm.ModuleUser) if err != nil { return @@ -274,8 +279,8 @@ func (this *ModelRtask) verfiyRtype8(uid string, cfg *cfg.GameRdtaskCondiData) ( return } -// 连续登陆xx天 -func (this *ModelRtask) verfiyRtype9(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +// 连续登陆xx天 未埋点的处理方法 +func (this *ModelRtask) verfiyRtype9(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { userModule, err := this.service.GetModule(comm.ModuleUser) if err != nil { return @@ -292,7 +297,7 @@ func (this *ModelRtask) verfiyRtype9(uid string, cfg *cfg.GameRdtaskCondiData) ( } // 拥有xx个好友 -func (this *ModelRtask) verfiyRtype10(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verfiyRtype10(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { m, err := this.service.GetModule(comm.ModuleFriend) if err != nil { return @@ -306,7 +311,7 @@ func (this *ModelRtask) verfiyRtype10(uid string, cfg *cfg.GameRdtaskCondiData) } // 用户等级达到xx级 -func (this *ModelRtask) verifyRtype20(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype20(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { userModule, err := this.service.GetModule(comm.ModuleUser) if err != nil { return @@ -321,7 +326,7 @@ func (this *ModelRtask) verifyRtype20(uid string, cfg *cfg.GameRdtaskCondiData) } // 日常任务活跃度达到xx -func (this *ModelRtask) verifyRtype63(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { +func (this *ModelRtask) verifyRtype63(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { userModule, err := this.service.GetModule(comm.ModuleUser) if err != nil { return diff --git a/modules/rtask/verify_test.go b/modules/rtask/verify_test.go deleted file mode 100644 index 0ae12830f..000000000 --- a/modules/rtask/verify_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package rtask - -import ( - "fmt" - "go_dreamfactory/pb" - cfg "go_dreamfactory/sys/configure/structs" - "reflect" - "testing" - - "github.com/agiledragon/gomonkey/v2" - . "github.com/smartystreets/goconvey/convey" -) - -var vals []int32 //通过接口传入的参数组 -var conf *cfg.GameRdtaskCondiData - -func TestVerify(t *testing.T) { - Convey("校验处理器测试", t, func() { - - Convey("校验接口参数组", func() { - patches := gomonkey.ApplyGlobalVar(&conf, &cfg.GameRdtaskCondiData{ - Id: 101, - Type: 1, - Data1: 25001, - }) - defer patches.Reset() - - patches2 := gomonkey.ApplyGlobalVar(&vals, []int32{25002}) - defer patches2.Reset() - - n, err := lenParam(conf, vals...) - fmt.Println(n, err) - }) - - }) -} - -func TestVerify2(t *testing.T) { - Convey("校验处理测试", t, func() { - Convey("rtype1", func() { - var r *ModelRtask - // 修改 - patches := gomonkey.ApplyMethod(reflect.TypeOf(r), "GetVerifyData", func(_ *ModelRtask, uid string, condiId int32) (*pb.RtaskData, error) { - return &pb.RtaskData{ - Data: map[int32]int32{0: 25001}, - }, nil - }) - defer patches.Reset() - - // - rtask := &ModelRtaskRecord{} - conf := &cfg.GameRdtaskCondiData{ - Id: 101, - Type: 1, - Data1: 25001, - } - err, ok := rtask.verifyFromDb("11", conf) - So(err, ShouldEqual, nil) - So(ok, ShouldEqual, true) - - //模拟接口参数传入 - patches3 := gomonkey.ApplyGlobalVar(&vals, []int32{25001}) - defer patches3.Reset() - - condiId, _ := rtask.equalParams(conf, vals...) - So(condiId, ShouldEqual, 101) - - }) - }) - -} diff --git a/modules/user/api_login.go b/modules/user/api_login.go index 2527b474a..313cead61 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -141,7 +141,6 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod this.module.RecoverUserPsStart(user.Uid) // 日常登录任务 - // this.module.ModuleRtask.SendToRtask(session, comm.Rtype8, 1) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype8, 1)) this.module.ModulePrivilege.CheckDailyPrivilegeMail(session) diff --git a/modules/user/module.go b/modules/user/module.go index 9dc6db3ca..bce523609 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -951,7 +951,7 @@ func (this *User) BingoSetUserVipLv(session comm.IUserSession, lv int32) error { return nil } -//添加用户皮肤数据 +// 添加用户皮肤数据 func (this *User) AddPer(session comm.IUserSession, pers map[string]int32, bPush bool) (code pb.ErrorCode) { var ( err error diff --git a/pb/rtask_msg.pb.go b/pb/rtask_msg.pb.go index c171aea5c..0de9ad904 100644 --- a/pb/rtask_msg.pb.go +++ b/pb/rtask_msg.pb.go @@ -105,8 +105,9 @@ type RtaskTestResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag"` - RtaskIds []int32 `protobuf:"varint,2,rep,packed,name=rtaskIds,proto3" json:"rtaskIds"` + Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag"` + RtaskIds []int32 `protobuf:"varint,2,rep,packed,name=rtaskIds,proto3" json:"rtaskIds"` + RtaskType int32 `protobuf:"varint,3,opt,name=rtaskType,proto3" json:"rtaskType"` } func (x *RtaskTestResp) Reset() { @@ -155,6 +156,13 @@ func (x *RtaskTestResp) GetRtaskIds() []int32 { return nil } +func (x *RtaskTestResp) GetRtaskType() int32 { + if x != nil { + return x.RtaskType + } + return 0 +} + var File_rtask_rtask_msg_proto protoreflect.FileDescriptor var file_rtask_rtask_msg_proto_rawDesc = []byte{ @@ -168,12 +176,14 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{ 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x3f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x5d, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (