Compare commits

..

No commits in common. "cfcf9c70278ffa17fcf837200105a0a1fde1818c" and "3bdc98a1f6c54550f9632787f219aa31435f18bf" have entirely different histories.

40 changed files with 701 additions and 1478 deletions

View File

@ -12,38 +12,11 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
// 无此活动 // 无此活动
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 }) return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
} }
let db = await G.mongodb.cEvent(`chuanshuozhilu${call.req.hdid}`).findOne({ uid: call.uid, type: `chuanshuozhilu${call.req.hdid}` }); let db = await G.mongodb.cEvent(`chuanshuozhilu${call.req.hdid}`).findOne({ uid: call.uid, type: `chuanshuozhilu${call.req.hdid}` });
let _info = db?.info || {}
// 如果初始没有数据,就判断玩家是否有活动对应的影响,生成一下初始化数据
if (!db) {
let _dbType: `chuanshuozhilu${number}` = `chuanshuozhilu${call.req.hdid}`
const hid = _hdinfo.data.hid
let heros = await G.mongodb.collection("hero").find({uid: call.uid, heroId: hid})
.sort({ "zhanli": -1 }).limit(1).toArray();
if (heros) {
let hero = heros[0]
const lv = hero.lv || 0
const jieji = hero.jieji || 0
let setInfo = {"lv": lv, "jieji": jieji}
await G.mongodb.cEvent(_dbType).updateOne(
{ uid: call.uid, type: _dbType },
{ $set: G.mongodb.createTreeObj({ key: `info.${hid}`, val: setInfo})},
{ upsert: true}
)
if (!cache[call.uid]) cache[call.uid] = {hid:{}};
if (!cache[call.uid][hid]) cache[call.uid][hid] = setInfo;
_info[hid] = setInfo
G.server.sendMsgByUid(call.uid, 'msg_s2c/HongDianChange', ['huodonghd']);
}
}
call.succ({ call.succ({
info: _info, info: db?.info || {},
hdinfo: _hdinfo hdinfo: _hdinfo
}); });
} }

View File

@ -6,7 +6,7 @@ import { fightResult } from "../../../shared/fightControl/fightType";
import { FightFun } from "../../../public/fight"; import { FightFun } from "../../../public/fight";
export default async function (call: ApiCall<ReqFight, ResFight>) { export default async function (call: ApiCall<ReqFight, ResFight>) {
let hd = await HQJGFun.HdInfo(call, call.req.hdid); let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
if (!hd) { if (!hd) {
// 无此活动 // 无此活动
@ -17,7 +17,7 @@ export default async function (call: ApiCall<ReqFight, ResFight>) {
let mydata = await HQJGFun.getMydata(call, call.req.hdid); let mydata = await HQJGFun.getMydata(call, call.req.hdid);
// 开始战斗 // 开始战斗
let result: fightResult = await FightFun.fightNpc(call, hd.data.boss.npcId, 'hqjg'); let result: fightResult = await FightFun.fightNpc(call, hd.data.bossId, 'hqjg');
let up = false; let up = false;
let today = HQJGFun.today(hd); let today = HQJGFun.today(hd);

View File

@ -1,42 +0,0 @@
import { ApiCall } from "tsrpc";
import { ReqGiftRec, ResGiftRec } from "../../../shared/protocols/event/huangqijiuguan/PtlGiftRec";
import HQJGFun from "./fun";
export default async function (call: ApiCall<ReqGiftRec, ResGiftRec>) {
let hd = await HQJGFun.HdInfo(call, call.req.hdid);
if (!hd || Object.keys(hd).length <= 0) {
// 无此活动
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
}
let gift = hd.data.gift.filter(i => i.id == call.req.giftid)[0];
if (!gift || !gift.free) {
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
}
let mydata = await HQJGFun.getMydata(call, call.req.hdid);
if ((mydata.giftbuy[call.req.giftid] || { num: 0 }).num + 1 > gift.buynum) {
return call.error("", { code: -2, message: globalThis.lng.hqjgtips_28 })
}
let prize: atn[] = [].concat(gift.prize);
if (!mydata.giftbuy[call.req.giftid]) {
mydata.giftbuy[call.req.giftid] = { num: 0, select: [] };
}
if (gift.dlz) {
for (let i = 0; i < gift.dlz.length; i++) {
if (!mydata.giftbuy[call.req.giftid].select[i]) {
let ids = Object.keys(gift.dlz[i])
prize.push(gift.dlz[i][ids[0]]);
mydata.giftbuy[call.req.giftid].select[i] = Number(ids[0]);
} else {
prize.push(gift.dlz[i][mydata.giftbuy[call.req.giftid].select[i]]);
}
}
}
mydata.giftbuy[call.req.giftid].num++;
await HQJGFun.setMyData(call.uid, call.req.hdid, { giftbuy: mydata.giftbuy });
call.succ({ data: mydata, prize: prize })
}

View File

@ -1,35 +0,0 @@
import { ApiCall } from "tsrpc";
import { ReqGiftSelect, ResGiftSelect } from "../../../shared/protocols/event/huangqijiuguan/PtlGiftSelect";
import HQJGFun from "./fun";
export default async function (call: ApiCall<ReqGiftSelect, ResGiftSelect>) {
let hd = await HQJGFun.HdInfo(call, call.req.hdid);
if (!hd || Object.keys(hd).length <= 0) {
// 无此活动
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
}
let gift = hd.data.gift.filter(i => i.id == call.req.giftid)[0];
if (!gift || !gift.dlz) {
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
}
for (let i = 0; i < call.req.seletc.length; i++) {
if (!gift.dlz[i] || !gift.dlz[i][call.req.seletc[i]]) {
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
}
}
let mydata = await HQJGFun.getMydata(call, call.req.hdid);
if (!mydata.giftbuy[call.req.giftid]) {
mydata.giftbuy[call.req.giftid] = {
num: 0, select: call.req.seletc
}
} else {
mydata.giftbuy[call.req.giftid].select = call.req.seletc;
}
await HQJGFun.setMyData(call.uid, call.req.hdid, { giftbuy: mydata.giftbuy });
call.succ({ data: mydata });
}

View File

@ -1,9 +1,10 @@
import HQJGFun from "./fun"; import HQJGFun from "./fun";
import { ApiCall } from "tsrpc"; import { ApiCall } from "tsrpc";
import { HuoDongFun } from "../../../public/huodongfun";
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huangqijiuguan/PtlOpen"; import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huangqijiuguan/PtlOpen";
export default async (call: ApiCall<ReqOpen, ResOpen>) => { export default async (call: ApiCall<ReqOpen, ResOpen>) => {
let hd = await HQJGFun.HdInfo(call, call.req.hdid); let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
if (!hd || Object.keys(hd).length <= 0) { if (!hd || Object.keys(hd).length <= 0) {
// 无此活动 // 无此活动
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 }) return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })

View File

@ -1,10 +1,11 @@
import { ApiCall } from "tsrpc"; import { ApiCall } from "tsrpc";
import HQJGFun, { Data } from "./fun"; import HQJGFun, { Data } from "./fun";
import { HuoDongFun } from "../../../public/huodongfun";
import { ReqRecDpsPrize, ResRecDpsPrize } from "../../../shared/protocols/event/huangqijiuguan/PtlRecDpsPrize"; import { ReqRecDpsPrize, ResRecDpsPrize } from "../../../shared/protocols/event/huangqijiuguan/PtlRecDpsPrize";
import { PlayerFun } from "../../../public/player"; import { PlayerFun } from "../../../public/player";
export default async function (call: ApiCall<ReqRecDpsPrize, ResRecDpsPrize>) { export default async function (call: ApiCall<ReqRecDpsPrize, ResRecDpsPrize>) {
let hd = await HQJGFun.HdInfo(call, call.req.hdid); let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
if (!hd) { if (!hd) {
// 无此活动 // 无此活动

View File

@ -19,7 +19,7 @@ export default async function (call: ApiCall<ReqZhaoMu, ResZhaoMu>) {
let prize = []; let prize = [];
let mydata = await HQJGFun.getMydata(call, call.req.hdid); let mydata = await HQJGFun.getMydata(call, call.req.hdid);
for (let n = 1; n <= call.req.num; n++) { for (let n = 0; n < call.req.num; n++) {
let num = mydata.zhaomu.num + n; let num = mydata.zhaomu.num + n;
let baodi = hd.data.baodi.filter(x => x.num == num); let baodi = hd.data.baodi.filter(x => x.num == num);
if (baodi.length > 0) { if (baodi.length > 0) {
@ -45,6 +45,4 @@ export default async function (call: ApiCall<ReqZhaoMu, ResZhaoMu>) {
await HQJGFun.setMyData(call.uid, call.req.hdid, { zhaomu: mydata.zhaomu }); await HQJGFun.setMyData(call.uid, call.req.hdid, { zhaomu: mydata.zhaomu });
call.succ({ data: mydata, prize: prize }) call.succ({ data: mydata, prize: prize })
G.emit("Class_task_159", 'Class_task_159', call, 1, 0);
} }

View File

@ -14,20 +14,14 @@ export default async function (call: ApiCall<ReqZhaoMuPrizeRec, ResZhaoMuPrizeRe
let mydata = await HQJGFun.getMydata(call, call.req.hdid); let mydata = await HQJGFun.getMydata(call, call.req.hdid);
for (let rec of call.req.recid) { for (let rec of call.req.recid) {
let con = hd.data.choukajiangli[rec.idx]; let con = hd.data.choukajiangli[rec];
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec)) {
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec.idx)) {
continue continue
} }
if (con.dlz) { mydata.zhaomu.prize.push(rec);
prize.push(con.dlz[0][rec.sec]);
} else {
prize = prize.concat(con.prize); prize = prize.concat(con.prize);
} }
console.log(JSON.stringify(prize));
mydata.zhaomu.prize.push(rec.idx);
}
if (prize.length <= 0) { if (prize.length <= 0) {
return call.error('', { code: -2, message: globalThis.lng.hqjgtips_28 }) return call.error('', { code: -2, message: globalThis.lng.hqjgtips_28 })

View File

@ -3,22 +3,18 @@ import { ReqAddHuoDong } from "../../../monopoly/protocols/PtlAddHuoDong"
import { HuoDongFun } from "../../../public/huodongfun" import { HuoDongFun } from "../../../public/huodongfun"
import { PublicShared } from "../../../shared/public/public" import { PublicShared } from "../../../shared/public/public"
import { EmailFun } from "../../../public/email" import { EmailFun } from "../../../public/email"
import { playerInfo } from "../../../shared/protocols/user/PtlLogin"
// hddata.data // hddata.data
export interface Data { export interface Data {
show: 1 show: 1
task: { task: {
[k: `day${number}`]: { [k: `day${number}`]: {
[k: string]: { pval: number, stype: number, cond: string[], tiaozhuan: number, prize: atn[], des: string } [k: string]: { pval: number, stype: string, cond: string[], tiaozhuan: number, prize: atn[], des: string }
} }
} }
huobi: atn // 抽卡货币 huobi: atn // 抽卡货币
boss: { bossId: number // boss表的ID
img: string
npcId: number
}
// boss排行邮件 // boss排行邮件
bossRank_des: string bossRank_des: string
@ -30,11 +26,11 @@ export interface Data {
chouka: { a: string, t: string, n: number, p: number, gailv: number, cishu: number }[] chouka: { a: string, t: string, n: number, p: number, gailv: number, cishu: number }[]
choukajiangli: { num: number, prize?: any[], dlz: { [k: string]: atn } }[] choukajiangli: { num: number, prize: any[] }[]
baodi: { num: number, prize: any[] }[] baodi: { num: number, prize: any[] }[]
gift: { id: number, free: boolean, payId: string, buynum: number, prize: atn[], dlz?: { [k: string]: atn }[] }[] gift: { id: number, free: boolean, payId: string, buynum: number, prize: atn[] }[]
duihuan: { id: number, need: atn[], prize: atn[], buyNum: number }[] duihuan: { id: number, need: atn[], prize: atn[], buyNum: number }[]
@ -155,14 +151,14 @@ export default class HQJGFun {
} }
/** 获取活动数据 */ /** 获取活动数据 */
static async HdInfo(call: ApiCall, hdid?: number): Promise<ReqAddHuoDong & { data: Data }> { static async HdInfo(call: ApiCall, hdid?: number): Promise<ReqAddHuoDong> {
if (!hdid) { if (!hdid) {
let hdlist = await HuoDongFun.gethdList( let hdlist = await HuoDongFun.gethdList(
call, this.htype call, this.htype
); );
return hdlist.length > 0 ? hdlist[0] : null return hdlist.length > 0 ? hdlist[0] : null
} else { } else {
return await HuoDongFun.getHdidInfo(call, hdid) as any as ReqAddHuoDong & { data: Data } return await HuoDongFun.getHdidInfo(call, hdid) as ReqAddHuoDong
} }
} }
@ -204,16 +200,24 @@ export default class HQJGFun {
} }
} }
static async buy(call: ApiCall, payId: string) {
let hddata = await this.HdInfo(call);
if (!hddata) { // 活动不存在
return
}
let mydata = await this.getMydata(call);
await this.setMyData(call.uid, (await this.HdInfo(call)).hdid, mydata);
}
/** /**
* *
*/ */
static async dayDpsLvPrize(time: number) { static async dayDpsLvPrize() {
console.log(
"黄旗酒馆 每日伤害等级奖励结算 开始执行。。。"
)
// 取stime小于当前时间的最后一条数据 // 取stime小于当前时间的最后一条数据
let hdinfo = await G.mongodb.collection("hdinfo").find({ let hdinfo = await G.mongodb.collection("hdinfo").find({
htype: this.htype, stime: { $lte: time } htype: this.htype, stime: { $lte: G.time }
}, { sort: { stime: -1 } }).limit(1).toArray(); }, { sort: { stime: -1 } }).limit(1).toArray();
// 没有活动数 // 没有活动数
@ -223,7 +227,6 @@ export default class HQJGFun {
let hd = hdinfo[0]; let hd = hdinfo[0];
let hdid = hdinfo[0].hdid; let hdid = hdinfo[0].hdid;
// 活动结束
if (hd.etime < G.time - 300) { if (hd.etime < G.time - 300) {
return return
} }
@ -257,26 +260,17 @@ export default class HQJGFun {
contentInsertArr: [lvprize.lv], contentInsertArr: [lvprize.lv],
}) })
} }
console.log(
"黄旗酒馆 每日伤害等级奖励结算 执行完成!!!"
)
}) })
} }
/** /**
* *
*/ */
static async endDpsRankPrize(time: number) { static async endDpsRankPrize() {
console.log( // 取stime小于当前时间的最后一条数据
"黄旗酒馆 最大伤害排行奖励结算 开始执行。。。"
)
let today = PublicShared.getToDayZeroTime(time + 300);
let yesterday = PublicShared.getToDayZeroTime(time - 300);
// 查询昨天23:59:00或者今天00:00:00结束的活动
let hdinfo = await G.mongodb.collection("hdinfo").find({ let hdinfo = await G.mongodb.collection("hdinfo").find({
htype: this.htype, rtime: { $gt: yesterday, $lte: today } htype: this.htype, stime: { $lte: G.time }
}).toArray(); }, { sort: { stime: -1 } }).limit(1).toArray();
// 没有活动数 // 没有活动数
if (hdinfo.length <= 0) { if (hdinfo.length <= 0) {
@ -285,7 +279,7 @@ export default class HQJGFun {
let hd = hdinfo[0]; let hd = hdinfo[0];
let hdid = hdinfo[0].hdid; let hdid = hdinfo[0].hdid;
if (hd.data.sendrank) { if (hd.etime < G.time - 300) {
return return
} }
@ -312,91 +306,5 @@ export default class HQJGFun {
contentInsertArr: [rank], contentInsertArr: [rank],
}) })
} }
// 标记已发送
await G.mongodb.collection("hdinfo").updateOne(
{ hdid: hdid }, { $set: { "data.sendrank": true } }
);
console.log(
"黄旗酒馆 最大伤害排行奖励结算 执行结束!!!"
)
}
/**设置任务 */
static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) {
// 活动过期,不计数
let hd = await this.HdInfo(call)
if (!hd) return
let today = this.today(hd);
await this.getMydata(call, hd.hdid)
let isset = 0;
let setData = {
$inc: {},
$set: {}
};
let tasks = hd.data.task[`day${today}`];
for (let taskid of Object.keys(tasks)) {
let taskCon = tasks[taskid];
if (taskCon.stype != stype) continue
// 不符合任务要求
if (!(await chkCall(taskCon["cond"], chkval, arg))) continue
// 根据需求改写
val = await alchangeVal(call, taskCon, val, arg)
isset = 1
if (isinc == 1) { // 累加
setData["$inc"][`task.val.day${today}.${taskid}`] = val
} else {
setData["$set"][`task.val.day${today}.${taskid}`] = val
}
}
// 设置任务
if (isset == 1) {
await G.mongodb.collection('event').updateOne({ uid: call.uid, type: this.dataType(hd.hdid) }, setData)
}
}
static async buy(player: playerInfo, payId: string, payArgs: any, call: ApiCall) {
let hd = await this.HdInfo(call);
if (!hd) { // 活动不存在
return
}
// 判断购买次数
let gift = hd.data.gift.filter(x => x.payId == payId)[0];
if (!gift) {
return
}
let mydata = await this.getMydata(call);
if (!mydata.giftbuy[gift.id]) {
mydata.giftbuy[gift.id] = { num: 0, select: [] };
}
let prize: atn[] = [];
if (mydata.giftbuy[gift.id].num + 1 > gift.buynum) {
let pay = G.gc.pay[payId];
prize.push({ a: "attr", t: "rmbmoney", n: pay.payExp[0].n })
} else {
prize = gift.prize;
for (let i = 0; i < gift.dlz.length; i++) {
if (!mydata.giftbuy[gift.id].select[i]) {
let ids = Object.keys(gift.dlz[i])
prize.push(gift.dlz[i][ids[0]]);
mydata.giftbuy[gift.id].select[i] = Number(ids[0]);
} else {
prize.push(gift.dlz[i][mydata.giftbuy[gift.id].select[i]]);
}
}
}
mydata.giftbuy[gift.id].num++;
await this.setMyData(call.uid, hd.hdid, { giftbuy: mydata.giftbuy });
} }
} }

