Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- diff --git config/players.properties
- +++ config/players.properties
- @@ -255,7 +255,46 @@
- #=============================================================
- # Maximum number of buffs. Remember that Divine Inspiration will give 4 additional buff slots on top of the number specified. Default: 20
- MaxBuffsAmount = 20
- # Store buffs/debuffs on user logout. Default: True
- StoreSkillCooltime = True
- +# =================================================================
- +# Offline trade/craft
- +# =================================================================
- +
- +# Option to enable or disable offline trade feature.
- +# Enable -> true, Disable -> false
- +OfflineTradeEnable = True
- +
- +# Option to enable or disable offline craft feature.
- +# Enable -> true, Disable -> false
- +OfflineCraftEnable = True
- +
- +# If set to True, off-line shops will be possible only in peace zones.
- +# Default: False
- +OfflineModeInPeaceZone = True
- +
- +# If set to True, players in off-line shop mode will not take any damage, thus they cannot be killed.
- +# Default: False
- +OfflineModeNoDamage = False
- +
- +# Restore offline traders/crafters after restart/shutdown.
- +# Default: False
- +RestoreOffliners = True
- +
- +# Do not restore offline characters, after OfflineMaxDays days spent from first restore.
- +# Require server restart to disconnect expired shops.
- +# 0 = disabled (always restore).
- +# Default: 7
- +OfflineMaxDays = 7
- +
- +# Disconnect shop after finished selling, buying.
- +# Default: True
- +OfflineDisconnectFinished = True
- +
- +#Offline Effect Sleep
- +OfflineSetSleepEffect = True
- +
- +
- diff --git java/net/sf/l2j/Config.java
- +++ java/net/sf/l2j/Config.java
- @@ -341,12 +341,23 @@
- public static int MAX_PVTSTORE_SLOTS_DWARF;
- public static int MAX_PVTSTORE_SLOTS_OTHER;
- public static boolean DEEPBLUE_DROP_RULES;
- public static boolean ALLOW_DELEVEL;
- public static int DEATH_PENALTY_CHANCE;
- + /** Offline Shop */
- + public static boolean OFFLINE_TRADE_ENABLE;
- + public static boolean OFFLINE_CRAFT_ENABLE;
- + public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
- + public static boolean OFFLINE_MODE_NO_DAMAGE;
- + public static boolean RESTORE_OFFLINERS;
- + public static int OFFLINE_MAX_DAYS;
- + public static boolean OFFLINE_DISCONNECT_FINISHED;
- + public static boolean OFFLINE_SET_SLEEP;
- +
- /** Inventory & WH */
- public static int INVENTORY_MAXIMUM_NO_DWARF;
- public static int INVENTORY_MAXIMUM_DWARF;
- public static int INVENTORY_MAXIMUM_PET;
- public static int MAX_ITEM_IN_PACKET;
- public static double WEIGHT_LIMIT;
- @@ -970,12 +981,21 @@
- MAX_PVTSTORE_SLOTS_DWARF = players.getProperty("MaxPvtStoreSlotsDwarf", 5);
- MAX_PVTSTORE_SLOTS_OTHER = players.getProperty("MaxPvtStoreSlotsOther", 4);
- DEEPBLUE_DROP_RULES = players.getProperty("UseDeepBlueDropRules", true);
- ALLOW_DELEVEL = players.getProperty("AllowDelevel", true);
- DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);
- + OFFLINE_TRADE_ENABLE = players.getProperty("OfflineTradeEnable", false);
- + OFFLINE_CRAFT_ENABLE = players.getProperty("OfflineCraftEnable", false);
- + OFFLINE_MODE_IN_PEACE_ZONE = players.getProperty("OfflineModeInPeaceZone", false);
- + OFFLINE_MODE_NO_DAMAGE = players.getProperty("OfflineModeNoDamage", false);
- + OFFLINE_SET_SLEEP = players.getProperty("OfflineSetSleepEffect", false);
- + RESTORE_OFFLINERS = players.getProperty("RestoreOffliners", false);
- + OFFLINE_MAX_DAYS = players.getProperty("OfflineMaxDays", 10);
- + OFFLINE_DISCONNECT_FINISHED = players.getProperty("OfflineDisconnectFinished", true);
- INVENTORY_MAXIMUM_NO_DWARF = players.getProperty("MaximumSlotsForNoDwarf", 80);
- INVENTORY_MAXIMUM_DWARF = players.getProperty("MaximumSlotsForDwarf", 100);
- INVENTORY_MAXIMUM_PET = players.getProperty("MaximumSlotsForPet", 12);
- MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, INVENTORY_MAXIMUM_DWARF);
- WEIGHT_LIMIT = players.getProperty("WeightLimit", 1.);
- WAREHOUSE_SLOTS_NO_DWARF = players.getProperty("MaximumWarehouseSlotsForNoDwarf", 100);
- diff --git java/net/sf/l2j/gameserver/GameServer.java
- +++ java/net/sf/l2j/gameserver/GameServer.java
- @@ -70,12 +70,13 @@
- import net.sf.l2j.gameserver.data.xml.SoulCrystalData;
- import net.sf.l2j.gameserver.data.xml.SpellbookData;
- import net.sf.l2j.gameserver.data.xml.StaticObjectData;
- import net.sf.l2j.gameserver.data.xml.SummonItemData;
- import net.sf.l2j.gameserver.data.xml.TeleportData;
- import net.sf.l2j.gameserver.data.xml.WalkerRouteData;
- +import net.sf.l2j.gameserver.enums.actors.OfflineStoresData;
- import net.sf.l2j.gameserver.geoengine.GeoEngine;
- import net.sf.l2j.gameserver.handler.AdminCommandHandler;
- import net.sf.l2j.gameserver.handler.ChatHandler;
- import net.sf.l2j.gameserver.handler.ItemHandler;
- import net.sf.l2j.gameserver.handler.SkillHandler;
- import net.sf.l2j.gameserver.handler.TargetHandler;
- @@ -235,12 +236,23 @@
- TeleportData.getInstance();
- StringUtil.printSection("Olympiads & Heroes");
- OlympiadGameManager.getInstance();
- Olympiad.getInstance();
- HeroManager.getInstance();
- + StringUtil.printSection("OfflineShop Started");
- + if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- + {
- + OfflineStoresData.getInstance().restoreOfflineTraders();
- + }
- + else
- + {
- + LOGGER.info("Offline Shop is disabled.");
- + }
- StringUtil.printSection("Four Sepulchers");
- FourSepulchersManager.getInstance();
- StringUtil.printSection("Quests & Scripts");
- ScriptData.getInstance();
- diff --git java/net/sf/l2j/gameserver/LoginServerThread.java
- +++ java/net/sf/l2j/gameserver/LoginServerThread.java
- @@ -292,12 +292,14 @@
- }
- }
- public void addClient(String account, GameClient client)
- {
- final GameClient existingClient = _clients.putIfAbsent(account, client);
- + if (client.isDetached())
- + return;
- if (existingClient == null)
- {
- try
- {
- sendPacket(new PlayerAuthRequest(client.getAccountName(), client.getSessionId()));
- }
- diff --git java/net/sf/l2j/gameserver/Shutdown.java
- +++ java/net/sf/l2j/gameserver/Shutdown.java
- @@ -15,12 +15,13 @@
- import net.sf.l2j.gameserver.data.manager.GrandBossManager;
- import net.sf.l2j.gameserver.data.manager.HeroManager;
- import net.sf.l2j.gameserver.data.manager.PetitionManager;
- import net.sf.l2j.gameserver.data.manager.RaidBossManager;
- import net.sf.l2j.gameserver.data.manager.SevenSignsManager;
- import net.sf.l2j.gameserver.data.manager.ZoneManager;
- +import net.sf.l2j.gameserver.enums.actors.OfflineStoresData;
- import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.Player;
- import net.sf.l2j.gameserver.model.olympiad.Olympiad;
- import net.sf.l2j.gameserver.network.GameClient;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- import net.sf.l2j.gameserver.network.gameserverpackets.ServerStatus;
- @@ -74,13 +75,24 @@
- @Override
- public void run()
- {
- if (this == SingletonHolder.INSTANCE)
- {
- StringUtil.printSection("Under " + MODE_TEXT[_shutdownMode] + " process");
- + try
- + {
- + if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- + {
- + OfflineStoresData.getInstance().storeOffliners();
- + LOGGER.info("Offline Traders Table: Offline shops stored.");
- + }
- + }
- + catch (Throwable t)
- + {
- +
- + }
- // disconnect players
- try
- {
- disconnectAllPlayers();
- LOGGER.info("All players have been disconnected.");
- }
- diff --git java/net/sf/l2j/gameserver/enums/actors/OfflineStoresData.java
- +++ java/net/sf/l2j/gameserver/enums/actors/OfflineStoresData.java
- @@ -0,0 +1,274 @@
- +package net.sf.l2j.gameserver.enums.actors;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.sql.Statement;
- +import java.util.Calendar;
- +import java.util.logging.Level;
- +import java.util.logging.Logger;
- +
- +import net.sf.l2j.commons.pool.ConnectionPool;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.LoginServerThread;
- +import net.sf.l2j.gameserver.enums.ZoneId;
- +import net.sf.l2j.gameserver.model.World;
- +import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.model.craft.ManufactureItem;
- +import net.sf.l2j.gameserver.model.craft.ManufactureList;
- +import net.sf.l2j.gameserver.model.trade.TradeItem;
- +import net.sf.l2j.gameserver.network.GameClient;
- +import net.sf.l2j.gameserver.network.GameClient.GameClientState;
- +
- +public class OfflineStoresData
- +{
- + private static final Logger LOGGER = Logger.getLogger(OfflineStoresData.class.getName());
- +
- + // SQL DEFINITIONS
- + private static final String SAVE_OFFLINE_STATUS = "INSERT INTO character_offline_trade (`charId`,`time`,`type`,`title`) VALUES (?,?,?,?)";
- + private static final String SAVE_ITEMS = "INSERT INTO character_offline_trade_items (`charId`,`item`,`count`,`price`,`enchant`) VALUES (?,?,?,?,?)";
- + private static final String CLEAR_OFFLINE_TABLE = "DELETE FROM character_offline_trade";
- + private static final String CLEAR_OFFLINE_TABLE_ITEMS = "DELETE FROM character_offline_trade_items";
- + private static final String LOAD_OFFLINE_STATUS = "SELECT * FROM character_offline_trade";
- + private static final String LOAD_OFFLINE_ITEMS = "SELECT * FROM character_offline_trade_items WHERE charId = ?";
- +
- + public void storeOffliners()
- + {
- + try (Connection con = ConnectionPool.getConnection(); PreparedStatement save_offline_status = con.prepareStatement(SAVE_OFFLINE_STATUS); PreparedStatement save_items = con.prepareStatement(SAVE_ITEMS))
- + {
- + try (Statement stm = con.createStatement())
- + {
- + stm.execute(CLEAR_OFFLINE_TABLE);
- + stm.execute(CLEAR_OFFLINE_TABLE_ITEMS);
- + }
- + for (Player pc : World.getInstance().getPlayers())
- + {
- + try
- + {
- + if (pc.getOperateType() != OperateType.NONE && (pc.getClient() == null || pc.getClient().isDetached()))
- + {
- + save_offline_status.setInt(1, pc.getObjectId());
- + save_offline_status.setLong(2, pc.getOfflineStartTime());
- + save_offline_status.setInt(3, pc.getOperateType().getId());
- + switch (pc.getOperateType())
- + {
- + case BUY:
- + if (!Config.OFFLINE_TRADE_ENABLE)
- + continue;
- +
- + save_offline_status.setString(4, pc.getBuyList().getTitle());
- + for (TradeItem i : pc.getBuyList())
- + {
- + save_items.setInt(1, pc.getObjectId());
- + save_items.setInt(2, i.getItem().getItemId());
- + save_items.setLong(3, i.getCount());
- + save_items.setLong(4, i.getPrice());
- + save_items.setLong(5, i.getEnchant());
- + save_items.addBatch();
- + }
- + break;
- + case SELL:
- + case PACKAGE_SELL:
- + if (!Config.OFFLINE_TRADE_ENABLE)
- + continue;
- +
- + save_offline_status.setString(4, pc.getSellList().getTitle());
- + pc.getSellList().updateItems();
- + for (TradeItem i : pc.getSellList())
- + {
- + save_items.setInt(1, pc.getObjectId());
- + save_items.setInt(2, i.getObjectId());
- + save_items.setLong(3, i.getCount());
- + save_items.setLong(4, i.getPrice());
- + save_items.setLong(5, i.getEnchant());
- + save_items.addBatch();
- + }
- + break;
- + case MANUFACTURE:
- + if (!Config.OFFLINE_CRAFT_ENABLE)
- + continue;
- +
- + save_offline_status.setString(4, pc.getManufactureList().getStoreName());
- + for (final ManufactureItem i : pc.getManufactureList())
- + {
- + save_items.setInt(1, pc.getObjectId());
- + save_items.setInt(2, i.getId());
- + save_items.setLong(3, 0L);
- + save_items.setLong(4, i.getValue());
- + save_items.setLong(5, 0L);
- + save_items.addBatch();
- + }
- + break;
- + }
- + save_items.executeBatch();
- + save_offline_status.execute();
- + }
- + }
- + catch (Exception e)
- + {
- + LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error while saving offline trader: " + pc.getObjectId() + " " + e, e);
- + }
- + }
- +
- + LOGGER.info(getClass().getSimpleName() + ": Offline traders stored.");
- + }
- + catch (Exception e)
- + {
- + LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error while saving offline traders: " + e, e);
- + }
- + }
- +
- + public void restoreOfflineTraders()
- + {
- + LOGGER.info(getClass().getSimpleName() + ": Loading offline traders...");
- + try (Connection con = ConnectionPool.getConnection(); Statement stm = con.createStatement(); ResultSet rs = stm.executeQuery(LOAD_OFFLINE_STATUS))
- + {
- + int nTraders = 0;
- + while (rs.next())
- + {
- + final long time = rs.getLong("time");
- + if (Config.OFFLINE_MAX_DAYS > 0)
- + {
- + final Calendar cal = Calendar.getInstance();
- + cal.setTimeInMillis(time);
- + cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
- + if (cal.getTimeInMillis() <= System.currentTimeMillis())
- + continue;
- + }
- +
- + OperateType type = null;
- + for (OperateType t : OperateType.values())
- + {
- + if (t.getId() == rs.getInt("type"))
- + {
- + type = t;
- + break;
- + }
- + }
- + if (type == null)
- + {
- + LOGGER.warning(getClass().getSimpleName() + ": PrivateStoreType with id " + rs.getInt("type") + " could not be found.");
- + continue;
- + }
- + if (type == OperateType.NONE)
- + continue;
- +
- + final Player player = Player.restore(rs.getInt("charId"));
- + if (player == null)
- + continue;
- +
- + try (PreparedStatement stm_items = con.prepareStatement(LOAD_OFFLINE_ITEMS))
- + {
- + player.isRunning();
- + player.sitDown();
- + player.setOnlineStatus(true, false);
- +
- + World.getInstance().addPlayer(player);
- +
- + final GameClient client = new GameClient(null);
- + client.setDetached(true);
- + player.setClient(client);
- + client.setPlayer(player);
- + client.setAccountName(player.getAccountNamePlayer());
- + player.setOnlineStatus(true, true);
- + client.setState(GameClientState.IN_GAME);
- + player.setOfflineStartTime(time);
- + player.spawnMe();
- +
- + LoginServerThread.getInstance().addClient(player.getAccountName(), client);
- +
- + stm_items.setInt(1, player.getObjectId());
- + try (ResultSet items = stm_items.executeQuery())
- + {
- + switch (type)
- + {
- + case BUY:
- + while (items.next())
- + {
- + player.getBuyList().addItemByItemId(items.getInt(2), items.getInt(3), items.getInt(4), items.getInt(5));
- + }
- +
- + player.getBuyList().setTitle(rs.getString("title"));
- + break;
- + case SELL:
- + case PACKAGE_SELL:
- + while (items.next())
- + if (player.getSellList().addItem(items.getInt(2), items.getInt(3), items.getInt(4)) == null)
- + throw new NullPointerException("NPE at SELL of offlineShop " + player.getObjectId() + " " + items.getInt(2) + " " + items.getInt(3) + " " + items.getInt(4));
- +
- + player.getSellList().setTitle(rs.getString("title"));
- + player.getSellList().setPackaged(type == OperateType.PACKAGE_SELL);
- + break;
- + case MANUFACTURE:
- + while (items.next())
- + player.getManufactureList().add(new ManufactureItem(items.getInt(2), items.getInt(4)));
- + player.getManufactureList().setStoreName(rs.getString("title"));
- + break;
- + }
- + }
- +
- + if (Config.OFFLINE_SET_SLEEP)
- + player.startAbnormalEffect(0x000080);
- +
- + player.setOperateType(type);
- + player.restoreEffects();
- + player.broadcastUserInfo();
- +
- + nTraders++;
- + }
- + catch (Exception e)
- + {
- + LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error loading trader: " + player, e);
- +
- + player.deleteMe();
- + }
- + }
- +
- + LOGGER.info(getClass().getSimpleName() + ": Loaded: " + nTraders + " offline trader(s)");
- +
- + try (Statement stm1 = con.createStatement())
- + {
- + stm1.execute(CLEAR_OFFLINE_TABLE);
- + stm1.execute(CLEAR_OFFLINE_TABLE_ITEMS);
- + }
- + }
- + catch (Exception e)
- + {
- + LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error while loading offline traders: ", e);
- + }
- + }
- +
- + public static boolean offlineMode(Player player)
- + {
- + if (player.isInOlympiadMode() || player.isFestivalParticipant() || player.isInJail() || player.getBoat() != null)
- + return false;
- +
- + boolean canSetShop = false;
- + switch (player.getOperateType())
- + {
- + case SELL:
- + case PACKAGE_SELL:
- + case BUY:
- + canSetShop = Config.OFFLINE_TRADE_ENABLE;
- + break;
- + case MANUFACTURE:
- + canSetShop = Config.OFFLINE_CRAFT_ENABLE;
- + break;
- + }
- + if (Config.OFFLINE_MODE_IN_PEACE_ZONE && !player.isInsideZone(ZoneId.PEACE))
- + canSetShop = false;
- +
- + return canSetShop;
- + }
- +
- + public static OfflineStoresData getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final OfflineStoresData _instance = new OfflineStoresData();
- + }
- +}
- \ No newline at end of file
- diff --git java/net/sf/l2j/gameserver/enums/actors/OperateType.java
- +++ java/net/sf/l2j/gameserver/enums/actors/OperateType.java
- @@ -15,12 +15,20 @@
- private int _id;
- private OperateType(int id)
- {
- _id = id;
- }
- + public static OperateType findById(int id)
- + {
- + for (OperateType privateStoreType : values())
- + {
- + if (privateStoreType.getId() == id)
- + return privateStoreType;
- + }
- + return null;
- + }
- public int getId()
- {
- return _id;
- }
- }
- \ No newline at end of file
- diff --git java/net/sf/l2j/gameserver/model/actor/Player.java
- +++ java/net/sf/l2j/gameserver/model/actor/Player.java
- @@ -2240,15 +2240,20 @@
- {
- _client = client;
- }
- public String getAccountName()
- {
- + if (getClient() == null)
- + return getAccountNamePlayer();
- return _accountName;
- }
- + public String getAccountNamePlayer()
- + {
- + return _accountName;
- + }
- public Map<Integer, String> getAccountChars()
- {
- return _chars;
- }
- /**
- @@ -3275,14 +3280,26 @@
- * Set the {@link OperateType} of this {@link Player}.
- * @param type : The new {@link OperateType} state to set.
- */
- public void setOperateType(OperateType type)
- {
- _operateType = type;
- + if (Config.OFFLINE_DISCONNECT_FINISHED && type == OperateType.NONE && (getClient() == null || getClient().isDetached()))
- + deleteMe();
- }
- + private long _offlineShopStart;
- + public long getOfflineStartTime()
- + {
- + return _offlineShopStart;
- + }
- + public void setOfflineStartTime(long time)
- + {
- + _offlineShopStart = time;
- + }
- +
- /**
- * @return True if this {@link Player} is set on any store mode, or false otherwise.
- */
- public boolean isInStoreMode()
- {
- return _operateType == OperateType.BUY || _operateType == OperateType.SELL || _operateType == OperateType.PACKAGE_SELL || _operateType == OperateType.MANUFACTURE;
- diff --git java/net/sf/l2j/gameserver/network/GameClient.java
- +++ java/net/sf/l2j/gameserver/network/GameClient.java
- @@ -19,15 +19,18 @@
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.LoginServerThread;
- import net.sf.l2j.gameserver.data.sql.ClanTable;
- import net.sf.l2j.gameserver.data.sql.PlayerInfoTable;
- import net.sf.l2j.gameserver.enums.FloodProtector;
- +import net.sf.l2j.gameserver.enums.MessageType;
- +import net.sf.l2j.gameserver.enums.ZoneId;
- import net.sf.l2j.gameserver.model.CharSelectSlot;
- import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.model.olympiad.OlympiadManager;
- import net.sf.l2j.gameserver.model.pledge.Clan;
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
- import net.sf.l2j.gameserver.network.serverpackets.ServerClose;
- /**
- @@ -206,22 +209,82 @@
- ThreadPool.execute(() ->
- {
- boolean fast = true;
- if (getPlayer() != null && !isDetached())
- {
- setDetached(true);
- + if (offlineMode(getPlayer()))
- + {
- + if (getPlayer().getParty() != null)
- + getPlayer().getParty().removePartyMember(getPlayer(), MessageType.EXPELLED);
- + OlympiadManager.getInstance().unRegisterNoble(getPlayer());
- +
- + // If the Character has Pet, unsummon it
- + if (getPlayer().hasPet())
- + {
- + getPlayer().getSummon().unSummon(getPlayer());
- + // Dead pet wasn't unsummoned, broadcast npcinfo changes (pet will be without owner name - means owner offline)
- + if (getPlayer().getSummon() != null)
- + getPlayer().getSummon().updateAndBroadcastStatus(0);
- + }
- +
- + if (Config.OFFLINE_SET_SLEEP)
- + getPlayer().startAbnormalEffect(0x000080);
- +
- + if (getPlayer().getOfflineStartTime() == 0)
- + getPlayer().setOfflineStartTime(System.currentTimeMillis());
- +
- + return;
- + }
- fast = !getPlayer().isInCombat() && !getPlayer().isLocked();
- }
- cleanMe(fast);
- });
- }
- catch (RejectedExecutionException e)
- {
- }
- }
- + /**
- + * @param player
- + * @return
- + */
- + public static boolean offlineMode(Player player)
- + {
- + if (player.isInOlympiadMode() || player.isFestivalParticipant() || player.isInJail() || player.getBoat() != null)
- + return false;
- +
- + boolean canSetShop = false;
- + switch (player.getOperateType())
- + {
- + case SELL:
- + case PACKAGE_SELL:
- + case BUY:
- + {
- + canSetShop = Config.OFFLINE_TRADE_ENABLE;
- + break;
- + }
- + case MANUFACTURE:
- + {
- + canSetShop = Config.OFFLINE_TRADE_ENABLE;
- + break;
- + }
- + default:
- + {
- + canSetShop = Config.OFFLINE_CRAFT_ENABLE && player.isCrafting();
- + break;
- + }
- + }
- +
- + if (Config.OFFLINE_MODE_IN_PEACE_ZONE && !player.isInsideZone(ZoneId.PEACE))
- + canSetShop = false;
- +
- + return canSetShop;
- + }
- +
- @Override
- protected void onForcedDisconnection()
- {
- LOGGER.debug("{} disconnected abnormally.", toString());
- }
- @@ -578,12 +641,14 @@
- {
- _slots = list;
- }
- public void close(L2GameServerPacket gsp)
- {
- + if (getConnection() == null)
- + return;
- getConnection().close(gsp);
- }
- /**
- * @param slot : The slot to test.
- * @return the objectId of the character associated to that slot, or -1 if not found.
Add Comment
Please, Sign In to add comment