添加debug接口

This commit is contained in:
luying
2021-03-05 11:45:33 +08:00
parent 8a122b6a4d
commit b1ceb1b695
5 changed files with 126 additions and 2 deletions
@@ -2,7 +2,7 @@ import { STATUS } from '../../../consts/statusCode';
import { RoleModel } from './../../../db/Role';
import { HeroModel } from '../../../db/Hero';
import { resResult, decodeIdCntArrayStr, parseGoodStr } from '../../../pubUtils/util';
import {Application, BackendSession} from 'pinus';
import {Application, BackendSession, pinus} from 'pinus';
import { handleCost } from '../../../services/rewardService';
import { getTitle, getTeraph, gameData, getScollByStar, getFriendLvByExp } from '../../../pubUtils/data';
import { SCHOOL, SCROLL } from '../../../pubUtils/dicParam';
@@ -358,4 +358,50 @@ export class RoleHandler {
});
}
async debugPlayerTime(msg: { type: number }, session: BackendSession) {
let { type } = msg;
let roleId = session.get('roleId');
let sid = session.get('sid');
if(type == 1) {
pinus.app.channelService.pushMessageByUids('onPlayTime', resResult(STATUS.SUCCESS, {
isGuest: true,
guestTime: 60 * 60, // 游客已体验时间
hasAuthenticated: false, // 是否进行过实名认证
isAdult: false, // 是否已成年
todayPlayTime: 60 * 60, // 今天已游戏时长
type: 1
} ), [{uid: roleId, sid: sid}]);
} else if (type == 2) {
pinus.app.channelService.pushMessageByUids('onPlayTime', resResult(STATUS.SUCCESS, {
isGuest: false,
guestTime: 0, // 游客已体验时间
hasAuthenticated: true, // 是否进行过实名认证
isAdult: false, // 是否已成年
todayPlayTime: 60 * 60, // 今天已游戏时长
type: 2
} ), [{uid: roleId, sid: sid}]);
} else if (type == 3) {
pinus.app.channelService.pushMessageByUids('onPlayTime', resResult(STATUS.SUCCESS, {
isGuest: false,
guestTime: 0, // 游客已体验时间
hasAuthenticated: true, // 是否进行过实名认证
isAdult: false, // 是否已成年
todayPlayTime: 3 * 60 * 60, // 今天已游戏时长
type: 3
} ), [{uid: roleId, sid: sid}]);
} else if (type == 4) {
pinus.app.channelService.pushMessageByUids('onPlayTime', resResult(STATUS.SUCCESS, {
isGuest: false,
guestTime: 0, // 游客已体验时间
hasAuthenticated: true, // 是否进行过实名认证
isAdult: false, // 是否已成年
todayPlayTime: 1.5 * 60 * 60, // 今天已游戏时长
type: 4
} ), [{uid: roleId, sid: sid}]);
}
return resResult(STATUS.SUCCESS);
}
}