feat(gvg): 准备期征战中原初始

This commit is contained in:
luying
2023-01-30 10:24:54 +08:00
parent 3a71d7da97
commit 3c8ac3c9e5
11 changed files with 244 additions and 16 deletions

View File

@@ -0,0 +1,78 @@
import { Application, BackendSession, ChannelService, HandlerService } from "pinus";
export default function (app: Application) {
new HandlerService(app, {});
return new GVGProduceHandler(app);
}
export class GVGProduceHandler {
channelService: ChannelService;
constructor(private app: Application) {
this.channelService = app.get('channelService');
}
// 领取排行榜获得的每日奖励
async receiveBox(msg: { vestigeId: number }, session: BackendSession) {
}
// 遗迹页面
async getVestige(msg: { vestigeId: number }, session: BackendSession) {
}
// 编辑阵容
async saveLineup(msg: { vestigeId: number, lineup: [{ actorId: number, dataId: number, order: number }] }, session: BackendSession) {
}
// 获取对手阵容消息
async getOppLineup(msg: { vestigeId: number, roleId: string, rank: number }, session: BackendSession) {
}
// 刷新对手
async refreshOpp(msg: {}, session: BackendSession) {
}
// 选择对手
async chooseOpp(msg: { vestigeId: number, rank: number, myRank: number }, session: BackendSession) {
}
// 出战界面撤退
async giveupCheck(msg: { battleCode: string }, session: BackendSession) {
}
// 获取对手具体战场数据
async getOppData(msg: { battleCode: string }, session: BackendSession) {
}
// 布完阵开始挑战
async checkBattle(msg: { battleCode: string, heroes: [{ actorId: number, dataId: number, order: number }] }, session: BackendSession) {
}
// 挑战结算
async battleEnd(msg: { battleCode: string, isSuccess: boolean }, session: BackendSession) {
}
// 征战中原简单小排行榜
async getLeagueRank(msg: {}, session: BackendSession) {
}
// 联军详细排名
async getLeagueDetailRank(msg: {}, session: BackendSession) {
}
// 玩家排行
async getPlayerRank(msg: { vestigeId: number }, session: BackendSession) {
}
}

View File

@@ -18,9 +18,10 @@ import { gameData } from "../../../pubUtils/data";
import { lockLeagueData } from "../../../services/redLockService";
import { addGVGReward, handleGVGCost } from "../../../services/gvg/gvgItemService";
import { RewardInter } from "../../../pubUtils/interface";
import { getGVGCities } from "../../../services/gvg/gvgBattleService";
import { getGVGCities, getGVGCitiesInfo } from "../../../services/gvg/gvgBattleService";
import { GVGRecModel } from "../../../db/GVGRec";
import { checkGVGTask } from "../../../services/task/taskService";
import { getFightTimeByPeriod, getVestiges } from "../../../services/gvg/gvgFightService";
export default function (app: Application) {
new HandlerService(app, {});
@@ -75,6 +76,26 @@ export class GVGHandler {
return resResult(STATUS.SUCCESS, data)
}
async getMap(msg: {}, session: BackendSession) {
const serverId = session.get('serverId');
const guildCode = session.get('guildCode');
let myLeague = await GVGLeagueModel.findLeagueByGuild(guildCode);
if(!myLeague) return resResult(STATUS.GVG_LEAGUE_NOT_EXIST);
let { configId, period, countdownTime } = getGVGPeriodData();
let { startFightTime, endFightTime } = getFightTimeByPeriod(period);
let cities = await getGVGCitiesInfo(myLeague);
let vestiges = await getVestiges(serverId);
return resResult(STATUS.SUCCESS, {
configId, period, countdownTime, startFightTime, endFightTime,
cities,
vestiges
});
}
// 获取动态
async getRec(msg: {}, session: BackendSession) {
const guildCode = session.get('guildCode');