pvp创建获取
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import {Application, BackendSession} from 'pinus';
|
||||
const _ = require('underscore');
|
||||
import { gameData } from '../../../pubUtils/data';
|
||||
import { checkPvp } from '../../../pubUtils/pvpUtil';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { SystemConfigModel } from '../../../db/SystemConfig'
|
||||
|
||||
import { PvpDefenseModel } from '../../../db/PvpDefense';
|
||||
export default function(app: Application) {
|
||||
return new PvpHandler(app);
|
||||
}
|
||||
@@ -9,5 +16,14 @@ export class PvpHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
async getData (msg: {}, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
let serverId = session.get('serverId');
|
||||
let result = await PvpDefenseModel.findByRoleIdIncludeAll(roleId);
|
||||
let system = await SystemConfigModel.findSystemConfig();
|
||||
|
||||
return resResult(STATUS.SUCCESS, { data: result });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user