Page 1 of 1

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

Posted: Mon Nov 26, 2012 1:27 am
by codiddle
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

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

Posted: Tue Nov 27, 2012 9:46 pm
by codiddle
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.

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

Posted: Thu Dec 06, 2012 7:17 pm
by codiddle
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.

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

Posted: Sat Dec 08, 2012 5:04 pm
by whasf
Pretty neat :)

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

Posted: Tue Dec 18, 2012 3:39 pm
by codiddle
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.

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

Posted: Wed Mar 06, 2013 6:33 am
by WiiStream
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

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

Posted: Wed Mar 06, 2013 6:37 am
by WiiStream
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

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

Posted: Sun May 26, 2013 6:25 pm
by XGP0001
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

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

Posted: Mon Jan 27, 2014 9:04 pm
by Robert
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.