优化:gm-server创建武将

This commit is contained in:
luying
2021-09-02 20:33:00 +08:00
parent e572cb2fa5
commit 62e32a4eb3
11 changed files with 372 additions and 191 deletions

View File

@@ -728,7 +728,7 @@ export const RoleModel = getModelForClass(Role);
export interface RoleType extends Pick<DocumentType<Role>, keyof Role> { };
export type RoleUpdate = Partial<RoleType>; // 将所有字段变成可选项
export type RoleInc = Partial<Pick<DocumentType<Role>, 'heroNum' | 'blockCnt' | 'friendCnt' | 'gold' | 'coin'>>;
export type RoleInc = Partial<Pick<DocumentType<Role>, 'heroNum' | 'blockCnt' | 'friendCnt' | 'gold' | 'coin' | 'ce'>>;
// 初始化
function getInitialTeraph() {

View File

@@ -34,7 +34,7 @@ export default class Skin extends BaseModel {
const items: SkinType[] = await SkinModel.insertMany(insertInfos);
return items;
}
public static async increaseSkin(roleId: string, id: number, info: { roleId: string, roleName: string, id: number, skinName: string, hid: number }, lean = true) {
const doc = new SkinModel();
const setOnInsert = Object.assign(doc.toJSON(), info);