Gui should never terminate on it's own.

This commit is contained in:
MobiusDev 2018-05-10 14:46:29 +00:00
parent fdb635f416
commit 301dd75d62
16 changed files with 40 additions and 8 deletions

View File

@ -41,6 +41,7 @@ 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;
@ -315,6 +316,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -315,6 +316,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -315,6 +316,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -315,6 +316,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -283,6 +284,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
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;
@ -225,12 +226,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -315,6 +316,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -303,6 +304,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}

View File

@ -41,6 +41,7 @@ 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;
@ -303,6 +304,7 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - GameServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override

View File

@ -40,6 +40,7 @@ import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
import com.l2jmobius.commons.util.SplashScreen;
@ -224,12 +225,13 @@ public class Gui
// Set frame.
JFrame frame = new JFrame("Mobius - LoginServer");
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.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)
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
{
LoginServer.getInstance().shutdown(false);
}