Jump to content

Recommended Posts

Posted

I was browsing L2J Forum & I have found a very useful tool ( well, at least for me :P )

Anyway i hope you like it !!

 

It is a "special" Gameserver.bat With Auto-Backup.You need to edit some things in the code in order to make auto-back :P

 

 

::::::::::
:: Config

:: Title of the server window.
@title GameServer

:: You can get more information about the color command by opening "Start - Run.." and typing:
:: cmd /k color /?
:: for example "@color 0a" will give the server console a matrix-like look.
:: default: color 07
@color 07

:: window size.
:: cols=number of symbols on one line, default is 80
:: lines=number of lines in one window, default is 300
:: remove "::" to activate
::

:: mode con: cols=80 lines=300
:: The command that will start the server.
:: You can start the server in high process priority if you change the default execution line to:
:: @set exec=start /wait /realtime java -Xmx512m -cp bsf.jar;bsh-2.0b4.jar;commons-logging-1.1.jar;mmocore.jar;javolution.jar;c3p0-0.9.1.jar;mysql-connector-java-5.0.5-bin.jar;l2jserver.jar;jython.jar net.sf.l2j.gameserver.GameServer
:: But this will also create one extra CMD window.

@set exec=java -Xmx512m -cp bsf.jar;bsh-2.0b4.jar;commons-logging-1.1.jar;mmocore.jar;javolution.jar;c3p0-0.9.1.jar;mysql-connector-java-5.0.5-bin.jar;l2jserver.jar;jython.jar net.sf.l2j.gameserver.GameServer

::
:: MySQL
::

@set mysqlPath="C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql"
@set mysqlBinPath="C:\Program Files\MySQL\MySQL Server 5.0\bin"
@set mysqldumpPath="C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump"
@set lsuser=root
@set lspass=
@set lsdb=l2jdb
@set lshost=localhost
@set gsuser=root
@set gspass=
@set gsdb=l2jdb
@set gshost=localhost

::
:: Log
::

:: The log file that will show when the server was started, restarted and shutdown.
@set StartEndLog_Enable=true
@set StartEndLog_Path="log/start-end.log"

:: Logging of database backup.
@set DatabaseBackupLog_Enable=true
@set DatabaseBackupLog_Path="log/start-end.log"

:: item.log
:: This file is created by the server if the item logging is enabled and it
:: gets very large very quickly.
:: Enable this option to move the item.log file to the backup folder every
:: time the database bacup is running.
@set MoveItemLog=true

::
:: Database Backup
::

@set DatabaseBackupOnStart_Enable=false
@set DatabaseBackupOnShutdown_Enable=true
@set DatabaseBackupOnRestart_Enable=true
@set DatabaseBackupOnAbnormal_Enable=true
@set DatabaseBackupPath=c:\backup

:: Config
::::::::::

@echo off
:start

:: --- Start of the backup script --- ::
if not "%DatabaseBackupOnStart_Enable%"=="true" goto EndBackup1
if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Starting>> %DatabaseBackupLog_Path%
for /F "tokens=2" %%I in ("%date%") do set CurrentDate=%%I
set BackupPath=%CurrentDate%-%random%
echo Backup will be saved in: %DatabaseBackupPath%\%BackupPath%
if not exist %DatabaseBackupPath% md %DatabaseBackupPath%&echo "%DatabaseBackupPath%" doesn't exist, creating path...
if not exist %DatabaseBackupPath% echo Couldn't create "%DatabaseBackupPath%", Backup canceled!&goto EndBackup1

md "%DatabaseBackupPath%\%BackupPath%"

if not "%MoveItemLog%"=="true" goto EndMoveItemLog1
if not exist log\item.log echo "item.log" doesn't exist.&goto EndMoveItemLog1
echo Moving item.log to "%DatabaseBackupPath%\%BackupPath%"
move log\item.log "%DatabaseBackupPath%\%BackupPath%\item.log"
echo.
:EndMoveItemLog1

