2
0

startGameServer.ps1 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. $OutputEncoding = New-Object -typename System.Text.UTF8Encoding
  2. $a = (Get-Host).UI.RawUI
  3. $a.WindowTitle = "L2J - Game Server Console"
  4. do
  5. {
  6. switch ($LASTEXITCODE)
  7. {
  8. -1 { cls; "Starting L2J Game Server."; break; }
  9. 2 { cls; "Restarting L2J Game Server."; break; }
  10. }
  11. ""
  12. # -------------------------------------
  13. # Default parameters for a basic server.
  14. java "-Djava.util.logging.manager=com.l2jserver.util.L2LogManager" -Xms1024m -Xmx1024m -cp "./../libs/*;l2jserver.jar" com.l2jserver.gameserver.GameServer
  15. #
  16. # If you have a big server and lots of memory, you could experiment for example with
  17. # java -server -Xmx1536m -Xms1024m -Xmn512m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts
  18. # If you are having troubles on server shutdown (saving data),
  19. # add this to startup paramethers: "-Djava.util.logging.manager=com.l2jserver.L2LogManager". Example:
  20. # REM java "-Djava.util.logging.manager=com.l2jserver.util.L2LogManager" -Xmx1024m -cp "./../libs/*;l2jserver.jar" com.l2jserver.gameserver.GameServer
  21. # -------------------------------------
  22. }
  23. while ($LASTEXITCODE -like 2)
  24. if ($LASTEXITCODE -like 1)
  25. {
  26. "Server Terminated Abnormally";
  27. }
  28. else
  29. {
  30. "Server Terminated";
  31. }