Selaa lähdekoodia

Simple way to enable logs while shutting down and saving data. Thanks Janiii

DrHouse 16 vuotta sitten
vanhempi
sitoutus
54e64609ff

+ 3 - 0
L2_GameServer/dist/startGameServer.bat

@@ -9,6 +9,9 @@ java -Xmx1024m -cp ./../libs/*;l2jserver.jar net.sf.l2j.gameserver.GameServer
 REM
 REM If you have a big server and lots of memory, you could experiment for example with
 REM java -server -Xmx1536m -Xms1024m -Xmn512m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts
+REM If you are having troubles on server shutdown (saving data),
+REM add this to startup paramethers: -Djava.util.logging.manager=net.sf.l2j.L2LogManager. Example:
+REM java -Djava.util.logging.manager=net.sf.l2j.util.L2LogManager -Xmx1024m -cp ./../libs/*;l2jserver.jar net.sf.l2j.gameserver.GameServer
 REM -------------------------------------
 if ERRORLEVEL 2 goto restart
 if ERRORLEVEL 1 goto error

+ 22 - 0
L2_GameServer/java/net/sf/l2j/util/L2LogManager.java

@@ -0,0 +1,22 @@
+package net.sf.l2j.util;
+
+import java.util.logging.LogManager;
+
+/**
+ * Dummy class to enable logs while shutting down
+ *
+ */
+public class L2LogManager extends LogManager {
+
+	public L2LogManager() {
+		super();
+	}
+
+	public void reset() {
+		// do nothing
+	}
+
+	public void doReset() {
+		super.reset();
+	}
+}