echo Loginserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %lshost% -u %lsuser% --password=%lspass% %lsdb% > "%DatabaseBackupPath%\%BackupPath%\loginserver.sql"
echo.
echo Gameserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %gshost% -u %gsuser% --password=%gspass% %gsdb% > "%DatabaseBackupPath%\%BackupPath%\gameserver.sql"
echo.
echo Done.
echo.
goto EndBackup1

if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Finished>> %DatabaseBackupLog_Path%
:EndBackup1
:: --- End of the backup script --- ::



if "%StartEndLog_Enable%"=="true" echo %date% ^| %time% ^| Gameserver: Starting>> %StartEndLog_Path%
echo Starting L2J Game Server.
echo.

:: --- Server starting here --- ::
%exec%
:: --- Server Stoping here --- ::

if ERRORLEVEL 2 goto restart
if ERRORLEVEL 1 goto error

:: --- Start of the backup script --- ::
if not "%DatabaseBackupOnShutdown_Enable%"=="true" goto EndBackup2
if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Starting>> %DatabaseBackupLog_Path%
for /F "tokens=2" %%I in ("%date%") do set CurrentDate=%%I
set BackupPath=%CurrentDate%-%random%
echo Backup will be saved in: "%DatabaseBackupPath%\%BackupPath%"
if not exist %DatabaseBackupPath% md %DatabaseBackupPath%&echo "%DatabaseBackupPath%" doesn't exist, creating path...
if not exist %DatabaseBackupPath% echo Couldn't create "%DatabaseBackupPath%", Backup canceled!&goto EndBackup2

md "%DatabaseBackupPath%\%BackupPath%"

if not "%MoveItemLog%"=="true" goto EndMoveItemLog2
if not exist log\item.log echo "item.log" doesn't exist.&goto EndMoveItemLog2
echo Moving item.log to "%DatabaseBackupPath%\%BackupPath%"
move log\item.log "%DatabaseBackupPath%\%BackupPath%\item.log"
echo.
:EndMoveItemLog2

echo Loginserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %lshost% -u %lsuser% --password=%lspass% %lsdb% > "%DatabaseBackupPath%\%BackupPath%\loginserver.sql"
echo.
echo Gameserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %gshost% -u %gsuser% --password=%gspass% %gsdb% > "%DatabaseBackupPath%\%BackupPath%\gameserver.sql"
echo.
echo Done.
echo.

if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Finished>> %DatabaseBackupLog_Path%
:EndBackup2
:: --- End of the backup script --- ::


if "%StartEndLog_Enable%"=="true" echo %date% ^| %time% ^| Gameserver: Server Shutdown>> %StartEndLog_Path%
goto end
:restart

:: --- Start of the backup script --- ::
if not "%DatabaseBackupOnRestart_Enable%"=="true" goto EndBackup3
if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Starting>> %DatabaseBackupLog_Path%
for /F "tokens=2" %%I in ("%date%") do set CurrentDate=%%I
set BackupPath=%CurrentDate%-%random%
echo Backup will be saved in: "%DatabaseBackupPath%\%BackupPath%"
if not exist %DatabaseBackupPath% md %DatabaseBackupPath%&echo "%DatabaseBackupPath%" doesn't exist, creating path...
if not exist %DatabaseBackupPath% echo Couldn't create "%DatabaseBackupPath%", Backup canceled!&goto EndBackup3

md "%DatabaseBackupPath%\%BackupPath%"

if not "%MoveItemLog%"=="true" goto EndMoveItemLog3
if not exist log\item.log echo "item.log" doesn't exist.&goto EndMoveItemLog3
echo Moving item.log to "%DatabaseBackupPath%\%BackupPath%"
move log\item.log "%DatabaseBackupPath%\%BackupPath%\item.log"
echo.
:EndMoveItemLog3

echo Loginserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %lshost% -u %lsuser% --password=%lspass% %lsdb% > "%DatabaseBackupPath%\%BackupPath%\loginserver.sql"
echo.
echo Gameserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %gshost% -u %gsuser% --password=%gspass% %gsdb% > "%DatabaseBackupPath%\%BackupPath%\gameserver.sql"
echo.
echo Done.
echo.


