Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
xcy 2023-12-18 18:35:44 +08:00
commit 20bb0c9478
23 changed files with 539 additions and 63 deletions

View File

@ -120,7 +120,13 @@ export default async function (call: ApiCall<ReqBingo, ResBingo>) {
}
} else if (shell[0] == 'heroMaxLv') {
let heros = await G.redis.get('hero', call.uid);
//let heros = await G.redis.get('hero', call.uid);
let s = await G.mongodb.collection('hero').find({
uid: call.uid
}).toArray();
let heros = s.map(h => G.mongodb.conversionIdObj(h));
for (let [_id, hero] of Object.entries(heros)) {
await HeroFun.changeHeroAttr(call, hero, {
lv: Object.keys(G.gc.playerLv).length * 3,

View File

@ -3,6 +3,7 @@ import {EventFun} from '../public/event/event';
import {PayFun} from '../public/pay';
import {ReqSyncBtn, ResSyncBtn, syncBtnKeys} from "../shared/protocols/PtlSyncBtn";
import {PublicShared} from '../shared/public/public';
import {HuoDongFun} from "../public/huodongfun";
const defaultKeys: syncBtnKeys[] = [
'huobanzhaomu', 'yibaichou', 'shouchong',
@ -10,7 +11,8 @@ const defaultKeys: syncBtnKeys[] = [
'zhanling',
'xianshilibao',
'xianshizhaomu',
'G123Gift'
'G123Gift',
'christmas',
// 'kaifukuanghuan',
// 'qiridenglu',
@ -36,6 +38,17 @@ export default async function (call: ApiCall<ReqSyncBtn, ResSyncBtn>) {
change[key] = data[key];
}
break;
case 'christmas':
//领完消失
if (!data[key]) {
let _hdList = await HuoDongFun.gethdList(call, 8)
if (_hdList) {
// 无此活动
data[key] = {active: true};
change[key] = data[key];
}
}
break;
case 'dayjijin':
case 'dengjijijin':
case 'guanqiajijin':

View File

@ -24,8 +24,10 @@ export default async function (call: ApiCall<ReqGame, ResGame>) {
_mydata["val"] += addval
_mydata["gamenum"] += 1
_setData["val"] = _mydata.val
_setData["game"] = _mydata["gamenum"]
_setData["gamenum"] = _mydata["gamenum"]
await Christmasfun.setMyData(call.uid, call.req.hdid, { $set: _setData})
// 监听任务
G.emit("Class_task_154", 'Class_task_154', call, 1, 0);
let changedata = { mydata: _mydata}
// 推送红点
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);

View File

@ -39,7 +39,7 @@ export default async function (call: ApiCall<ReqChangePos, ResChangePos>) {
}
} else if (call.req.state == 'change') {
if (heroPos[call.req.pos]) {
let unLoadHero = await G.redis.get('hero', call.uid, heroPos[call.req.pos]);
let unLoadHero = await HeroFun.getHero(call, heroPos[call.req.pos]);
unLoadHero && fightHeros.removeOne(id => id == unLoadHero.heroId);
}
if (fightHeros.includes(hero.heroId.toString())) return call.errorCode(-2);

View File

@ -4,7 +4,7 @@ import { ReqGetList, ResGetList } from "../../shared/protocols/hero/PtlGetList";
export default async function (call: ApiCall<ReqGetList, ResGetList>) {
let list: ResGetList['list'] = {};
let kvList: k_v<RedisCollections2['hero']> = {};
//let kvList: k_v<RedisCollections2['hero']> = {};
let arrList = await G.mongodb.collection('hero').find({ uid: call.uid }).toArray();
let heroCon = G.gc.hero;
@ -12,7 +12,7 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
let maxherolv = 0;
arrList.forEach(v => {
let d = G.mongodb.conversionIdObj(v);
kvList[G.formatRedisKey(d._id)] = d;
//kvList[G.formatRedisKey(d._id)] = d;
list[d._id] = d;
if (v.lv > maxherolv) maxherolv = v.lv;
@ -23,7 +23,7 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({ uid: call.conn.uid, type: 'usertasklog' },
{ $set: { maxherolv: maxherolv, herocolor: color } }, { upsert: true });
G.redis.set('hero', call.uid, kvList);
//G.redis.set('hero', call.uid, kvList);
let recLshd = await G.mongodb.collection('playerInfo', 'lshd_hero').findOne({ uid: call.conn.uid, type: 'lshd_hero' });
let { uid, _id, type, ...heros } = (recLshd || {});

View File

@ -39,7 +39,7 @@ export default async function (call: ApiCall<ReqJinJie, ResJinJie, ServiceType>)
let selectHeros: ResGetList['list'][''][] = [];
for (let _id of call.req.idArr) {
let _hero = await G.redis.get('hero', call.uid, _id);
let _hero = await HeroFun.getHero(call, _id);
if (!_hero) return call.error(globalThis.lng.hero_1);
selectHeros.push(_hero);
}

View File

@ -42,6 +42,12 @@ export default async function (call: ApiCall<ReqAllFinsh, ResAllFinsh>) {
// 设置数据
await TaskFun.setTask(call.uid, { type: _type, taskid: { $in: _finishTaks } }, { finish: 1 })
let prize = await PlayerFun.sendPrize(call, _prize)
// 是否是每日任务奖励最终宝箱
if (_type == 4 && 25 in _finishTaks){
// 监听任务
G.emit("Class_task_155", 'Class_task_155', call, 1, 0);
}
let data = {
finishtask: _finishTaks,

View File

@ -44,6 +44,11 @@ export default async function (call: ApiCall<ReqFinsh, ResFinsh>) {
}
// 设置数据
await TaskFun.setTask(call.uid, {taskid: taskid}, {finish: 1})
// 是否是每日任务奖励最终宝箱
if (_task["type"] == 4 && 25 == taskid){
// 监听任务
G.emit("Class_task_155", 'Class_task_155', call, 1, 0);
}
let _prize = await PlayerFun.sendPrize(call, _con["prize"])
_task["finish"] = 1

View File

@ -140,6 +140,10 @@ export type gEventType = {
Class_task_152: (eventname, call, val, chkVal) => void;
/**合成x次装备 */
Class_task_153: (eventname, call, val, chkVal) => void;
/**参与圣诞活动小游戏 */
Class_task_154: (eventname, call, val, chkVal) => void;
/**每日任务宝箱领取 */
Class_task_155: (eventname, call, val, chkVal) => void;
};
export function addListener() {

View File

@ -0,0 +1,62 @@
{
"1": {
"id": 1,
"jieji": 0,
"ewai_buff": 0
},
"2": {
"id": 2,
"jieji": 1,
"ewai_buff": 0
},
"3": {
"id": 3,
"jieji": 2,
"ewai_buff": 0
},
"4": {
"id": 4,
"jieji": 3,
"ewai_buff": 0
},
"5": {
"id": 5,
"jieji": 4,
"ewai_buff": 0.4
},
"6": {
"id": 6,
"jieji": 5,
"ewai_buff": 0.5
},
"7": {
"id": 7,
"jieji": 6,
"ewai_buff": 0.6
},
"8": {
"id": 8,
"jieji": 7,
"ewai_buff": 0.8
},
"9": {
"id": 9,
"jieji": 8,
"ewai_buff": 1
},
"10": {
"id": 10,
"jieji": 9,
"ewai_buff": 1.2
},
"11": {
"id": 11,
"jieji": 10,
"ewai_buff": 1.4
},
"12": {
"id": 12,
"jieji": 11,
"ewai_buff": 1.8
}
}

View File

@ -3332,17 +3332,17 @@
//玩游戏需要消耗
"gameneed": [{"a": "attr", "t":"jinbi", "n": 1}],
//玩游戏拿分
"game": [0,1,2,3,4,5],
"game": [5,10,20,30,50],
//战令
"zhanling":[
{
"val": 1,
"pt": [{"a": "attr", "t":"jinbi", "n": 1}],
"gj": [{"a": "attr", "t":"jinbi", "n": 1}]
"val": 2500,
"pt": [{"a": "item", "t":"1", "n": 200000}],
"gj": [{"a": "item", "t":"50101", "n": 1},{"a": "item", "t":"1", "n": 500000}]
},
{
"val": 2,
"pt": [{"a": "attr", "t":"jinbi", "n": 1}],
"pt": [{"a": "attr", "t":"rmbmoney", "n": 500}],
"gj": [{"a": "attr", "t":"jinbi", "n": 1}]
},
{
@ -3351,6 +3351,7 @@
"gj": [{"a": "attr", "t":"jinbi", "n": 1}]
}
],
//战令PayID
"zlpayid":"ycmb_1_1",
//活动礼包
"libao": {
@ -3475,6 +3476,7 @@
intr: "czlbtips_1",
intr: "czlbtips_2",
//礼包
//礼包
gift: [
{
id: '1',
@ -3483,7 +3485,10 @@
free: false,
payId: 'czlb_1',
buyNum: 1,
prize: [{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600}]
prize:{"1":[{'a': 'item', 't': '13', 'n': 600}],
"2":[{'a': 'item', 't': '13', 'n': 600}],
"3":[{'a': 'item', 't': '13', 'n': 600}]
}
},
{
id: '2',
@ -3492,7 +3497,10 @@
free: false,
payId: 'czlb_2',
buyNum: 1,
prize: [{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600}]
prize: {"1":[{'a': 'item', 't': '13', 'n': 600}],
"2":[{'a': 'item', 't': '13', 'n': 600}],
"3":[{'a': 'item', 't': '13', 'n': 600}]
}
},
{
id: '3',
@ -3501,7 +3509,10 @@
free: false,
payId: 'czlb_3',
buyNum: 1,
prize: [{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600},{'a': 'item', 't': '13', 'n': 600}]
prize: {"1":[{'a': 'item', 't': '13', 'n': 600}],
"2":[{'a': 'item', 't': '13', 'n': 600}],
"3":[{'a': 'item', 't': '13', 'n': 600}]
}
}
]
}

View File

@ -4183,7 +4183,33 @@
"n": 60
}
],
"prize": [],
"prize": [
{
"a": "hero",
"t": "4002",
"n": 1
},
{
"a": "attr",
"t": "rmbmoney",
"n": 120
},
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 50000
},
{
"a": "attr",
"t": "jinbi",
"n": 100000
}
],
"firstPayPrize": [],
"name": "pay_name_shouchong_1",
"undefined": "首充礼包_6",
@ -4203,7 +4229,33 @@
"n": 300
}
],
"prize": [],
"prize": [
{
"a": "hero",
"t": "5001",
"n": 1
},
{
"a": "attr",
"t": "rmbmoney",
"n": 600
},
{
"a": "item",
"t": "12",
"n": 1500
},
{
"a": "item",
"t": "1",
"n": 300000
},
{
"a": "attr",
"t": "jinbi",
"n": 300000
}
],
"firstPayPrize": [],
"name": "pay_name_shouchong_2",
"undefined": "首充礼包_30",
@ -4223,7 +4275,33 @@
"n": 980
}
],
"prize": [],
"prize": [
{
"a": "hero",
"t": "5001",
"n": 1
},
{
"a": "equip",
"t": "1009",
"n": 1
},
{
"a": "equip",
"t": "2009",
"n": 1
},
{
"a": "equip",
"t": "3009",
"n": 1
},
{
"a": "equip",
"t": "4009",
"n": 1
}
],
"firstPayPrize": [],
"name": "pay_name_shouchong_3",
"undefined": "首充礼包_98",
@ -4243,7 +4321,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 200000},{a: 'item', t: '1', n: 100000},{a: 'item', t: '4', n: 5}]",
"prize": [
{
"a": "item",
"t": "4",
"n": 5
},
{
"a": "item",
"t": "1",
"n": 100000
},
{
"a": "attr",
"t": "jinbi",
"n": 200000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_1",
"undefined": "积天礼包_6",
@ -4263,7 +4357,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 400000},{a: 'item', t: '1', n: 200000},{a: 'item', t: '607', n: 20}]",
"prize": [
{
"a": "item",
"t": "607",
"n": 20
},
{
"a": "item",
"t": "1",
"n": 200000
},
{
"a": "attr",
"t": "jinbi",
"n": 400000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_2",
"undefined": "积天礼包_6",
@ -4283,7 +4393,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 600000},{a: 'item', t: '1', n: 300000},{a: 'item', t: '4', n: 10}]",
"prize": [
{
"a": "item",
"t": "4",
"n": 10
},
{
"a": "item",
"t": "1",
"n": 300000
},
{
"a": "attr",
"t": "jinbi",
"n": 600000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_3",
"undefined": "积天礼包_6",
@ -4303,7 +4429,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 800000},{a: 'item', t: '1', n: 400000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 400000
},
{
"a": "attr",
"t": "jinbi",
"n": 800000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_4",
"undefined": "积天礼包_6",
@ -4323,7 +4465,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 1000000},{a: 'item', t: '1', n: 500000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 500000
},
{
"a": "attr",
"t": "jinbi",
"n": 1000000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_5",
"undefined": "积天礼包_6",
@ -4343,7 +4501,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 1200000},{a: 'item', t: '1', n: 600000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 600000
},
{
"a": "attr",
"t": "jinbi",
"n": 1200000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_6",
"undefined": "积天礼包_6",
@ -4363,7 +4537,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 1400000},{a: 'item', t: '1', n: 700000},{a: 'item', t: '600', n: 20}]",
"prize": [
{
"a": "item",
"t": "600",
"n": 20
},
{
"a": "item",
"t": "1",
"n": 700000
},
{
"a": "attr",
"t": "jinbi",
"n": 1400000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_7",
"undefined": "积天礼包_6",
@ -4383,7 +4573,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 1600000},{a: 'item', t: '1', n: 800000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 800000
},
{
"a": "attr",
"t": "jinbi",
"n": 1600000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_8",
"undefined": "积天礼包_6",
@ -4403,7 +4609,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 1800000},{a: 'item', t: '1', n: 900000},{a: 'item', t: '4', n: 10}]",
"prize": [
{
"a": "item",
"t": "4",
"n": 10
},
{
"a": "item",
"t": "1",
"n": 900000
},
{
"a": "attr",
"t": "jinbi",
"n": 1800000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_9",
"undefined": "积天礼包_6",
@ -4423,7 +4645,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 2000000},{a: 'item', t: '1', n: 1000000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 1000000
},
{
"a": "attr",
"t": "jinbi",
"n": 2000000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_10",
"undefined": "积天礼包_6",
@ -4443,7 +4681,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 2200000},{a: 'item', t: '1', n: 1100000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 1100000
},
{
"a": "attr",
"t": "jinbi",
"n": 2200000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_11",
"undefined": "积天礼包_6",
@ -4463,7 +4717,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 2400000},{a: 'item', t: '1', n: 1200000},{a: 'item', t: '4', n: 10}]",
"prize": [
{
"a": "item",
"t": "4",
"n": 10
},
{
"a": "item",
"t": "1",
"n": 1200000
},
{
"a": "attr",
"t": "jinbi",
"n": 2400000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_12",
"undefined": "积天礼包_6",
@ -4483,7 +4753,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 2600000},{a: 'item', t: '1', n: 1300000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 1300000
},
{
"a": "attr",
"t": "jinbi",
"n": 2600000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_13",
"undefined": "积天礼包_6",
@ -4503,7 +4789,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 2800000},{a: 'item', t: '1', n: 1400000},{a: 'item', t: '12', n: 500}]",
"prize": [
{
"a": "item",
"t": "12",
"n": 500
},
{
"a": "item",
"t": "1",
"n": 1400000
},
{
"a": "attr",
"t": "jinbi",
"n": 2800000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_14",
"undefined": "积天礼包_6",
@ -4523,7 +4825,23 @@
"n": 60
}
],
"prize": "[{a: 'attr', t: 'jinbi', n: 3000000},{a: 'item', t: '1', n: 1500000},{a: 'item', t: '600', n: 20}]",
"prize": [
{
"a": "item",
"t": "600",
"n": 20
},
{
"a": "item",
"t": "1",
"n": 1500000
},
{
"a": "attr",
"t": "jinbi",
"n": 3000000
}
],
"firstPayPrize": [],
"name": "pay_name_jitianlibao_15",
"undefined": "积天礼包_6",

View File

@ -1011,7 +1011,7 @@
"mofa": 0,
"islong": 0
},
"describe": "普通攻击替换为随机攻击3个目标造成基础伤害95%的物理伤害"
"describe": "普通攻击替换为随机攻击2个目标造成基础伤害95%的物理伤害"
},
"4002201": {
"skillid": 4002201,
@ -1029,7 +1029,7 @@
"mofa": 0,
"islong": 0
},
"describe": "普通攻击替换为随机攻击3个目标造成基础伤害114%的物理伤害"
"describe": "普通攻击替换为随机攻击2个目标造成基础伤害114%的物理伤害"
},
"4003200": {
"skillid": 4003200,
@ -1202,7 +1202,7 @@
"order": "rand",
"limit": 6,
"data": {
"pro": 0.11
"pro": 0.13
},
"chkdata": {},
"ext": {},
@ -1217,7 +1217,7 @@
"order": "rand",
"limit": 6,
"data": {
"pro": 0.11
"pro": 0.13
},
"chkdata": {},
"ext": {},

View File

@ -739,7 +739,7 @@
"sxleixing": "zhongdu",
"buff_type": 2,
"xiaoguocanshu": {
"pro": 0.15,
"pro": 0.18,
"type": "hp"
},
"round": 2,
@ -759,7 +759,7 @@
"sxleixing": "zhongdu",
"buff_type": 2,
"xiaoguocanshu": {
"pro": 0.15,
"pro": 0.18,
"type": "hp"
},
"round": 2,

View File

@ -17,7 +17,7 @@ export class EquipFun {
//穿戴装备时该装备穿戴在另一个英雄身上
if (change.wearaId != undefined && equip.wearaId && equip.wearaId != change.wearaId && changeHero) {
let takeHero = await G.redis.get('hero', call.uid, equip.wearaId);
let takeHero = await HeroFun.getHero(call, equip.wearaId);
if (takeHero) {
let _equip = Object.assign({}, takeHero.equip);
_equip[G.gc.equip[equip.equipId].type] = '';

View File

@ -24,9 +24,9 @@ export class HeroFun {
hero.zhanli = HeroShared.getHeroZhanLi(hero, call.otherBuff, Object.values(call.conn.gud.heroPos).indexOf(hero._id));
change.zhanli = hero.zhanli;
for (let k in change) {
await G.redis.set('hero', call.uid, hero._id, k as any, change[k]);
}
// for (let k in change) {
// await G.redis.set('hero', call.uid, hero._id, k as any, change[k]);
// }
await G.mongodb.collection('hero').updateOne({uid: call.uid, _id: new ObjectId(hero._id)}, {
$set: {
@ -41,13 +41,13 @@ export class HeroFun {
/**获取英雄 */
static async getHero(call: call, oid: string) {
let data = await G.redis.get('hero', call.uid, oid);
if (!data) { // 如果redis中的hero数据被清理掉 直接查询数据库
//let data = await G.redis.get('hero', call.uid, oid);
//if (!data) { // 如果redis中的hero数据被清理掉 直接查询数据库
let {_id, ...info} = await G.mongodb.collection("hero").findOne({
_id: G.mongodb.conversionId(oid)
})
data = Object.assign({_id: _id.toHexString()}, info)
}
let data = Object.assign({_id: _id.toHexString()}, info)
//}
return data
}

View File

@ -149,6 +149,12 @@ export class PayFun {
needVip: 0,
front: {}
}
} else if (payId == '136GiftAll') {
// 136礼包一键购买加入所有礼包奖励
conf = {
...conf,
prize: R.compose(R.flatten(), R.map(i => i.prize), R.filter(i => i.id.indexOf('136Gift') != -1), R.values())(G.gc.pay)
}
}
return conf
}
@ -225,7 +231,7 @@ export class PayFun {
prize.push(...conf.prize)
}
let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs)
let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs, player)
if (isReplaceConf) {
let prizePayId = `zuanshi_${conf.money}`
payArgs.toPrizePayId = prizePayId
@ -314,8 +320,9 @@ export class PayFun {
* @param payId
* @param conf
* @param payArgs
* @param player
*/
static async checkBuysAfterPay(uid, payId, conf, payArgs) {
static async checkBuysAfterPay(uid, payId, conf, payArgs, player) {
if (payId == 'G123SendGift') {
let giftInfo = await G.mongodb.collection('giftLog').findOne({popup_id: payArgs.popup_id});
if (giftInfo.purchaseLimitAmount && giftInfo.buyNumber >= giftInfo.purchaseLimitAmount && number(giftInfo.price) > 0) {
@ -327,6 +334,12 @@ export class PayFun {
buyLog = buyLog.filter(v => v.time >= PublicShared.getToDayZeroTime(G.time));
}
if (conf.buys > 0 && buyLog.length >= conf.buys) return true;
//针对周末礼包的单独处理
if (payId.indexOf('wkdlibao') != -1) {
let call = this.getCall(player)
let conf = await zmlbGetConf(call, {payId})
if (buyLog.length && buyLog.length >= conf.buyNum) return true
}
}
return false
}
@ -376,10 +389,20 @@ export class PayFun {
if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0 && payId.indexOf('wkdlibao') == -1) {
return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2});
}
if (payId.indexOf('136Gift') != -1 && payId != '136Gift1') {
buyLog = await this.getPayLog(player.uid, '136Gift1');
if (buyLog.slice(-1)[0]?.eTime > G.time) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -3});
//针对每日礼包的单独处理
let zeroTime = PublicShared.getToDayZeroTime(G.time)
if (payId.indexOf('136Gift') != -1 && payId != '136GiftAll') {
let buyLog136 = await this.getPayLog(player.uid, '136GiftAll');
buyLog136 = buyLog136.filter(v => v.time >= zeroTime);
if (buyLog136.length) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1});
}
if (payId.indexOf('136Gift') != -1 && payId == '136GiftAll') {
let ids = R.compose(R.map(i => i.id), R.filter(i => i.id.indexOf('136Gift') != -1 && i.id != '136GiftAll'), R.values())(G.gc.pay)
let buyLog136 = await this.getPayLogs(player.uid, ids);
let buyLog136list = R.compose(R.filter(v => v.time >= zeroTime), R.flatten(), R.values())(buyLog136)
if (buyLog136list.length) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1});
}
//针对周末礼包的单独处理
if (payId.indexOf('wkdlibao') != -1) {
let call = this.getCall(player)
let conf = await zmlbGetConf(call, {payId})

View File

@ -454,12 +454,12 @@ export class PlayerFun {
//hero/apiGetList里会G.redis.set('hero', call.uid, kvList);
//在这之后再执行下面的代码则不会报错
if (await G.redis.type('hero', call.uid) != null) {
G.redis.set('hero', call.uid, id, {
_id: id,
...ops
});
}
// if (await G.redis.type('hero', call.uid) != null) {
// G.redis.set('hero', call.uid, id, {
// _id: id,
// ...ops
// });
// }
call.addEventMsg('msg_s2c/HeroChange', id, {

View File

@ -38,7 +38,7 @@ export class ShiwuFun {
//穿戴饰物时该装备穿戴在另一个英雄身上
if (change.wearId != undefined && shiwu.wearId && shiwu.wearId != change.wearId && changeHero) {
let takeHero = await G.redis.get('hero', call.uid, shiwu.wearId);
let takeHero = await HeroFun.getHero(call, shiwu.wearId);
if (takeHero) {
let _shiwu = Object.assign({}, takeHero.shiwu);
let _pos = Object.keys(_shiwu).filter(pos => _shiwu[pos]._id == shiwu._id)[0];
@ -55,7 +55,7 @@ export class ShiwuFun {
//属性发生变化并且穿戴在英雄身上时
if (change.wearId == undefined && shiwu.wearId) {
let takeHero = await G.redis.get('hero', call.uid, shiwu.wearId);
let takeHero = await HeroFun.getHero(call, shiwu.wearId);
if (takeHero) {
let _shiwu = Object.assign({}, takeHero.shiwu);
let _pos = Object.keys(_shiwu).filter(pos => _shiwu[pos]._id == shiwu._id)[0];

View File

@ -766,6 +766,24 @@ export module manager {
return call.conn.gud?.helpHeros?.length || 0;
}
}
// 第56个任务 完成圣诞活动小游戏
export class Class_task_154 extends BaseClass {
stype = 154
isinc = 1
async initVal(call: ApiCall, con) {
return 1;
}
}
// 第57个任务 领取每日任务最终宝箱
export class Class_task_155 extends BaseClass {
stype = 155
isinc = 0
async initVal(call: ApiCall, con) {
return 1;
}
}
}

View File

@ -75,8 +75,9 @@ async function clearRedis() {
G.redis.fromatKey('jjc'),
G.redis.fromatKey('user'),
G.redis.fromatKey('item'),
G.redis.fromatKey('hero'),
//G.redis.fromatKey('equip'),
//G.redis.fromatKey('hero'),
//G.redis.fromatKey('shiwu'),
//G.redis.fromatKey('gbtx'),
//G.redis.fromatKey('dxlt'),

View File

@ -30,4 +30,4 @@ export type defaultSyncBtn = {
export type syncBtnKeys = 'shouchong' | 'kaifukuanghuan' | jijinType | 'zhanling' | 'qiridenglu'
| 'xianshilibao' | 'yibaichou' | 'huobanzhaomu' | 'xianshizhaomu'
| 'leijichongzhi' | 'xinshoulibao' | 'jierihuodong' | 'yuedujijin' | 'zixuanlibao' | 'diaoluoduihuan' | 'chuanshuozhilu'
| 'yangchengmubiao' | 'G123Gift'
| 'yangchengmubiao' | 'G123Gift' | 'christmas'

View File

@ -18826,6 +18826,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": "Literal",
"literal": "G123Gift"
}
},
{
"id": 18,
"type": {
"type": "Literal",
"literal": "christmas"
}
}
]
},