初始:修复创建角色之后保存对话之前bug
This commit is contained in:
@@ -5,7 +5,7 @@ import { resResult, decodeIdCntArrayStr, parseGoodStr } from '../../../pubUtils/
|
|||||||
import { Application, BackendSession, pinus } from 'pinus';
|
import { Application, BackendSession, pinus } from 'pinus';
|
||||||
import { handleCost, addItems, createHeroes } from '../../../services/rewardService';
|
import { handleCost, addItems, createHeroes } from '../../../services/rewardService';
|
||||||
import { getTitle, getTeraph, gameData, getScollByStar, getFriendLvByExp, getHeroExpByLv } from '../../../pubUtils/data';
|
import { getTitle, getTeraph, gameData, getScollByStar, getFriendLvByExp, getHeroExpByLv } from '../../../pubUtils/data';
|
||||||
import { SCHOOL, SCROLL, EXTERIOR } from '../../../pubUtils/dicParam';
|
import { SCHOOL, SCROLL, EXTERIOR, SCRIPT } from '../../../pubUtils/dicParam';
|
||||||
import { getAtrrNameById } from '../../../consts/constModules/abilityConst'
|
import { getAtrrNameById } from '../../../consts/constModules/abilityConst'
|
||||||
import { findIndex } from 'underscore';
|
import { findIndex } from 'underscore';
|
||||||
import { SclResultInter, SclPosInter } from '../../../pubUtils/interface';
|
import { SclResultInter, SclPosInter } from '../../../pubUtils/interface';
|
||||||
@@ -19,6 +19,8 @@ import { updateUserInfo } from '../../../services/redisService';
|
|||||||
import { checkTaskWithHero, checkTask, checkTaskWithArgs } from '../../../services/taskService';
|
import { checkTaskWithHero, checkTask, checkTaskWithArgs } from '../../../services/taskService';
|
||||||
import { accomplishTask } from '../../../pubUtils/taskUtil';
|
import { accomplishTask } from '../../../pubUtils/taskUtil';
|
||||||
import { getGoldObject, getCoinObject } from '../../../pubUtils/itemUtils';
|
import { getGoldObject, getCoinObject } from '../../../pubUtils/itemUtils';
|
||||||
|
import { getWarById } from '../../../pubUtils/gamedata';
|
||||||
|
import { RScriptRecordModel } from '../../../db/RScriptRecord';
|
||||||
|
|
||||||
export default function (app: Application) {
|
export default function (app: Application) {
|
||||||
return new RoleHandler(app);
|
return new RoleHandler(app);
|
||||||
@@ -57,6 +59,10 @@ export class RoleHandler {
|
|||||||
|
|
||||||
role = await RoleModel.updateRoleInfo(roleId, { hasInit: true, roleName })
|
role = await RoleModel.updateRoleInfo(roleId, { hasInit: true, roleName })
|
||||||
|
|
||||||
|
let battleId = SCRIPT.SCRIPT_BATTLE_ID;
|
||||||
|
let warInfo = getWarById(battleId);
|
||||||
|
await RScriptRecordModel.setScript(roleId, battleId, warInfo.warType, 2, SCRIPT.SCRIPT_NAME);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
roleId, roleName, heroes
|
roleId, roleName, heroes
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user