View File

@ -35,7 +35,6 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
_mydata.lunci += 1 _mydata.lunci += 1
_setData["taskval"] = _mydata.taskval _setData["taskval"] = _mydata.taskval
_setData["lunci"] = _mydata.lunci _setData["lunci"] = _mydata.lunci
_setData["finishid"] = _mydata.finishid
} }
// 设置任务改变数据 // 设置任务改变数据

View File

@ -16,8 +16,8 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
if (call.req.index > day) return call.errorCode(-3); if (call.req.index > day) return call.errorCode(-3);
if (rec.includes(call.req.index)) return call.errorCode(-4); if (rec.includes(call.req.index)) return call.errorCode(-4);
// 从异步改成同步
await G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true}); G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true});
await PlayerFun.sendPrize(call, [].concat(conf.prize[call.req.index])); await PlayerFun.sendPrize(call, [].concat(conf.prize[call.req.index]));

View File

@ -51,24 +51,16 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) { async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) {
try { try {
// 修复配件数据 // 修复配件数据
//hero数据里所有英雄穿戴中的配件的 _idobjectId let peijianids = [];
// let peijianids = []; Object.values(list).map(hero => {
// Object.values(list).map(hero => { hero.peijian && Object.values(hero.peijian).map(
// hero.peijian && Object.values(hero.peijian).map( i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id))
// i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id)) )
// ) });
// });
//通过上述的_id去配件表查询所有配件 let peijians = (await G.mongodb.collection("peijian").find(
// let wearedPeiJian = (await G.mongodb.collection("peijian").find( {uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1}}
// {uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1, wearId:1}} ).toArray()).map(temp => G.mongodb.conversionId(temp._id));
// ).toArray());
// //peijians = 所有从db里查到的peijian的 _id字符串数据集合
// let peijians = wearedPeiJian.map(temp => {
// let idstr = G.mongodb.conversionId(temp._id)
// return idstr;
// });
let shiwuIds = R.flatten(R.values(list).map(hero => R.values(hero.shiwu).map(i => G.mongodb.conversionId(i._id)))) let shiwuIds = R.flatten(R.values(list).map(hero => R.values(hero.shiwu).map(i => G.mongodb.conversionId(i._id))))
@ -76,19 +68,15 @@ async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) {
{uid: call.uid, _id: {$in: shiwuIds}}, {projection: {_id: 1}} {uid: call.uid, _id: {$in: shiwuIds}}, {projection: {_id: 1}}
).toArray()).map(i => G.mongodb.conversionId(i._id)); ).toArray()).map(i => G.mongodb.conversionId(i._id));
//let peijianChanges = {}; let peijianChanges = {};
let shiwuChanges = {}; let shiwuChanges = {};
Object.values(list).map(hero => { Object.values(list).map(hero => {
// for (let pos in hero.peijian) { for (let pos in hero.peijian) {
// //hero该位置记录的穿戴中的配件_id if (!peijians.includes(PeijianShared.fmt(hero.peijian[pos])._id)) {
// let _pid = PeijianShared.fmt(hero.peijian[pos])._id; hero.peijian[pos] = "";
peijianChanges[hero._id] = hero.peijian;
// if (!peijians.includes(_pid) || peijianWearTo?.[_pid] != hero._id ) { }
// //这个配件实际在peijian表里不存在 或 配件表里该配件并不是在这个英雄身上 }
// hero.peijian[pos] = "";
// peijianChanges[hero._id] = hero.peijian;
// }
// }
for (let pos in hero.shiwu) { for (let pos in hero.shiwu) {
if (!shiwus.includes(hero.shiwu[pos]._id)) { if (!shiwus.includes(hero.shiwu[pos]._id)) {
hero.shiwu = R.omit([pos], hero.shiwu) hero.shiwu = R.omit([pos], hero.shiwu)
@ -97,12 +85,12 @@ async function checkDataAndFix(call: ApiCall, list: ResGetList['list']) {
} }
}) })
// for (let oid in peijianChanges) { for (let oid in peijianChanges) {
// // 修复数据 // 修复数据
// G.mongodb.collection("hero").updateOne( G.mongodb.collection("hero").updateOne(
// G.mongodb.conversionIdObj({_id: oid}), {$set: {peijian: peijianChanges[oid]}} G.mongodb.conversionIdObj({_id: oid}), {$set: {peijian: peijianChanges[oid]}}
// ) )
// } }
for (let oid in shiwuChanges) { for (let oid in shiwuChanges) {
// 修复数据 // 修复数据

View File

@ -30,6 +30,6 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
}); });
UserFun.activeHeadFrame(call.uid, 'jjc_rank', data["rank"] + 1); UserFun.activeHeadFrame(call.uid, 'jjc_rank', data["rank"] + 1);
//JJCFun.checkUpdatePlayer() JJCFun.checkUpdatePlayer()
} }

View File

