战力计算,远征战力筛选
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user