Compare commits

..

No commits in common. "8f92372471b10cc90ac6e900961c27624c363e6f" and "499acf36845b87f55a2ee9644ce86da85df4d6d7" have entirely different histories.

5 changed files with 7 additions and 26 deletions

View File

@ -14,7 +14,7 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
if (args.length < 1 || _ids.isDuplication() || heroIds.isDuplication()) return call.error(globalThis.lng.kbzz_1);
let event = await G.mongodb.cEvent('xstask').findOne({uid: call.uid, type: 'xstask'});
if (event?.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
if (event.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
//所有的任务
let taskList = await XstaskFun.getAllTask(call.uid);

View File

@ -9,7 +9,7 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
if (call.req.heroIds.isDuplication()) return call.error(globalThis.lng.xstask_10);
let event = await G.mongodb.cEvent('xstask').findOne({uid: call.uid, type: 'xstask'});
if (event?.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
if (event.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
let task = await XstaskFun.getTask(call.uid, call.req._id);
let taskConf = G.gc.xstask[task?.taskId];

View File

@ -13,7 +13,7 @@ export default async function (call: ApiCall<ReqRefresh, ResRefresh>) {
if (delNum < 1) return call.error(globalThis.lng.xstask_11);
let event = await G.mongodb.cEvent('xstask').findOne({uid: call.uid, type: 'xstask'});
if (event?.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
if (event.receiveNum >= 8) return call.error(globalThis.lng.xstask_11);
let change: ResRefresh = {};
let needDel = taskList.filter(task => task.receiveData == undefined || task.receiveData.rec == true);

View File

@ -1,5 +1,4 @@
import { Db, MongoClient } from "mongodb";
import { Logger } from "tsrpc";
let logDB:Db;
let errorLogDB:Db;
@ -29,28 +28,13 @@ async function connGameLogDB() {
return logDB;
}
export let mylogger: Logger = {
debug(...args: any[]){
console.debug(...args);
},
log(...args: any[]){
console.log(...args);
},
warn(...args: any[]){
console.warn(...args);
},
error(...args: any[]){
addErrorLog( args );
console.error(...args);
}
}
process.on('uncaughtException',function(err:Error){
addErrorLog( (err?.stack || err)?.toString() );
addErrorLog((err?.stack)?.toString());
})
process.on('unhandledRejection', function (err:Error, promise) {
addErrorLog( (err?.stack || err)?.toString() );
addErrorLog((err?.stack)?.toString());
})
async function addErrorLog(errData:any){

View File

@ -13,7 +13,6 @@ import {player} from './shared/protocols/user/type';
import {unQueueByConn} from './api_s2c/user/ApiLogin';
import {clusterPublish, setUidProcessId} from './clusterUtils';
import {clearGud, getGud} from './public/gud';
import { mylogger } from './gameLog';
export async function createWs() {
@ -26,9 +25,8 @@ export async function createWs() {
json: true,
//API超时时间5分钟为登陆排队做准备
apiTimeout: 300000,
logLevel: G.argv.logModel as LogLevel,
logger:mylogger
});
logLevel: G.argv.logModel as LogLevel
});
setCrossWs(G.serverCross);
await G.serverCross.autoImplementApi(resolve(__dirname, 'api_cross'), true);
await G.serverCross.start();
@ -39,7 +37,6 @@ export async function createWs() {
wss: getWssFile(),
//API超时时间5分钟为登陆排队做准备只针对游服
apiTimeout: 300000,
logger:mylogger
});
setWs(G.server);
await G.server.autoImplementApi(resolve(__dirname, 'api_s2c'), true);