@ -1,38 +1,12 @@
import {ApiCall} from "tsrpc"; import {ApiCall} from "tsrpc";
import { connGameLogDB } from "../../gameLog"; import {ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList";
import {PeiJian, ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList";
import { PeijianShared } from "../../shared/public/peijian";
export default async function (call: ApiCall<ReqGetList, ResGetList>) { export default async function (call: ApiCall<ReqGetList, ResGetList>) {
let _maxLv = 0 let _maxLv = 0
let color = {} let color = {}
let peijianCon = G.gc.peijian let peijianCon = G.gc.peijian
//所有上阵的英雄_id
let heroIds = R.values(call.conn.gud.heroPos)
//将所有未上阵的英雄的配件卸下
if(heroIds.length>0){
let _ids = heroIds.map(_id => G.mongodb.conversionId(_id));
await G.mongodb.collection("hero").updateMany({uid: call.conn.uid},{
$set:{
peijian:{}
}
});
}
//如果配件穿戴在了未上阵的hero身上则执行卸下操作
await G.mongodb.collection('peijian').updateMany({uid: call.conn.uid, wearId: {$nin: heroIds}}, {$set: {wearId: ''}})
let heroPeiJian = {};
let dbList = (await G.mongodb.collection('peijian').find({uid: call.uid}).toArray()).map(p => { let dbList = (await G.mongodb.collection('peijian').find({uid: call.uid}).toArray()).map(p => {
if(p.wearId){
if(!heroPeiJian[ p.wearId ]){
heroPeiJian[ p.wearId ] = {};
}
heroPeiJian[ p.wearId ][ Object.keys(heroPeiJian[ p.wearId ]).length + 1 ] = PeijianShared.fmt( p as any )
}
let np = G.mongodb.conversionIdObj(p); let np = G.mongodb.conversionIdObj(p);
let {uid, ...ops} = np; let {uid, ...ops} = np;
@ -42,25 +16,17 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
return ops; return ops;
}); });
//对hero的peijian字段进行修正 // 修复配件穿戴在不存在的英雄身上
if(Object.keys(heroPeiJian).length > 0){ let heroIds = R.values(call.conn.gud.heroPos)
for(let heroid in heroPeiJian){ let fixIds = dbList.filter(i => i.wearId && !heroIds.includes(i.wearId)).map(i => G.mongodb.conversionId(i._id))
await G.mongodb.collection("hero").updateOne({ if (fixIds.length) {
uid : call.conn.uid, await G.mongodb.collection('peijian').updateMany({_id: {$in: fixIds}}, {$set: {wearId: ''}})
_id : G.mongodb.conversionId(heroid)
},{
$set:{
peijian : heroPeiJian[heroid]
}
});
}
} }
// 记录玩家最大等级,颜色相关数据 注册任务用 // 记录玩家最大等级,颜色相关数据 注册任务用
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: {maxpeijianlv: _maxLv, peijiancolor: color}}, {upsert: true}) {$set: {maxpeijianlv: _maxLv, peijiancolor: color}}, {upsert: true})
let list = Object.fromEntries(dbList.map(p => [G.formatRedisKey(p._id), p])); let list = Object.fromEntries(dbList.map(p => [G.formatRedisKey(p._id), p]));
G.redis.set('peijian', call.uid, list); G.redis.set('peijian', call.uid, list);

View File

@ -1,51 +0,0 @@
import { patchInit } from "../patch";
class Path {
async fun1(a: any) {
let taskType = 2;
let users = await G.mongodb.collection('user').find({ loginTime: { $gte: 1704643200 } }).toArray();
for (let i = 0; i < users.length; i++) {
let user = users[i];
let unFinishTask = (await G.mongodb.collection('task').find({
uid: user.uid, type: taskType, finish: 0
}, { projection: { taskid: 1 } }).toArray()).map(i => i.taskid);
if (unFinishTask.length >= 2) {
for (let taskid of unFinishTask) {
let con = G.gc.task[taskType][taskid];
if (!con) {
await G.mongodb.collection("task").deleteOne({
uid: user.uid, taskid: taskid
});
console.log(`删除玩家${user.uid}任务:${taskid}`);
}
if (unFinishTask.includes(con.pretask)) {
await G.mongodb.collection("task").deleteOne({
uid: user.uid, taskid: taskid
});
console.log(`删除玩家${user.uid}任务:${taskid}`);
}
}
}
}
}
async run() {
await this.fun1(1);
}
}
async function main() {
await patchInit()
let patch = new Path();
await patch.run();
console.log("逻辑执行完成,等待退出");
setTimeout(function () {
console.log('结束程序');
process.exit();
}, 3000);
}
main();

View File

@ -15,15 +15,13 @@ import { ZhanLingTasks } from './public/zhanling';
import { player } from './shared/protocols/user/type'; import { player } from './shared/protocols/user/type';
import { PublicShared } from './shared/public/public'; import { PublicShared } from './shared/public/public';
import { setGud } from './public/gud'; import { setGud } from './public/gud';
import { checkResetBuyLog } from "./api_s2c/event/zhoumolibao/ApiOpen"; import {checkResetBuyLog} from "./api_s2c/event/zhoumolibao/ApiOpen";
import { PushGiftFun } from "./public/pushgift"; import {Christmasfun} from "./api_s2c/event/christmas/fun";
import { LeiChongLiBaoBuyGift } from "./api_s2c/event/leichonglibao/ApiReceive"; import {PushGiftFun} from "./public/pushgift";
import {LeiChongLiBaoBuyGift} from "./api_s2c/event/leichonglibao/ApiReceive";
import { HongDianChange } from './api_s2c/hongdian/fun'; import { HongDianChange } from './api_s2c/hongdian/fun';
import HQJGFun from './api_s2c/event/huangqijiuguan/fun';
export type gEventType = { export type gEventType = {
/**新的一天 */
NEW_DAY: (time: number) => void;
/**玩家断开连接 */ /**玩家断开连接 */
PLAYER_DISCONNECT: (uid: string) => void; PLAYER_DISCONNECT: (uid: string) => void;
/**玩家修改名字 */ /**玩家修改名字 */
@ -154,8 +152,6 @@ export type gEventType = {
Class_task_157: (eventname, call, val, chkVal) => void; Class_task_157: (eventname, call, val, chkVal) => void;
/**今日参与{1}次抓娃娃小游戏 */ /**今日参与{1}次抓娃娃小游戏 */
Class_task_158: (eventname, call, val, chkVal) => void; Class_task_158: (eventname, call, val, chkVal) => void;
/**黄旗酒馆累计抽卡X次*/
Class_task_159: (eventname, call, val, chkVal) => void;
}; };
export function addListener() { export function addListener() {
@ -169,7 +165,7 @@ export function addListener() {
XstaskFun.uidTask[uid] = null; XstaskFun.uidTask[uid] = null;
delete XstaskFun.uidTask[uid]; delete XstaskFun.uidTask[uid];
} }
setGud(uid, { logoutTime: G.time }); setGud(uid,{ logoutTime: G.time });
G.mongodb.collection('user').updateOne({ uid: uid }, { $set: { logoutTime: G.time } }); G.mongodb.collection('user').updateOne({ uid: uid }, { $set: { logoutTime: G.time } });
}); });
@ -181,7 +177,7 @@ export function addListener() {
} }
}); });
G.on('PLAYER_PAY', async (player, payId, payArgs, call) => { G.on('PLAYER_PAY', async (player, payId, payArgs,call) => {
let conf: any = await PayFun.getConf(payId, payArgs); let conf: any = await PayFun.getConf(payId, payArgs);
ActionLog.addDayLog(player.uid, { key: 'pay', val: conf.payExp[0].n }); ActionLog.addDayLog(player.uid, { key: 'pay', val: conf.payExp[0].n });
ActionLog.addRetainLog(player.uid, { key: 'pay', val: conf.payExp[0].n }); ActionLog.addRetainLog(player.uid, { key: 'pay', val: conf.payExp[0].n });
@ -265,9 +261,4 @@ export function addListener() {
let call = PayFun.getCall(gud); let call = PayFun.getCall(gud);
G.emit("Class_task_134", 'Class_task_134', call, 1, 0, items); G.emit("Class_task_134", 'Class_task_134', call, 1, 0, items);
}); });
// 黄旗酒馆
G.on("NEW_DAY", HQJGFun.dayDpsLvPrize.bind(HQJGFun));
G.on("NEW_DAY", HQJGFun.endDpsRankPrize.bind(HQJGFun));
G.on("PLAYER_PAY", HQJGFun.buy.bind(HQJGFun));
} }

View File

