战力计算,远征战力筛选

This commit is contained in:
luying
2020-11-12 18:21:05 +08:00
parent 40c16587b3
commit b0a0bbc71b
34 changed files with 22812 additions and 15964 deletions

View File

@@ -1,6 +1,7 @@
import { ChatRemote } from '../remote/chatRemote';
import {Application, BackendSession} from 'pinus';
import { FrontendSession } from 'pinus';
import { HeroModel } from '../../../db/Hero';
import Actor from '../../../pubUtils/actor';
import { updateCe } from '../../../pubUtils/util';
export default function(app: Application) {
return new ChatHandler(app);
@@ -10,8 +11,15 @@ export class ChatHandler {
constructor(private app: Application) {
}
async test(msg: {content: string , target: string}, session: BackendSession) {
console.log('test')
async test(msg: {}, session: BackendSession) {
let roleId = session.get('roleId')
let hero = await HeroModel.find().limit(1000);
for(let h of hero) {
let actor = new Actor(h);
let ce = actor.calculateCE();
await updateCe(roleId, h);
}
return 'success'
}
/**
* Send messages to users