New patch.
Hopefully final.
Index: java/org/l2jmobius/gameserver/LoginServerThread.java
===================================================================
--- java/org/l2jmobius/gameserver/LoginServerThread.java (revision 8553)
+++ java/org/l2jmobius/gameserver/LoginServerThread.java (working copy)
@@ -262,8 +262,7 @@
{
playerList.add(player.getAccountName());
}
- final PlayerInGame pig = new PlayerInGame(playerList);
- sendPacket(pig);
+ sendPacket(new PlayerInGame(playerList));
}
break;
}
@@ -464,9 +463,10 @@
public void doKickPlayer(String account)
{
- if (_accountsInGameServer.get(account) != null)
+ final GameClient client = _accountsInGameServer.get(account);
+ if (client != null)
{
- _accountsInGameServer.get(account).closeNow();
+ client.close(true);
getInstance().sendLogout(account);
}
}
Index: java/org/l2jmobius/gameserver/data/OfflineTradeTable.java
===================================================================
--- java/org/l2jmobius/gameserver/data/OfflineTradeTable.java (revision 8553)
+++ java/org/l2jmobius/gameserver/data/OfflineTradeTable.java (working copy)
@@ -32,7 +32,6 @@
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.network.ConnectionState;
import org.l2jmobius.gameserver.network.GameClient;
/**
@@ -202,10 +201,10 @@
try
{
final GameClient client = new GameClient();
+ client.setDetached(true);
player = PlayerInstance.load(rs.getInt("charId"));
client.setPlayer(player);
client.setAccountName(player.getAccountName());
- client.setConnectionState(ConnectionState.IN_GAME);
player.setClient(client);
player.setOfflineMode(true);
player.setOnlineStatus(false);
Index: java/org/l2jmobius/gameserver/model/TradeList.java
===================================================================
--- java/org/l2jmobius/gameserver/model/TradeList.java (revision 8585)
+++ java/org/l2jmobius/gameserver/model/TradeList.java (working copy)
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;
import org.l2jmobius.Config;
@@ -157,7 +158,7 @@
public TradeList(PlayerInstance owner)
{
- _items = new ArrayList<>();
+ _items = new CopyOnWriteArrayList<>();
_owner = owner;
}
Index: java/org/l2jmobius/gameserver/model/World.java
===================================================================
--- java/org/l2jmobius/gameserver/model/World.java (revision 8553)
+++ java/org/l2jmobius/gameserver/model/World.java (working copy)
@@ -315,7 +315,7 @@
if (!player.isTeleporting() && (tmp != null))
{
- LOGGER.warning("Teleporting: Duplicate character!? Closing both characters (" + player.getName() + ")");
+ // LOGGER.warning("Teleporting: Duplicate character!? Closing both characters (" + player.getName() + ")");
player.closeNetConnection();
tmp.closeNetConnection();
return;
Index: java/org/l2jmobius/gameserver/network/GameClient.java
===================================================================
--- java/org/l2jmobius/gameserver/network/GameClient.java (revision 8585)
+++ java/org/l2jmobius/gameserver/network/GameClient.java (working copy)
@@ -634,8 +634,18 @@
player.decreaseBoxes();
}
+ player.setClient(null);
+
+ if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) //
+ || (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE))
+ {
+ if (!Config.OFFLINE_MODE_IN_PEACE_ZONE || (Config.OFFLINE_MODE_IN_PEACE_ZONE && player.isInsideZone(ZoneId.PEACE)))
+ {
+ return;
+ }
+ }
+
// prevent closing again
- player.setClient(null);
player.deleteMe();
player.store(true);
}
@@ -721,7 +731,7 @@
if (Config.OFFLINE_MODE_SET_INVULNERABLE)
{
- _player.setInvul(true);
+ player.setInvul(true);
}
if (Config.OFFLINE_SET_NAME_COLOR)
{
@@ -784,15 +794,6 @@
return false;
}
- /**
- * Returns false if client can receive packets. True if detached or queue overflow detected and queue still not empty.
- * @return
- */
- public boolean dropPacket()
- {
- return _isDetached;
- }
-
public void setProtocolVersion(int version)
{
_protocolVersion = version;
Index: java/org/l2jmobius/gameserver/network/clientpackets/SetPrivateStoreListSell.java
===================================================================
--- java/org/l2jmobius/gameserver/network/clientpackets/SetPrivateStoreListSell.java (revision 8553)
+++ java/org/l2jmobius/gameserver/network/clientpackets/SetPrivateStoreListSell.java (working copy)
@@ -62,7 +62,7 @@
_items[(x * 3) + 2] = price;
}
- return false;
+ return true;
}
@Override