军团:添加活跃排行榜

This commit is contained in:
luying
2021-01-26 13:25:05 +08:00
parent 3c3e734019
commit 08ef299fec
14 changed files with 293 additions and 59 deletions

View File

@@ -6,6 +6,7 @@ import { redisUserInfoUpdate } from './redisService';
import { switchOnFunc } from './funcSwitchService';
import { FUNC_OPT_TYPE } from '../consts';
import { BackendSession } from 'pinus';
import { REDIS_KEY } from '../consts/consts';
export async function roleLevelup(roleId: string, kingExp: number, session: BackendSession) {
let role = await RoleModel.findByRoleId(roleId);
@@ -23,7 +24,7 @@ export async function roleLevelup(roleId: string, kingExp: number, session: Back
role = await RoleModel.levelup(roleId, newLv, newExp);
if(newLv > lv) { // 升级
await switchOnFunc(roleId, FUNC_OPT_TYPE.LEVEL_UP, newLv, session);
await redisUserInfoUpdate(roleId, [{field: 'lv', value: newLv}])
await redisUserInfoUpdate(REDIS_KEY.USER_INFO, roleId, [{field: 'lv', value: newLv}])
}
let actordata = [];
for(let i = lv; i <= newLv; i++) {