聊天:修复部分系统消息推送触发
This commit is contained in:
@@ -535,6 +535,7 @@ export class EquipHandler {
|
|||||||
let { count, consumes, jewel, type } = msg;
|
let { count, consumes, jewel, type } = msg;
|
||||||
let roleId: string = session.get('roleId');
|
let roleId: string = session.get('roleId');
|
||||||
let roleName: string = session.get('roleName');
|
let roleName: string = session.get('roleName');
|
||||||
|
let serverId: number = session.get('serverId');
|
||||||
let sid: string = session.get('sid');
|
let sid: string = session.get('sid');
|
||||||
let goodInfo = getGoodById(jewel);
|
let goodInfo = getGoodById(jewel);
|
||||||
let good = ITID.get(goodInfo.itid);
|
let good = ITID.get(goodInfo.itid);
|
||||||
@@ -549,6 +550,10 @@ export class EquipHandler {
|
|||||||
let result = await addItems(roleId, roleName, sid, [{ id: jewel, count: count }]);
|
let result = await addItems(roleId, roleName, sid, [{ id: jewel, count: count }]);
|
||||||
if (type == 1)
|
if (type == 1)
|
||||||
return resResult(STATUS.SUCCESS, { goods: result });
|
return resResult(STATUS.SUCCESS, { goods: result });
|
||||||
|
|
||||||
|
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||||
|
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||||
|
}
|
||||||
return resResult(STATUS.SUCCESS);
|
return resResult(STATUS.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,6 +640,7 @@ export class EquipHandler {
|
|||||||
let roleId: string = session.get('roleId');
|
let roleId: string = session.get('roleId');
|
||||||
let roleName: string = session.get('roleName');
|
let roleName: string = session.get('roleName');
|
||||||
let sid: string = session.get('sid');
|
let sid: string = session.get('sid');
|
||||||
|
let serverId = session.get('serverId');
|
||||||
let goodInfo = getGoodById(jewel);
|
let goodInfo = getGoodById(jewel);
|
||||||
let good = ITID.get(goodInfo.itid);
|
let good = ITID.get(goodInfo.itid);
|
||||||
let needUpdate = false;
|
let needUpdate = false;
|
||||||
@@ -661,6 +667,11 @@ export class EquipHandler {
|
|||||||
let hasError = await decreaseItems(roleId, sid, consumes);//检查是消耗是否足够
|
let hasError = await decreaseItems(roleId, sid, consumes);//检查是消耗是否足够
|
||||||
if (!!hasError)
|
if (!!hasError)
|
||||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||||
|
|
||||||
|
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||||
|
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||||
|
}
|
||||||
|
|
||||||
let result = {};
|
let result = {};
|
||||||
if (needUpdate) {
|
if (needUpdate) {
|
||||||
//穿戴宝石
|
//穿戴宝石
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { ItemModel } from '../../../db/Item';
|
|||||||
import { gameData, getHeroExpByLv, getHeroStarByQuality, getHeroWakeByQuality, getHeroLvByExp, getMaxGradeByjobClass, getJobByGradeAndClass, getFriendShipById, getFavourLvByExp } from '../../../pubUtils/data';
|
import { gameData, getHeroExpByLv, getHeroStarByQuality, getHeroWakeByQuality, getHeroLvByExp, getMaxGradeByjobClass, getJobByGradeAndClass, getFriendShipById, getFavourLvByExp } from '../../../pubUtils/data';
|
||||||
import { RewardInter } from '../../../pubUtils/interface';
|
import { RewardInter } from '../../../pubUtils/interface';
|
||||||
import { getDropItems, FIGURE_UNLOCK_CONDITION } from '../../../consts/constModules/itemConst'
|
import { getDropItems, FIGURE_UNLOCK_CONDITION } from '../../../consts/constModules/itemConst'
|
||||||
import { pushComposeOrangeHero, pushHeroQualityUpMsg, pushHeroStarMax } from '../../../services/chatService';
|
import { pushComposeOrangeHero, pushHeroQualityUpMsg, pushHeroStarMax, pushHeroWakeUp } from '../../../services/chatService';
|
||||||
import { calculatetopLineup } from '../../../pubUtils/playerCe';
|
import { calculatetopLineup } from '../../../pubUtils/playerCe';
|
||||||
import { PvpDefenseModel } from '../../../db/PvpDefense';
|
import { PvpDefenseModel } from '../../../db/PvpDefense';
|
||||||
import { Attribute } from '../../../domain/roleField/attribute';
|
import { Attribute } from '../../../domain/roleField/attribute';
|
||||||
@@ -215,8 +215,6 @@ export class HeroHandler {
|
|||||||
// 武将升星
|
// 武将升星
|
||||||
public async starUp(msg: { hid: number, star: number, starStage: number}, session: BackendSession) {
|
public async starUp(msg: { hid: number, star: number, starStage: number}, session: BackendSession) {
|
||||||
let roleId: string = session.get('roleId');
|
let roleId: string = session.get('roleId');
|
||||||
let roleName: string = session.get('roleName');
|
|
||||||
let serverId: string = session.get('serverId');
|
|
||||||
let sid: string = session.get('sid');
|
let sid: string = session.get('sid');
|
||||||
|
|
||||||
let {hid, star, starStage} = msg;
|
let {hid, star, starStage} = msg;
|
||||||
@@ -258,7 +256,6 @@ export class HeroHandler {
|
|||||||
colorStar: hero.colorStar,
|
colorStar: hero.colorStar,
|
||||||
colorStarStage: hero.colorStarStage
|
colorStarStage: hero.colorStarStage
|
||||||
}
|
}
|
||||||
pushHeroStarMax(roleId, roleName, serverId, hero);
|
|
||||||
return resResult(STATUS.SUCCESS, {isUpStar, curHero});
|
return resResult(STATUS.SUCCESS, {isUpStar, curHero});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,6 +311,8 @@ export class HeroHandler {
|
|||||||
|
|
||||||
let roleId: string = session.get('roleId');
|
let roleId: string = session.get('roleId');
|
||||||
let sid: string = session.get('sid');
|
let sid: string = session.get('sid');
|
||||||
|
let roleName: string = session.get('roleName');
|
||||||
|
let serverId: string = session.get('serverId');
|
||||||
|
|
||||||
let {hid, colorStar, colorStarStage} = msg;
|
let {hid, colorStar, colorStarStage} = msg;
|
||||||
// 根据dic_hero 获得 1. 碎片id 2. 碎片数量 3. 初始武将星级 4. 初始品质
|
// 根据dic_hero 获得 1. 碎片id 2. 碎片数量 3. 初始武将星级 4. 初始品质
|
||||||
@@ -362,6 +361,8 @@ export class HeroHandler {
|
|||||||
colorStar: hero.colorStar,
|
colorStar: hero.colorStar,
|
||||||
colorStarStage: hero.colorStarStage
|
colorStarStage: hero.colorStarStage
|
||||||
}
|
}
|
||||||
|
if(isWakeUp) pushHeroWakeUp(roleId, roleName, serverId, hero); // 第一次觉醒
|
||||||
|
pushHeroStarMax(roleId, roleName, serverId, hero);
|
||||||
return resResult(STATUS.SUCCESS, {isUpStar, curHero});
|
return resResult(STATUS.SUCCESS, {isUpStar, curHero});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -505,6 +505,8 @@ export class RoleHandler {
|
|||||||
if(checkName) return resResult(STATUS.NAME_HAS_USED);
|
if(checkName) return resResult(STATUS.NAME_HAS_USED);
|
||||||
|
|
||||||
let role = await RoleModel.updateRoleInfo(roleId, { roleName });
|
let role = await RoleModel.updateRoleInfo(roleId, { roleName });
|
||||||
|
session.set('roleName', role.roleName);
|
||||||
|
session.push('roleName', () => {});
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, { roleName: role.roleName });
|
return resResult(STATUS.SUCCESS, { roleName: role.roleName });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,12 +30,16 @@ export async function pushComposeOrangeHero(roleId: string, roleName: string, se
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function pushHeroStarMax(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
|
export async function pushHeroStarMax(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
|
||||||
if (heroInfo.star !== HERO_GROW_MAX.STAR) {
|
if (heroInfo.colorStar !== HERO_GROW_MAX.STAR) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_STAR_MAX, heroInfo);
|
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_STAR_MAX, heroInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function pushHeroWakeUp(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
|
||||||
|
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_WAKEUP, heroInfo);
|
||||||
|
}
|
||||||
|
|
||||||
export async function pushComBtlTeamMsg(teamCode: string, roleId: string, roleName: string, type: number, source: number, content: string, targetRoleId: string, targetMsgCode: string) {
|
export async function pushComBtlTeamMsg(teamCode: string, roleId: string, roleName: string, type: number, source: number, content: string, targetRoleId: string, targetMsgCode: string) {
|
||||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
|
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
|
||||||
if (!msgData) return null;
|
if (!msgData) return null;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": "蛮夷入侵",
|
"name": "蛮夷入侵",
|
||||||
"openDay": "",
|
"openDay": "3&0",
|
||||||
"duringTime": 900,
|
"duringTime": 900,
|
||||||
"startTime": 20,
|
"startTime": 20,
|
||||||
"startMinute": 0,
|
"startMinute": 0,
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"name": "诸侯混战",
|
"name": "诸侯混战",
|
||||||
"openDay": "",
|
"openDay": "2&4&6",
|
||||||
"duringTime": 900,
|
"duringTime": 900,
|
||||||
"startTime": 20,
|
"startTime": 20,
|
||||||
"startMinute": 0,
|
"startMinute": 0,
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"name": "粮草先行",
|
"name": "粮草先行",
|
||||||
"openDay": "1&5&6",
|
"openDay": "1&5",
|
||||||
"duringTime": 600,
|
"duringTime": 600,
|
||||||
"startTime": 20,
|
"startTime": 20,
|
||||||
"startMinute": 0,
|
"startMinute": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user