Compare commits

...

14 Commits

Author SHA1 Message Date
75be49d528 发奖发错了 2024-01-12 00:40:17 +08:00
799c0a60d3 slzd不需要回复次数 2024-01-12 00:40:17 +08:00
05a1ab6fb3 矿洞结算bug 2024-01-12 00:40:16 +08:00
38aeaf3247 积分容错 2024-01-12 00:40:16 +08:00
625220ca03 聊天分组bug 2024-01-12 00:40:16 +08:00
yushunrui
b7c86e9769 脚本提交,兑换掉落修改礼包内容, 玩家新年头像框刷成永久 2024-01-12 00:40:15 +08:00
yushunrui
e4815b4246 fix:处理了头像框和聊天框得逻辑 2024-01-12 00:40:00 +08:00
yushunrui
3e43065142 fix:头像框 聊天框,造型逻辑修改 2024-01-12 00:36:00 +08:00
xichaoyin
d421f06edf fix:丛林狩猎定时器修复 2024-01-12 00:33:24 +08:00
46a333b87f 去掉多余的环境变量,解决pm2集群启动失败问题 2024-01-12 00:33:24 +08:00
xichaoyin
3a7d3cadf4 fix:时区脚本修复 2024-01-12 00:33:23 +08:00
0947bc386e addhp不应该取整 2024-01-12 00:33:04 +08:00
a8d0a87f72 配件修正 2024-01-12 00:33:04 +08:00
74e0286250 天赋技能 2024-01-12 00:33:03 +08:00
15 changed files with 163 additions and 119 deletions

View File

