优化:创建武将从util放到game-server的service
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user