Moved again previous commit variables in World.

This commit is contained in:
MobiusDevelopment
2020-04-01 11:56:04 +00:00
parent f2a7531d24
commit 362fc6d6cb
129 changed files with 256 additions and 295 deletions

View File

@@ -162,9 +162,6 @@ public class GameServer
{
private static final Logger LOGGER = Logger.getLogger(GameServer.class.getName());
public static volatile int MAX_CONNECTED_COUNT = 0;
public static volatile int OFFLINE_TRADE_COUNT = 0;
private final DeadLockDetector _deadDetectThread;
private static GameServer INSTANCE;
public static final Calendar dateTimeServerStarted = Calendar.getInstance();

View File

@@ -26,7 +26,6 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem;
@@ -306,7 +305,7 @@ public class OfflineTraderTable
}
}
GameServer.OFFLINE_TRADE_COUNT = nTraders;
World.OFFLINE_TRADE_COUNT = nTraders;
LOGGER.info(getClass().getSimpleName() + ": Loaded " + nTraders + " offline traders.");
if (!Config.STORE_OFFLINE_TRADE_IN_REALTIME)
@@ -447,7 +446,7 @@ public class OfflineTraderTable
public static synchronized void removeTrader(int traderObjId)
{
GameServer.OFFLINE_TRADE_COUNT--;
World.OFFLINE_TRADE_COUNT--;
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);

View File

@@ -45,6 +45,10 @@ import org.l2jmobius.gameserver.network.serverpackets.DeleteObject;
public class World
{
private static final Logger LOGGER = Logger.getLogger(World.class.getName());
public static volatile int MAX_CONNECTED_COUNT = 0;
public static volatile int OFFLINE_TRADE_COUNT = 0;
/** Gracia border Flying objects not allowed to the east of it. */
public static final int GRACIA_MAX_X = -166168;
public static final int GRACIA_MAX_Z = 6105;

View File

@@ -47,7 +47,6 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
@@ -5674,7 +5673,7 @@ public class PlayerInstance extends Playable
if (Config.OFFLINE_DISCONNECT_FINISHED && (privateStoreType == PrivateStoreType.NONE) && ((_client == null) || _client.isDetached()))
{
Disconnection.of(this).storeMe().deleteMe();
GameServer.OFFLINE_TRADE_COUNT--;
World.OFFLINE_TRADE_COUNT--;
}
}

View File

@@ -122,13 +122,13 @@ public class SystemPanel extends JPanel
public void run()
{
final int playerCount = World.getInstance().getPlayers().size();
if (GameServer.MAX_CONNECTED_COUNT < playerCount)
if (World.MAX_CONNECTED_COUNT < playerCount)
{
GameServer.MAX_CONNECTED_COUNT = playerCount;
World.MAX_CONNECTED_COUNT = playerCount;
}
lblConnected.setText("Connected: " + playerCount);
lblMaxConnected.setText("Max connected: " + GameServer.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + GameServer.OFFLINE_TRADE_COUNT);
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
}
}, 1000, 1000);

View File

@@ -19,8 +19,8 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.GameServer;
import org.l2jmobius.gameserver.data.sql.impl.OfflineTraderTable;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
@@ -100,7 +100,7 @@ public class OfflineTradeUtil
return false;
}
GameServer.OFFLINE_TRADE_COUNT++;
World.OFFLINE_TRADE_COUNT++;
final GameClient client = player.getClient();
client.close(true);