private void sendSummonFall( Collection<RoleInstance> sameMapMembers, List<GoodsOperateBean> goodsList, String name) { try { if (Util.isEmpty(goodsList)) { return; } String mapStr = Wildcard.getChatGoodsName(goodsList, ChannelType.Map); C1802_ChatRouteRespMessage mapTrsMsg = new C1802_ChatRouteRespMessage(); mapTrsMsg.setChannelType(ChannelType.Map.getType()); mapTrsMsg.setMessage(name + GameContext.getI18n().getText(TextId.FALL_GAIN) + mapStr); mapTrsMsg.setContextList(null); mapTrsMsg.setSendRoleId(-1); mapTrsMsg.setSendRoleName(GameContext.getI18n().getText(TextId.SYSTEM)); for (AbstractRole role : sameMapMembers) { role.getBehavior().sendMessage(mapTrsMsg); } } catch (Exception e) { logger.error("sendSummonFall error", e); } }
private void sendRollInfo( List<AbstractRole> sameMapMembers, int[] points, GoodsBase goodsBase, int num, AbstractRole winner, int maxIndex) { // 构建roll点信息 StringBuffer buffer = new StringBuffer(); buffer.append(((RoleInstance) winner).getRoleName()); buffer.append( GameContext.getI18n().messageFormat(TextId.FALL_ROLL_POINT_GAIN, points[maxIndex])); buffer.append(Wildcard.getChatGoodsContent(goodsBase, ChannelType.System, num)); // buffer.append("[").append(goodsBase.getName()).append("]"); int index = -1; for (AbstractRole role : sameMapMembers) { index++; if (role.getRoleId().equals(winner.getRoleId())) { continue; } buffer.append(","); buffer.append(((RoleInstance) role).getRoleName()); buffer.append(" "); buffer.append(points[index]); buffer.append(GameContext.getI18n().getText(TextId.FALL_ROLL_POINT)); } C1802_ChatRouteRespMessage trsMsg = new C1802_ChatRouteRespMessage(); trsMsg.setChannelType(ChannelType.System.getType()); trsMsg.setMessage(buffer.toString()); trsMsg.setContextList(null); trsMsg.setSendRoleId(-1); trsMsg.setSendRoleName(GameContext.getI18n().getText(TextId.SYSTEM)); for (AbstractRole role : sameMapMembers) { role.getBehavior().sendMessage(trsMsg); } }