Merge branch 'feature/hero' of gitlab.trgame.cn:zyztech/zyz_server

Conflicts:
	shared/consts/consts.ts
	shared/db/Role.ts
	web-server/app/service/Auth.ts
This commit is contained in:
luying
2020-12-14 11:17:02 +08:00
57 changed files with 18170 additions and 10511 deletions

View File

@@ -1,5 +1,4 @@
import { FIX_SMS_CODE_TELS, COUNTER, DEFAULT_ITEMS, ITID, DEFAULT_GOLD, DEFAULT_LV } from '@consts/consts';
import { CounterModel } from '@db/Counter';
import { DEFAULT_HEROES } from '@consts/consts';
import { HeroModel } from '@db/Hero';
import { RoleModel } from '@db/Role';
@@ -141,23 +140,17 @@ export default class Auth extends Service {
if(hero) {
continue;
}
const seqId = await CounterModel.getNewCounter(COUNTER.HID)||-1;
let dicHero = getHeroInfoById(hid);
if(!dicHero) {
break;
}
let {quality, initialStars: star, jobid: job, name: hName} = dicHero;
const heroInfo = {
roleId,
roleName: role.roleName,
hid: hid,
hName: dicHero.name,
seqId,
star: dicHero.quality,
lv: 30,
ce: 100
}
await HeroModel.createHero(heroInfo);
hero = await HeroModel.createHero({
roleId, roleName: role.roleName, hid, hName, star, quality, job, serverId: role.serverId
});
}
for(let {id, count} of DEFAULT_ITEMS) {