Some sweet batch files I made (Needs a little work)

Applications/Tools written to make running DarkStar easier for the rest of us.
Post Reply
codiddle
Posts: 56
Joined: Sat Aug 11, 2012 12:58 pm

Some sweet batch files I made (Needs a little work)

Post by codiddle » Mon Nov 26, 2012 1:27 am

They're not perfect,

Only FFXIStart.bat needs to be executed, and the rest will happen automagically. It'd be nice to execute ffxiboot as well, while running the script and perhaps even run mysql, however, I'm having a hard enough time right now getting my server live, I've been focusing on fixing that...

They're all in the same folder as their respective DSConnect, DSGame, DSSearch-server.exe files.

------------------------------------------------First, there's a FFXIStart.bat file with the following:
@echo off
color 0a
echo **************************STARTING CONNECT**********************************
start DSConnect-server.exe
call DSGame.bat
if errorlevel 1 goto error
goto finish
:error
echo.
echo DSConnect-server failed to initialize...
pause
:finish

----------------------------------------Second, there's a DSGame.bat file with the following contents:
@echo off
color 0a
echo **************************STARTING GAME**********************************
call DSSearch.bat
timeout /t 5
start DSGame-server.exe
if errorlevel 1 goto error
goto finish
:error
echo.
echo DSGame-server failed to initialize...
pause
:finish
------------------------------------------Third, there's a DSSearch.bat file with the following contents:
@echo off
color 0a
echo **************************STARTING SEARCH**********************************
start DSSearch-server.exe
if errorlevel 1 goto error
goto finish
:error
echo.
echo DSSearch-server failed to initialize...
pause
:finish

codiddle
Posts: 56
Joined: Sat Aug 11, 2012 12:58 pm

Re: Some sweet batch files I made (Needs a little work)

Post by codiddle » Tue Nov 27, 2012 9:46 pm

Since I added this a few days ago, I've done a lot more to it.
I rewrote all of the batch files, but now they also include mysqld.exe, and mxi.exe. Not only that, the batch file opens the config files for FFXICalculator.exe and Client.ini (for mxi) to setup the game config before launching all of the other exe files. I have it all setup inside of my WAMP server, so I can also launch the DSP Frontend along with it, in the www directory. I'm going to upload it, but I can't decide whether I want to upload the DSP source code AND the WAMP files, or leave that up to the user. It'll be more complicated if I were to upload it without the entire package.

codiddle
Posts: 56
Joined: Sat Aug 11, 2012 12:58 pm

Re: Some sweet batch files I made (Needs a little work)

Post by codiddle » Thu Dec 06, 2012 7:17 pm

I built this program in C# to launch different parts of the emulator. I was hoping to add a link to Deveous's website on the 127.0.0.1 address, but my coding skills are limited and I couldn't figure out how to do that, even using the default browser, I couldn't get it to work. I can paste the code, but here's the simple GUI launcher I made...
The filesystem is contained within the WAMP structure... because I used it to combine a few projects into 1 directory. Plus it's easier to implement tools like this, if the file structure is set in uniform a certain way. I doubt this will ever be used, so I thought I'd post a pic before I posted any code or files.
Attachments
FFXI_Launcher.png

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Some sweet batch files I made (Needs a little work)

Post by whasf » Sat Dec 08, 2012 5:04 pm

Pretty neat :)
-- Whasf

codiddle
Posts: 56
Joined: Sat Aug 11, 2012 12:58 pm

Re: Some sweet batch files I made (Needs a little work)

Post by codiddle » Tue Dec 18, 2012 3:39 pm

Thanks, the code was real simple.

For each button, all I did was add the code: (Including the code for on button click)
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"C:\wamp\bin\mysql\MySQL.bat");
}

Later I added a try/catch for each one, in case the file couldn't be found. But if you're compiling this for yourself, you should know when you move files, the code won't work.

WiiStream

Re: Some sweet batch files I made (Needs a little work)

Post by WiiStream » Wed Mar 06, 2013 6:33 am

Here is a auto restart bat I wrote.
But the server has to be compiled in release mode to work correctly. if it is in debug mode when compiled the Brake point will show.

Code: Select all

@ECHO OFF 
CLS 
ECHO DSGame-server Started %time:~0,5% %date:~1% 
:SERVERLOOP 
DSGame-server.exe
ECHO DSGame-server Restarted %time:~0,5% %date:~1% 
ECHO. 
GOTO SERVERLOOP 
:END

WiiStream

Re: Some sweet batch files I made (Needs a little work)

Post by WiiStream » Wed Mar 06, 2013 6:37 am

Here is a auto restart bat I wrote.
But the server has to be compiled in release mode to work correctly. if it is in debug mode when compiled the Brake point will show.

Code: Select all

@ECHO OFF 
CLS 
ECHO DSGame-server Started %time:~0,5% %date:~1% 
:SERVERLOOP 
DSGame-server.exe
ECHO DSGame-server Restarted %time:~0,5% %date:~1% 
ECHO. 
GOTO SERVERLOOP 
:END
YOU do not want to do this with this bat file! and if you do you will start up the exe none stop so do not do this.

Code: Select all

@ECHO OFF 
CLS 
ECHO DSGame-server Started %time:~0,5% %date:~1% 
:SERVERLOOP 
start DSGame-server.exe <----------------------DO NOT ADD START
ECHO DSGame-server Restarted %time:~0,5% %date:~1% 
ECHO. 
GOTO SERVERLOOP 
:END

XGP0001
Posts: 16
Joined: Sat Apr 13, 2013 11:00 am

Re: Some sweet batch files I made (Needs a little work)

Post by XGP0001 » Sun May 26, 2013 6:25 pm

I tried to make my GameServer.exe reload with this when it crashes but It still wont reset until i click "OK" that my server has crashed. How do I get around this?

I used the .bat

@ECHO OFF
CLS
ECHO DSGame-server Started %time:~0,5% %date:~1%
:SERVERLOOP
DSGame-server.exe
ECHO DSGame-server Restarted %time:~0,5% %date:~1%
ECHO.
GOTO SERVERLOOP
:END

Robert
Posts: 33
Joined: Fri Aug 16, 2013 9:14 am

Re: Some sweet batch files I made (Needs a little work)

Post by Robert » Mon Jan 27, 2014 9:04 pm

you could cheat and just taskkill the whole process and then add a timer to just restart the process again. The debug mode when the server client is compiled is the reason the popup appears.
Which is a good thing, really, when you find a brake point that crashs the server it should point directly to the problem, and that should give you the info to debug, and solve the crash.

C++ runs flawlessly when fully debugged.

Post Reply