聊天:添加返回
This commit is contained in:
@@ -21,7 +21,7 @@ import { setAp } from '../../../services/actionPointService';
|
||||
import { roleLevelup } from '../../../services/normalBattleService';
|
||||
import { addUserToChannel } from '../../../services/roleService';
|
||||
import { ChannelUser } from '../../../domain/ChannelUser';
|
||||
import { pushComBtlTeamMsg, pushFriendTeamInviteMsg, pushNormalEquipMsg, pushTeamInviteMsg } from '../../../services/chatService';
|
||||
import { pushComBtlTeamMsg, pushFriendTeamInviteMsg, pushNormalItemMsg, pushTeamInviteMsg } from '../../../services/chatService';
|
||||
import { EXTERIOR } from '../../../pubUtils/dicParam';
|
||||
import { getTodayZeroDate } from '../../../pubUtils/timeUtil';
|
||||
import { FriendParams } from '../../../domain/roleField/friend';
|
||||
@@ -776,7 +776,7 @@ export class ComBattleHandler {
|
||||
const goods = await addItems(roleId, roleName, sid, reward);
|
||||
if (dicCompose.targetQuality >= QUALITY_TYPE.ORANGE) {
|
||||
const { name } = getGoodById(target);
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.ORANGE_BLUEPRT_COMPOSE, target, name);
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.ORANGE_BLUEPRT_COMPOSE, target, name);
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, { goods, costGold: 0 });
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ITID, SPEICAL_ITEM, QUALITY_TYPE } from "../../../consts/constModules/i
|
||||
import { changeEquip, dressEquip, checkMaterialEnough, takeOffEquipAndCalPlayerCe } from "../../../services/equipService";
|
||||
|
||||
import { indexOf, findIndex } from 'underscore';
|
||||
import { pushEquipRefineSucMsg, pushNormalEquipMsg } from "../../../services/chatService";
|
||||
import { pushEquipRefineSucMsg, pushNormalEquipMsg, pushNormalItemMsg } from "../../../services/chatService";
|
||||
|
||||
export default function (app: Application) {
|
||||
return new EquipHandler(app);
|
||||
@@ -78,10 +78,10 @@ export class EquipHandler {
|
||||
let items = [{ id: gid, count: 1 }];
|
||||
let goods = await addItems(roleId, roleName, sid, items);
|
||||
if (targetGood.suitId) {
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.EQUIP_COMPOSE_SUIT, gid, targetGood.name);
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.EQUIP_COMPOSE_SUIT, gid, targetGood.name, targetGood.quality);
|
||||
}
|
||||
if (targetGood.quality >= QUALITY_TYPE.ORANGE) {
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.EQUIP_COMPOSE_ORANGE, gid, targetGood.name);
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.EQUIP_COMPOSE_ORANGE, gid, targetGood.name, targetGood.quality);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { goods });
|
||||
}
|
||||
@@ -229,7 +229,7 @@ export class EquipHandler {
|
||||
if (!curEplace) {
|
||||
return resResult(STATUS.ROLE_EQUIP_PLACE_NOT_ENOUGH);
|
||||
}
|
||||
let { lv, refineLv } = curEplace; // 强化等级,精炼等级,精炼次数
|
||||
let { lv, refineLv, equip } = curEplace; // 强化等级,精炼等级,精炼次数
|
||||
|
||||
if (lv < HERO_GROW_MAX.EQUIP_STRENGTHEN) {
|
||||
return resResult(STATUS.ROLE_EQUIP_NOT_REACH_MAX);
|
||||
@@ -277,7 +277,8 @@ export class EquipHandler {
|
||||
}
|
||||
|
||||
if (isSuccess) {
|
||||
pushEquipRefineSucMsg(roleId, roleName, serverId, curEplace);
|
||||
let curEquip = <EquipType>equip;
|
||||
pushEquipRefineSucMsg(roleId, roleName, serverId, curEplace, curEquip?curEquip.quality: 0);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { isSuccess, curHero });
|
||||
}
|
||||
@@ -552,7 +553,7 @@ export class EquipHandler {
|
||||
return resResult(STATUS.SUCCESS, { goods: result });
|
||||
|
||||
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
@@ -610,7 +611,7 @@ export class EquipHandler {
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
await addItems(roleId, roleName, sid, [{ id: jewel, count: count }]);
|
||||
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
@@ -669,7 +670,7 @@ export class EquipHandler {
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
|
||||
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
}
|
||||
|
||||
let result = {};
|
||||
|
||||
@@ -82,17 +82,24 @@ export async function pushGuildBossSucMsg(roleId: string, roleName: string, guil
|
||||
return msgData;
|
||||
}
|
||||
|
||||
export async function pushEquipRefineSucMsg(roleId: string, roleName: string, serverId: number, eplace: Partial<EPlace>) {
|
||||
export async function pushEquipRefineSucMsg(roleId: string, roleName: string, serverId: number, eplace: Partial<EPlace>, quality: number) {
|
||||
const { id, lv, refineLv, equip } = eplace;
|
||||
const { id: equipId } = equip as EquipType;
|
||||
const data = { id, lv, refineLv, equipId };
|
||||
const data = { id, lv, refineLv, equipId, quality };
|
||||
const content = JSON.stringify({ roleId, roleName, eplace: data });
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_REFINE_SUC, content, null, null);
|
||||
await pushGroupMsgToRoom(msgData);
|
||||
return msgData;
|
||||
}
|
||||
|
||||
export async function pushNormalEquipMsg(roleId: string, roleName: string, serverId: number, source: number, id: number, name: string) {
|
||||
export async function pushNormalEquipMsg(roleId: string, roleName: string, serverId: number, source: number, id: number, name: string, quality: number) {
|
||||
const content = JSON.stringify({ roleId, roleName, equip: { id, name, quality } });
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
|
||||
await pushGroupMsgToRoom(msgData);
|
||||
return msgData;
|
||||
}
|
||||
|
||||
export async function pushNormalItemMsg(roleId: string, roleName: string, serverId: number, source: number, id: number, name: string) {
|
||||
const content = JSON.stringify({ roleId, roleName, equip: { id, name } });
|
||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
|
||||
await pushGroupMsgToRoom(msgData);
|
||||
|
||||
Reference in New Issue
Block a user