if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Finished>> %DatabaseBackupLog_Path%
:EndBackup3
:: --- End of the backup script --- ::


if "%StartEndLog_Enable%"=="true" echo %date% ^| %time% ^| Gameserver: Admin Restart>> %StartEndLog_Path%
echo.
echo Admin Restart ...
echo.
goto start
:error
:: --- Start of the backup script --- ::
if not "%DatabaseBackupOnAbnormal_Enable%"=="true" goto EndBackup4
if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Starting>> %DatabaseBackupLog_Path%
for /F "tokens=2" %%I in ("%date%") do set CurrentDate=%%I
set BackupPath=%CurrentDate%-%random%
echo Backup will be saved in: "%DatabaseBackupPath%\%BackupPath%"
if not exist %DatabaseBackupPath% md %DatabaseBackupPath%&echo "%DatabaseBackupPath%" doesn't exist, creating path...
if not exist %DatabaseBackupPath% echo Couldn't create "%DatabaseBackupPath%", Backup canceled!&goto EndBackup4

md "%DatabaseBackupPath%\%BackupPath%"

if not "%MoveItemLog%"=="true" goto EndMoveItemLog4
if not exist log\item.log echo "item.log" doesn't exist.&goto EndMoveItemLog4
echo Moving item.log to "%DatabaseBackupPath%\%BackupPath%"
move log\item.log "%DatabaseBackupPath%\%BackupPath%\item.log"
echo.
:EndMoveItemLog4

echo Loginserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %lshost% -u %lsuser% --password=%lspass% %lsdb% > "%DatabaseBackupPath%\%BackupPath%\loginserver.sql"
echo.
echo Gameserver backup.
echo -------------------
%mysqldumpPath% --add-drop-table -h %gshost% -u %gsuser% --password=%gspass% %gsdb% > "%DatabaseBackupPath%\%BackupPath%\gameserver.sql"
echo.
echo Done.
echo.


if "%DatabaseBackupLog_Enable%"=="true" echo %date% ^| %time% ^| Backup: Finished>> %DatabaseBackupLog_Path%
:EndBackup4
:: --- End of the backup script --- ::
if "%StartEndLog_Enable%"=="true" echo %date% ^| %time% ^| Gameserver: Server terminated abnormaly>> %StartEndLog_Path%
echo.
echo Server terminated abnormaly
echo.
:end
echo.
echo server terminated
echo.
pause

  • 2 weeks later...
  • 1 month later...
  • 11 months later...
Guest
This topic is now closed to further replies.


  • Posts

    • ## [1.4.0] - 2026-01-28   ### ✨ New Features - **Vote System**: Lineage 2 servers can now use our vote–reward system. Players vote on the website and claim rewards in-game (1 vote = 1 claim) - **Vote Page**: On each server’s page (`/servers/<server>`), a **“Vote for Server”** button opens a dedicated vote page with cooldown info and optional Turnstile verification - **By Votes View**: The **“By Votes”** tab on the main page shows **actual vote counts** per server - **API Documentation**: New **API Docs** page at `/docs` (and footer link) with HMAC auth, endpoints, and examples for game server integration - **Vote API (My Servers)**: Server owners can open **“Vote API”** in My Servers to manage credentials, cooldown, allowed IPs, and open the docs   ### 🔄 Improvements - **Server Pages**: Single-server data is cached and loads faster; server pages can be opened by ID or by name (e.g. `/servers/my-server-name`) - **API Root**: Visiting the API root redirects to the docs URL configured in admin (default: site docs page) - **Admin Panel**: New **“Vote System”** tab for global settings (Turnstile, API security, default cooldown, docs URL)   ### 🔐 Security & Reliability - Turnstile (CAPTCHA) support for vote submissions to reduce abuse - HMAC-protected game server API for secure vote check/claim and stats
    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..