HiredMerchantRequest.java
资源名称:src.rar [点击查看]
上传用户:gwt600
上传日期:2021-06-03
资源大小:704k
文件大小:1k
源码类别:
游戏
开发平台:
Java
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package net.sf.odinms.net.channel.handler;
- import java.util.Arrays;
- import net.sf.odinms.client.MapleClient;
- import net.sf.odinms.net.AbstractMaplePacketHandler;
- import net.sf.odinms.server.maps.MapleMapObjectType;
- import net.sf.odinms.tools.MaplePacketCreator;
- import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
- /**
- *
- * @author XoticStory
- */
- public class HiredMerchantRequest extends AbstractMaplePacketHandler {
- @Override
- public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
- if (!c.isGuest()) {
- if (c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), 23000, Arrays.asList(MapleMapObjectType.HIRED_MERCHANT, MapleMapObjectType.SHOP)).size() == 0) {
- if (!c.getPlayer().hasMerchant()) {
- c.getSession().write(MaplePacketCreator.hiredMerchantBox());
- } else {
- c.getPlayer().dropMessage(1, "You already have a store open, please go close that store first");
- }
- } else {
- c.getPlayer().dropMessage(1, "You may not establish a store here.");
- }
- } else {
- c.getPlayer().dropMessage(1, "Guest users are not allowed to open hired merchants.");
- }
- }
- }