军团活动:诸侯混战城池状态
This commit is contained in:
@@ -549,12 +549,13 @@ export class EquipHandler {
|
||||
if (!res)
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
let result = await addItems(roleId, roleName, sid, [{ id: jewel, count: count }]);
|
||||
if (type == 1)
|
||||
return resResult(STATUS.SUCCESS, { goods: result });
|
||||
|
||||
|
||||
if (goodInfo.lvLimited >= JEWEL_PUSH_LV) {
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.JEWEL_COMPOSE, jewel, goodInfo.name);
|
||||
}
|
||||
if (type == 1)
|
||||
return resResult(STATUS.SUCCESS, { goods: result });
|
||||
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import { EquipModel } from "../../../db/Equip";
|
||||
import { getPlayerMainAttribute } from "../../../services/pvpService";
|
||||
import { FRIEND } from "../../../pubUtils/dicParam";
|
||||
import { PlayerDetail, PlayerDetailHero } from "../../../domain/battleField/guild";
|
||||
import { createPrivateMsg, pushMsgToRole } from "../../../services/chatService";
|
||||
import { createPrivateMsg, pushMsgToRole, pushPresent } from "../../../services/chatService";
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
@@ -605,9 +605,10 @@ export class FriendHandler {
|
||||
let roleId: string = session.get('roleId');
|
||||
let roleName: string = session.get('roleName');
|
||||
let sid: string = session.get('sid');
|
||||
let serverId: string = session.get('serverId');
|
||||
|
||||
let { roleId: hisRoleId, items } = msg;
|
||||
let myRelation = await FriendRelationModel.findFriendByRole(roleId, POPULATE_TYPE.NOT);
|
||||
let myRelation = await FriendRelationModel.findFriendByRole(roleId, POPULATE_TYPE.FRIEND_NAME_ONLY);
|
||||
let friends = myRelation?myRelation.friends: [];
|
||||
let curFriend = friends.find(cur => cur.roleId == hisRoleId);
|
||||
if(!curFriend) return resResult(STATUS.FRIEND_NOT_FOUND);
|
||||
@@ -636,8 +637,10 @@ export class FriendHandler {
|
||||
// TODO 日志可以转到log服
|
||||
await FriendPresentLogModel.createRecord(roleId, hisRoleId, items);
|
||||
for(let {id, count} of items ) {
|
||||
const msgData = await createPrivateMsg(roleId, roleName, MSG_TYPE.RICH_TEXT, MSG_SOURCE.ROLE_SEND_TEXT, JSON.stringify({ id, count }), hisRoleId, null);
|
||||
const msgData = await createPrivateMsg(roleId, roleName, MSG_TYPE.RICH_TEXT, MSG_SOURCE.PRIVATE_SEND_GIFT, JSON.stringify({ id, count }), hisRoleId, null);
|
||||
await pushMsgToRole(msgData);
|
||||
let hisRole = <RoleType>curFriend.role;
|
||||
await pushPresent(roleId, roleName, serverId, hisRole.roleName, id);
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
|
||||
Reference in New Issue
Block a user