Compare commits
11 Commits
0326ceffd7
...
4c33bad9fb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4c33bad9fb | ||
![]() |
5c6e403e19 | ||
![]() |
070edf1cb5 | ||
![]() |
db2286509c | ||
![]() |
94bf56cc9e | ||
58ff276e10 | |||
11e5f17b20 | |||
![]() |
7ae7349550 | ||
![]() |
b84fd92528 | ||
![]() |
dbda10a17e | ||
![]() |
87d5b0902f |
@ -60,6 +60,8 @@ const localApps = [
|
|||||||
instances: instancesNum,
|
instances: instancesNum,
|
||||||
// 传递给脚本的参数
|
// 传递给脚本的参数
|
||||||
args: '-serverType msg',
|
args: '-serverType msg',
|
||||||
|
//允许强制gc
|
||||||
|
node_args: '--expose-gc',
|
||||||
// 是否启用监控模式,默认是false。如果设置成true,当应用程序变动时,pm2会自动重载。这里也可以设置你要监控的文件。
|
// 是否启用监控模式,默认是false。如果设置成true,当应用程序变动时,pm2会自动重载。这里也可以设置你要监控的文件。
|
||||||
watch: false,
|
watch: false,
|
||||||
// 不用监听的文件
|
// 不用监听的文件
|
||||||
@ -86,6 +88,8 @@ const crossApps = [
|
|||||||
cwd: './',
|
cwd: './',
|
||||||
// 传递给脚本的参数
|
// 传递给脚本的参数
|
||||||
args: '-serverType cross',
|
args: '-serverType cross',
|
||||||
|
//允许强制gc
|
||||||
|
node_args: '--expose-gc',
|
||||||
// 是否启用监控模式,默认是false。如果设置成true,当应用程序变动时,pm2会自动重载。这里也可以设置你要监控的文件。
|
// 是否启用监控模式,默认是false。如果设置成true,当应用程序变动时,pm2会自动重载。这里也可以设置你要监控的文件。
|
||||||
watch: false,
|
watch: false,
|
||||||
// 不用监听的文件
|
// 不用监听的文件
|
||||||
|
31
package-lock.json
generated
31
package-lock.json
generated
@ -11,6 +11,7 @@
|
|||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
|
"heapdump": "^0.3.15",
|
||||||
"ioredis": "^5.3.2",
|
"ioredis": "^5.3.2",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mathjs": "^11.4.0",
|
"mathjs": "^11.4.0",
|
||||||
@ -2545,6 +2546,18 @@
|
|||||||
"he": "bin/he"
|
"he": "bin/he"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/heapdump": {
|
||||||
|
"version": "0.3.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/heapdump/-/heapdump-0.3.15.tgz",
|
||||||
|
"integrity": "sha512-n8aSFscI9r3gfhOcAECAtXFaQ1uy4QSke6bnaL+iymYZ/dWs9cqDqHM+rALfsHUwukUbxsdlECZ0pKmJdQ/4OA==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"nan": "^2.13.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/http-basic": {
|
"node_modules/http-basic": {
|
||||||
"version": "8.1.3",
|
"version": "8.1.3",
|
||||||
"resolved": "https://registry.npmmirror.com/http-basic/-/http-basic-8.1.3.tgz",
|
"resolved": "https://registry.npmmirror.com/http-basic/-/http-basic-8.1.3.tgz",
|
||||||
@ -3199,6 +3212,11 @@
|
|||||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/nan": {
|
||||||
|
"version": "2.18.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
|
||||||
|
"integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w=="
|
||||||
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.1.tgz",
|
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.1.tgz",
|
||||||
@ -6645,6 +6663,14 @@
|
|||||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"heapdump": {
|
||||||
|
"version": "0.3.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/heapdump/-/heapdump-0.3.15.tgz",
|
||||||
|
"integrity": "sha512-n8aSFscI9r3gfhOcAECAtXFaQ1uy4QSke6bnaL+iymYZ/dWs9cqDqHM+rALfsHUwukUbxsdlECZ0pKmJdQ/4OA==",
|
||||||
|
"requires": {
|
||||||
|
"nan": "^2.13.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"http-basic": {
|
"http-basic": {
|
||||||
"version": "8.1.3",
|
"version": "8.1.3",
|
||||||
"resolved": "https://registry.npmmirror.com/http-basic/-/http-basic-8.1.3.tgz",
|
"resolved": "https://registry.npmmirror.com/http-basic/-/http-basic-8.1.3.tgz",
|
||||||
@ -7163,6 +7189,11 @@
|
|||||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"nan": {
|
||||||
|
"version": "2.18.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
|
||||||
|
"integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w=="
|
||||||
|
},
|
||||||
"nanoid": {
|
"nanoid": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.1.tgz",
|
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.1.tgz",
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
|
"heapdump": "^0.3.15",
|
||||||
"ioredis": "^5.3.2",
|
"ioredis": "^5.3.2",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mathjs": "^11.4.0",
|
"mathjs": "^11.4.0",
|
||||||
|
23
src/api_o2s/games/Apiheapdump.ts
Normal file
23
src/api_o2s/games/Apiheapdump.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { ApiCall } from "tsrpc";
|
||||||
|
import { Reqheapdump, Resheapdump } from "../../monopoly/protocols/games/Ptlheapdump";
|
||||||
|
var heapdump = require('heapdump');
|
||||||
|
|
||||||
|
export default async function (call: ApiCall<Reqheapdump, Resheapdump>) {
|
||||||
|
|
||||||
|
if(call.req.act == "heapdump"){
|
||||||
|
let name = Date.now() + '.heapsnapshot'
|
||||||
|
heapdump.writeSnapshot(name);
|
||||||
|
call.succ({
|
||||||
|
code:200,
|
||||||
|
data:name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(call.req.act == "gc"){
|
||||||
|
global.gc();
|
||||||
|
call.succ({
|
||||||
|
code:200,
|
||||||
|
data:"gc..."
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +1,38 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import {ApiCall} from "tsrpc";
|
||||||
import { PlayerFun } from '../../../public/player';
|
import {PlayerFun} from '../../../public/player';
|
||||||
import { ReqRec, ResRec } from "../../../shared/protocols/event/huobanzhaomu/PtlRec";
|
import {ReqRec, ResRec} from "../../../shared/protocols/event/huobanzhaomu/PtlRec";
|
||||||
import { HongDianChange } from "../../hongdian/fun";
|
import {HongDianChange} from "../../hongdian/fun";
|
||||||
|
import {PayFun} from "../../../public/pay";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqRec, ResRec>) {
|
export default async function (call: ApiCall<ReqRec, ResRec>) {
|
||||||
let conf = G.gc.huobanzhaomu[call.req.index];
|
let conf = G.gc.huobanzhaomu[call.req.index];
|
||||||
if (!conf) return call.error('', { code: -1 });
|
if (!conf) return call.error('', {code: -1});
|
||||||
if (conf.gudKey && call.conn.gud[conf.gudKey] < conf.total) return call.error('', { code: -2 });
|
if (conf.gudKey && call.conn.gud[conf.gudKey] < conf.total) return call.error('', {code: -2});
|
||||||
|
|
||||||
let db = await G.mongodb.cEvent('huobanzhaomu').findOne({ uid: call.uid, type: 'huobanzhaomu' });
|
let db = await G.mongodb.cEvent('huobanzhaomu').findOne({uid: call.uid, type: 'huobanzhaomu'});
|
||||||
if (db?.rec.includes(call.req.index)) return call.error('', { code: -3 });
|
if (db?.rec.includes(call.req.index)) return call.error('', {code: -3});
|
||||||
if (!conf.gudKey && (db?.rec?.length || 0) < G.gc.huobanzhaomu.length - 1) return call.error('', { code: -4 });
|
|
||||||
|
if (conf.gudKey == "chaozhiyueka") {
|
||||||
|
let logs = await PayFun.getPayLog(call.uid, "chaozhiyueka");
|
||||||
|
if (!logs || logs.slice(-1)[0].eTime < G.time) {
|
||||||
|
return call.error('', {code: -4});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!conf.gudKey && (db?.rec?.length || 0) < G.gc.huobanzhaomu.length - 1) {
|
||||||
|
return call.error('', {code: -4});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await PlayerFun.sendPrize(call, conf.prize);
|
await PlayerFun.sendPrize(call, conf.prize);
|
||||||
|
|
||||||
if (db?.rec?.length + 1 >= G.gc.huobanzhaomu.length) {
|
if (db?.rec?.length + 1 >= G.gc.huobanzhaomu.length) {
|
||||||
G.mongodb.collection('syncBtns').updateOne({ uid: call.uid }, { $set: { 'huobanzhaomu.active': false } }, { upsert: true });
|
G.mongodb.collection('syncBtns').updateOne({uid: call.uid}, {$set: {'huobanzhaomu.active': false}}, {upsert: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
G.mongodb.cEvent('huobanzhaomu').updateOne(
|
G.mongodb.cEvent('huobanzhaomu').updateOne(
|
||||||
{ uid: call.uid, type: 'huobanzhaomu' },
|
{uid: call.uid, type: 'huobanzhaomu'},
|
||||||
{ $push: { rec: call.req.index } },
|
{$push: {rec: call.req.index}},
|
||||||
{ upsert: true }
|
{upsert: true}
|
||||||
);
|
);
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['huobanzhaomuhd'])
|
HongDianChange.sendChangeKey(call.uid, ['huobanzhaomuhd'])
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import {ApiCall} from "tsrpc";
|
||||||
import { PlayerFun } from '../../public/player';
|
import {PlayerFun} from '../../public/player';
|
||||||
import { XstaskFun } from '../../public/xstask';
|
import {XstaskFun} from '../../public/xstask';
|
||||||
import { ReqAllGet, ResAllGet } from "../../shared/protocols/xstask/PtlAllGet";
|
import {ReqAllGet, ResAllGet} from "../../shared/protocols/xstask/PtlAllGet";
|
||||||
import { HongDianChange } from "../hongdian/fun";
|
import {HongDianChange} from "../hongdian/fun";
|
||||||
import { PublicShared } from "../../shared/public/public";
|
import {PublicShared} from "../../shared/public/public";
|
||||||
|
import {TeQuanFun} from "../../public/tequan";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
|
export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
|
||||||
const taskList = JSON.parse(JSON.stringify(await XstaskFun.getAllTask(call.uid)));
|
const taskList = JSON.parse(JSON.stringify(await XstaskFun.getAllTask(call.uid)));
|
||||||
let taskInfo = await XstaskFun.getInfo(call.uid);
|
let taskInfo = await XstaskFun.getInfo(call.uid);
|
||||||
let prizeArr:atn[] = []
|
let tequan = await TeQuanFun.getXsTaskNum(call);
|
||||||
for(let task of taskList) {
|
let prizeArr: atn[] = []
|
||||||
|
for (let task of taskList) {
|
||||||
const taskConf = G.gc.xstask[task?.taskId];
|
const taskConf = G.gc.xstask[task?.taskId];
|
||||||
if (!task) continue;
|
if (!task) continue;
|
||||||
if (task.receiveData == undefined) continue;
|
if (task.receiveData == undefined) continue;
|
||||||
@ -23,12 +25,12 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
|
|||||||
// }
|
// }
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
let change: Parameters<typeof XstaskFun.changeInfo>[1] = { $inc: {} };
|
let change: Parameters<typeof XstaskFun.changeInfo>[1] = {$inc: {}};
|
||||||
change.$inc[`finishNum.${taskConf.colour}`] = 1;
|
change.$inc[`finishNum.${taskConf.colour}`] = 1;
|
||||||
// 比对派遣时间,如果小于当日0点,则更新新任务,否则该变领取状态为true
|
// 比对派遣时间,如果小于当日0点,则更新新任务,否则该变领取状态为true
|
||||||
if(task.receiveData.time < PublicShared.getToDayZeroTime()) {
|
if (task.receiveData.time < PublicShared.getToDayZeroTime()) {
|
||||||
// 更新任务
|
// 更新任务
|
||||||
let newTask = XstaskFun.randomTasks(taskInfo?.lv, 1)
|
let newTask = XstaskFun.randomTasks(taskInfo?.lv, 1)
|
||||||
XstaskFun.updateTask(call.uid, task._id, newTask[0].taskId)
|
XstaskFun.updateTask(call.uid, task._id, newTask[0].taskId)
|
||||||
} else {
|
} else {
|
||||||
// 更新领取状态
|
// 更新领取状态
|
||||||
@ -38,6 +40,14 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
|
|||||||
XstaskFun.changeInfo(call.uid, change);
|
XstaskFun.changeInfo(call.uid, change);
|
||||||
await PlayerFun.sendPrize(call, taskConf.prize);
|
await PlayerFun.sendPrize(call, taskConf.prize);
|
||||||
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
|
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
|
||||||
|
|
||||||
|
if (!tequan) {
|
||||||
|
prizeArr.push(...taskConf.prize)
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
prizeArr.push(...taskConf.prize)
|
||||||
|
}
|
||||||
|
}
|
||||||
prizeArr.push(...taskConf.prize)
|
prizeArr.push(...taskConf.prize)
|
||||||
}
|
}
|
||||||
call.succ({
|
call.succ({
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import {ApiCall} from "tsrpc";
|
||||||
import { PlayerFun } from '../../public/player';
|
import {PlayerFun} from '../../public/player';
|
||||||
import { XstaskFun } from '../../public/xstask';
|
import {XstaskFun} from '../../public/xstask';
|
||||||
import { ReqGet, ResGet } from "../../shared/protocols/xstask/PtlGet";
|
import {ReqGet, ResGet} from "../../shared/protocols/xstask/PtlGet";
|
||||||
import { HongDianChange } from "../hongdian/fun";
|
import {HongDianChange} from "../hongdian/fun";
|
||||||
import { PublicShared } from '../../shared/public/public';
|
import {PublicShared} from '../../shared/public/public';
|
||||||
|
import {TeQuanFun} from "../../public/tequan";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqGet, ResGet>) {
|
export default async function (call: ApiCall<ReqGet, ResGet>) {
|
||||||
|
|
||||||
@ -23,24 +24,32 @@ export default async function (call: ApiCall<ReqGet, ResGet>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let change: Parameters<typeof XstaskFun.changeInfo>[1] = { $inc: {} };
|
let change: Parameters<typeof XstaskFun.changeInfo>[1] = {$inc: {}};
|
||||||
change.$inc[`finishNum.${taskConf.colour}`] = 1;
|
change.$inc[`finishNum.${taskConf.colour}`] = 1;
|
||||||
// 比对派遣时间,如果小于当日0点,则更新新任务,否则该变领取状态为true
|
// 比对派遣时间,如果小于当日0点,则更新新任务,否则该变领取状态为true
|
||||||
if(task.receiveData.time < PublicShared.getToDayZeroTime()) {
|
if (task.receiveData.time < PublicShared.getToDayZeroTime()) {
|
||||||
// 更新任务
|
// 更新任务
|
||||||
let newTask = XstaskFun.randomTasks(taskInfo?.lv, 1)
|
let newTask = XstaskFun.randomTasks(taskInfo?.lv, 1)
|
||||||
XstaskFun.updateTask(call.uid, call.req._id, newTask[0].taskId)
|
XstaskFun.updateTask(call.uid, call.req._id, newTask[0].taskId)
|
||||||
} else {
|
} else {
|
||||||
// 更新领取状态
|
// 更新领取状态
|
||||||
XstaskFun.finishTask(call.uid, call.req._id)
|
XstaskFun.finishTask(call.uid, call.req._id)
|
||||||
}
|
}
|
||||||
// XstaskFun.delTask(call.uid, call.req._id);
|
// XstaskFun.delTask(call.uid, call.req._id);
|
||||||
|
let send_prize = [];
|
||||||
XstaskFun.changeInfo(call.uid, change);
|
XstaskFun.changeInfo(call.uid, change);
|
||||||
await PlayerFun.sendPrize(call, taskConf.prize);
|
if (!await TeQuanFun.getXsTaskNum(call)) {
|
||||||
|
send_prize = taskConf.prize;
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
send_prize = send_prize.concat(taskConf.prize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await PlayerFun.sendPrize(call, send_prize);
|
||||||
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
|
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
|
||||||
|
|
||||||
call.succ({
|
call.succ({
|
||||||
taskList: await XstaskFun.getAllTask(call.uid),
|
taskList: await XstaskFun.getAllTask(call.uid),
|
||||||
prize: taskConf.prize
|
prize: send_prize
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -36,7 +36,7 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
|||||||
XstaskFun.delTasks(call.uid, delTask.map(task => task._id));
|
XstaskFun.delTasks(call.uid, delTask.map(task => task._id));
|
||||||
}
|
}
|
||||||
|
|
||||||
needAddTask += await TeQuanFun.getXsTaskNum(call);
|
// needAddTask += await TeQuanFun.getXsTaskNum(call);
|
||||||
needAddTask && await XstaskFun.addTasks(call.uid, XstaskFun.randomTasks(taskInfo?.lv || changeInfo.lv, needAddTask));
|
needAddTask && await XstaskFun.addTasks(call.uid, XstaskFun.randomTasks(taskInfo?.lv || changeInfo.lv, needAddTask));
|
||||||
|
|
||||||
let { _id, uid, type, ...info } = taskInfo || changeInfo as typeof taskInfo;
|
let { _id, uid, type, ...info } = taskInfo || changeInfo as typeof taskInfo;
|
||||||
|
18
src/monopoly/protocols/games/Ptlheapdump.ts
Normal file
18
src/monopoly/protocols/games/Ptlheapdump.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { StringTypeSchema } from "tsbuffer-schema";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区服初始化
|
||||||
|
*/
|
||||||
|
export type Reqheapdump = {
|
||||||
|
act:string,
|
||||||
|
data:any
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type Resheapdump = {
|
||||||
|
/**
|
||||||
|
* 如果发送成功 将返回
|
||||||
|
*/
|
||||||
|
code: number
|
||||||
|
data: any;
|
||||||
|
};
|
@ -1,6 +1,7 @@
|
|||||||
import { ServiceProto } from 'tsrpc-proto';
|
import { ServiceProto } from 'tsrpc-proto';
|
||||||
import { Reqsendemail, Ressendemail } from './email/Ptlsendemail';
|
import { Reqsendemail, Ressendemail } from './email/Ptlsendemail';
|
||||||
import { Reqdeploy, Resdeploy } from './games/Ptldeploy';
|
import { Reqdeploy, Resdeploy } from './games/Ptldeploy';
|
||||||
|
import { Reqheapdump, Resheapdump } from './games/Ptlheapdump';
|
||||||
import { Reqmetrics, Resmetrics } from './games/Ptlmetrics';
|
import { Reqmetrics, Resmetrics } from './games/Ptlmetrics';
|
||||||
import { Reqnotification, Resnotification } from './games/Ptlnotification';
|
import { Reqnotification, Resnotification } from './games/Ptlnotification';
|
||||||
import { Reqopen, Resopen } from './games/Ptlopen';
|
import { Reqopen, Resopen } from './games/Ptlopen';
|
||||||
@ -31,6 +32,10 @@ export interface ServiceType {
|
|||||||
req: Reqdeploy,
|
req: Reqdeploy,
|
||||||
res: Resdeploy
|
res: Resdeploy
|
||||||
},
|
},
|
||||||
|
"games/heapdump": {
|
||||||
|
req: Reqheapdump,
|
||||||
|
res: Resheapdump
|
||||||
|
},
|
||||||
"games/metrics": {
|
"games/metrics": {
|
||||||
req: Reqmetrics,
|
req: Reqmetrics,
|
||||||
res: Resmetrics
|
res: Resmetrics
|
||||||
@ -127,96 +132,101 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"name": "games/metrics",
|
"name": "games/heapdump",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"name": "games/notification",
|
"name": "games/metrics",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"name": "games/open",
|
"name": "games/notification",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
"name": "games/ranking",
|
"name": "games/open",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"name": "gift/popup",
|
"name": "games/ranking",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"name": "gm/Pay",
|
"name": "gift/popup",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"name": "gm/SendPrize",
|
"name": "gm/Pay",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
"name": "hdinfo/details",
|
"name": "gm/SendPrize",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10,
|
"id": 10,
|
||||||
"name": "AddHuoDong",
|
"name": "hdinfo/details",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11,
|
"id": 11,
|
||||||
"name": "CatAllhd",
|
"name": "AddHuoDong",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12,
|
"id": 12,
|
||||||
"name": "DelHuoDong",
|
"name": "CatAllhd",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 13,
|
"id": 13,
|
||||||
"name": "Email",
|
"name": "DelHuoDong",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 14,
|
"id": 14,
|
||||||
"name": "GetLog",
|
"name": "Email",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 15,
|
"id": 15,
|
||||||
"name": "healthz",
|
"name": "GetLog",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 16,
|
"id": 16,
|
||||||
"name": "union/rename",
|
"name": "healthz",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 17,
|
"id": 17,
|
||||||
"name": "user/data",
|
"name": "union/rename",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 18,
|
"id": 18,
|
||||||
"name": "user/disable",
|
"name": "user/data",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 19,
|
"id": 19,
|
||||||
"name": "user/getdata",
|
"name": "user/disable",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 20,
|
"id": 20,
|
||||||
|
"name": "user/getdata",
|
||||||
|
"type": "api"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 21,
|
||||||
"name": "user/rename",
|
"name": "user/rename",
|
||||||
"type": "api"
|
"type": "api"
|
||||||
}
|
}
|
||||||
@ -367,6 +377,44 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"games/Ptlheapdump/Reqheapdump": {
|
||||||
|
"type": "Interface",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "act",
|
||||||
|
"type": {
|
||||||
|
"type": "String"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "data",
|
||||||
|
"type": {
|
||||||
|
"type": "Any"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"games/Ptlheapdump/Resheapdump": {
|
||||||
|
"type": "Interface",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "code",
|
||||||
|
"type": {
|
||||||
|
"type": "Number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "data",
|
||||||
|
"type": {
|
||||||
|
"type": "Any"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"games/Ptlmetrics/Reqmetrics": {
|
"games/Ptlmetrics/Reqmetrics": {
|
||||||
"type": "Interface"
|
"type": "Interface"
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,8 @@ export async function createHttp() {
|
|||||||
json: true,
|
json: true,
|
||||||
cors: '*',
|
cors: '*',
|
||||||
port: G.config.httpPort,
|
port: G.config.httpPort,
|
||||||
logLevel: G.argv.logModel as LogLevel
|
logLevel: G.argv.logModel as LogLevel,
|
||||||
|
apiTimeout:300000,
|
||||||
});
|
});
|
||||||
setHttp(G.http);
|
setHttp(G.http);
|
||||||
await G.http.autoImplementApi(resolve(__dirname, 'api_o2s'), true);
|
await G.http.autoImplementApi(resolve(__dirname, 'api_o2s'), true);
|
||||||
|
@ -640,25 +640,25 @@ export class _mongodb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@ts-ignore
|
// //@ts-ignore
|
||||||
FindCursor.prototype._toArray = FindCursor.prototype.toArray;
|
// FindCursor.prototype._toArray = FindCursor.prototype.toArray;
|
||||||
//@ts-ignore
|
// //@ts-ignore
|
||||||
FindCursor.prototype.toArray = async function(){
|
// FindCursor.prototype.toArray = async function(){
|
||||||
let rss = await this._toArray();
|
// let rss = await this._toArray();
|
||||||
|
//
|
||||||
//如果返回的数据超过50条
|
// //如果返回的数据超过50条
|
||||||
if(rss.length>50){
|
// if(rss.length>50){
|
||||||
addGameLog("system","findCount",null,{
|
// addGameLog("system","findCount",null,{
|
||||||
collection: this.namespace.collection,
|
// collection: this.namespace.collection,
|
||||||
db:this.namespace.db,
|
// db:this.namespace.db,
|
||||||
count:rss.length
|
// count:rss.length
|
||||||
})
|
// })
|
||||||
console.log("system,findCount",{
|
// console.log("system,findCount",{
|
||||||
collection: this.namespace.collection,
|
// collection: this.namespace.collection,
|
||||||
db:this.namespace.db,
|
// db:this.namespace.db,
|
||||||
count:rss.length
|
// count:rss.length
|
||||||
})
|
// })
|
||||||
console.trace();
|
// console.trace();
|
||||||
}
|
// }
|
||||||
return rss;
|
// return rss;
|
||||||
}
|
// }
|
Loading…
Reference in New Issue
Block a user