@ -17,7 +17,7 @@ export default async function (call: ApiCall<ReqGetUser, ResGetUser>) {
arr.map(i=>{ arr.map(i=>{
res[i.uid] = { res[i.uid] = {
data: i.data, data: i.data,
jifen:i.jifen, jifen:i?.jifen||0,
}; };
}); });

View File

@ -51,16 +51,24 @@ 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 {
// 修复配件数据 // 修复配件数据
let peijianids = []; //hero数据里所有英雄穿戴中的配件的 _idobjectId
Object.values(list).map(hero => { // let peijianids = [];
hero.peijian && Object.values(hero.peijian).map( // Object.values(list).map(hero => {
i => peijianids.push(G.mongodb.conversionId(PeijianShared.fmt(i)._id)) // 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( //通过上述的_id去配件表查询所有配件
{uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1}} // let wearedPeiJian = (await G.mongodb.collection("peijian").find(
).toArray()).map(temp => G.mongodb.conversionId(temp._id)); // {uid: call.uid, _id: {$in: peijianids}}, {projection: {_id: 1, wearId:1}}
// ).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))))
@ -68,15 +76,19 @@ 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) {
if (!peijians.includes(PeijianShared.fmt(hero.peijian[pos])._id)) { // //hero该位置记录的穿戴中的配件_id
hero.peijian[pos] = ""; // let _pid = PeijianShared.fmt(hero.peijian[pos])._id;
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)
@ -85,12 +97,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

@ -5,7 +5,7 @@ import {ReqYanShi, ResYanShi} from "../../shared/protocols/kuangdong/PtlYanShi";
export default async function (call: ApiCall<ReqYanShi, ResYanShi>) { export default async function (call: ApiCall<ReqYanShi, ResYanShi>) {
return call.errorCode(1) //return call.errorCode(1)
let hdid = call.req.hdid let hdid = call.req.hdid
let con = await KuangDongfun.getCon(hdid) let con = await KuangDongfun.getCon(hdid)

View File

@ -1,12 +1,38 @@
import {ApiCall} from "tsrpc"; import {ApiCall} from "tsrpc";
import {ReqGetList, ResGetList} from "../../shared/protocols/peijian/PtlGetList"; import { connGameLogDB } from "../../gameLog";
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;
@ -16,17 +42,25 @@ export default async function (call: ApiCall<ReqGetList, ResGetList>) {
return ops; return ops;
}); });
// 修复配件穿戴在不存在的英雄身上 //对hero的peijian字段进行修正
let heroIds = R.values(call.conn.gud.heroPos) if(Object.keys(heroPeiJian).length > 0){
let fixIds = dbList.filter(i => i.wearId && !heroIds.includes(i.wearId)).map(i => G.mongodb.conversionId(i._id)) for(let heroid in heroPeiJian){
if (fixIds.length) { await G.mongodb.collection("hero").updateOne({
await G.mongodb.collection('peijian').updateMany({_id: {$in: fixIds}}, {$set: {wearId: ''}}) uid : call.conn.uid,
_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

@ -41,13 +41,16 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
}, },
{ upsert: true } { upsert: true }
); );
} else if (data.fightNum < G.gc.slzd.maxFightNum && G.time - data.replyCd > G.gc.slzd.replyCd) {
let addNum = Math.floor((G.time - data.replyCd) / G.gc.slzd.replyCd);
let maxAddNum = G.gc.slzd.maxFightNum - data.fightNum;
data.fightNum += addNum > maxAddNum ? maxAddNum : addNum;
data.replyCd = G.time;
G.mongodb.collection('slzdUser').updateOne({ uid: call.uid }, { $set: { 'data.fightNum': data.fightNum, 'data.replyCd': data.replyCd } });
} }
//不需要回复次数
// else if (data.fightNum < G.gc.slzd.maxFightNum && G.time - data.replyCd > G.gc.slzd.replyCd) {
// let addNum = Math.floor((G.time - data.replyCd) / G.gc.slzd.replyCd);
// let maxAddNum = G.gc.slzd.maxFightNum - data.fightNum;
// data.fightNum += addNum > maxAddNum ? maxAddNum : addNum;
// data.replyCd = G.time;
// G.mongodb.collection('slzdUser').updateOne({ uid: call.uid }, { $set: { 'data.fightNum': data.fightNum, 'data.replyCd': data.replyCd } });
// }
let { refreshTime, ...ops } = data; let { refreshTime, ...ops } = data;
call.succ({ call.succ({

View File

@ -3,50 +3,16 @@ import { patchFun, patchInit } from "../patch";
class Path { class Path {
async huodong2(a: any) { async huodong2(a: any) {
const con ={ const hdids = [2002,2003]
2000:[
{ payId: '', num: 1, prize: [{a: 'item', t: '49', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true },
{ payId: 'duihuan_1_1', prize: [{a: 'item', t: '49', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false },
{ payId: 'duihuan_1_2', prize: [{a: 'item', t: '49', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false },
{ payId: 'duihuan_1_3', prize: [{a: 'item', t: '49', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false },
{ payId: 'duihuan_1_4', prize: [{a: 'item', t: '49', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false },
{ payId: 'duihuan_1_5', prize: [{a: 'item', t: '49', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false },
],
2001: [
{ payId: '', num: 1, prize: [{a: 'item', t: '49', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true },
{ payId: 'duihuan_3_1', prize: [{a: 'item', t: '49', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false },
{ payId: 'duihuan_3_2', prize: [{a: 'item', t: '49', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false },
{ payId: 'duihuan_3_3', prize: [{a: 'item', t: '49', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false },
{ payId: 'duihuan_3_4', prize: [{a: 'item', t: '49', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false },
{ payId: 'duihuan_3_5', prize: [{a: 'item', t: '49', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false },
],
2002: [
{ payId: '', num: 1, prize: [{a: 'item', t: '50', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true },
{ payId: 'duihuan_2_1', prize: [{a: 'item', t: '50', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false },
{ payId: 'duihuan_2_2', prize: [{a: 'item', t: '50', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false },
{ payId: 'duihuan_2_3', prize: [{a: 'item', t: '50', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false },
{ payId: 'duihuan_2_4', prize: [{a: 'item', t: '50', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false },
{ payId: 'duihuan_2_5', prize: [{a: 'item', t: '50', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false },
],
2003: [
{ payId: '', num: 1, prize: [{a: 'item', t: '50', n: 20}, {a: 'attr', t: 'rmbmoney', n: 200}], free: true },
{ payId: 'duihuan_4_1', prize: [{a: 'item', t: '50', n: 50}, {a: 'attr', t: 'rmbmoney', n: 600}], free: false },
{ payId: 'duihuan_4_2', prize: [{a: 'item', t: '50', n: 100}, {a: 'attr', t: 'rmbmoney', n: 1360}], free: false },
{ payId: 'duihuan_4_3', prize: [{a: 'item', t: '50', n: 200}, {a: 'attr', t: 'rmbmoney', n: 2560}], free: false },
{ payId: 'duihuan_4_4', prize: [{a: 'item', t: '50', n: 600}, {a: 'attr', t: 'rmbmoney', n: 6560}], free: false },
{ payId: 'duihuan_4_5', prize: [{a: 'item', t: '50', n: 1200}, {a: 'attr', t: 'rmbmoney', n: 12960}], free: false },
],
}
const hdids = [2000,2001,2002,2003]
const hdinfos = await G.mongodb.find('hdinfo', { hdid: { $in: hdids } }) const hdinfos = await G.mongodb.find('hdinfo', { hdid: { $in: hdids } })
for (let i = 0; i < hdinfos.length; i++) { for (let i = 0; i < hdinfos.length; i++) {
let hdinfo = hdinfos[i] let hdinfo = hdinfos[i]
hdinfo.data.event.gift = con[hdinfo.hdid] hdinfo.data.gift = {}
console.log(hdinfo.hdid,hdinfo.data.event.gift)
await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data": hdinfo.data}}); await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data.figt": {}} });
console.log(hdinfo.hdid,"finish") console.log(hdinfo.hdid,"finish")
} }
return "sucess!!!" return "sucess!!!"
} }
@ -58,9 +24,11 @@ class Path {
await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} }); await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} });
console.log(user.uid, user.headFrames) console.log(user.uid, user.headFrames)
} }
return "sucess!!!" return "sucess!!!"
} }
async run() { async run() {
await this.huodong2(1); await this.huodong2(1);
await this.headFrame(1); await this.headFrame(1);

View File

@ -4,6 +4,7 @@ import { MsgChat } from '../shared/protocols/msg_s2c/MsgChat';
import { player } from '../shared/protocols/user/type'; import { player } from '../shared/protocols/user/type';
import { chatLog, chatMsgLog } from '../shared/protocols/type' import { chatLog, chatMsgLog } from '../shared/protocols/type'
import { PublicShared } from '../shared/public/public'; import { PublicShared } from '../shared/public/public';
import { clusterRunOnce } from '../clusterUtils';
const msgListLen = { const msgListLen = {
'cross': 30, 'cross': 30,
@ -28,13 +29,9 @@ export function getCrossChatGroupByOpenDay(){
export class ChatFun { export class ChatFun {
/**新增消息 */ /**新增消息 */
static async newMsg(sendData: MsgChat) { static async newMsg(sendData: MsgChat) {
G.mongodb.collection('chat').updateOne( let addToDB = 0;
{ type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` },
{ $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } },
{ upsert: true }
);
if (sendData.type == 'guild') { if (sendData.type == 'guild') {
addToDB = 1;
G.server.broadcastClusterMsg('msg_s2c/Chat', sendData,{ghId:(sendData.sender as player)?.ghId}); G.server.broadcastClusterMsg('msg_s2c/Chat', sendData,{ghId:(sendData.sender as player)?.ghId});
}else if(sendData.type == 'cross'){ }else if(sendData.type == 'cross'){
//所有的子进程都会收到,不需要集群内分别广播 //所有的子进程都会收到,不需要集群内分别广播
@ -42,9 +39,27 @@ export class ChatFun {
//如果时候同一个分组的 //如果时候同一个分组的
delete sendData?.otherData?.group; delete sendData?.otherData?.group;
G.server.broadcastMsg('msg_s2c/Chat', sendData); G.server.broadcastMsg('msg_s2c/Chat', sendData);
addToDB = 2;
} }
}else{ }else{
G.server.broadcastClusterMsg('msg_s2c/Chat', sendData); G.server.broadcastClusterMsg('msg_s2c/Chat', sendData);
addToDB = 1;
}
if(addToDB == 1){
G.mongodb.collection('chat').updateOne(
{ type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` },
{ $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } },
{ upsert: true }
);
}else if(addToDB == 2){
clusterRunOnce(()=>{
G.mongodb.collection('chat').updateOne(
{ type: `${sendData.type}${sendData.type == 'guild' ? (sendData.sender as player)?.ghId : ''}` },
{ $push: { list: { $each: [sendData], $slice: -msgListLen[sendData.type] } } },
{ upsert: true }
);
})
} }
} }

View File

@ -179,14 +179,14 @@ export class KuangDongfun {
} }
if (!kdInfo) return [] if (!kdInfo) return []
let _con = await this.getCon(hdid) let _con = await this.getCon(hdid)
let _kcTime = G.time + kdInfo.yanshi - kdInfo.ctime let _kcTime = G.time - kdInfo.ctime
//let _gud = await G.mongodb.collection('user').findOne({uid: kdInfo.uid}) //let _gud = await G.mongodb.collection('user').findOne({uid: kdInfo.uid})
let _gud = await getGud(kdInfo.uid) let _gud = await getGud(kdInfo.uid)
let gamer_lv = _gud.lv let gamer_lv = _gud.lv
// @ts-ignore // @ts-ignore
let prize: prizeType[] = _con.reward let prize: prizeType[] = _con.reward
// let prize: prizeType[] = [{ a: 'attr', t: 'rmbmoney', n: 50 }] // todo 待接入配置 // let prize: prizeType[] = [{ a: 'attr', t: 'rmbmoney', n: 50 }] // todo 待接入配置
if (_kcTime > 8 * 3600) _kcTime = 8 * 3600 + kdInfo.yanshi // 设置最大时长 if (_kcTime > 8 * 3600 + kdInfo.yanshi) _kcTime = 8 * 3600 + kdInfo.yanshi // 设置最大时长
prize[0]["n"] = Math.floor(eval(_con.formula) * _kcTime) prize[0]["n"] = Math.floor(eval(_con.formula) * _kcTime)
if (_con.public_map == 1){ if (_con.public_map == 1){

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,7 +161,13 @@ 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({allStar: {$gte: this.star}}).toArray()).forEach(u => { (await G.mongodb.collection('clslCrossUser').find(
{
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

@ -299,7 +299,7 @@ export class SchedulerWzryZuanshiSendPrize extends SchedulerWzryAutoBaoMing {
await this.record() await this.record()
return return
} }
let _prizeCon = this.typeprzie=='zhuanshi'?G.gc.wangzherongyao.wangzhe.jiangli.zuanshi:G.gc.wangzherongyao.wangzhe.jiangli.wangzhe; let _prizeCon = this.typeprzie=='zuanshi'?G.gc.wangzherongyao.wangzhe.jiangli.zuanshi:G.gc.wangzherongyao.wangzhe.jiangli.wangzhe;
let _u = [] let _u = []
for (let index = 0; index < _user.length; index++) { for (let index = 0; index < _user.length; index++) {
const element = _user[index]; const element = _user[index];

View File

@ -302,8 +302,11 @@ export class UserFun {
gud.headFrames[conf.id] = G.time + val * v; gud.headFrames[conf.id] = G.time + 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});
@ -338,16 +341,15 @@ export class UserFun {
if (conf?.cond?.[0] == 'time') { if (conf?.cond?.[0] == 'time') {
let val = conf.cond[1]; let val = conf.cond[1];
if (val == -1 && !gud.chatFrames[conf.id]) { if (val == -1 && !gud.headFrames[conf.id]) {
change = true; change = true;
gud.chatFrames[conf.id] = -1; gud.headFrames[conf.id] = -1;
} else if (val > 0 && gud.chatFrames[conf.id] != -1) { } else if (val >= 0) {
change = true; change = true;
gud.chatFrames[conf.id] = G.time + val * v; gud.headFrames[conf.id] = G.time + val * v;
} }
} }
} }
if (change) { if (change) {
PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames}); PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames});
G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames}); G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames});
@ -384,13 +386,11 @@ export class UserFun {
if (val == -1) { if (val == -1) {
change = true; change = true;
gud.model[conf.id] = {id: conf.id + '', time: -1}; gud.headFrames[conf.id] = -1;
} else if (gud.model[conf.id].time < G.time) { }
else if (val >= 0) {
change = true; change = true;
gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v}; gud.headFrames[conf.id] = G.time + val * v;
} else {
change = true;
gud.model[conf.id] = {id: conf.id + '', time: gud.model[conf.id].time += val * v}
} }
} }
} }

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

@ -318,7 +318,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) continue; if (k.indexOf('pro') != -1 || k.indexOf('drop') != -1 || k=='addhp') continue;
buff[k] = Math.floor(buff[k]); buff[k] = Math.floor(buff[k]);
} }
} }

View File

@ -1,4 +1,10 @@
# "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
unset $i
done