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

    • Hello, I'm working with custom Icons and noticed that you can use 64x64 icons and the client will handle them without problems in the Inventory and when you Drag them, they look HD so it's really cool, the problem starts when you move them to the shortcut bar, when they're placed there instead of rescaling the icon it just show the upper left corner (so it's 32x32 but showing only the part that fits in that space). I tried checking interface.u but can't find the line where the size for the icons in the shortcut bar are handled.   When in Inventory the item shows in a 32x32 size, if I use a 64x64 icon it re-scales so the icon looks great When dragging the item the image becomes 64x64 which looks pretty big, but it works good When placing the item in the shortcut bar only the top left of the icon is visible   Is there a way I can adjust the shortcut bar so that it re-scales the icon?
    • If you want to edit a large amount of entries in the L2 File-edit I recommend using excel, since both work with columns you can copy the entire file or just a few lines and paste it in excel and it will copy without problems, after you're done with editing you just select the cells and paste them in the .dat file making sure you're formatting correctly. I'm currently doing a massive edit on all gear and that's how i'm handling the .dat work
    • the logic is the "stacking" that is a filter if you use it then the item cannot co-exist (stack)
    • [Exclusive L2Gold Weekend Server] Available ONLY on Saturdays & Sundays – nowhere else, no other time ! Custom Armors (Dynasty, Apella) Custom Weapons (L2Gold Weapons) Custom Jewelry (L2Gold Jewelry) Custom Teleport System Custom AIO Buffer Custom Zones & NPCs Custom Raidboss … and much more waiting for you every weekend! This is not just another private server – it’s a limited-time battleground. When the weekend comes, everyone gathers in one place for the ultimate L2 experience. 👉 Online: Saturday–Sunday only 👉 Contact / Info: [https://www.facebook.com/profile.php?id=61578869175323]
    • ⏳ The price drops like sand slipping down in an hourglass.   📉 USA numbers are already at the lowest 💸 🌍 Next in line: Europe, Asia, and dozens of other countries.     All next week we’ll be actively working on lowering prices. The process has already started  soon costs will be much cheaper. 🔥 Get ready: the price drop will affect every country!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock