3.3.5a Realm Status Checker/Restarter >> Batch file

Azayaka

Allelujah
Administrator
Azayaka Rep
3
0
0
Rep
9
Azayaka Vouches
0
0
0
Vouches
0
Posts
321
Likes
219
2 YEARS
2 YEARS OF SERVICE
LEVEL 99 60 XP
Hello,

I've created a realm restarter. I know this has been done several times over; however, I thought I could improve it slightly. So I introduce a new logic behind the realm restarter.

Instead of opening the worldserver in the same batch file as the restarter, we create a new cmd(this will take slightly more resources). There will also be a slight delay in realm restarting doing it this way as well instead of instantly restarting. We can create a separate log file to track when the server restarts, yes you'll still have crash logs but that would be more detailed. This is by no means a perfect solution, but it is a solution.

I'm open to suggestions and alterations. Please share your changes or thoughts on this approach.

Allelujah



Don't forget to update your path if it differs from mine.

Bash:
@echo off
:restart
set "appPath=C:\Desktop\source_build\bin\RelWithDebInfo\worldserver.exe"
start "" "%appPath%"
echo %date% %time%: Started the application. >> C:\Desktop\source_build\bin\RelWithDebInfo\restart_log.txt

:check
timeout /t 10 /nobreak
tasklist | findstr /i "worldserver.exe" >nul
if errorlevel 1 (
    echo %date% %time%: Application not running, restarting... >> C:\\Desktop\source_build\bin\RelWithDebInfo\restart_log.txt
    goto restart
) else (
    echo %date% %time%: Application is running. >> C:\Desktop\source_build\bin\RelWithDebInfo\restart_log.txt
    goto check
)
 

3,389

1,271

9,555

428

Top