优化:创建武将从util放到game-server的service

This commit is contained in:
陆莹
2022-03-16 20:42:46 +08:00
parent 73e5ec2698
commit 4e110afc70
11 changed files with 439 additions and 428 deletions

View File

@@ -179,7 +179,7 @@ export class Rank {
* @param hero 武将数据库
* @param isInc 得分是累加上的还是直接设置的
*/
public async setRankWithHeroInfo(roleId: string, hid: number, score: number, timestamp: number, hero?: HeroType, isInc = false) {
public async setRankWithHeroInfo(roleId: string, hid: number, score: number, timestamp: number, hero?: HeroUpdate, isInc = false) {
// 如果没有信息,更新玩家信息
for (let infoKey of [this.infoKey, ...this.extraKeys]) {
await this.generParamAndSet(infoKey, { roleId, hid }, { hero });
@@ -235,7 +235,7 @@ export class Rank {
* @param fields 玩家id
* @param db 数据库内的数据
*/
public async generParamAndSet(infoKey: string, fields: myIdInter, db: { role?: RoleType, guild?: GuildType, hero?: HeroType }) {
public async generParamAndSet(infoKey: string, fields: myIdInter, db: { role?: RoleType, guild?: GuildType, hero?: HeroUpdate }) {
let { roleId, guildCode, hid } = fields;
let { role, guild, hero } = db;