Graphical user interface.
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver;
|
||||
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Toolkit;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -149,6 +150,7 @@ import com.l2jmobius.gameserver.network.loginserver.LoginServerNetworkManager;
|
||||
import com.l2jmobius.gameserver.network.telnet.TelnetServer;
|
||||
import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
|
||||
import com.l2jmobius.gameserver.taskmanager.TaskManager;
|
||||
import com.l2jmobius.gameserver.ui.Gui;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
public class GameServer
|
||||
@ -172,6 +174,28 @@ public class GameServer
|
||||
public GameServer() throws Exception
|
||||
{
|
||||
final long serverLoadStart = System.currentTimeMillis();
|
||||
Server.serverMode = Server.MODE_GAMESERVER;
|
||||
|
||||
// GUI
|
||||
if (!GraphicsEnvironment.isHeadless())
|
||||
{
|
||||
new Gui();
|
||||
}
|
||||
|
||||
// Create log folder
|
||||
final File logFolder = new File(Config.DATAPACK_ROOT, "log");
|
||||
logFolder.mkdir();
|
||||
|
||||
// Create input stream for log file -- or store file data into memory
|
||||
try (InputStream is = new FileInputStream(new File("./log.cfg")))
|
||||
{
|
||||
LogManager.getLogManager().readConfiguration(is);
|
||||
}
|
||||
|
||||
// Initialize config
|
||||
Config.load();
|
||||
printSection("Database");
|
||||
DatabaseFactory.getInstance();
|
||||
|
||||
printSection("ThreadPool");
|
||||
ThreadPool.init();
|
||||
@ -459,24 +483,6 @@ public class GameServer
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server.serverMode = Server.MODE_GAMESERVER;
|
||||
|
||||
/*** Main ***/
|
||||
// Create log folder
|
||||
final File logFolder = new File(Config.DATAPACK_ROOT, "log");
|
||||
logFolder.mkdir();
|
||||
|
||||
// Create input stream for log file -- or store file data into memory
|
||||
try (InputStream is = new FileInputStream(new File("./log.cfg")))
|
||||
{
|
||||
LogManager.getLogManager().readConfiguration(is);
|
||||
}
|
||||
|
||||
// Initialize config
|
||||
Config.load();
|
||||
printSection("Database");
|
||||
DatabaseFactory.getInstance();
|
||||
|
||||
INSTANCE = new GameServer();
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.gameserver.LoginServerThread;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import com.l2jmobius.gameserver.model.L2ManufactureItem;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.TradeItem;
|
||||
@ -298,6 +299,7 @@ public class OfflineTradersTable
|
||||
player.setOnlineStatus(true, true);
|
||||
player.restoreEffects();
|
||||
player.broadcastUserInfo();
|
||||
PlayerCountManager.getInstance().incOfflineTradeCount();
|
||||
nTraders++;
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -451,6 +453,8 @@ public class OfflineTradersTable
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
PlayerCountManager.getInstance().decOfflineTradeCount();
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.instancemanager;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class PlayerCountManager
|
||||
{
|
||||
private volatile static int connectedCount = 0;
|
||||
private volatile static int maxConnectedCount = 0;
|
||||
private volatile static int offlineTradeCount = 0;
|
||||
|
||||
protected PlayerCountManager()
|
||||
{
|
||||
}
|
||||
|
||||
public int getConnectedCount()
|
||||
{
|
||||
return connectedCount;
|
||||
}
|
||||
|
||||
public int getMaxConnectedCount()
|
||||
{
|
||||
return maxConnectedCount;
|
||||
}
|
||||
|
||||
public int getOfflineTradeCount()
|
||||
{
|
||||
return offlineTradeCount;
|
||||
}
|
||||
|
||||
public synchronized void incConnectedCount()
|
||||
{
|
||||
connectedCount++;
|
||||
maxConnectedCount = Math.max(maxConnectedCount, connectedCount);
|
||||
}
|
||||
|
||||
public void decConnectedCount()
|
||||
{
|
||||
connectedCount--;
|
||||
}
|
||||
|
||||
public void incOfflineTradeCount()
|
||||
{
|
||||
offlineTradeCount++;
|
||||
}
|
||||
|
||||
public synchronized void decOfflineTradeCount()
|
||||
{
|
||||
offlineTradeCount = Math.max(0, offlineTradeCount - 1);
|
||||
}
|
||||
|
||||
public static PlayerCountManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final PlayerCountManager INSTANCE = new PlayerCountManager();
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.ai.L2CharacterAI;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@ -135,6 +136,8 @@ public final class L2World
|
||||
|
||||
if (object.isPlayer())
|
||||
{
|
||||
PlayerCountManager.getInstance().incConnectedCount();
|
||||
|
||||
final L2PcInstance newPlayer = (L2PcInstance) object;
|
||||
if (newPlayer.isTeleporting()) // TODO: drop when we stop removing player from the world while teleporting.
|
||||
{
|
||||
@ -170,6 +173,8 @@ public final class L2World
|
||||
_allObjects.remove(object.getObjectId());
|
||||
if (object.isPlayer())
|
||||
{
|
||||
PlayerCountManager.getInstance().decConnectedCount();
|
||||
|
||||
final L2PcInstance player = (L2PcInstance) object;
|
||||
if (player.isTeleporting()) // TODO: drop when we stop removing player from the world while teleportingq.
|
||||
{
|
||||
|
370
L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java
Normal file
370
L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ui/Gui.java
Normal file
@ -0,0 +1,370 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.ui;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.DropMode;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||
import com.l2jmobius.commons.util.SplashScreen;
|
||||
import com.l2jmobius.gameserver.Shutdown;
|
||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class Gui
|
||||
{
|
||||
JFrame frmGameServer;
|
||||
JTextArea txtrConsole;
|
||||
|
||||
final static String[] shutdownOptions =
|
||||
{
|
||||
"Shutdown",
|
||||
"Cancel"
|
||||
};
|
||||
final static String[] restartOptions =
|
||||
{
|
||||
"Restart",
|
||||
"Cancel"
|
||||
};
|
||||
final static String[] abortOptions =
|
||||
{
|
||||
"Abort",
|
||||
"Cancel"
|
||||
};
|
||||
final static String[] confirmOptions =
|
||||
{
|
||||
"Confirm",
|
||||
"Cancel"
|
||||
};
|
||||
|
||||
public Gui()
|
||||
{
|
||||
frmGameServer = new JFrame();
|
||||
frmGameServer.setVisible(false);
|
||||
frmGameServer.setTitle("Mobius - GameServer");
|
||||
frmGameServer.setResizable(false);
|
||||
frmGameServer.setBounds(100, 100, 825, 618);
|
||||
frmGameServer.getContentPane().setLayout(null);
|
||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
frmGameServer.addWindowListener(new WindowAdapter()
|
||||
{
|
||||
@Override
|
||||
public void windowClosing(WindowEvent ev)
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||
{
|
||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JScrollPane scrollPanel = new JScrollPane();
|
||||
scrollPanel.setBounds(10, 11, 799, 544);
|
||||
frmGameServer.getContentPane().add(scrollPanel);
|
||||
|
||||
txtrConsole = new JTextArea();
|
||||
txtrConsole.setWrapStyleWord(true);
|
||||
txtrConsole.setEditable(false);
|
||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
scrollPanel.setViewportView(txtrConsole);
|
||||
txtrConsole.setDropMode(DropMode.INSERT);
|
||||
txtrConsole.setLineWrap(true);
|
||||
txtrConsole.setEditable(false);
|
||||
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||
frmGameServer.setJMenuBar(menuBar);
|
||||
|
||||
JMenu mnActions = new JMenu("Actions");
|
||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
menuBar.add(mnActions);
|
||||
|
||||
JMenuItem mntmShutdown = new JMenuItem("Shutdown");
|
||||
mntmShutdown.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmShutdown.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Shutdown GameServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||
{
|
||||
final Object answer = JOptionPane.showInputDialog(null, "Shutdown delay in seconds", "Input", JOptionPane.INFORMATION_MESSAGE, null, null, "600");
|
||||
if (answer != null)
|
||||
{
|
||||
final String input = ((String) answer).trim();
|
||||
if (Util.isDigit(input))
|
||||
{
|
||||
final int delay = Integer.valueOf(input);
|
||||
if (delay > 0)
|
||||
{
|
||||
Shutdown.getInstance().startShutdown(null, delay, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mnActions.add(mntmShutdown);
|
||||
|
||||
JMenuItem mntmRestart = new JMenuItem("Restart");
|
||||
mntmRestart.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmRestart.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Restart GameServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, restartOptions, restartOptions[1]) == 0)
|
||||
{
|
||||
final Object answer = JOptionPane.showInputDialog(null, "Restart delay in seconds", "Input", JOptionPane.INFORMATION_MESSAGE, null, null, "600");
|
||||
if (answer != null)
|
||||
{
|
||||
final String input = ((String) answer).trim();
|
||||
if (Util.isDigit(input))
|
||||
{
|
||||
final int delay = Integer.valueOf(input);
|
||||
if (delay > 0)
|
||||
{
|
||||
Shutdown.getInstance().startShutdown(null, delay, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mnActions.add(mntmRestart);
|
||||
|
||||
JMenuItem mntmAbort = new JMenuItem("Abort");
|
||||
mntmAbort.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmAbort.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Abort server shutdown?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, abortOptions, abortOptions[1]) == 0)
|
||||
{
|
||||
Shutdown.getInstance().abort(null);
|
||||
}
|
||||
});
|
||||
mnActions.add(mntmAbort);
|
||||
|
||||
JMenu mnReload = new JMenu("Reload");
|
||||
mnReload.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
menuBar.add(mnReload);
|
||||
|
||||
JMenuItem mntmConfigs = new JMenuItem("Configs");
|
||||
mntmConfigs.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmConfigs.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload configs?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
Config.load();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmConfigs);
|
||||
|
||||
JMenuItem mntmAccess = new JMenuItem("Access");
|
||||
mntmAccess.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmAccess.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload admin access levels?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
AdminData.getInstance().load();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmAccess);
|
||||
|
||||
JMenuItem mntmHtml = new JMenuItem("HTML");
|
||||
mntmHtml.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmHtml.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload HTML files?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
HtmCache.getInstance().reload();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmHtml);
|
||||
|
||||
JMenuItem mntmMultisells = new JMenuItem("Multisells");
|
||||
mntmMultisells.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmMultisells.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload multisells?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
MultisellData.getInstance().load();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmMultisells);
|
||||
|
||||
JMenuItem mntmBuylists = new JMenuItem("Buylists");
|
||||
mntmBuylists.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmBuylists.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload buylists?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
BuyListData.getInstance().load();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmBuylists);
|
||||
|
||||
JMenuItem mntmPrimeShop = new JMenuItem("PrimeShop");
|
||||
mntmPrimeShop.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmPrimeShop.addActionListener(arg0 ->
|
||||
{
|
||||
if (JOptionPane.showOptionDialog(null, "Reload PrimeShop?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, confirmOptions, confirmOptions[1]) == 0)
|
||||
{
|
||||
PrimeShopData.getInstance().load();
|
||||
}
|
||||
});
|
||||
mnReload.add(mntmPrimeShop);
|
||||
|
||||
JMenu mnAnnounce = new JMenu("Announce");
|
||||
mnAnnounce.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
menuBar.add(mnAnnounce);
|
||||
|
||||
JMenuItem mntmNormal = new JMenuItem("Normal");
|
||||
mntmNormal.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmNormal.addActionListener(arg0 ->
|
||||
{
|
||||
final Object input = JOptionPane.showInputDialog(null, "Announce message", "Input", JOptionPane.INFORMATION_MESSAGE, null, null, "");
|
||||
if (input != null)
|
||||
{
|
||||
final String message = ((String) input).trim();
|
||||
if (!message.isEmpty())
|
||||
{
|
||||
Broadcast.toAllOnlinePlayers(message, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
mnAnnounce.add(mntmNormal);
|
||||
|
||||
JMenuItem mntmCritical = new JMenuItem("Critical");
|
||||
mntmCritical.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmCritical.addActionListener(arg0 ->
|
||||
{
|
||||
final Object input = JOptionPane.showInputDialog(null, "Critical announce message", "Input", JOptionPane.INFORMATION_MESSAGE, null, null, "");
|
||||
if (input != null)
|
||||
{
|
||||
final String message = ((String) input).trim();
|
||||
if (!message.isEmpty())
|
||||
{
|
||||
Broadcast.toAllOnlinePlayers(message, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
mnAnnounce.add(mntmCritical);
|
||||
|
||||
// Align menu items bar to right after this.
|
||||
// menuBar.add(Box.createHorizontalGlue());
|
||||
|
||||
JMenu mnHelp = new JMenu("Help");
|
||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
menuBar.add(mnHelp);
|
||||
|
||||
JMenuItem mntmAbout = new JMenuItem("About");
|
||||
mntmAbout.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||
mntmAbout.addActionListener(arg0 ->
|
||||
{
|
||||
new frmAbout();
|
||||
});
|
||||
mnHelp.add(mntmAbout);
|
||||
|
||||
// Set icons.
|
||||
List<Image> icons = new ArrayList<>();
|
||||
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
|
||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||
frmGameServer.setIconImages(icons);
|
||||
|
||||
// System Panel.
|
||||
JPanel systemPanel = new SystemPanel();
|
||||
JLayeredPane layeredPanel = new JLayeredPane();
|
||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
||||
layeredPanel.setBounds(0, 0, 819, 566);
|
||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||
|
||||
// Center frame to screen.
|
||||
frmGameServer.setLocationRelativeTo(null);
|
||||
|
||||
// Limit console lines to 500.
|
||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||
|
||||
// Redirect output to text area.
|
||||
redirectSystemStreams();
|
||||
|
||||
// Show SplashScreen.
|
||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
||||
}
|
||||
|
||||
// Set where the text is redirected. In this case, txtrConsole.
|
||||
void updateTextArea(String text)
|
||||
{
|
||||
SwingUtilities.invokeLater(() ->
|
||||
{
|
||||
txtrConsole.append(text);
|
||||
txtrConsole.setCaretPosition(txtrConsole.getText().length());
|
||||
});
|
||||
}
|
||||
|
||||
// Method that manages the redirect.
|
||||
private void redirectSystemStreams()
|
||||
{
|
||||
OutputStream out = new OutputStream()
|
||||
{
|
||||
@Override
|
||||
public void write(int b)
|
||||
{
|
||||
updateTextArea(String.valueOf((char) b));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len)
|
||||
{
|
||||
updateTextArea(new String(b, off, len));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b)
|
||||
{
|
||||
write(b, 0, b.length);
|
||||
}
|
||||
};
|
||||
|
||||
System.setOut(new PrintStream(out, true));
|
||||
System.setErr(new PrintStream(out, true));
|
||||
}
|
||||
}
|
@ -0,0 +1,295 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.Locale;
|
||||
|
||||
final class Locator
|
||||
{
|
||||
/**
|
||||
* Constructor for Locator.
|
||||
*/
|
||||
private Locator()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getClassSource.
|
||||
* @param c Class<?>
|
||||
* @return File
|
||||
*/
|
||||
static File getClassSource(Class<?> c)
|
||||
{
|
||||
String classResource = c.getName().replace('.', '/') + ".class";
|
||||
return getResourceSource(c.getClassLoader(), classResource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getResourceSource.
|
||||
* @param c ClassLoader
|
||||
* @param resource String
|
||||
* @return File
|
||||
*/
|
||||
private static File getResourceSource(ClassLoader c, String resource)
|
||||
{
|
||||
if (c == null)
|
||||
{
|
||||
c = Locator.class.getClassLoader();
|
||||
}
|
||||
|
||||
URL url = null;
|
||||
|
||||
if (c == null)
|
||||
{
|
||||
url = ClassLoader.getSystemResource(resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
url = c.getResource(resource);
|
||||
}
|
||||
|
||||
if (url != null)
|
||||
{
|
||||
String u = url.toString();
|
||||
|
||||
if (u.startsWith("jar:file:"))
|
||||
{
|
||||
int pling = u.indexOf("!");
|
||||
String jarName = u.substring(4, pling);
|
||||
return new File(fromURI(jarName));
|
||||
}
|
||||
else if (u.startsWith("file:"))
|
||||
{
|
||||
int tail = u.indexOf(resource);
|
||||
String dirName = u.substring(0, tail);
|
||||
return new File(fromURI(dirName));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method fromURI.
|
||||
* @param uri String
|
||||
* @return String
|
||||
*/
|
||||
private static String fromURI(String uri)
|
||||
{
|
||||
URL url = null;
|
||||
|
||||
try
|
||||
{
|
||||
url = new URL(uri);
|
||||
}
|
||||
catch (MalformedURLException emYouEarlEx)
|
||||
{
|
||||
// empty catch clause
|
||||
}
|
||||
|
||||
if ((url == null) || !"file".equals(url.getProtocol()))
|
||||
{
|
||||
throw new IllegalArgumentException("Can only handle valid file: URIs");
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder(url.getHost());
|
||||
|
||||
if (buf.length() > 0)
|
||||
{
|
||||
buf.insert(0, File.separatorChar).insert(0, File.separatorChar);
|
||||
}
|
||||
|
||||
String file = url.getFile();
|
||||
int queryPos = file.indexOf('?');
|
||||
buf.append(queryPos < 0 ? file : file.substring(0, queryPos));
|
||||
uri = buf.toString().replace('/', File.separatorChar);
|
||||
|
||||
if ((File.pathSeparatorChar == ';') && uri.startsWith("\\") && (uri.length() > 2) && Character.isLetter(uri.charAt(1)) && (uri.lastIndexOf(':') > -1))
|
||||
{
|
||||
uri = uri.substring(1);
|
||||
}
|
||||
|
||||
String path = decodeUri(uri);
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method decodeUri.
|
||||
* @param uri String
|
||||
* @return String
|
||||
*/
|
||||
private static String decodeUri(String uri)
|
||||
{
|
||||
if (uri.indexOf('%') == -1)
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
CharacterIterator iter = new StringCharacterIterator(uri);
|
||||
|
||||
for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next())
|
||||
{
|
||||
if (c == '%')
|
||||
{
|
||||
char c1 = iter.next();
|
||||
|
||||
if (c1 != CharacterIterator.DONE)
|
||||
{
|
||||
int i1 = Character.digit(c1, 16);
|
||||
char c2 = iter.next();
|
||||
|
||||
if (c2 != CharacterIterator.DONE)
|
||||
{
|
||||
int i2 = Character.digit(c2, 16);
|
||||
sb.append((char) ((i1 << 4) + i2));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
String path = sb.toString();
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getToolsJar.
|
||||
* @return File
|
||||
*/
|
||||
static File getToolsJar()
|
||||
{
|
||||
boolean toolsJarAvailable = false;
|
||||
|
||||
try
|
||||
{
|
||||
Class.forName("com.sun.tools.javac.Main");
|
||||
toolsJarAvailable = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class.forName("sun.tools.javac.Main");
|
||||
toolsJarAvailable = true;
|
||||
}
|
||||
catch (Exception e2)
|
||||
{
|
||||
// empty catch clause
|
||||
}
|
||||
}
|
||||
|
||||
if (toolsJarAvailable)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String javaHome = System.getProperty("java.home");
|
||||
|
||||
if (javaHome.toLowerCase(Locale.US).endsWith("jre"))
|
||||
{
|
||||
javaHome = javaHome.substring(0, javaHome.length() - 4);
|
||||
}
|
||||
|
||||
File toolsJar = new File(javaHome + "/lib/tools.jar");
|
||||
|
||||
if (!toolsJar.exists())
|
||||
{
|
||||
System.out.println("Unable to locate tools.jar. " + "Expected to find it in " + toolsJar.getPath());
|
||||
return null;
|
||||
}
|
||||
|
||||
return toolsJar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLocationURLs.
|
||||
* @param location File
|
||||
* @return URL[] * @throws MalformedURLException
|
||||
* @throws MalformedURLException
|
||||
*/
|
||||
static URL[] getLocationURLs(File location) throws MalformedURLException
|
||||
{
|
||||
return getLocationURLs(location, new String[]
|
||||
{
|
||||
".jar"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLocationURLs.
|
||||
* @param location File
|
||||
* @param extensions String[]
|
||||
* @return URL[] * @throws MalformedURLException
|
||||
* @throws MalformedURLException
|
||||
*/
|
||||
private static URL[] getLocationURLs(File location, final String[] extensions) throws MalformedURLException
|
||||
{
|
||||
URL[] urls = new URL[0];
|
||||
|
||||
if (!location.exists())
|
||||
{
|
||||
return urls;
|
||||
}
|
||||
|
||||
if (!location.isDirectory())
|
||||
{
|
||||
urls = new URL[1];
|
||||
String path = location.getPath();
|
||||
|
||||
for (String extension : extensions)
|
||||
{
|
||||
if (path.toLowerCase().endsWith(extension))
|
||||
{
|
||||
urls[0] = location.toURI().toURL();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return urls;
|
||||
}
|
||||
|
||||
File[] matches = location.listFiles((FilenameFilter) (dir, name) ->
|
||||
{
|
||||
for (String extension : extensions)
|
||||
{
|
||||
if (name.toLowerCase().endsWith(extension))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
urls = new URL[matches.length];
|
||||
|
||||
for (int i = 0; i < matches.length; ++i)
|
||||
{
|
||||
urls[i] = matches[i].toURI().toURL();
|
||||
}
|
||||
|
||||
return urls;
|
||||
}
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.io.File;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.LineBorder;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.GameServer;
|
||||
import com.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class SystemPanel extends JPanel
|
||||
{
|
||||
final static long startTime = System.currentTimeMillis();
|
||||
|
||||
public SystemPanel()
|
||||
{
|
||||
setBackground(Color.WHITE);
|
||||
setBounds(500, 20, 284, 140);
|
||||
setBorder(new LineBorder(new Color(0, 0, 0), 1, false));
|
||||
setOpaque(true);
|
||||
setLayout(null);
|
||||
|
||||
JLabel lblProtocol = new JLabel("Protocol");
|
||||
lblProtocol.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblProtocol.setBounds(10, 5, 264, 17);
|
||||
add(lblProtocol);
|
||||
|
||||
JLabel lblConnected = new JLabel("Connected");
|
||||
lblConnected.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblConnected.setBounds(10, 23, 264, 17);
|
||||
add(lblConnected);
|
||||
|
||||
JLabel lblMaxConnected = new JLabel("Max connected");
|
||||
lblMaxConnected.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblMaxConnected.setBounds(10, 41, 264, 17);
|
||||
add(lblMaxConnected);
|
||||
|
||||
JLabel lblOfflineShops = new JLabel("Offline trade");
|
||||
lblOfflineShops.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblOfflineShops.setBounds(10, 59, 264, 17);
|
||||
add(lblOfflineShops);
|
||||
|
||||
JLabel lblElapsedTime = new JLabel("Elapsed time");
|
||||
lblElapsedTime.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblElapsedTime.setBounds(10, 77, 264, 17);
|
||||
add(lblElapsedTime);
|
||||
|
||||
JLabel lblJavaVersion = new JLabel("Build JDK");
|
||||
lblJavaVersion.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblJavaVersion.setBounds(10, 95, 264, 17);
|
||||
add(lblJavaVersion);
|
||||
|
||||
JLabel lblBuildDate = new JLabel("Build date");
|
||||
lblBuildDate.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||
lblBuildDate.setBounds(10, 113, 264, 17);
|
||||
add(lblBuildDate);
|
||||
|
||||
// Set initial values.
|
||||
lblProtocol.setText("Protocol: 0");
|
||||
lblConnected.setText("Connected: 0");
|
||||
lblMaxConnected.setText("Max connected: 0");
|
||||
lblOfflineShops.setText("Offline trade: 0");
|
||||
lblElapsedTime.setText("Elapsed: 0 sec");
|
||||
lblJavaVersion.setText("Java version: " + System.getProperty("java.version"));
|
||||
lblBuildDate.setText("Build date: Unavailable");
|
||||
try
|
||||
{
|
||||
File jarName = Locator.getClassSource(GameServer.class);
|
||||
JarFile jarFile = new JarFile(jarName);
|
||||
Attributes attrs = jarFile.getManifest().getMainAttributes();
|
||||
lblBuildDate.setText("Build date: " + attrs.getValue("Build-Date").split(" ")[0]);
|
||||
jarFile.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
// Initial update task.
|
||||
new Timer().schedule(new TimerTask()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
lblProtocol.setText((Config.PROTOCOL_LIST.size() > 1 ? "Protocols: " : "Protocol: ") + Config.PROTOCOL_LIST.toString());
|
||||
}
|
||||
}, 4500);
|
||||
|
||||
// Repeating elapsed time task.
|
||||
new Timer().scheduleAtFixedRate(new TimerTask()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
lblConnected.setText("Connected: " + PlayerCountManager.getInstance().getConnectedCount());
|
||||
lblMaxConnected.setText("Max connected: " + PlayerCountManager.getInstance().getMaxConnectedCount());
|
||||
lblOfflineShops.setText("Offline trade: " + PlayerCountManager.getInstance().getOfflineTradeCount());
|
||||
lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - startTime));
|
||||
}
|
||||
}, 1000, 1000);
|
||||
}
|
||||
|
||||
static String getDurationBreakdown(long millis)
|
||||
{
|
||||
long days = TimeUnit.MILLISECONDS.toDays(millis);
|
||||
millis -= TimeUnit.DAYS.toMillis(days);
|
||||
long hours = TimeUnit.MILLISECONDS.toHours(millis);
|
||||
millis -= TimeUnit.HOURS.toMillis(hours);
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(millis);
|
||||
millis -= TimeUnit.MINUTES.toMillis(minutes);
|
||||
long seconds = TimeUnit.MILLISECONDS.toSeconds(millis);
|
||||
|
||||
return (days + "d " + hours + "h " + minutes + "m " + seconds + "s");
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.ui;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Font;
|
||||
import java.awt.Window.Type;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class frmAbout
|
||||
{
|
||||
private JFrame frmAbout;
|
||||
final static String URL = "www.l2jmobius.com";
|
||||
URI uri;
|
||||
|
||||
public frmAbout()
|
||||
{
|
||||
initialize();
|
||||
uri = createURI(URL);
|
||||
frmAbout.setVisible(true);
|
||||
}
|
||||
|
||||
private void initialize()
|
||||
{
|
||||
frmAbout = new JFrame();
|
||||
frmAbout.setResizable(false);
|
||||
frmAbout.setTitle("About");
|
||||
frmAbout.setBounds(100, 100, 297, 197);
|
||||
frmAbout.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
frmAbout.setType(Type.UTILITY);
|
||||
frmAbout.getContentPane().setLayout(null);
|
||||
|
||||
JLabel lblLjmobius = new JLabel("L2jMobius");
|
||||
lblLjmobius.setFont(new Font("Tahoma", Font.PLAIN, 32));
|
||||
lblLjmobius.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblLjmobius.setBounds(10, 11, 271, 39);
|
||||
frmAbout.getContentPane().add(lblLjmobius);
|
||||
|
||||
JLabel lblData = new JLabel("2013-" + Calendar.getInstance().get(Calendar.YEAR));
|
||||
lblData.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblData.setBounds(10, 44, 271, 14);
|
||||
frmAbout.getContentPane().add(lblData);
|
||||
|
||||
JLabel lblSupports = new JLabel("Server Protocol");
|
||||
lblSupports.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblSupports.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
lblSupports.setBounds(10, 78, 271, 23);
|
||||
frmAbout.getContentPane().add(lblSupports);
|
||||
|
||||
JLabel lblProtocols = new JLabel("Protocol Number");
|
||||
lblProtocols.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblProtocols.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
lblProtocols.setBounds(10, 92, 271, 23);
|
||||
frmAbout.getContentPane().add(lblProtocols);
|
||||
|
||||
JLabel site = new JLabel(URL);
|
||||
site.setText("<HTML><FONT color=\"#000099\"><U>" + URL + "</U></FONT></HTML>");
|
||||
site.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
site.setBounds(76, 148, 140, 14);
|
||||
site.addMouseListener(new MouseAdapter()
|
||||
{
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent arg0)
|
||||
{
|
||||
if (Desktop.isDesktopSupported())
|
||||
{
|
||||
try
|
||||
{
|
||||
Desktop.getDesktop().browse(uri);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
frmAbout.getContentPane().add(site);
|
||||
|
||||
// Generate protocols text.
|
||||
String protocols = "";
|
||||
if (Config.PROTOCOL_LIST.size() > 1)
|
||||
{
|
||||
for (Integer number : Config.PROTOCOL_LIST)
|
||||
{
|
||||
if (!protocols.isEmpty())
|
||||
{
|
||||
protocols += " - ";
|
||||
}
|
||||
protocols += number;
|
||||
}
|
||||
lblSupports.setText("Server Protocols");
|
||||
}
|
||||
else
|
||||
{
|
||||
protocols += Config.PROTOCOL_LIST.get(0);
|
||||
}
|
||||
lblProtocols.setText(protocols);
|
||||
|
||||
// Center frame to screen.
|
||||
frmAbout.setLocationRelativeTo(null);
|
||||
}
|
||||
|
||||
public static URI createURI(String str)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new URI(str);
|
||||
}
|
||||
catch (URISyntaxException x)
|
||||
{
|
||||
throw new IllegalArgumentException(x.getMessage(), x);
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
|
||||
import com.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
@ -100,6 +101,8 @@ public final class OfflineTradeUtil
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerCountManager.getInstance().incOfflineTradeCount();
|
||||
|
||||
final L2GameClient client = player.getClient();
|
||||
client.setDetached(true);
|
||||
|
||||
|
Reference in New Issue
Block a user