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