@ -3291,7 +3291,7 @@
} }
}, },
{ {
"hdid" : 4000, // 唯一活动id 自选礼包 定制礼包 "hdid" : 4000, // 唯一活动id 自选礼包
"htype" : 4, // 后端唯一识别标识 "htype" : 4, // 后端唯一识别标识
"stype" : 400, // 前端唯一识别标识(看前端需要是否修改) "stype" : 400, // 前端唯一识别标识(看前端需要是否修改)
"ttype" : 1, // 0 按照开服时间计算1 玩家注册时间计算 4 屏蔽此活动 "ttype" : 1, // 0 按照开服时间计算1 玩家注册时间计算 4 屏蔽此活动
@ -4248,6 +4248,9 @@
"icon": "icon_tuisonglibao", "icon": "icon_tuisonglibao",
"showtime" : "仅供参考,会复写正确值", // 自选礼包,如果存在多个活动,计费点不要设置一样;如果是一样,可能会存在付费一次,购买多次。 "showtime" : "仅供参考,会复写正确值", // 自选礼包,如果存在多个活动,计费点不要设置一样;如果是一样,可能会存在付费一次,购买多次。
"data" : { "data" : {
//活动文本描述
intr: "wkdtips_1",
intr: "wkdtips_2",
//礼包 //礼包
gift: [ gift: [
{ {
@ -4303,7 +4306,7 @@
"data" : { "data" : {
//活动文本描述 //活动文本描述
intr: "czlbtips_1", intr: "czlbtips_1",
intr2: "czlbtips_2", intr: "czlbtips_2",
//礼包 //礼包
gift: [ gift: [
{ {
@ -6866,19 +6869,16 @@
}, },
], ],
//兑换商店 //兑换商店
//sell是打X折显示用
"duihuan": [ "duihuan": [
{id:1, need: [{a: 'attr', t: 'huangqiduihuan', n: 1000}], prize: [{a: 'item', t: '610', n: 1}], buyNum: 2}, {id:1, need: [{a: 'attr', t: 'huangqiduihuan', n: 1000}], prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}], buyNum: 2 },
{id:2, need: [{a: 'attr', t: 'huangqiduihuan', n: 2000}], prize: [{a: 'item', t: '610', n: 2}], buyNum: 1, sell: 90}, {id:2, need: [{a: 'attr', t: 'huangqiduihuan', n: 2000}], prize: [{a: 'item', t: '610', n: 2},{a: 'item', t: '2', n: 600},{a: 'item', t: '1', n: 550}], buyNum: 1 },
{id:3, need: [{a: 'attr', t: 'huangqiduihuan', n: 3000}], prize: [{a: 'item', t: '610', n: 3}], buyNum: 1, sell: 80}, {id:3, need: [{a: 'attr', t: 'huangqiduihuan', n: 3000}], prize: [{a: 'item', t: '610', n: 3},{a: 'item', t: '2', n: 700},{a: 'item', t: '1', n: 230}], buyNum: 1 },
{id:4, need: [{a: 'attr', t: 'huangqiduihuan', n: 4000}], prize: [{a: 'item', t: '610', n: 4}], buyNum: 3, sell: 75}, {id:4, need: [{a: 'attr', t: 'huangqiduihuan', n: 4000}], prize: [{a: 'item', t: '610', n: 4},{a: 'item', t: '2', n: 800},{a: 'item', t: '1', n: 690}], buyNum: 3 },
{id:5, need: [{a: 'attr', t: 'huangqiduihuan', n: 5000}], prize: [{a: 'item', t: '610', n: 5}], buyNum: 5}, {id:5, need: [{a: 'attr', t: 'huangqiduihuan', n: 5000}], prize: [{a: 'item', t: '610', n: 5},{a: 'item', t: '2', n: 900},{a: 'item', t: '1', n: 3300}], buyNum: 5 },
{id:6, need: [{a: 'attr', t: 'huangqiduihuan', n: 6000}], prize: [{a: 'item', t: '610', n: 6}], buyNum: 6} {id:6, need: [{a: 'attr', t: 'huangqiduihuan', n: 6000}], prize: [{a: 'item', t: '610', n: 6},{a: 'item', t: '2', n: 1000},{a: 'item', t: '1', n: 130}], buyNum: 6 }
], ],
//boss战配置 //boss表的ID
//npcId读NPC表 "bossId": 17001,
//img是战斗地图写死
"boss": {npcId: 17001, img:"bg_fight_jg"},
//boss挑战等级奖励每日0点结算发邮件 //boss挑战等级奖励每日0点结算发邮件
"bossLvReward": [ "bossLvReward": [
{lv:1, "need": 10000, prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}]}, {lv:1, "need": 10000, prize: [{a: 'item', t: '610', n: 1},{a: 'item', t: '2', n: 500},{a: 'item', t: '1', n: 1000}]},
@ -6951,30 +6951,7 @@
//boss排行邮件标题 //boss排行邮件标题
"bossRank_title": "email_title_hqjg_rank", "bossRank_title": "email_title_hqjg_rank",
//boss排行邮件内容 //boss排行邮件内容
"bossRank_des": "email_content_hqjg_rank", "bossRank_des": "email_content_hqjg_rank"
//活动时间结束后道具转换
"zhuanhuan": [
{
"start": {
'a': 'attr', 't': 'huangqijinbi', 'n': 1
},
"end": {
'a': 'attr', 't': 'jinbi', 'n': 10000
}
},
{
"start": {
'a': 'attr', 't': 'huangqiduihuan', 'n': 1
},
"end": {
'a': 'attr', 't': 'jinbi', 'n': 5000
}
}
],
//活动结算转换货币邮件标题
"end_mail_title": "email_title_hqjg_end",
//活动结算转换货币邮件内容
"end_mail_des": "email_content_hqjg_end"
} }
} }
] ]

View File

@ -2114,7 +2114,7 @@
"638": { "638": {
"id": 638, "id": 638,
"name": "intr_item_name_638", "name": "intr_item_name_638",
"undefined": "使用后可随机获得以下碎片", "undefined": "使用后可以随机获得巴拉莱卡、罗贝尔特中的10个碎片",
"type": 2, "type": 2,
"sort": 1, "sort": 1,
"colour": 5, "colour": 5,
@ -4016,7 +4016,7 @@
"undefined": "使用后解锁头像框“圣诞氛围”,解锁后防御加成+1%,解锁后生命加成+1%", "undefined": "使用后解锁头像框“圣诞氛围”,解锁后防御加成+1%,解锁后生命加成+1%",
"type": 7, "type": 7,
"sort": 1, "sort": 1,
"colour": 5, "colour": 4,
"way": [], "way": [],
"go": "", "go": "",
"icon": "txk_028", "icon": "txk_028",
@ -4027,7 +4027,7 @@
"usePrize": [], "usePrize": [],
"selecPrize": [], "selecPrize": [],
"payId": "", "payId": "",
"advancedEffects": "ani_xiangzikuang" "advancedEffects": ""
}, },
"50010": { "50010": {
"id": 50010, "id": 50010,
@ -4035,7 +4035,7 @@
"undefined": "使用后解锁头像框“披星戴月”,解锁后伤害加成+1%限时7天", "undefined": "使用后解锁头像框“披星戴月”,解锁后伤害加成+1%限时7天",
"type": 7, "type": 7,
"sort": 1, "sort": 1,
"colour": 5, "colour": 4,
"way": [], "way": [],
"go": "", "go": "",
"icon": "txk_025", "icon": "txk_025",
@ -4046,7 +4046,7 @@
"usePrize": [], "usePrize": [],
"selecPrize": [], "selecPrize": [],
"payId": "", "payId": "",
"advancedEffects": "ani_xiangzikuang" "advancedEffects": ""
}, },
"50011": { "50011": {
"id": 50011, "id": 50011,
@ -4054,7 +4054,7 @@
"undefined": "使用后解锁头像框“新春安宁”,解锁后生命加成+1%", "undefined": "使用后解锁头像框“新春安宁”,解锁后生命加成+1%",
"type": 7, "type": 7,
"sort": 1, "sort": 1,
"colour": 5, "colour": 4,
"way": [], "way": [],
"go": "", "go": "",
"icon": "txk_029", "icon": "txk_029",
@ -4065,26 +4065,7 @@
"usePrize": [], "usePrize": [],
"selecPrize": [], "selecPrize": [],
"payId": "", "payId": "",
"advancedEffects": "ani_xiangzikuang" "advancedEffects": ""
},
"50012": {
"id": 50012,
"name": "playerheadFrame_name_26",
"undefined": "使用后解锁头像框“花漫大地”,解锁后生命加成+1%限时7天",
"type": 7,
"sort": 1,
"colour": 5,
"way": [],
"go": "",
"icon": "txk_007",
"sicon": "txk_007",
"describe": "intr_item_describe_50012",
"diaoluo": 26,
"useNeed": [],
"usePrize": [],
"selecPrize": [],
"payId": "",
"advancedEffects": "ani_xiangzikuang"
}, },
"50101": { "50101": {
"id": 50101, "id": 50101,

View File

@ -1,201 +1,25 @@
{ {
//登陆福利 //登陆福利
denglufuli: [ denglufuli: [
{ { total: 2, prize: [{a: 'attr', t: 'jinbi', n: 20000},{a: 'item', t: '1', n: 40000},{a: 'item', t: '12', n: 200}] },
total: 2, { total: 3, prize: [{a: 'attr', t: 'jinbi', n: 20000},{a: 'item', t: '1', n: 40000},{a: 'item', t: '12', n: 200}] },
prize: [ { total: 4, prize: [{a: 'attr', t: 'jinbi', n: 20000},{a: 'item', t: '1', n: 40000},{a: 'item', t: '12', n: 200}] },
{ { total: 5, prize: [{a: 'attr', t: 'jinbi', n: 20000},{a: 'item', t: '1', n: 40000},{a: 'item', t: '12', n: 200}] },
a: 'attr',
t: 'jinbi',
n: 20000
},
{
a: 'item',
t: '1',
n: 40000
},
{
a: 'item',
t: '12',
n: 200
}
]
},
{
total: 3,
prize: [
{
a: 'attr',
t: 'jinbi',
n: 20000
},
{
a: 'item',
t: '1',
n: 40000
},
{
a: 'item',
t: '12',
n: 200
}
]
},
{
total: 4,
prize: [
{
a: 'attr',
t: 'jinbi',
n: 20000
},
{
a: 'item',
t: '1',
n: 40000
},
{
a: 'item',
t: '12',
n: 200
}
]
},
{
total: 5,
prize: [
{
a: 'attr',
t: 'jinbi',
n: 20000
},
{
a: 'item',
t: '1',
n: 40000
},
{
a: 'item',
t: '12',
n: 200
}
]
},
], ],
//活动任务 //活动任务
huodongrenwu: [ huodongrenwu: [
{ {idx: 0, taskId: 'use_attr_rmbmoney', total: 300, prize: [{ a: 'item', t: '4', n: 5 }] , decs: 'intr_jierihuodong_1'},
idx: 0, {idx: 1, taskId: 'tanxian/FastGuaJi', total: 3, prize: [{ a: 'item', t: '4', n: 5 }] , decs: 'intr_jierihuodong_2'},
taskId: 'use_attr_rmbmoney', {idx: 2, taskId: 'jjc/Fight', total: 3, prize: [{ a: 'item', t: '4', n: 5 }] , decs: 'intr_jierihuodong_3'}
total: 300,
prize: [
{
a: 'item',
t: '4',
n: 5
}
],
decs: 'intr_jierihuodong_1'
},
{
idx: 1,
taskId: 'tanxian/FastGuaJi',
total: 3,
prize: [
{
a: 'item',
t: '4',
n: 5
}
],
decs: 'intr_jierihuodong_2'
},
{
idx: 2,
taskId: 'jjc/Fight',
total: 3,
prize: [
{
a: 'item',
t: '4',
n: 5
}
],
decs: 'intr_jierihuodong_3'
}
], ],
//兑换 //兑换
duihuan: [ duihuan: [
{ { need: [{a: 'attr', t: 'jinbi', n: 200}], prize: [{a: 'item', t: '12', n: 200}], num: 10 },
need: [ { need: [{a: 'attr', t: 'jinbi', n: 400}], prize: [{a: 'item', t: '12', n: 400}], num: 10 }
{
a: 'attr',
t: 'jinbi',
n: 200
}
],
prize: [
{
a: 'item',
t: '12',
n: 200
}
],
num: 10
},
{
need: [
{
a: 'attr',
t: 'jinbi',
n: 400
}
],
prize: [
{
a: 'item',
t: '12',
n: 400
}
],
num: 10
}
], ],
//礼包 //礼包
libao: [ libao: [
{ { need: [{a: 'attr', t: 'jinbi', n: 200}], prize: [{a: 'item', t: '12', n: 200}], num: 10 },
need: [ { need: [{a: 'attr', t: 'jinbi', n: 400}], prize: [{a: 'item', t: '12', n: 400}], num: 10 }
{
a: 'attr',
t: 'jinbi',
n: 200
}
],
prize: [
{
a: 'item',
t: '12',
n: 200
}
],
num: 10
},
{
need: [
{
a: 'attr',
t: 'jinbi',
n: 400
}
],
prize: [
{
a: 'item',
t: '12',
n: 400
}
],
num: 10
}
] ]
} }

View File

@ -21849,22 +21849,6 @@
"isboss": 1, "isboss": 1,
"ghname": "npc_ghname_2" "ghname": "npc_ghname_2"
}, },
"17004": {
"npcId": 17004,
"attr": {},
"npclist": "5001_60_90301#5001_60_90301#5001_60_90301#5001_60_90301#5001_60_90301#5001_60_90301",
"npcLv": [],
"isboss": 1,
"ghname": "npc_ghname_6",
"skin": [
50011,
50011,
50011,
50011,
50011,
50011
]
},
"18001": { "18001": {
"npcId": 18001, "npcId": 18001,
"attr": {}, "attr": {},

View File

@ -69,7 +69,7 @@
1001 1001
], ],
"intr": "intr_playerinfo_intr_1001", "intr": "intr_playerinfo_intr_1001",
"sort": 43, "sort": 42,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -84,7 +84,7 @@
1002 1002
], ],
"intr": "intr_playerinfo_intr_1002", "intr": "intr_playerinfo_intr_1002",
"sort": 44, "sort": 43,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -99,7 +99,7 @@
2001 2001
], ],
"intr": "intr_playerinfo_intr_2001", "intr": "intr_playerinfo_intr_2001",
"sort": 41, "sort": 40,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -114,7 +114,7 @@
2002 2002
], ],
"intr": "intr_playerinfo_intr_2002", "intr": "intr_playerinfo_intr_2002",
"sort": 42, "sort": 41,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -129,7 +129,7 @@
3001 3001
], ],
"intr": "intr_playerinfo_intr_3001", "intr": "intr_playerinfo_intr_3001",
"sort": 26, "sort": 25,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -144,7 +144,7 @@
3002 3002
], ],
"intr": "intr_playerinfo_intr_3002", "intr": "intr_playerinfo_intr_3002",
"sort": 27, "sort": 26,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -159,7 +159,7 @@
3003 3003
], ],
"intr": "intr_playerinfo_intr_3003", "intr": "intr_playerinfo_intr_3003",
"sort": 28, "sort": 27,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -174,7 +174,7 @@
3004 3004
], ],
"intr": "intr_playerinfo_intr_3004", "intr": "intr_playerinfo_intr_3004",
"sort": 29, "sort": 28,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -189,7 +189,7 @@
3005 3005
], ],
"intr": "intr_playerinfo_intr_3005", "intr": "intr_playerinfo_intr_3005",
"sort": 30, "sort": 29,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -204,7 +204,7 @@
3006 3006
], ],
"intr": "intr_playerinfo_intr_3006", "intr": "intr_playerinfo_intr_3006",
"sort": 31, "sort": 30,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -219,7 +219,7 @@
3007 3007
], ],
"intr": "intr_playerinfo_intr_3007", "intr": "intr_playerinfo_intr_3007",
"sort": 32, "sort": 31,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -234,7 +234,7 @@
3008 3008
], ],
"intr": "intr_playerinfo_intr_3008", "intr": "intr_playerinfo_intr_3008",
"sort": 33, "sort": 32,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -249,7 +249,7 @@
3009 3009
], ],
"intr": "intr_playerinfo_intr_3009", "intr": "intr_playerinfo_intr_3009",
"sort": 34, "sort": 33,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -264,7 +264,7 @@
3010 3010
], ],
"intr": "intr_playerinfo_intr_3010", "intr": "intr_playerinfo_intr_3010",
"sort": 35, "sort": 34,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -279,7 +279,7 @@
3011 3011
], ],
"intr": "intr_playerinfo_intr_3011", "intr": "intr_playerinfo_intr_3011",
"sort": 36, "sort": 35,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -294,7 +294,7 @@
3012 3012
], ],
"intr": "intr_playerinfo_intr_3012", "intr": "intr_playerinfo_intr_3012",
"sort": 37, "sort": 36,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -309,7 +309,7 @@
3013 3013
], ],
"intr": "intr_playerinfo_intr_3013", "intr": "intr_playerinfo_intr_3013",
"sort": 38, "sort": 37,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -324,7 +324,7 @@
3014 3014
], ],
"intr": "intr_playerinfo_intr_3014", "intr": "intr_playerinfo_intr_3014",
"sort": 39, "sort": 38,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -339,7 +339,7 @@
3015 3015
], ],
"intr": "intr_playerinfo_intr_3015", "intr": "intr_playerinfo_intr_3015",
"sort": 40, "sort": 39,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -354,7 +354,7 @@
4001 4001
], ],
"intr": "intr_playerinfo_intr_4001", "intr": "intr_playerinfo_intr_4001",
"sort": 11, "sort": 10,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -369,7 +369,7 @@
4002 4002
], ],
"intr": "intr_playerinfo_intr_4002", "intr": "intr_playerinfo_intr_4002",
"sort": 12, "sort": 11,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -384,7 +384,7 @@
4003 4003
], ],
"intr": "intr_playerinfo_intr_4003", "intr": "intr_playerinfo_intr_4003",
"sort": 13, "sort": 12,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -399,7 +399,7 @@
4004 4004
], ],
"intr": "intr_playerinfo_intr_4004", "intr": "intr_playerinfo_intr_4004",
"sort": 14, "sort": 13,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -414,7 +414,7 @@
4005 4005
], ],
"intr": "intr_playerinfo_intr_4005", "intr": "intr_playerinfo_intr_4005",
"sort": 15, "sort": 14,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -429,7 +429,7 @@
4006 4006
], ],
"intr": "intr_playerinfo_intr_4006", "intr": "intr_playerinfo_intr_4006",
"sort": 16, "sort": 15,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -444,7 +444,7 @@
4007 4007
], ],
"intr": "intr_playerinfo_intr_4007", "intr": "intr_playerinfo_intr_4007",
"sort": 17, "sort": 16,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -459,7 +459,7 @@
4008 4008
], ],
"intr": "intr_playerinfo_intr_4008", "intr": "intr_playerinfo_intr_4008",
"sort": 18, "sort": 17,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -474,7 +474,7 @@
4009 4009
], ],
"intr": "intr_playerinfo_intr_4009", "intr": "intr_playerinfo_intr_4009",
"sort": 19, "sort": 18,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -489,7 +489,7 @@
4010 4010
], ],
"intr": "intr_playerinfo_intr_4010", "intr": "intr_playerinfo_intr_4010",
"sort": 20, "sort": 19,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -504,7 +504,7 @@
4011 4011
], ],
"intr": "intr_playerinfo_intr_4011", "intr": "intr_playerinfo_intr_4011",
"sort": 21, "sort": 20,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -519,7 +519,7 @@
4012 4012
], ],
"intr": "intr_playerinfo_intr_4012", "intr": "intr_playerinfo_intr_4012",
"sort": 22, "sort": 21,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -527,14 +527,14 @@
"4013": { "4013": {
"id": 4013, "id": 4013,
"name": "intr_playerinfo_name_4013", "name": "intr_playerinfo_name_4013",
"undefined": "获得干部葛丽特后解锁", "undefined": "获得干部格里达尔后解锁",
"img": 4013, "img": 4013,
"cond": [ "cond": [
"hero", "hero",
4013 4013
], ],
"intr": "intr_playerinfo_intr_4013", "intr": "intr_playerinfo_intr_4013",
"sort": 23, "sort": 22,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -549,7 +549,7 @@
4014 4014
], ],
"intr": "intr_playerinfo_intr_4014", "intr": "intr_playerinfo_intr_4014",
"sort": 24, "sort": 23,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -564,7 +564,7 @@
4015 4015
], ],
"intr": "intr_playerinfo_intr_4015", "intr": "intr_playerinfo_intr_4015",
"sort": 25, "sort": 24,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -579,7 +579,7 @@
5001 5001
], ],
"intr": "intr_playerinfo_intr_5001", "intr": "intr_playerinfo_intr_5001",
"sort": 6, "sort": 5,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -594,7 +594,7 @@
5002 5002
], ],
"intr": "intr_playerinfo_intr_5002", "intr": "intr_playerinfo_intr_5002",
"sort": 7, "sort": 6,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -609,7 +609,7 @@
5003 5003
], ],
"intr": "intr_playerinfo_intr_5003", "intr": "intr_playerinfo_intr_5003",
"sort": 8, "sort": 7,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -624,7 +624,7 @@
5004 5004
], ],
"intr": "intr_playerinfo_intr_5004", "intr": "intr_playerinfo_intr_5004",
"sort": 9, "sort": 8,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""
@ -639,22 +639,7 @@
5005 5005
], ],
"intr": "intr_playerinfo_intr_5005", "intr": "intr_playerinfo_intr_5005",
"sort": 10, "sort": 9,
"buff": {},
"colour": 1,
"ani": ""
},
"50011": {
"id": 50011,
"name": "intr_playerinfo_name_50011",
"undefined": "获得干部莱薇外观【兔女郎】后解锁",
"img": 50011,
"cond": [
"heroskin",
50011
],
"intr": "intr_playerinfo_intr_50011",
"sort": 5,
"buff": {}, "buff": {},
"colour": 1, "colour": 1,
"ani": "" "ani": ""

View File

@ -139,7 +139,7 @@
"id": 9, "id": 9,
"name": "playerheadFrame_name_9", "name": "playerheadFrame_name_9",
"undefined": "名望等级达到五阶获得,解锁后防御加成+1%", "undefined": "名望等级达到五阶获得,解锁后防御加成+1%",
"img": "txk_012", "img": "txk_005",
"cond": [ "cond": [
"renown", "renown",
41 41
@ -311,7 +311,7 @@
"id": 19, "id": 19,
"name": "playerheadFrame_name_19", "name": "playerheadFrame_name_19",
"undefined": "开服冲榜活动获得,解锁后攻击加成+1%", "undefined": "开服冲榜活动获得,解锁后攻击加成+1%",
"img": "txk_006", "img": "txk_004",
"cond": [ "cond": [
"time", "time",
-1 -1
@ -395,8 +395,8 @@
"24": { "24": {
"id": 24, "id": 24,
"name": "playerheadFrame_name_24", "name": "playerheadFrame_name_24",
"undefined": "消费竞赛活动获得,解锁后伤害加成+1%限时7天", "undefined": "消费竞赛活动前三名获得,解锁后伤害加成+1%限时7天",
"img": "txk_015", "img": "txk_025",
"cond": [ "cond": [
"time", "time",
604800 604800
@ -425,22 +425,5 @@
}, },
"colour": 4, "colour": 4,
"ani": "" "ani": ""
},
"26": {
"id": 26,
"name": "playerheadFrame_name_26",
"undefined": "黄旗酒馆活动获得,解锁后生命加成+1%限时7天",
"img": "txk_007",
"cond": [
"time",
604800
],
"intr": "playerheadFrame_des_26",
"sort": 26,
"buff": {
"hppro": 0.01
},
"colour": 5,
"ani": ""
} }
} }

View File

@ -1705,13 +1705,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有1%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.01的几率造成双倍伤害"
}, },
"tx01301": { "tx01301": {
"skillid": "tx01301", "skillid": "tx01301",
@ -1724,13 +1724,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有2%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.02的几率造成双倍伤害"
}, },
"tx01302": { "tx01302": {
"skillid": "tx01302", "skillid": "tx01302",
@ -1743,13 +1743,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有3%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.03的几率造成双倍伤害"
}, },
"tx01303": { "tx01303": {
"skillid": "tx01303", "skillid": "tx01303",
@ -1762,13 +1762,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有4%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.04的几率造成双倍伤害"
}, },
"tx01304": { "tx01304": {
"skillid": "tx01304", "skillid": "tx01304",
@ -1781,13 +1781,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有5%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.05的几率造成双倍伤害"
}, },
"tx01305": { "tx01305": {
"skillid": "tx01305", "skillid": "tx01305",
@ -1800,13 +1800,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有6%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.06的几率造成双倍伤害"
}, },
"tx01306": { "tx01306": {
"skillid": "tx01306", "skillid": "tx01306",
@ -1819,13 +1819,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有7%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.07的几率造成双倍伤害"
}, },
"tx01307": { "tx01307": {
"skillid": "tx01307", "skillid": "tx01307",
@ -1838,13 +1838,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有8%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.08的几率造成双倍伤害"
}, },
"tx01308": { "tx01308": {
"skillid": "tx01308", "skillid": "tx01308",
@ -1857,13 +1857,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有9%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.09的几率造成双倍伤害"
}, },
"tx01309": { "tx01309": {
"skillid": "tx01309", "skillid": "tx01309",
@ -1876,13 +1876,13 @@
"sxleixing": "attr", "sxleixing": "attr",
"buff_type": 1, "buff_type": 1,
"xiaoguocanshu": { "xiaoguocanshu": {
"dpspro": 1 "dpspro": 2
}, },
"round": 3, "round": 2,
"group": "tx01300", "group": "tx01300",
"jiejiaxiaoguo": "retime", "jiejiaxiaoguo": "retime",
"diejiacengshu": 1, "diejiacengshu": 1,
"describe": "进入战斗后的前2回合进入致命状态攻击敌人时有10%的几率造成双倍伤害" "describe": "进入战斗后的前2回合进入致命状态攻击敌人时有0.10的几率造成双倍伤害"
}, },
"tx02300": { "tx02300": {
"skillid": "tx02300", "skillid": "tx02300",

View File

@ -800,8 +800,6 @@ type gc_npc = k_v<{
'ghname': string 'ghname': string
/**npc名称 */ /**npc名称 */
'npcname': string 'npcname': string
/**怪物皮肤*/
'skin': number[]
}>; }>;
type gc_openCond = k_v<{ type gc_openCond = k_v<{

View File

@ -94,37 +94,37 @@ export class JJCFun {
* @param uTimeOffset * @param uTimeOffset
* @param isUpdate * @param isUpdate
*/ */
// static async checkUpdatePlayer(min: number = 0, max: number = 1000, uTimeOffset: number = 600, isUpdate: boolean = true) { static async checkUpdatePlayer(min: number = 0, max: number = 1000, uTimeOffset: number = 600, isUpdate: boolean = true) {
// // 获取指定排名用户uid // 获取指定排名用户uid
// let sortInfo = await this.getRankListUid(min, max) let sortInfo = await this.getRankListUid(min, max)
// if (!sortInfo.length) return [] if (!sortInfo.length) return []
// let updateArr = [] let updateArr = []
// let users = await G.redis.hGetAll('rank:jjc:data') let users = await G.redis.hGetAll('rank:jjc:data')
// for (let i = 0; i < sortInfo.length; i++) { for (let i = 0; i < sortInfo.length; i++) {
// let uid = sortInfo[i] let uid = sortInfo[i]
// let rankInfo = users[uid] let rankInfo = users[uid]
// if (!rankInfo?.player) continue if (!rankInfo?.player) continue
// // 比对utime判断是否更新数据 // 比对utime判断是否更新数据
// if (!rankInfo.player.isNpc) { if (!rankInfo.player.isNpc) {
// if (!rankInfo.utime || (rankInfo.utime && rankInfo.utime < (G.time - uTimeOffset))) { if (!rankInfo.utime || (rankInfo.utime && rankInfo.utime < (G.time - uTimeOffset))) {
// updateArr.push(rankInfo) updateArr.push(rankInfo)
// } }
// } }
// } }
// // 更新数据 // 更新数据
// if (isUpdate && updateArr.length > 0) { if (isUpdate && updateArr.length > 0) {
// let playerArrInfo = await G.mongodb.collection("user").find({uid: {$in: updateArr.map(i => i.uid)}}).toArray() let playerArrInfo = await G.mongodb.collection("user").find({uid: {$in: updateArr.map(i => i.uid)}}).toArray()
// for (let i = 0; i < playerArrInfo.length; i++) { for (let i = 0; i < playerArrInfo.length; i++) {
// let playerInfo = playerArrInfo[i] let playerInfo = playerArrInfo[i]
// let index = updateArr.findIndex(x => x.player.uid == playerInfo.uid) let index = updateArr.findIndex(x => x.player.uid == playerInfo.uid)
// updateArr[index].player = playerInfo updateArr[index].player = playerInfo
// updateArr[index].utime = G.time updateArr[index].utime = G.time
// this.updatePlayerData(playerInfo.uid, updateArr[index]); this.updatePlayerData(playerInfo.uid, updateArr[index]);
// } }
// } }
// } }
/** /**
* uid[] * uid[]

View File

@ -260,10 +260,7 @@ export class PayFun {
let selectPrize = await G.ioredis.get(`pay:${payId}:${player.uid}`); let selectPrize = await G.ioredis.get(`pay:${payId}:${player.uid}`);
if (selectPrize) { if (selectPrize) {
prize.push(...JSON.parse(selectPrize)) prize.push(...JSON.parse(selectPrize))
//支付A check -> 玩家支付 -> 网络延迟 G.ioredis.del(`pay:${payId}:${player.uid}`)
//支付B check -> 玩家支付 -> pay -> del
//支付A -> pay 时,这里可能被清了,导致给玩家发放了空的奖励,因此,这里不清除
//G.ioredis.del(`pay:${payId}:${player.uid}`)
} }
} }

View File

@ -1,27 +1,25 @@
import {ObjectId, OptionalId} from 'mongodb'; import { ObjectId, OptionalId } from 'mongodb';
import {ApiCall, BaseConnection, TsrpcError} from 'tsrpc'; import { ApiCall, BaseConnection, TsrpcError } from 'tsrpc';
import {checkPlayerGift} from '../api_s2c/event/xianshilibao/fun'; import { checkPlayerGift } from '../api_s2c/event/xianshilibao/fun';
import {md_redPoint_check} from '../api_s2c/gongyu/mingdao/ApiOpen'; import { md_redPoint_check } from '../api_s2c/gongyu/mingdao/ApiOpen';
import {CollectionPeiJian} from '../module/collection_peijian'; import { CollectionPeiJian } from '../module/collection_peijian';
import {Wjjl} from '../module/collection_wjjl'; import { Wjjl } from '../module/collection_wjjl';
import {MongodbCollections} from '../module/mongodb'; import { MongodbCollections } from '../module/mongodb';
import {G123} from '../sdk/G123'; import { G123 } from '../sdk/G123';
import {ResGetList} from '../shared/protocols/item/PtlGetList'; import { ResGetList } from '../shared/protocols/item/PtlGetList';
import {ResLogin} from '../shared/protocols/user/PtlLogin'; import { ResLogin } from '../shared/protocols/user/PtlLogin';
import {player} from '../shared/protocols/user/type'; import { player } from '../shared/protocols/user/type';
import {HeroShared, otherBuff} from '../shared/public/hero'; import { HeroShared, otherBuff } from '../shared/public/hero';
import {PublicShared} from '../shared/public/public'; import { PublicShared } from '../shared/public/public';
import {HeroFun} from './hero'; import { HeroFun } from './hero';
import {ShiwuFun} from './shiwu'; import { ShiwuFun } from './shiwu';
import {UserFun} from './user'; 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"; import { PushGiftFun } from "./pushgift";
import { ActionLog } from './actionLog/actionLog'; import { ActionLog } from './actionLog/actionLog';
import { roleDataType } from '../shared/fightControl/fightType'; import HeroSkinFun from './heroskin';
import { PlayerShared } from '../shared/public/player';
export type call = { export type call = {
get otherBuff(): otherBuff; get otherBuff(): otherBuff;
@ -43,41 +41,6 @@ export type call = {
}; };
export class PlayerFun { export class PlayerFun {
/**
* uid获取战斗数据
* @param uid
* @returns
*/
static async getDefaultFightDataByUid(uid:string){
let gud = await getGud(uid);
let posObj = gud.heroPos;
let roles: k_v<roleDataType> = {};
if (gud.selectMatrix && gud.matrixPos) {
posObj = gud.matrixPos[gud.selectMatrix];
}
let heros = await HeroFun.getHeros({uid:uid}, Object.values(posObj).filter(_id => _id != '') as string[]);
let otherBuff = UserFun.getOtherBuff(gud)
Object.entries(posObj).forEach(obj => {
let pos = obj[0];
let _id = obj[1];
let hero = heros.filter(h => h._id == _id)[0];
if (hero) {
roles[pos] = {
...hero,
attr: {
...HeroShared.getHeroBasicAttr(hero, { ...otherBuff, allBuff: HeroShared.getAllBuff(heros) }, Number(pos))
}
};
}
});
return {
player: { ...gud, buff: PlayerShared.getBuff(gud) },
roles: roles
};
}
/** /**
* atn数量 * atn数量
*/ */
@ -107,13 +70,13 @@ export class PlayerFun {
if (err) { if (err) {
// 消耗不足 触发推送礼包 // 消耗不足 触发推送礼包
PushGiftFun.chkItemGift(call.uid, atn) 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 };
} }
} }
} }
return {isOk: true, atn: null}; return { isOk: true, atn: null };
} }
/** /**
@ -131,7 +94,7 @@ export class PlayerFun {
atn: need atn: need
}; };
if (args.length < 1) { if (args.length < 1) {
throw new TsrpcError('', {code: -104, atn: meet.atn}); throw new TsrpcError('', { code: -104, atn: meet.atn });
} }
return await this.checkNeedByArgs(call, ...args); return await this.checkNeedByArgs(call, ...args);
} }
@ -154,10 +117,10 @@ export class PlayerFun {
all.push(this.addItem(call, item)); all.push(this.addItem(call, item));
} }
// 记录消耗 // 记录消耗
addGameLog(call.uid, call.service.name, call.req, {need: val}) addGameLog(call.uid, call.service.name, call.req, { need: val })
await Promise.all(all); await Promise.all(all);
G.emit('USE_ITEM', call.conn.gud, needArr.map(need => { G.emit('USE_ITEM', call.conn.gud, needArr.map(need => {
return {...need, n: Math.abs(need.n)}; return { ...need, n: Math.abs(need.n) };
})); }));
} }
@ -173,16 +136,18 @@ export class PlayerFun {
let equip = prizeList.filter(atn => atn.a == 'equip' && atn.n != 0); let equip = prizeList.filter(atn => atn.a == 'equip' && atn.n != 0);
let shiwu = prizeList.filter(atn => atn.a == 'shiwu' && atn.n != 0); let shiwu = prizeList.filter(atn => atn.a == 'shiwu' && atn.n != 0);
let peijian = prizeList.filter(atn => atn.a == 'peijian' && atn.n != 0); let peijian = prizeList.filter(atn => atn.a == 'peijian' && atn.n != 0);
let heroskin = prizeList.filter(atn => atn.a == 'heroskin' && atn.n != 0);
// 记录获得 // 记录获得
addGameLog(call.uid, call.service.name, call.req, {prize: prizeList}) addGameLog(call.uid, call.service.name, call.req, { prize: prizeList })
await Promise.all([ await Promise.all([
attr.length > 0 && this.addAttr(call, attr), attr.length > 0 && this.addAttr(call, attr),
item.length > 0 && this.addItem(call, item), item.length > 0 && this.addItem(call, item),
hero.length > 0 && this.addHero(call, hero), hero.length > 0 && this.addHero(call, hero),
equip.length > 0 && this.addEquip(call, equip), equip.length > 0 && this.addEquip(call, equip),
shiwu.length > 0 && this.addShiwu(call, shiwu), shiwu.length > 0 && this.addShiwu(call, shiwu),
peijian.length > 0 && this.addPeijian(call, peijian) peijian.length > 0 && this.addPeijian(call, peijian),
heroskin.length > 0 && this.addHeroskin(call, heroskin),
]); ]);
return prizeList; return prizeList;
@ -217,9 +182,9 @@ export class PlayerFun {
} }
} }
if( (atn.t == 'rmbmoney' || atn.t == 'jinbi') && atn.n > 0 ){ if ((atn.t == 'rmbmoney' || atn.t == 'jinbi') && atn.n > 0) {
//统计今日获取的金币和钻石 //统计今日获取的金币和钻石
ActionLog.addDayLog(call.conn.uid, { key: 'got_'+atn.t, val: atn.n }); ActionLog.addDayLog(call.conn.uid, { key: 'got_' + atn.t, val: atn.n });
} }
// 增加vip经验的任务监听 // 增加vip经验的任务监听
@ -227,7 +192,7 @@ export class PlayerFun {
G.emit("Class_task_157", 'Class_task_157', call, atn.n, 0); G.emit("Class_task_157", 'Class_task_157', call, atn.n, 0);
} }
all.push(this.changeAttr(call.conn.uid, change)); all.push(this.changeAttr(call.conn.uid, change));
all.push(this.upAttr(call, {...atn, n: change[atn.t]})); all.push(this.upAttr(call, { ...atn, n: change[atn.t] }));
//await this.changeAttr(call.conn.uid, change); //await this.changeAttr(call.conn.uid, change);
//await this.upAttr(call, {...atn, n: change[atn.t]}); //await this.upAttr(call, {...atn, n: change[atn.t]});
} }
@ -270,17 +235,17 @@ export class PlayerFun {
G.mongodb.collection('rmbuse').insertOne(data); G.mongodb.collection('rmbuse').insertOne(data);
// 消费竞赛开启时写入跨服数据库 // 消费竞赛开启时写入跨服数据库
if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') { if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') {
G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, { G.crossmongodb.collection('rmbuse').updateOne({ uid: data.uid, type: `xfjs_${G.huodong.xfjsId}` }, {
$set: {time: G.time}, $set: { time: G.time },
$inc: {change: data.change} $inc: { change: data.change }
}, {upsert: true}); }, { upsert: true });
} }
} }
static async changeAttr(uid: string, change: Partial<player>) { static async changeAttr(uid: string, change: Partial<player>) {
setGud(uid, change); setGud(uid, change);
G.mongodb.collection('user').updateOne({uid: uid}, {$set: change}); G.mongodb.collection('user').updateOne({ uid: uid }, { $set: change });
if (G.server.uid_connections[uid]) { if (G.server.uid_connections[uid]) {
checkPlayerGift(G.server.uid_connections[uid].gud, change); checkPlayerGift(G.server.uid_connections[uid].gud, change);
@ -302,9 +267,9 @@ export class PlayerFun {
const curLv = call.conn.gud.lv; const curLv = call.conn.gud.lv;
while (conf[curLv + addLv + 1] && atn.n >= conf[curLv + addLv + 1].need) { while (conf[curLv + addLv + 1] && atn.n >= conf[curLv + addLv + 1].need) {
addLv++; addLv++;
G123.sendUserLevelUp({...call.conn.gud, lv: curLv + addLv, nexp: atn.n}); G123.sendUserLevelUp({ ...call.conn.gud, lv: curLv + addLv, nexp: atn.n });
} }
addLv && await this.addAttr(call, {lv: curLv + addLv}); addLv && await this.addAttr(call, { lv: curLv + addLv });
break; break;
case 'payExp': case 'payExp':
let addVip = 0; let addVip = 0;
@ -313,7 +278,7 @@ export class PlayerFun {
while (vipConf[curVip + addVip + 1] && atn.n >= vipConf[curVip + addVip + 1].exp) { while (vipConf[curVip + addVip + 1] && atn.n >= vipConf[curVip + addVip + 1].exp) {
addVip++; addVip++;
} }
addVip && await this.addAttr(call, {vip: curVip + addVip}); addVip && await this.addAttr(call, { vip: curVip + addVip });
break; break;
} }
} }
@ -324,7 +289,7 @@ export class PlayerFun {
static async addItem(call: call, val: atn[]) { static async addItem(call: call, val: atn[]) {
for (let atn of val) { for (let atn of val) {
let upObj = { let upObj = {
filter: {uid: call.uid, itemId: atn.t}, filter: { uid: call.uid, itemId: atn.t },
update: { update: {
$setOnInsert: { $setOnInsert: {
firstTime: G.time, firstTime: G.time,
@ -356,7 +321,7 @@ 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}, { addGameLog(call.uid, "_itemChange", { "additem": 1 }, {
"filter": upObj.filter, "filter": upObj.filter,
"update": upObj.update, "update": upObj.update,
"options": upObj.options "options": upObj.options
@ -364,10 +329,10 @@ export class PlayerFun {
} else { } else {
if (item.num + atn.n <= 0) { if (item.num + atn.n <= 0) {
await Promise.all([ await Promise.all([
G.mongodb.collection('item').deleteOne({uid: call.uid, itemId: atn.t}) G.mongodb.collection('item').deleteOne({ uid: call.uid, itemId: atn.t })
]); ]);
call.addEventMsg('msg_s2c/ItemChange', atn.t, {num: 0}); call.addEventMsg('msg_s2c/ItemChange', atn.t, { num: 0 });
addGameLog(call.uid, "_itemChange", {"delitem": 1}, {"itemId": atn.t}) addGameLog(call.uid, "_itemChange", { "delitem": 1 }, { "itemId": atn.t })
} else { } else {
await Promise.all([ await Promise.all([
G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options) G.mongodb.collection('item').updateOne(upObj.filter, upObj.update, upObj.options)
@ -376,7 +341,7 @@ 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}, { addGameLog(call.uid, "_itemChange", { "attritem": 1 }, {
"filter": upObj.filter, "filter": upObj.filter,
"update": upObj.update, "update": upObj.update,
"options": upObj.options, "options": upObj.options,
@ -411,7 +376,7 @@ export class PlayerFun {
insertData.forEach((v, key) => { insertData.forEach((v, key) => {
let id = result.insertedIds[key].toHexString(); let id = result.insertedIds[key].toHexString();
let {_id, ...ops} = v; let { _id, ...ops } = v;
Wjjl.setVal(call.uid, `has_equip_color_${G.gc.equip[ops.equipId].colour}`, 1, false); Wjjl.setVal(call.uid, `has_equip_color_${G.gc.equip[ops.equipId].colour}`, 1, false);
@ -445,10 +410,10 @@ export class PlayerFun {
*/ */
static async cutEquip(call: call, _idArr: string[]) { static async cutEquip(call: call, _idArr: string[]) {
for (let _id of _idArr) { for (let _id of _idArr) {
G.mongodb.collection('equip').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); G.mongodb.collection('equip').deleteOne({ uid: call.uid, _id: new ObjectId(_id) });
call.addEventMsg('msg_s2c/EquipChange', _id, {num: 0}); call.addEventMsg('msg_s2c/EquipChange', _id, { num: 0 });
addGameLog(call.uid, "_cutEquip", {}, {_id: _id}) addGameLog(call.uid, "_cutEquip", {}, { _id: _id })
} }
} }
@ -482,7 +447,7 @@ export class PlayerFun {
let v = insertData[key] let v = insertData[key]
let id = result.insertedIds[key].toHexString(); let id = result.insertedIds[key].toHexString();
let {_id, ...ops} = v; let { _id, ...ops } = v;
call.addEventMsg('msg_s2c/HeroChange', id, { call.addEventMsg('msg_s2c/HeroChange', id, {
_id: id, _id: id,
@ -515,9 +480,9 @@ export class PlayerFun {
static async cutHero(call: call, _idArr: string[]) { static async cutHero(call: call, _idArr: string[]) {
for (let _id of _idArr) { for (let _id of _idArr) {
await HeroFun.delHero(call, _id); await HeroFun.delHero(call, _id);
G.mongodb.collection('hero').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); G.mongodb.collection('hero').deleteOne({ uid: call.uid, _id: new ObjectId(_id) });
call.addEventMsg('msg_s2c/HeroChange', _id, {num: 0}); call.addEventMsg('msg_s2c/HeroChange', _id, { num: 0 });
addGameLog(call.uid, "_cutHero", {}, {_id: _id}) addGameLog(call.uid, "_cutHero", {}, { _id: _id })
} }
} }
@ -532,7 +497,7 @@ export class PlayerFun {
colour: v.colour, colour: v.colour,
wearId: '', wearId: '',
shiwuId: v.t, shiwuId: v.t,
jichu: ShiwuFun.randomJichu({colour: v.colour, shiwuId: v.t}), jichu: ShiwuFun.randomJichu({ colour: v.colour, shiwuId: v.t }),
fujia: [] fujia: []
}; };
if (v.shiwuBuff) { if (v.shiwuBuff) {
@ -552,7 +517,7 @@ export class PlayerFun {
insertData.forEach((v, key) => { insertData.forEach((v, key) => {
let id = result.insertedIds[key].toHexString(); let id = result.insertedIds[key].toHexString();
let {_id, ...ops} = v; let { _id, ...ops } = v;
call.addEventMsg('msg_s2c/ShiwuChange', id, { call.addEventMsg('msg_s2c/ShiwuChange', id, {
_id: id, _id: id,
...ops ...ops
@ -571,9 +536,9 @@ export class PlayerFun {
*/ */
static async cutShiwu(call: call, _idArr: string[]) { static async cutShiwu(call: call, _idArr: string[]) {
for (let _id of _idArr) { for (let _id of _idArr) {
G.mongodb.collection('shiwu').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); G.mongodb.collection('shiwu').deleteOne({ uid: call.uid, _id: new ObjectId(_id) });
call.addEventMsg('msg_s2c/ShiwuChange', _id, {num: 0}); call.addEventMsg('msg_s2c/ShiwuChange', _id, { num: 0 });
addGameLog(call.uid, "_cutShiwu", {}, {_id: _id}) addGameLog(call.uid, "_cutShiwu", {}, { _id: _id })
} }
} }
@ -598,7 +563,7 @@ export class PlayerFun {
addGameLog(call.uid, "_addPeiJian", {}, insertData) addGameLog(call.uid, "_addPeiJian", {}, insertData)
insertData.forEach((v, key) => { insertData.forEach((v, key) => {
let {_id, uid, ...ops} = v; let { _id, uid, ...ops } = v;
let id = _id.toHexString(); let id = _id.toHexString();
if (G.gc.peijian[v.peijianId].colour != 5) { if (G.gc.peijian[v.peijianId].colour != 5) {
@ -606,8 +571,8 @@ export class PlayerFun {
lshd[v.peijianId]++; lshd[v.peijianId]++;
} }
G.redis.set('peijian', call.uid, id, {_id: id, ...ops}); G.redis.set('peijian', call.uid, id, { _id: id, ...ops });
call.addEventMsg('msg_s2c/PeijianChange', id, {_id: id, ...ops}); call.addEventMsg('msg_s2c/PeijianChange', id, { _id: id, ...ops });
}); });
G.mongodb.collection('playerInfo', 'lshd_peijian').updateOne( G.mongodb.collection('playerInfo', 'lshd_peijian').updateOne(
@ -628,15 +593,39 @@ export class PlayerFun {
return Object.values(result.insertedIds).map(v => G.mongodb.conversionId(v)); return Object.values(result.insertedIds).map(v => G.mongodb.conversionId(v));
} }
/**
*
* */
static async addHeroskin(call: call, val: atn[]) {
let prize = [];
let upskin = {};
let heroskin = HeroSkinFun.getHeroSkin(call);
for (let p of val) {
if (!heroskin[p.t]) {
upskin[p.t] = 1;
} else {
prize.concat(G.gc.heroSkin[p.t].zhuanhuan);
}
}
if (Object.keys(upskin).length > 0) {
this.addAttr(call, { heroskin: Object.assign(heroskin, upskin) });
}
// 皮肤存在转换为其他奖励
if (prize.length > 0) {
this.sendPrize(call, prize);
}
}
/** /**
* *
*/ */
static async cutPeijian(call: call, _idArr: string[]) { static async cutPeijian(call: call, _idArr: string[]) {
for (let _id of _idArr) { for (let _id of _idArr) {
G.redis.del('peijian', call.uid, _id); G.redis.del('peijian', call.uid, _id);
G.mongodb.collection('peijian').deleteOne({uid: call.uid, _id: new ObjectId(_id)}); G.mongodb.collection('peijian').deleteOne({ uid: call.uid, _id: new ObjectId(_id) });
call.addEventMsg('msg_s2c/PeijianChange', _id, {num: 0}); call.addEventMsg('msg_s2c/PeijianChange', _id, { num: 0 });
addGameLog(call.uid, "_cutPeijian", {}, {_id: _id}) addGameLog(call.uid, "_cutPeijian", {}, { _id: _id })
} }
} }
@ -645,7 +634,7 @@ export class PlayerFun {
*/ */
static async getAttr(uid: string, where: { ctype: string; }) { static async getAttr(uid: string, where: { ctype: string; }) {
let _w = where; let _w = where;
Object.assign(_w, {uid: uid}); Object.assign(_w, { uid: uid });
const _res = await G.mongodb.collection('playattr').find(_w).toArray(); const _res = await G.mongodb.collection('playattr').find(_w).toArray();
_res.forEach(v => { _res.forEach(v => {
if (v._id) { if (v._id) {
@ -660,7 +649,7 @@ export class PlayerFun {
*/ */
static async getAttrOne(uid: string, where: { ctype: string; }) { static async getAttrOne(uid: string, where: { ctype: string; }) {
let _w = where; let _w = where;
Object.assign(_w, {uid: uid}); Object.assign(_w, { uid: uid });
const _res = await G.mongodb.collection('playattr').findOne(_w); const _res = await G.mongodb.collection('playattr').findOne(_w);
if (_res) { if (_res) {
delete _res['_id']; delete _res['_id'];
@ -676,10 +665,10 @@ export class PlayerFun {
time = G.time; time = G.time;
} }
let _zeroTime = PublicShared.getToDayZeroTime(time); let _zeroTime = PublicShared.getToDayZeroTime(time);
let _tmp = {lasttime: {$gte: _zeroTime, $lte: _zeroTime + 24 * 60 * 60 - 1}}; let _tmp = { lasttime: { $gte: _zeroTime, $lte: _zeroTime + 24 * 60 * 60 - 1 } };
let _w = where; let _w = where;
Object.assign(_w, {uid: uid, ..._tmp}); Object.assign(_w, { uid: uid, ..._tmp });
const _res = await G.mongodb.collection('playattr').find(_w).toArray(); const _res = await G.mongodb.collection('playattr').find(_w).toArray();
_res.forEach(v => { _res.forEach(v => {
if (v._id) { if (v._id) {
@ -694,7 +683,7 @@ export class PlayerFun {
*/ */
static async setAttr(uid: string, where: { ctype: string; }, data: {}, islasttime = 1) { static async setAttr(uid: string, where: { ctype: string; }, data: {}, islasttime = 1) {
let _w = where; let _w = where;
Object.assign(_w, {uid: uid}); Object.assign(_w, { uid: uid });
if (islasttime == 1) { if (islasttime == 1) {
data["lasttime"] = G.time; data["lasttime"] = G.time;
@ -705,7 +694,7 @@ export class PlayerFun {
// 加入创建数据时间 // 加入创建数据时间
data["ctime"] = G.time; data["ctime"] = G.time;
} }
let _res = await G.mongodb.collection('playattr').updateMany(_w, {$set: data}, {upsert: true}); let _res = await G.mongodb.collection('playattr').updateMany(_w, { $set: data }, { upsert: true });
return _res; return _res;
} }
} }

View File

@ -1,7 +1,7 @@
import { PublicShared } from '../../shared/public/public'; import {PublicShared} from '../../shared/public/public';
import { EmailFun } from '../email'; import {EmailFun} from '../email';
import { RankClslCross } from '../rank/rank_clsl'; import {RankClslCross} from '../rank/rank_clsl';
import { Scheduler, schedulerType } from './scheduler'; import {Scheduler, schedulerType} from './scheduler';
/** /**
* *
@ -26,12 +26,12 @@ export class SchedulerClslLocalCtor extends Scheduler {
// 修改clslCrossUser表中的uid为del_uid_week 并且 设置ttltime为当前时间 // 修改clslCrossUser表中的uid为del_uid_week 并且 设置ttltime为当前时间
await G.mongodb.collection('clslCrossUser').updateMany( await G.mongodb.collection('clslCrossUser').updateMany(
{ {
ttltime: { $exists: false } ttltime: {$exists: false}
}, { $rename: { "uid": `del_uid_${week}` }, $set: { "ttltime": new Date() } } }, {$rename: {"uid": `del_uid_${week}`}, $set: {"ttltime": new Date()}}
); );
// 获取分组信息 重置排行榜 // 获取分组信息 重置排行榜
let groups = await G.mongodb.collection('clslCrossGroup').findOne({ week }); let groups = await G.mongodb.collection('clslCrossGroup').findOne({week});
Object.keys(groups.groups).forEach((group) => { Object.keys(groups.groups).forEach((group) => {
// 清理排行数据 // 清理排行数据
new RankClslCross(group).clear(); new RankClslCross(group).clear();
@ -64,7 +64,7 @@ export class SchedulerClslCrossCtor extends Scheduler {
async start() { async start() {
let week = PublicShared.getToWeek(); let week = PublicShared.getToWeek();
let users = await G.mongodb.collection('clslCrossUser').find({ let users = await G.mongodb.collection('clslCrossUser').find({
ttltime: { $exists: false } ttltime: {$exists: false}
}, { }, {
projection: { projection: {
"uid": 1, "uid": 1,
@ -118,15 +118,15 @@ export class SchedulerClslCrossCtor extends Scheduler {
// 更新玩家分组id // 更新玩家分组id
for (let group in groups) { for (let group in groups) {
await G.mongodb.collection('clslCrossUser').updateMany({ uid: { $in: groups[group].users } }, { $set: { group: group } }); await G.mongodb.collection('clslCrossUser').updateMany({uid: {$in: groups[group].users}}, {$set: {group: group}});
} }
// 记录分组 // 记录分组
await G.mongodb.collection("clslCrossGroup").updateOne({ week: week }, { $set: { groups: groups } }, { upsert: true }); await G.mongodb.collection("clslCrossGroup").updateOne({week: week}, {$set: {groups: groups}}, {upsert: true});
// 初始化丛林猎手排行榜 // 初始化丛林猎手排行榜
G.mongodb.collection('clslCrossUser').find({ G.mongodb.collection('clslCrossUser').find({
allStar: { $gte: this.star }, ttltime: { $exists: false } allStar: {$gte: this.star}, ttltime: {$exists: false}
}).toArray().then(users => { }).toArray().then(users => {
users.forEach(u => { users.forEach(u => {
new RankClslCross(u.group).addNew({ new RankClslCross(u.group).addNew({
@ -161,13 +161,7 @@ export class SchedulerClslPrize extends Scheduler {
async start() { async start() {
// 排名奖励 // 排名奖励
let group2users: { [group: string]: string[] } = {}; let group2users: { [group: string]: string[] } = {};
(await G.mongodb.collection('clslCrossUser').find( (await G.mongodb.collection('clslCrossUser').find({allStar: {$gte: this.star}}).toArray()).forEach(u => {
{
uid: { $exists: true },
allStar: { $gte: this.star }
},
{ sort: { allStar: -1 } }
).limit(10).toArray()).forEach(u => {
if (u.group in group2users) { if (u.group in group2users) {
group2users[u.group].push(u.uid); group2users[u.group].push(u.uid);
} else { } else {

View File

@ -59,9 +59,6 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
} }
} }
})() })()
// 转点刷新事件
G.emit('NEW_DAY', G.time);
}) })
let users = Object.values(G.server.uid_connections) let users = Object.values(G.server.uid_connections)

View File

@ -1,20 +1,19 @@
import { ApiCall } from "tsrpc" import {ApiCall} from "tsrpc"
import { YangChengMuBiaofun } from "../api_s2c/event/yangchengmubiao/fun" import {YangChengMuBiaofun} from "../api_s2c/event/yangchengmubiao/fun"
import { Christmasfun } from "../api_s2c/event/christmas/fun" import {Christmasfun} from "../api_s2c/event/christmas/fun"
// import { YangChengMuBiaofun } from "../api_s2c/event/yangchengmubiao/fun" // import { YangChengMuBiaofun } from "../api_s2c/event/yangchengmubiao/fun"
import { Wjjl } from "../module/collection_wjjl" import {Wjjl} from "../module/collection_wjjl"
import { PublicShared } from "../shared/public/public" import {PublicShared} from "../shared/public/public"
import { PayFun } from "./pay" import {PayFun} from "./pay"
import { TaskFun } from "./task" import {TaskFun} from "./task"
import { CollectionWanted } from "../module/collection_wanted"; import {CollectionWanted} from "../module/collection_wanted";
import { TanXianFun } from "./tanxian"; import {TanXianFun} from "./tanxian";
import { PataFun } from "./pata"; import {PataFun} from "./pata";
import { weixiuchangType } from "../shared/protocols/weixiuchang/type"; import {weixiuchangType} from "../shared/protocols/weixiuchang/type";
import { FunWeiXiuChang } from "./weixiuchang"; import {FunWeiXiuChang} from "./weixiuchang";
import { JJCFun } from "./jjc"; import {JJCFun} from "./jjc";
import { getGud } from "./gud"; import {getGud} from "./gud";
import { Yuandanfun } from "../api_s2c/event/yuandan/fun"; import {Yuandanfun} from "../api_s2c/event/yuandan/fun";
import HQJGFun from "../api_s2c/event/huangqijiuguan/fun"
let _classNameFunc = {} let _classNameFunc = {}
/** /**
@ -73,15 +72,13 @@ export module manager {
// 设置数据 // 设置数据
async setVal(call: ApiCall, val: number, chkval, arg) { async setVal(call: ApiCall, val: number, chkval, arg) {
TaskFun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg); TaskFun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg)
// 养成目标任务计数 // 养成目标任务计数
YangChengMuBiaofun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg); YangChengMuBiaofun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg)
// 圣诞活动任务计数 // 圣诞活动任务计数
Christmasfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg); Christmasfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg)
// 元旦活动任务计数 // 元旦活动任务计数
Yuandanfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg); Yuandanfun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg)
// 黄旗酒馆
HQJGFun.setTaskVal(call, this.stype, val, this.chkCall, chkval, this.isinc, this.alchangeVal, arg);
} }
// 任务数值, 和检测值,看情况需要上层复写 // 任务数值, 和检测值,看情况需要上层复写
@ -170,12 +167,12 @@ export module manager {
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
return await G.mongodb.collection('hero').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 return await G.mongodb.collection('hero').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
} }
async alchangeVal(call: ApiCall, con, val: number) { async alchangeVal(call: ApiCall, con, val: number) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
return await G.mongodb.collection('hero').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 return await G.mongodb.collection('hero').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
} }
} }
@ -197,13 +194,13 @@ export module manager {
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
let _num = await G.mongodb.collection('hero').countDocuments({ uid: call.uid, jieji: { $gte: _chk } }) || 0 let _num = await G.mongodb.collection('hero').countDocuments({uid: call.uid, jieji: {$gte: _chk}}) || 0
return _num return _num
} }
async alchangeVal(call: ApiCall, con, val: number) { async alchangeVal(call: ApiCall, con, val: number) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
let _num = await G.mongodb.collection('hero').countDocuments({ uid: call.uid, jieji: { $gte: _chk } }) || 0 let _num = await G.mongodb.collection('hero').countDocuments({uid: call.uid, jieji: {$gte: _chk}}) || 0
return _num return _num
} }
} }
@ -259,13 +256,13 @@ export module manager {
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
let _num = await G.mongodb.collection('equip').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 let _num = await G.mongodb.collection('equip').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
return _num return _num
} }
async alchangeVal(call: ApiCall, con, val: number) { async alchangeVal(call: ApiCall, con, val: number) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
let _num = await G.mongodb.collection('equip').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 let _num = await G.mongodb.collection('equip').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
return _num return _num
} }
} }
@ -429,7 +426,7 @@ export module manager {
isinc = 1 isinc = 1
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let myData = await G.mongodb.cPlayerInfo('meirishilian').findOne({ uid: call.uid, type: 'meirishilian' }); let myData = await G.mongodb.cPlayerInfo('meirishilian').findOne({uid: call.uid, type: 'meirishilian'});
if (myData.data.refreshTime > PublicShared.getToDayZeroTime()) { if (myData.data.refreshTime > PublicShared.getToDayZeroTime()) {
return R.compose(R.sum(), R.map(i => i[0].useFightNum), R.values())(myData.data.numInfo) || 0 return R.compose(R.sum(), R.map(i => i[0].useFightNum), R.values())(myData.data.numInfo) || 0
} }
@ -449,7 +446,7 @@ export module manager {
isinc = 1 isinc = 1
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let myData = await G.mongodb.cPlayerInfo('qjzzd').findOne({ uid: call.uid, type: 'qjzzd' }); let myData = await G.mongodb.cPlayerInfo('qjzzd').findOne({uid: call.uid, type: 'qjzzd'});
if (myData?.refreFightTime > PublicShared.getToDayZeroTime()) { if (myData?.refreFightTime > PublicShared.getToDayZeroTime()) {
return myData?.useFightNum || 0 return myData?.useFightNum || 0
} }
@ -508,7 +505,7 @@ export module manager {
isinc = 1 isinc = 1
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let data: Partial<CollectionWanted> = await G.mongodb.collection('wanted').findOne({ uid: call.uid }) || {}; let data: Partial<CollectionWanted> = await G.mongodb.collection('wanted').findOne({uid: call.uid}) || {};
if (data.refreshTime > PublicShared.getToDayZeroTime()) { if (data.refreshTime > PublicShared.getToDayZeroTime()) {
return data.toDayUseNum || 0 return data.toDayUseNum || 0
} }
@ -611,12 +608,12 @@ export module manager {
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
return await G.mongodb.collection('peijian').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 return await G.mongodb.collection('peijian').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
} }
async alchangeVal(call: ApiCall, con, val: number) { async alchangeVal(call: ApiCall, con, val: number) {
let _chk = parseInt(con.cond[0]) let _chk = parseInt(con.cond[0])
return await G.mongodb.collection('peijian').countDocuments({ uid: call.uid, lv: { $gte: _chk } }) || 0 return await G.mongodb.collection('peijian').countDocuments({uid: call.uid, lv: {$gte: _chk}}) || 0
} }
} }
@ -678,11 +675,11 @@ export module manager {
isinc = 0 isinc = 0
async initVal(call: ApiCall, con) { async initVal(call: ApiCall, con) {
return await G.mongodb.collection('equip').countDocuments({ uid: call.uid, wearaId: { $ne: "" } }) || 0 return await G.mongodb.collection('equip').countDocuments({uid: call.uid, wearaId: {$ne: ""}}) || 0
} }
async alchangeVal(call: ApiCall, con, val: number) { async alchangeVal(call: ApiCall, con, val: number) {
return await G.mongodb.collection('equip').countDocuments({ uid: call.uid, wearaId: { $ne: "" } }) || 0 return await G.mongodb.collection('equip').countDocuments({uid: call.uid, wearaId: {$ne: ""}}) || 0
} }
} }
@ -836,11 +833,6 @@ export module manager {
} }
} }
// 第61个任务 黄旗酒馆累计抽卡X次
export class Class_task_159 extends BaseClass {
stype = 159
isinc = 1
}
} }

View File

@ -305,11 +305,8 @@ export class UserFun {
gud.headFrames[conf.id] += val * v; gud.headFrames[conf.id] += val * v;
} }
} }
else if(conf?.cond?.[0] == "jjc_rank") {
change = true;
gud.headFrames[conf.id] = -1;
}
} }
if (change) { if (change) {
PlayerFun.changeAttr(uid, {headFrames: gud.headFrames}); PlayerFun.changeAttr(uid, {headFrames: gud.headFrames});
G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {headFrames: gud.headFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {headFrames: gud.headFrames});

View File

@ -86,8 +86,8 @@ export async function startAfter() {
new SchedulerSlzdClean().init(); new SchedulerSlzdClean().init();
new SchedulerSlzdPrize().init(); new SchedulerSlzdPrize().init();
// new SchedulerClslPrize().init(); new SchedulerClslPrize().init();
// new SchedulerClslLocalCtor().init(); new SchedulerClslLocalCtor().init();
new SchedulerWzryAutoBaoMing().init(); new SchedulerWzryAutoBaoMing().init();
new SchedulerWzryjingcaiSendPrize().init(); new SchedulerWzryjingcaiSendPrize().init();
new SchedulerWzryendDel().init(); new SchedulerWzryendDel().init();

View File

@ -152,7 +152,7 @@ export class FightControl {
this.eachLiveRoles((role) => { this.eachLiveRoles((role) => {
let heroId = role.roleData.heroId; let heroId = role.roleData.heroId;
// let shiwu = role.roleData?.shiwu || {}; // let shiwu = role.roleData?.shiwu || {};
let talent = role.roleData?.talent || {}; // let talent = role.roleData?.talent || {};
let skills = G.gc.heroskill[heroId][role.roleData.jieji || 0].bdskill || []; let skills = G.gc.heroskill[heroId][role.roleData.jieji || 0].bdskill || [];
skills = skills.concat(role.roleData.attr.skillArr); skills = skills.concat(role.roleData.attr.skillArr);
@ -161,15 +161,15 @@ export class FightControl {
// if (!zhushuan) continue; // if (!zhushuan) continue;
// if (zhushuan.skill) skills.push(zhushuan.skill); // if (zhushuan.skill) skills.push(zhushuan.skill);
// }; // };
const hero_tf = G.gc.hero_tf; // const hero_tf = G.gc.hero_tf;
for (let key in talent) { // for (let key in talent) {
let cdata = hero_tf[key][talent[key]]; // let cdata = hero_tf[key][talent[key]];
if (cdata && cdata.skill_effect) skills.push(cdata.skill_effect); // if (cdata && cdata.skill_effect) skills.push(cdata.skill_effect);
} // }
// skills.push('tx06309'); // skills.push('tx06309');
if (!skills) return; //if (!skills) return;
skills.forEach(_skill => { skills.forEach(_skill => {
let askillconf = getSkillConf(_skill); let askillconf = getSkillConf(_skill);
if (!askillconf) return console.log('没有技能配置-->', _skill); if (!askillconf) return console.log('没有技能配置-->', _skill);

View File

@ -121,7 +121,7 @@ export function createNpc(npcId: string | number, fixData: Partial<ResLogin['gud
isNpc: true isNpc: true
}, },
roles: Object.fromEntries(dataArr.map((d, i) => [i + 1, function () { roles: Object.fromEntries(dataArr.map((d, i) => [i + 1, function () {
d['skin'] = (npcConf.skin?.[i] || '');
let { id, atk, def, mindps, maxdps, hp, speed, ...ops } = G.gc.armyattr[d.countId]; let { id, atk, def, mindps, maxdps, hp, speed, ...ops } = G.gc.armyattr[d.countId];
let buff = HeroShared.getHeroBasicAttr({ heroId: d.heroId, lv: d.lv }); let buff = HeroShared.getHeroBasicAttr({ heroId: d.heroId, lv: d.lv });
@ -149,9 +149,9 @@ export function createNpc(npcId: string | number, fixData: Partial<ResLogin['gud
return { return {
attr: buff, attr: buff,
...d, ...d,
lv: (npcConf.npcLv ? npcConf.npcLv[i] : 0) || d.lv, lv: (npcConf.npcLv ? npcConf.npcLv[i]: 0) || d.lv,
isBoss: !!npcConf.isboss, isBoss: !!npcConf.isboss,
trueLv: d.lv || (npcConf.npcLv ? npcConf.npcLv[i] : 0) trueLv: d.lv || (npcConf.npcLv ? npcConf.npcLv[i]: 0)
}; };
}()])) }()]))

View File

@ -1,11 +0,0 @@
import { PlayerData } from "../../../../api_s2c/event/huangqijiuguan/fun"
export interface ReqGiftRec {
hdid: number
giftid: number
}
export interface ResGiftRec {
data: PlayerData
prize: { a: string, t: string, n: number }[]
}

View File

@ -1,11 +0,0 @@
import { PlayerData } from "../../../../api_s2c/event/huangqijiuguan/fun"
export interface ReqGiftSelect {
hdid: number
giftid: number
seletc: number[]
}
export interface ResGiftSelect {
data: PlayerData
}

View File

@ -2,7 +2,7 @@ import { PlayerData } from "../../../../api_s2c/event/huangqijiuguan/fun"
export interface ReqZhaoMuPrizeRec { export interface ReqZhaoMuPrizeRec {
hdid: number hdid: number
recid: { idx: number, sec: string }[] recid: number[]
} }
export interface ResZhaoMuPrizeRec { export interface ResZhaoMuPrizeRec {

File diff suppressed because it is too large Load Diff

View File

@ -322,7 +322,7 @@ export class HeroShared {
static amendAttr(buff: k_v<number>) { static amendAttr(buff: k_v<number>) {
for (let k in buff) { for (let k in buff) {
if (typeof buff[k] != 'number') continue; if (typeof buff[k] != 'number') continue;
if (k.indexOf('pro') != -1 || k.indexOf('drop') != -1 || k=='addhp') continue; if (k.indexOf('pro') != -1 || k.indexOf('drop') != -1) continue;
buff[k] = Math.floor(buff[k]); buff[k] = Math.floor(buff[k]);
} }
} }

View File

@ -1,10 +1,9 @@
# "Asia/Shanghai" # "Asia/Shanghai"
# "Asia/Tokyo" # "Asia/Tokyo"
cp "/usr/share/zoneinfo/$1" "/etc/localtime" cp "/usr/share/zoneinfo/$1" "/etc/localtime"
echo "$1" > /etc/timezone echo "$1" > /etc/timezone
for i in `env | grep -E -i 'SERVER_GAME' | sed 's/=.*//'` ; do pm2 restart all || true
unset $i
done