Merge remote-tracking branch 'origin/dev-leijichongzhi' into release
# Conflicts: # src/api_s2c/hongdian/ApiGet.ts # src/api_s2c/pushgift/ApiOpen.ts # src/globalListener.ts # src/module/collection_event.ts # src/public/pushgift.ts # src/shared/protocols/hongdian/PtlGet.ts # src/shared/protocols/msg_s2c/MsgPushGiftChange.ts # src/shared/protocols/serviceProto.ts
This commit is contained in:
commit
38c1b28f9c
21
src/api_s2c/event/leichonglibao/ApiOpen.ts
Normal file
21
src/api_s2c/event/leichonglibao/ApiOpen.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import {ApiCall} from "tsrpc";
|
||||||
|
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/leichonglibao/PtlOpen";
|
||||||
|
|
||||||
|
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||||
|
let data = await G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).findOne(
|
||||||
|
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}
|
||||||
|
)
|
||||||
|
let change = {opentime: G.time}
|
||||||
|
if (!data) {
|
||||||
|
Object.assign(change, {sc: false, buy: []})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每天open红点
|
||||||
|
G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).updateOne(
|
||||||
|
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}, {$set: change}, {upsert: true}
|
||||||
|
)
|
||||||
|
|
||||||
|
let temp = Object.assign((data || {}), change) as ResOpen & { opentime }
|
||||||
|
|
||||||
|
call.succ({sc: temp.sc, buy: temp.buy});
|
||||||
|
}
|
120
src/api_s2c/event/leichonglibao/ApiReceive.ts
Normal file
120
src/api_s2c/event/leichonglibao/ApiReceive.ts
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
import {ApiCall} from "tsrpc";
|
||||||
|
import {HuoDongFun} from "../../../public/huodongfun";
|
||||||
|
import {ReqReceive, ResReceive} from "../../../shared/protocols/event/leichonglibao/PtlReceive";
|
||||||
|
import {PlayerFun} from "../../../public/player";
|
||||||
|
import {PublicShared} from "../../../shared/public/public";
|
||||||
|
|
||||||
|
export type LeiChongLiBaoData = {
|
||||||
|
intr: string
|
||||||
|
intr2: string
|
||||||
|
payRewardNum: number
|
||||||
|
dlz: { [key: string]: atn }[]
|
||||||
|
gift: {
|
||||||
|
id: string, name: string, need: atn[], free: boolean, payId: string, scale: number, buynum: number, prize: atn[]
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
||||||
|
let hdinfo = await HuoDongFun.gethdList(call, 12);
|
||||||
|
|
||||||
|
if (hdinfo.length <= 0) {
|
||||||
|
// 无此活动
|
||||||
|
return call.error('', {code: -1, message: globalThis.lng.huodong_open_1})
|
||||||
|
}
|
||||||
|
|
||||||
|
let hddata = hdinfo.filter(i => i.hdid == call.req.hdid)[0].data as LeiChongLiBaoData;
|
||||||
|
|
||||||
|
let data = await G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).findOne(
|
||||||
|
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (data.sc) {
|
||||||
|
// 自选奖励已领取
|
||||||
|
return call.error('', {code: -1, message: globalThis.lng.task_finsh_3})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.buy.length < hddata.payRewardNum) {
|
||||||
|
// 累计购买礼包次数不足
|
||||||
|
return call.error("", {code: -1, message: globalThis.lng.ljlibaotips_8})
|
||||||
|
}
|
||||||
|
|
||||||
|
let _prize: atn[] = [];
|
||||||
|
for (let i = 0; i < hddata.dlz.length; i++) {
|
||||||
|
_prize.push(hddata.dlz[i][call.req.select[i] || "1"])
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改领取标识
|
||||||
|
await G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).updateOne(
|
||||||
|
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}, {$set: {sc: true}}
|
||||||
|
)
|
||||||
|
|
||||||
|
PlayerFun.sendPrize(call, _prize)
|
||||||
|
call.succ({prize: _prize})
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function LeiChongLiBaoBuyGift(call: ApiCall, payId: string) {
|
||||||
|
let hdinfo = await HuoDongFun.gethdList(call, 12);
|
||||||
|
|
||||||
|
if (hdinfo.length <= 0) {
|
||||||
|
console.log(call.uid, "购买累充礼包 但是活动没有开启", payId);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let gift: LeiChongLiBaoData["gift"][0];
|
||||||
|
|
||||||
|
let hdid = hdinfo[0].hdid;
|
||||||
|
let hddata = hdinfo[0].data as LeiChongLiBaoData;
|
||||||
|
for (let g of hddata.gift) {
|
||||||
|
if (g.payId == payId) {
|
||||||
|
gift = g;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gift) return; // 不是购买累充礼包
|
||||||
|
|
||||||
|
let mydata = await G.mongodb.cEvent(`leichonglibao${hdid}`).findOne(
|
||||||
|
{type: `leichonglibao${hdid}`, uid: call.uid}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (mydata && mydata.buy.includes(gift.payId)) {
|
||||||
|
console.log(call.uid, "购买累充礼包 重复购买", payId);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let update;
|
||||||
|
if (mydata) {
|
||||||
|
update = {$push: {buy: payId}}
|
||||||
|
} else {
|
||||||
|
update = {$set: {opentime: G.time, sc: false, buy: [payId]}}
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerFun.sendPrize(call, gift.prize)
|
||||||
|
G.mongodb.cEvent(`leichonglibao${hdid}`).updateOne(
|
||||||
|
{uid: call.uid, type: `leichonglibao${hdid}`}, update
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function LeiChongLiBaoGetHongDian(call: ApiCall) {
|
||||||
|
let hdinfo = await HuoDongFun.gethdList(call, 12);
|
||||||
|
|
||||||
|
if (hdinfo.length <= 0) {
|
||||||
|
return {show: false}
|
||||||
|
}
|
||||||
|
|
||||||
|
let hdid = hdinfo[0].hdid;
|
||||||
|
let hddata = hdinfo[0].data as LeiChongLiBaoData;
|
||||||
|
|
||||||
|
let mydata = await G.mongodb.cEvent(`leichonglibao${hdid}`).findOne(
|
||||||
|
{type: `leichonglibao${hdid}`, uid: call.uid}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!mydata || mydata.opentime < PublicShared.getToDayZeroTime()) {
|
||||||
|
return {show: true}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mydata.sc && mydata.buy.length >= hddata.payRewardNum) {
|
||||||
|
return {show: true}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {show: false}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
import {ApiCall} from "tsrpc";
|
import {ApiCall} from "tsrpc";
|
||||||
import {RedisCollections2} from '../../module/redis';
|
import {RedisCollections2} from '../../module/redis';
|
||||||
import {ReqGetList, ResGetList} from "../../shared/protocols/hero/PtlGetList";
|
import {ReqGetList, ResGetList} from "../../shared/protocols/hero/PtlGetList";
|
||||||
|
import {PeijianShared} from "../../shared/public/peijian";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
||||||
let list: ResGetList['list'] = {};
|
let list: ResGetList['list'] = {};
|
||||||
@ -19,13 +20,46 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
|
|||||||
if (!color[heroCon[v.heroId].colour]) color[heroCon[v.heroId].colour] = 0;
|
if (!color[heroCon[v.heroId].colour]) color[heroCon[v.heroId].colour] = 0;
|
||||||
color[heroCon[v.heroId].colour] += 1;
|
color[heroCon[v.heroId].colour] += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 修复配件数据
|
||||||
|
let peijianids = [];
|
||||||
|
Object.values(list).map(hero => {
|
||||||
|
hero.peijian && Object.values(hero.peijian).map(
|
||||||
|
i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id))
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
let peijians = (await G.mongodb.collection("peijian").find(
|
||||||
|
{uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1}}
|
||||||
|
).toArray()).map(temp => G.mongodb.conversionId(temp._id));
|
||||||
|
|
||||||
|
let changes = {};
|
||||||
|
Object.values(list).map(hero => {
|
||||||
|
for (let pos in hero.peijian) {
|
||||||
|
if (!peijians.includes(PeijianShared.fmt(hero.peijian[pos])._id)) {
|
||||||
|
hero.peijian[pos] = "";
|
||||||
|
changes[hero._id] = hero.peijian;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let oid in changes) {
|
||||||
|
// 修复数据
|
||||||
|
G.mongodb.collection("hero").updateOne(
|
||||||
|
G.mongodb.conversionIdObj({_id: oid}), {$set: {peijian: changes[oid]}}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 记录玩家最大等级,颜色相关数据 注册任务用
|
// 记录玩家最大等级,颜色相关数据 注册任务用
|
||||||
await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({uid: call.conn.uid, type: 'usertasklog'},
|
await G.mongodb.collection('playerInfo', 'usertasklog').updateOne({uid: call.conn.uid, type: 'usertasklog'},
|
||||||
{$set: {maxherolv: maxherolv, herocolor: color}}, {upsert: true});
|
{$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 recLshd = await G.mongodb.collection('playerInfo', 'lshd_hero').findOne({
|
||||||
|
uid: call.conn.uid,
|
||||||
|
type: 'lshd_hero'
|
||||||
|
});
|
||||||
let {uid, _id, type, ...heros} = (recLshd || {});
|
let {uid, _id, type, ...heros} = (recLshd || {});
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,12 +15,13 @@ import {md_redPoint} from '../gongyu/mingdao/ApiOpen';
|
|||||||
import {HongDianFun, HuoDongHongDianFun} from "./fun";
|
import {HongDianFun, HuoDongHongDianFun} from "./fun";
|
||||||
import {FunWeiXiuChang} from "../../public/weixiuchang";
|
import {FunWeiXiuChang} from "../../public/weixiuchang";
|
||||||
import {getShouChongRedPoint} from "../event/shouchong/ApiReceive";
|
import {getShouChongRedPoint} from "../event/shouchong/ApiReceive";
|
||||||
|
import {LeiChongLiBaoGetHongDian} from "../event/leichonglibao/ApiReceive";
|
||||||
import { playerCanReceive } from '../event/payForDiamond/ApiCanReceive';
|
import { playerCanReceive } from '../event/payForDiamond/ApiCanReceive';
|
||||||
|
|
||||||
const defaultKeys: hongdianKey[] = ['jiuba', 'jiaotang', 'shouchong', 'clslhd', 'dixiaqianzhuanghd', 'gonghuihd', 'hbzbhd', 'jjchd', 'taskhd',
|
const defaultKeys: hongdianKey[] = ['jiuba', 'jiaotang', 'shouchong', 'clslhd', 'dixiaqianzhuanghd', 'gonghuihd', 'hbzbhd', 'jjchd', 'taskhd',
|
||||||
'xstaskhd', 'lingzhulaixihd', 'dxlthd', 'wzcjhd', 'slzdhd', 'qjzzdhd', 'kuangdonghd', 'qiandaohd', 'kaifukuanghuanhd', 'jijinhd', 'zhuishalinghd',
|
'xstaskhd', 'lingzhulaixihd', 'dxlthd', 'wzcjhd', 'slzdhd', 'qjzzdhd', 'kuangdonghd', 'qiandaohd', 'kaifukuanghuanhd', 'jijinhd', 'zhuishalinghd',
|
||||||
'yibaichouhd', 'huobanzhaomuhd', 'qirileichonghd', 'jierihd', 'kbzzhd', 'wzryhd', 'yuedujijin', 'mingdao', 'patahd',
|
'yibaichouhd', 'huobanzhaomuhd', 'qirileichonghd', 'jierihd', 'kbzzhd', 'wzryhd', 'yuedujijin', 'mingdao', 'patahd',
|
||||||
'heishihd', 'huodonghd', 'renown', 'weixiuchang', 'kaifujingsai', 'zhoumolibao', 'pobinglibao', 'payForDiamond'];
|
'heishihd', 'huodonghd', 'renown', 'weixiuchang', 'kaifujingsai', 'zhoumolibao', 'pobinglibao', 'leichonglibao', 'payForDiamond'];
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqGet, ResGet>) {
|
export default async function (call: ApiCall<ReqGet, ResGet>) {
|
||||||
|
|
||||||
@ -164,6 +165,9 @@ export default async function (call: ApiCall<ReqGet, ResGet>) {
|
|||||||
case 'zhoumolibao':
|
case 'zhoumolibao':
|
||||||
res[key] = await HongDianFun.zhoumolibao(call);
|
res[key] = await HongDianFun.zhoumolibao(call);
|
||||||
break;
|
break;
|
||||||
|
case "leichonglibao":
|
||||||
|
res[key] = await LeiChongLiBaoGetHongDian(call)
|
||||||
|
break;
|
||||||
case 'payForDiamond':
|
case 'payForDiamond':
|
||||||
const receiveResult = await playerCanReceive(call, false);
|
const receiveResult = await playerCanReceive(call, false);
|
||||||
res[key] = { show: receiveResult && receiveResult.result };
|
res[key] = { show: receiveResult && receiveResult.result };
|
||||||
|
@ -365,7 +365,6 @@ export class HuoDongHongDianFun {
|
|||||||
// 检测 htype 8 圣诞活动红点
|
// 检测 htype 8 圣诞活动红点
|
||||||
ishd = await this.christmasHongDian(call, element)
|
ishd = await this.christmasHongDian(call, element)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.htype == 10) {
|
if (element.htype == 10) {
|
||||||
// 检测 htype 10 破冰活动红点
|
// 检测 htype 10 破冰活动红点
|
||||||
ishd = await this.pobinglibao(call, element)
|
ishd = await this.pobinglibao(call, element)
|
||||||
|
@ -9,6 +9,7 @@ import {ReqLottery, ResLottery} from "../../shared/protocols/jiuba/PtlLottery";
|
|||||||
import {PublicShared} from '../../shared/public/public';
|
import {PublicShared} from '../../shared/public/public';
|
||||||
import {HongDianChange} from '../hongdian/fun';
|
import {HongDianChange} from '../hongdian/fun';
|
||||||
import {RankKfjs} from "../../public/rank/rank_kfjs";
|
import {RankKfjs} from "../../public/rank/rank_kfjs";
|
||||||
|
import {PushGiftFun} from "../../public/pushgift";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqLottery, ResLottery>) {
|
export default async function (call: ApiCall<ReqLottery, ResLottery>) {
|
||||||
|
|
||||||
@ -142,4 +143,8 @@ export default async function (call: ApiCall<ReqLottery, ResLottery>) {
|
|||||||
valArr: [await rankKfjs.getRankScore(call.uid) + call.req.type]
|
valArr: [await rankKfjs.getRankScore(call.uid) + call.req.type]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 十连抽推送礼包
|
||||||
|
if (call.req.type == 10) {
|
||||||
|
PushGiftFun.chkRecruitGift(call.uid)
|
||||||
|
}
|
||||||
}
|
}
|
@ -132,6 +132,9 @@ async function doLogin(call: ApiCall<ReqLogin, ResLogin>) {
|
|||||||
//await G.redis.set('user', gud.uid, gud);
|
//await G.redis.set('user', gud.uid, gud);
|
||||||
await initGud(gud.uid, gud);
|
await initGud(gud.uid, gud);
|
||||||
|
|
||||||
|
// 修复公会id
|
||||||
|
await fixUnionData(gud);
|
||||||
|
|
||||||
//记录玩家所在的进程,change: 更换到处理完踢线操作在写入。
|
//记录玩家所在的进程,change: 更换到处理完踢线操作在写入。
|
||||||
// setUidProcessId(gud.uid);
|
// setUidProcessId(gud.uid);
|
||||||
|
|
||||||
@ -279,3 +282,18 @@ async function LoginFun(call: ApiCall<ReqLogin, ResLogin>) {
|
|||||||
// G.mongodb.collection("hero").findOneAndUpdate({_id: i._id}, {$set: {shiwu: shiwuChange}})
|
// G.mongodb.collection("hero").findOneAndUpdate({_id: i._id}, {$set: {shiwu: shiwuChange}})
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// 修复玩家退出公会 但是gud中残留公会id
|
||||||
|
async function fixUnionData(gud: ResLogin["gud"]) {
|
||||||
|
if (gud.ghId) {
|
||||||
|
let ghdata = await G.mongodb.collection("gonghui").findOne(
|
||||||
|
{_id: G.mongodb.conversionId(gud.ghId), 'players.uid': gud.uid}
|
||||||
|
)
|
||||||
|
if (!ghdata) {
|
||||||
|
gud.ghId = "";
|
||||||
|
gud.ghName = "";
|
||||||
|
gud.ghLevel = 0;
|
||||||
|
PlayerFun.changeAttr(gud.uid, {ghId: '', ghLevel: 0})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1932
src/fix_patch/patch_20231215.ts
Normal file
1932
src/fix_patch/patch_20231215.ts
Normal file
File diff suppressed because it is too large
Load Diff
43
src/fix_patch/patch_20231220.ts
Normal file
43
src/fix_patch/patch_20231220.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import {ctor} from "../global";
|
||||||
|
import {initMongoDB} from "../setMongodb";
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
await initMongoDB()
|
||||||
|
|
||||||
|
let datas = await G.mongodb.collection("event").find(
|
||||||
|
{type: {$in: ["yangchengmubiao100", "yangchengmubiao101"]}}
|
||||||
|
).toArray();
|
||||||
|
|
||||||
|
for (let i = 0; i < datas.length; i++) {
|
||||||
|
let add = 0;
|
||||||
|
let data = datas[i];
|
||||||
|
if (!Array.isArray(data.taskval)) continue;
|
||||||
|
let taskval: { [taskid: string]: number } = {};
|
||||||
|
for (let i = 0; i < data.taskval.length; i++) {
|
||||||
|
if (data.taskval[i] === null) continue;
|
||||||
|
|
||||||
|
if (typeof data.taskval[i] == "number") {
|
||||||
|
add = data.taskval[i];
|
||||||
|
} else {
|
||||||
|
taskval = Object.assign(taskval, data.taskval[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let taskid in taskval) {
|
||||||
|
taskval[taskid] = (taskval[taskid] || 0) + add;
|
||||||
|
}
|
||||||
|
await G.mongodb.collection("event").updateOne(
|
||||||
|
{uid: data.uid, type: data.type}, {$set: {taskval: taskval}}
|
||||||
|
)
|
||||||
|
console.log(`修复玩家${data.uid}人才计划数据完成...`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctor();
|
||||||
|
start().then(() => {
|
||||||
|
setInterval(() => {
|
||||||
|
console.log(new Date().format("MM-dd hh:mm:ss"));
|
||||||
|
}, 1000)
|
||||||
|
console.log("逻辑执行完成...等待退出!!!");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
import {ctor} from "./global";
|
import {ctor} from "../global";
|
||||||
import {initMongoDB} from "./setMongodb";
|
import {initMongoDB} from "../setMongodb";
|
||||||
import {yangchengmubiao} from "./shared/protocols/event/yangchengmubiao/PtlOpen";
|
import {yangchengmubiao} from "../shared/protocols/event/yangchengmubiao/PtlOpen";
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
await initMongoDB()
|
await initMongoDB()
|
126
src/fix_patch/patch_20231221_1.ts
Normal file
126
src/fix_patch/patch_20231221_1.ts
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
import {ctor} from "../global";
|
||||||
|
import {initMongoDB} from "../setMongodb";
|
||||||
|
import {yangchengmubiao} from "../shared/protocols/event/yangchengmubiao/PtlOpen";
|
||||||
|
import {number} from "mathjs";
|
||||||
|
import {PublicShared} from "../shared/public/public";
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
await initMongoDB()
|
||||||
|
|
||||||
|
const task = {
|
||||||
|
'2001': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 5}, {'a': 'item', 't': '626', 'n': 10}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 50,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2002': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 5}, {'a': 'item', 't': '626', 'n': 10}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 100,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2003': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '626', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 200,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2004': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '600', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 250,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2005': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '600', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 300,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2006': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '619', 'n': 1}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 400,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2007': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '619', 'n': 1}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 500,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let hdid = [100, 101];
|
||||||
|
let openday = PublicShared.getOpenServerDay();
|
||||||
|
let openhdlist = await G.mongodb.collection("hdinfo").find(
|
||||||
|
{hdid: {$in: hdid}, stime: {$lte: openday}, etime: {$gte: openday}}
|
||||||
|
).toArray();
|
||||||
|
|
||||||
|
// 没有开启的活动 返回
|
||||||
|
if (openhdlist.length <= 0) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
hdid = openhdlist.map(hd => hd.hdid);
|
||||||
|
}
|
||||||
|
|
||||||
|
let datas: yangchengmubiao[];
|
||||||
|
datas = await G.mongodb.cEvent(`yangchengmubiao${hdid[0]}`).find(
|
||||||
|
{type: `yangchengmubiao${hdid[0]}`}
|
||||||
|
).toArray();
|
||||||
|
|
||||||
|
for (let i = 0; i < datas.length; i++) {
|
||||||
|
let data = datas[i];
|
||||||
|
let finishid = new Set(data.finishid["2"]);
|
||||||
|
// 查找任务未完成 但设置了领奖标识
|
||||||
|
for (let taskid in task) {
|
||||||
|
let con = task[taskid];
|
||||||
|
let taskval = data.taskval || {};
|
||||||
|
if (finishid.has(number(taskid)) && (taskval[taskid] || 0) < con.pval) {
|
||||||
|
finishid.delete(number(taskid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 没有删除的
|
||||||
|
if (finishid.size == data.finishid["2"].length) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
await G.mongodb.collection("event").updateOne(
|
||||||
|
{"uid": data.uid, "type": data.type}, {$set: {"finishid.2": [...finishid]}}
|
||||||
|
)
|
||||||
|
console.log(`修复玩家${data.uid}人才计划${data.type}数据完成...`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctor();
|
||||||
|
start().then(() => {
|
||||||
|
let s = 0;
|
||||||
|
setInterval(() => {
|
||||||
|
s += 1;
|
||||||
|
console.log(new Date().format("MM-dd hh:mm:ss"));
|
||||||
|
if (s >= 3) process.exit(1);
|
||||||
|
}, 1000)
|
||||||
|
console.log("逻辑执行完成...等待退出!!!");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
98
src/fix_patch/patch_20231222.ts
Normal file
98
src/fix_patch/patch_20231222.ts
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
import {ctor} from "../global";
|
||||||
|
import {_mongodb} from "../setMongodb";
|
||||||
|
import {MongoClient} from "mongodb";
|
||||||
|
|
||||||
|
async function initMongoDB() {
|
||||||
|
console.log('connect mongodb ......');
|
||||||
|
let client = await MongoClient.connect(G.config.mongodbUrl);
|
||||||
|
G.mongodb = new _mongodb(client.db(G.config.dbName || ''));
|
||||||
|
console.log('connect mongodb succ');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
await initMongoDB()
|
||||||
|
|
||||||
|
const task = {
|
||||||
|
'2001': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 5}, {'a': 'item', 't': '626', 'n': 10}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 50,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2002': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 5}, {'a': 'item', 't': '626', 'n': 10}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 100,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2003': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '626', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 200,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2004': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '600', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 250,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2005': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '600', 'n': 20}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 300,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2006': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '619', 'n': 1}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 400,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
},
|
||||||
|
'2007': {
|
||||||
|
'prize': [{'a': 'item', 't': '4', 'n': 10}, {'a': 'item', 't': '619', 'n': 1}],
|
||||||
|
'tujing': '',
|
||||||
|
'title': 'intr_yczm_day_des_2',
|
||||||
|
'type': 2,
|
||||||
|
'pval': 500,
|
||||||
|
'cond': [],
|
||||||
|
'stype': 118
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let hdid = [100, 101];
|
||||||
|
await G.mongodb.collection("hdinfo").updateMany(
|
||||||
|
{hdid: {$in: hdid}}, {$set: {"data.tasklist.2": task}}
|
||||||
|
)
|
||||||
|
console.log(`修复区服${G.config.serverId}人才计划活动数据完成...`);
|
||||||
|
}
|
||||||
|
|
||||||
|
ctor();
|
||||||
|
start().then(() => {
|
||||||
|
let s = 0;
|
||||||
|
setInterval(() => {
|
||||||
|
s += 1;
|
||||||
|
console.log(new Date().format("MM-dd hh:mm:ss"));
|
||||||
|
if (s >= 3) process.exit(1);
|
||||||
|
}, 1000)
|
||||||
|
console.log("逻辑执行完成...等待退出!!!");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
22
src/fix_patch/patch_email_find.ts
Normal file
22
src/fix_patch/patch_email_find.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import {initMongoDB} from "../setMongodb";
|
||||||
|
import {ctor} from "../global";
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
await initMongoDB();
|
||||||
|
|
||||||
|
let emails = await G.mongodb.collection("email").find({
|
||||||
|
title: {$regex: "wzry"}
|
||||||
|
}).toArray();
|
||||||
|
|
||||||
|
for (let i = 0; i < emails.length; i++) {
|
||||||
|
console.log();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctor();
|
||||||
|
start().then(() => {
|
||||||
|
setInterval(() => {
|
||||||
|
console.log(new Date().format("MM-dd hh:mm:ss"));
|
||||||
|
}, 1000)
|
||||||
|
console.log("逻辑执行完成...等待退出!!!");
|
||||||
|
});
|
@ -1,5 +1,5 @@
|
|||||||
import {ctor} from './global';
|
import {ctor} from '../global';
|
||||||
import {initMongoDB} from './setMongodb';
|
import {initMongoDB} from '../setMongodb';
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
//连接mongodb
|
//连接mongodb
|
@ -1,5 +1,5 @@
|
|||||||
import {ctor} from "./global";
|
import {ctor} from "../global";
|
||||||
import {initMongoDB} from "./setMongodb";
|
import {initMongoDB} from "../setMongodb";
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
await initMongoDB()
|
await initMongoDB()
|
47
src/fix_patch/patch_queryEmail.ts
Normal file
47
src/fix_patch/patch_queryEmail.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import fs from "fs";
|
||||||
|
import {MongoClient} from "mongodb";
|
||||||
|
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
let mongodbUrl = "mongodb://blacklagoon:lffu2bD%5eGn2%5eE%2bE7@blacklagoon-mongo-secondary.pro.g123-cpp.com:3717,blacklagoon-mongo-primary.pro.g123-cpp.com:3717?replicaSet=mgset-351738825"
|
||||||
|
//连接mongodb
|
||||||
|
let client = await MongoClient.connect(mongodbUrl);
|
||||||
|
|
||||||
|
console.log('链接成功');
|
||||||
|
|
||||||
|
let user2email: { [uid: string]: { [title: string]: { prize: any, get_num: number, unget_num: number } } } = {};
|
||||||
|
for (let i = 1; i < 49; i++) {
|
||||||
|
let dbName = `blacklagoon_s${i}`
|
||||||
|
console.log(dbName)
|
||||||
|
|
||||||
|
let mongodb = client.db(dbName);
|
||||||
|
let emails = await mongodb.collection("email").find({
|
||||||
|
title: {$regex: "wzry"}
|
||||||
|
}).toArray();
|
||||||
|
|
||||||
|
for (let i = 0; i < emails.length; i++) {
|
||||||
|
let email = emails[i];
|
||||||
|
if (!email.prizeData?.prize) continue;
|
||||||
|
if (!user2email[email.uid]) {
|
||||||
|
user2email[email.uid] = {};
|
||||||
|
}
|
||||||
|
if (!user2email[email.uid][email.title]) {
|
||||||
|
user2email[email.uid][email.title] = {
|
||||||
|
prize: email.prizeData.prize,
|
||||||
|
get_num: 0,
|
||||||
|
unget_num: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (email.prizeData.isGet) {
|
||||||
|
user2email[email.uid][email.title].get_num += 1;
|
||||||
|
} else {
|
||||||
|
user2email[email.uid][email.title].unget_num += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fs.writeFileSync('email.json', JSON.stringify(user2email, null, 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
start().then(() => {
|
||||||
|
process.exit()
|
||||||
|
});
|
@ -1,6 +1,6 @@
|
|||||||
import {ctor} from './global';
|
import {ctor} from '../global';
|
||||||
import {initMongoDB} from './setMongodb';
|
import {initMongoDB} from '../setMongodb';
|
||||||
import {initRedis} from './setRedis';
|
import {initRedis} from '../setRedis';
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
//连接mongodb
|
//连接mongodb
|
@ -18,6 +18,7 @@ import { setGud } from './public/gud';
|
|||||||
import {checkResetBuyLog} from "./api_s2c/event/zhoumolibao/ApiOpen";
|
import {checkResetBuyLog} from "./api_s2c/event/zhoumolibao/ApiOpen";
|
||||||
import {Christmasfun} from "./api_s2c/event/christmas/fun";
|
import {Christmasfun} from "./api_s2c/event/christmas/fun";
|
||||||
import {PushGiftFun} from "./public/pushgift";
|
import {PushGiftFun} from "./public/pushgift";
|
||||||
|
import {LeiChongLiBaoBuyGift} from "./api_s2c/event/leichonglibao/ApiReceive";
|
||||||
|
|
||||||
export type gEventType = {
|
export type gEventType = {
|
||||||
/**玩家断开连接 */
|
/**玩家断开连接 */
|
||||||
@ -201,7 +202,8 @@ export function addListener() {
|
|||||||
{ $inc: { payNum: conf.money } },
|
{ $inc: { payNum: conf.money } },
|
||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
);
|
);
|
||||||
PushGiftFun.buy(player.uid, payId) // 推送礼包
|
await PushGiftFun.buy(player.uid, payId) // 推送礼包
|
||||||
|
await LeiChongLiBaoBuyGift(call, payId) // 累充礼包
|
||||||
});
|
});
|
||||||
|
|
||||||
G.on("FIRST_LOGIN_EVERY_DAY", (gud, lastTime, curTime) => {
|
G.on("FIRST_LOGIN_EVERY_DAY", (gud, lastTime, curTime) => {
|
||||||
|
@ -1773,6 +1773,24 @@ type gc_yuyuemail = {
|
|||||||
'prize': { "a": string, "t": string, "n": number, [x: string]: any }[]
|
'prize': { "a": string, "t": string, "n": number, [x: string]: any }[]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type gc_push_gift = {
|
||||||
|
[k: string]: {
|
||||||
|
/**礼包id*/
|
||||||
|
id: number
|
||||||
|
/**礼包类型*/
|
||||||
|
type: number
|
||||||
|
/**礼包参数*/
|
||||||
|
num: any[]
|
||||||
|
/**购买id*/
|
||||||
|
payId: string[]
|
||||||
|
/**持续时间*/
|
||||||
|
time: number
|
||||||
|
/**冷却时间*/
|
||||||
|
displayCD: number
|
||||||
|
/**显示返利比*/
|
||||||
|
scale: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type gcType = {
|
type gcType = {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
@ -1922,6 +1940,7 @@ type gcType = {
|
|||||||
kfcb_content: gc_kfcb_content
|
kfcb_content: gc_kfcb_content
|
||||||
kfcb_prize: gc_kfcb_prize
|
kfcb_prize: gc_kfcb_prize
|
||||||
yuyuemail: gc_yuyuemail
|
yuyuemail: gc_yuyuemail
|
||||||
|
tuisonglibao: gc_push_gift
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ class Lng {
|
|||||||
huoqupaihang: "huoqupaihang";
|
huoqupaihang: "huoqupaihang";
|
||||||
wucigonghui: "wucigonghui";
|
wucigonghui: "wucigonghui";
|
||||||
nameyicunzai: "nameyicunzai";
|
nameyicunzai: "nameyicunzai";
|
||||||
|
ljlibaotips_8:"ljlibaotips_8";
|
||||||
|
|
||||||
"11111" = "globalThis.lng.chat_1"
|
"11111" = "globalThis.lng.chat_1"
|
||||||
// return call.error('', { code: -3, message: globalThis.lng.chat_2 });
|
// return call.error('', { code: -3, message: globalThis.lng.chat_2 });
|
||||||
|
@ -22,6 +22,7 @@ import {ResOpen as ResOpenZixuanlibao} from '../shared/protocols/event/zixuanlib
|
|||||||
import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/PtlOpen';
|
import {ResOpen as ResOpenKaifujingsai} from '../shared/protocols/kaifujingsai/PtlOpen';
|
||||||
import {ResOpen as ResOpenZhoumolibao} from '../shared/protocols/event/zhoumolibao/PtlOpen';
|
import {ResOpen as ResOpenZhoumolibao} from '../shared/protocols/event/zhoumolibao/PtlOpen';
|
||||||
import {ResOpen as ResOpenPobinglibao} from '../shared/protocols/event/pobinglibao/PtlOpen';
|
import {ResOpen as ResOpenPobinglibao} from '../shared/protocols/event/pobinglibao/PtlOpen';
|
||||||
|
import {ResOpen as ResOpenLeiChongLiBao} from '../shared/protocols/event/leichonglibao/PtlOpen';
|
||||||
|
|
||||||
export type eventType = {
|
export type eventType = {
|
||||||
shouchong: {
|
shouchong: {
|
||||||
@ -51,7 +52,7 @@ export type eventType = {
|
|||||||
qirichongzhi: Omit<ResOpenQirichongzhi, 'finished'>;
|
qirichongzhi: Omit<ResOpenQirichongzhi, 'finished'>;
|
||||||
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
||||||
kaifujingsai: ResOpenKaifujingsai;
|
kaifujingsai: ResOpenKaifujingsai;
|
||||||
zhoumolibao: ResOpenZhoumolibao & { refreshTime: number; }
|
zhoumolibao: ResOpenZhoumolibao & { refreshTime: number; };
|
||||||
pobinglibao: ResOpenPobinglibao
|
pobinglibao: ResOpenPobinglibao
|
||||||
payForDiamond: {
|
payForDiamond: {
|
||||||
[time: number]: number
|
[time: number]: number
|
||||||
@ -65,6 +66,7 @@ export type eventType = {
|
|||||||
[k: `zixuanlibao${number}`]: ResOpenZixuanlibao;
|
[k: `zixuanlibao${number}`]: ResOpenZixuanlibao;
|
||||||
[k: `leijichongzhi${number}`]: Omit<ResOpenLeijichongzhi, 'payNum'>;
|
[k: `leijichongzhi${number}`]: Omit<ResOpenLeijichongzhi, 'payNum'>;
|
||||||
[k: `qiridenglu${number}`]: Pick<ResOpenQiridenglu, 'recPrize'>;
|
[k: `qiridenglu${number}`]: Pick<ResOpenQiridenglu, 'recPrize'>;
|
||||||
|
[k: `leichonglibao${number}`]: ResOpenLeiChongLiBao & { opentime: number };
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CollectionEvent<T extends keyof eventType> = {
|
export type CollectionEvent<T extends keyof eventType> = {
|
||||||
|
13
src/module/collection_pushgift.ts
Normal file
13
src/module/collection_pushgift.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import {ObjectId} from "mongodb";
|
||||||
|
import {ResOpen} from "../shared/protocols/pushgift/PtlOpen";
|
||||||
|
|
||||||
|
export type Gift = {
|
||||||
|
id: string
|
||||||
|
uid: string
|
||||||
|
buy: number[]
|
||||||
|
ctime: number
|
||||||
|
passTime: number
|
||||||
|
ext_data: { [key: string]: any }
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CollectionPushGift = Gift & { _id: ObjectId };
|
@ -59,6 +59,7 @@ import {CollectionPlayerBehavior} from "./collection_player_behavior";
|
|||||||
import {CollectionRmbuse} from "./collection_rmbuse";
|
import {CollectionRmbuse} from "./collection_rmbuse";
|
||||||
import {CollectionFightLog} from "./collection_fightLog";
|
import {CollectionFightLog} from "./collection_fightLog";
|
||||||
import {CollectionShop} from "./collection_shop";
|
import {CollectionShop} from "./collection_shop";
|
||||||
|
import {CollectionPushGift} from "./collection_pushgift";
|
||||||
|
|
||||||
export type MongodbCollections = {
|
export type MongodbCollections = {
|
||||||
user: CollectionUser;
|
user: CollectionUser;
|
||||||
@ -131,4 +132,5 @@ export type MongodbCollections = {
|
|||||||
rmbuse: CollectionRmbuse
|
rmbuse: CollectionRmbuse
|
||||||
fightLog: CollectionFightLog
|
fightLog: CollectionFightLog
|
||||||
shop: CollectionShop
|
shop: CollectionShop
|
||||||
|
pushgift:CollectionPushGift
|
||||||
};
|
};
|
@ -17,6 +17,7 @@ import {UserFun} from './user';
|
|||||||
import {getItemByItemId, getItemNum} from './item';
|
import {getItemByItemId, getItemNum} from './item';
|
||||||
import {getGud, setGud} from './gud';
|
import {getGud, setGud} from './gud';
|
||||||
import {addGameLog} from "../gameLog";
|
import {addGameLog} from "../gameLog";
|
||||||
|
import {PushGiftFun} from "./pushgift";
|
||||||
|
|
||||||
|
|
||||||
export type call = {
|
export type call = {
|
||||||
@ -66,6 +67,8 @@ export class PlayerFun {
|
|||||||
|
|
||||||
if (has < atn.n) {
|
if (has < atn.n) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
// 消耗不足 触发推送礼包
|
||||||
|
PushGiftFun.chkItemGift(call.uid, atn)
|
||||||
throw new TsrpcError('', {code: -104, atn: atn});
|
throw new TsrpcError('', {code: -104, atn: atn});
|
||||||
} else {
|
} else {
|
||||||
return {isOk: false, atn: atn};
|
return {isOk: false, atn: atn};
|
||||||
@ -198,6 +201,16 @@ export class PlayerFun {
|
|||||||
// 修改属性应在相关奖励领取之前,否则奖励内获取的用户数据是旧数据
|
// 修改属性应在相关奖励领取之前,否则奖励内获取的用户数据是旧数据
|
||||||
// await this.changeAttr(call.conn.uid, change);
|
// await this.changeAttr(call.conn.uid, change);
|
||||||
call.addEventMsg('msg_s2c/PlayerChange', change);
|
call.addEventMsg('msg_s2c/PlayerChange', change);
|
||||||
|
|
||||||
|
// 等级改变 触发推送礼包
|
||||||
|
if (change["lv"]) {
|
||||||
|
PushGiftFun.chkLvGift(call.uid, change["lv"])
|
||||||
|
}
|
||||||
|
// 关卡改变 触发推送礼包
|
||||||
|
if (change["mapId"]) {
|
||||||
|
PushGiftFun.chkLevelGift(call.uid, change["mapId"])
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async changeAttrLog(uid: string, change, atn, before) {
|
static async changeAttrLog(uid: string, change, atn, before) {
|
||||||
@ -299,7 +312,11 @@ export class PlayerFun {
|
|||||||
|
|
||||||
G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options);
|
G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options);
|
||||||
call.addEventMsg('msg_s2c/ItemChange', atn.t, data);
|
call.addEventMsg('msg_s2c/ItemChange', atn.t, data);
|
||||||
addGameLog(call.uid, "_itemChange", {"additem":1}, {"filter": upObj.filter, "update": upObj.update, "options": upObj.options})
|
addGameLog(call.uid, "_itemChange", {"additem": 1}, {
|
||||||
|
"filter": upObj.filter,
|
||||||
|
"update": upObj.update,
|
||||||
|
"options": upObj.options
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (item.num + atn.n <= 0) {
|
if (item.num + atn.n <= 0) {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
@ -327,7 +344,12 @@ export class PlayerFun {
|
|||||||
num: item.num + atn.n,
|
num: item.num + atn.n,
|
||||||
lastTime: upObj.update.$set.lastTime
|
lastTime: upObj.update.$set.lastTime
|
||||||
});
|
});
|
||||||
addGameLog(call.uid, "_itemChange",{"attritem":1}, {"filter": upObj.filter, "update": upObj.update, "options": upObj.options,newNum:item.num + atn.n})
|
addGameLog(call.uid, "_itemChange", {"attritem": 1}, {
|
||||||
|
"filter": upObj.filter,
|
||||||
|
"update": upObj.update,
|
||||||
|
"options": upObj.options,
|
||||||
|
newNum: item.num + atn.n
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
import {MongoClient} from "mongodb";
|
|
||||||
import * as ramda from 'ramda'
|
|
||||||
import fs from "fs";
|
|
||||||
|
|
||||||
let R = ramda
|
|
||||||
|
|
||||||
async function start() {
|
|
||||||
//连接mongodb
|
|
||||||
let client = await MongoClient.connect('mongodbUrl');
|
|
||||||
|
|
||||||
console.log('链接成功')
|
|
||||||
|
|
||||||
let a: any = {}
|
|
||||||
|
|
||||||
for (let i = 1; i < 20; i++) {
|
|
||||||
let dbName = `blacklagoon_s${i}`
|
|
||||||
console.log(dbName)
|
|
||||||
let mongodb = client.db(dbName);
|
|
||||||
a[dbName] = {};
|
|
||||||
(await mongodb.collection('email').find({type: 'gm', uid: 'system'}).toArray()).map(i => {
|
|
||||||
a[dbName][i.title] = R.compose(R.map(i => ({[i[0]]: i.length})), R.values, R.filter(i => i.length > 1), R.groupBy(i => i))(i.prizelist)
|
|
||||||
console.log(a[dbName][i.title])
|
|
||||||
})
|
|
||||||
console.log(dbName, '查询完成')
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync('tab.json', JSON.stringify(a, null, 2))
|
|
||||||
}
|
|
||||||
|
|
||||||
//定义全局变量
|
|
||||||
// ctor();
|
|
||||||
//启动服务
|
|
||||||
start().then(() => {
|
|
||||||
process.exit()
|
|
||||||
});
|
|
@ -98,6 +98,15 @@ function setWs(server: WsServer<ServiceType>) {
|
|||||||
|
|
||||||
//执行 API 接口实现之前
|
//执行 API 接口实现之前
|
||||||
server.flows.preApiCallFlow.push(async call => {
|
server.flows.preApiCallFlow.push(async call => {
|
||||||
|
// 临时停服维护方案
|
||||||
|
// let lng = {
|
||||||
|
// "zh-TW": "停服維護中,請等待!",
|
||||||
|
// "ko": "서버 점검 중, 잠시만 기다려 주세요.",
|
||||||
|
// "ja": "サーバーメンテナンス中、しばらくお待ちください。",
|
||||||
|
// "en": "Server under maintenance. Please wait.",
|
||||||
|
// }
|
||||||
|
// call.error("", {code: -1, message: lng[call.req.lng] || lng["ja"]})
|
||||||
|
// return null;
|
||||||
|
|
||||||
//是否短时间内重复请求某个api
|
//是否短时间内重复请求某个api
|
||||||
// let timeIntervalLimit = call.service.conf?.timeIntervalLimit == undefined ? 500 : call.service.conf?.timeIntervalLimit;
|
// let timeIntervalLimit = call.service.conf?.timeIntervalLimit == undefined ? 500 : call.service.conf?.timeIntervalLimit;
|
||||||
|
8
src/shared/protocols/event/leichonglibao/PtlOpen.ts
Normal file
8
src/shared/protocols/event/leichonglibao/PtlOpen.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export type ReqOpen = {
|
||||||
|
hdid: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ResOpen = {
|
||||||
|
sc: boolean // 自选奖励领取标识
|
||||||
|
buy: string[] // 特价礼包购买记录
|
||||||
|
}
|
10
src/shared/protocols/event/leichonglibao/PtlReceive.ts
Normal file
10
src/shared/protocols/event/leichonglibao/PtlReceive.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import {prizeType} from "../../type";
|
||||||
|
|
||||||
|
export interface ReqReceive {
|
||||||
|
hdid: number
|
||||||
|
select: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResReceive {
|
||||||
|
prize: prizeType[]
|
||||||
|
}
|
@ -53,8 +53,8 @@ export type hongdianKey =
|
|||||||
| 'kaifujingsai'
|
| 'kaifujingsai'
|
||||||
| 'zhoumolibao'
|
| 'zhoumolibao'
|
||||||
| 'pobinglibao'
|
| 'pobinglibao'
|
||||||
| 'payForDiamond';
|
| 'payForDiamond'
|
||||||
|
| 'leichonglibao';
|
||||||
export type hongdianVal = {
|
export type hongdianVal = {
|
||||||
show?: boolean;
|
show?: boolean;
|
||||||
// 看功能需要
|
// 看功能需要
|
||||||
|
5
src/shared/protocols/pushgift/PtlOpen.ts
Normal file
5
src/shared/protocols/pushgift/PtlOpen.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import {Gift} from "../../../module/collection_pushgift";
|
||||||
|
|
||||||
|
export type ReqOpen = {}
|
||||||
|
|
||||||
|
export type ResOpen = { gifts: Gift[] }
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user