pvp测试debug
This commit is contained in:
@@ -19,7 +19,7 @@ import { PvpRecordModel, HeroesRecord } from '../../../db/PvpRecord';
|
||||
import { existsRank, initRank, getRank, setRank, getMyRank } from '../../../services/redisService';
|
||||
import { handleCost } from '../../../services/rewardService';
|
||||
import { nowSeconds } from '../../../pubUtils/timeUtil';
|
||||
|
||||
import { setPvpSeasonResult, resetPvpWarId } from '../../../services/timeTaskService';
|
||||
export default function(app: Application) {
|
||||
return new PvpHandler(app);
|
||||
}
|
||||
@@ -51,6 +51,16 @@ export class PvpHandler {
|
||||
|
||||
}
|
||||
|
||||
async debugPvpSeasonReset(msg: {}, session: BackendSession) {
|
||||
let { seasonNum, seasonEndTime } = await setPvpSeasonResult({name: 'exce setPvpSeasonResult debug'});
|
||||
return resResult(STATUS.SUCCESS, { seasonNum, seasonEndTime })
|
||||
}
|
||||
|
||||
async debugPvpWarReset(msg: {}, session: BackendSession) {
|
||||
let systemConfig = await resetPvpWarId();
|
||||
return resResult(STATUS.SUCCESS, {systemConfig});
|
||||
}
|
||||
|
||||
async getData (msg: {}, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let {pvpDefense, warId} = await findPvpDefAllByRoleId(roleId);
|
||||
@@ -261,7 +271,7 @@ export class PvpHandler {
|
||||
|
||||
if (!!isDefaultHero) {
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
let { resHeroes } = await defaultHeroes(role);
|
||||
let { resHeroes } = await defaultHeroes(role, challengeCnt, challengeRefTime, true);
|
||||
return resResult(STATUS.SUCCESS, { heroes: resHeroes, challengeCnt, challengeRefTime, isDefaultHero} );
|
||||
} else {
|
||||
for (let dataId = PVP_HERO_POS.START; dataId <= PVP_HERO_POS.END; dataId++) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Application, ChannelService, FrontendSession, RemoterClass } from 'pinus';
|
||||
import { Application, ChannelService, FrontendSession, pinus, RemoterClass } from 'pinus';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { getRedis, setRedis, delRedis } from '../../../services/redisService';
|
||||
@@ -28,7 +28,8 @@ export class ConnectorRemote {
|
||||
await sessionService.akick(uid);
|
||||
}
|
||||
|
||||
public async pushMessage(sid: string, uid: string, route: string, data:any) {
|
||||
public async pushMessage( uid: string, route: string, data:any) {
|
||||
let sid = pinus.app.getServerId();
|
||||
if (!!sid) {
|
||||
let uids = [{uid, sid}];
|
||||
this.channelService.pushMessageByUids(route, data, uids);
|
||||
|
||||
Reference in New Issue
Block a user