compile build bat file

Applications/Tools written to make running DarkStar easier for the rest of us.
Post Reply
Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

compile build bat file

Post by Delaide » Fri Jan 16, 2015 3:12 am

So, as I have noted lately, I am trying to automate my entire server process.
So far, I have shown how I start my servers with the user access control now fixed: viewtopic.php?f=16&t=2429
and how I export important tables: viewtopic.php?f=16&t=2428

I have now completed a simple batch that will allow you to single click build all servers. Please note though, this is mostly to help guide people who want to be able to automate their process. You will need to modify the code to match your specifics.

I am using: Windows 7 64 bit, so if you are using 32 bit, you will need to change the folder to your MSBuild.exe file.
I am using: Microsoft Visual Express 2013, so if you are using a different Visual Express suite, please check the path of your MSBuild.exe file. If you are using a different compiler, I apologize, but I am not sure how to build it from the command line.

Also remember, you need to point to your DSP project download folder, which will probably be different from my D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSConnect-server\

I build Debug by default, because I have noticed I get strange behavior sometimes with Release builds, so if you want Release, change

Code: Select all

/p:Configuration=Debug
to:

Code: Select all

/p:Configuration=Release
So here is the code, but please remember, this is only for reference. If you want to automate your build, you will need to make changes as appropriate:

Code: Select all

"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSConnect-server\DSConnect-server.sln" /p:Configuration=Debug
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSGame-server\DSGame-server.sln" /p:Configuration=Debug
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSSearch-server\DSSearch-server.sln" /p:Configuration=Debug
Eventually, I hope to put all of these steps together in a single step for everyone.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: compile build bat file

Post by kjLotus » Fri Jan 16, 2015 3:20 am

Delaide wrote:because I have noticed I get strange behavior sometimes with Release builds
can't fix it if I don't know about it!

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: compile build bat file

Post by Delaide » Fri Jan 16, 2015 4:12 am

Sorry KJ. I am not completely sure what is wrong. The issue I have noticed though is, if I build using release, then when I go to shut down the server, at least by clicking the upper right hand x, I will get the program crash window. It isn't a big deal, and doesn't seem to corrupt anything, but just something strange I have noticed. So I end up having to click the button to let windows terminate it.

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: compile build bat file

Post by tagban » Fri Jan 16, 2015 8:12 am

I never have this problem.

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: compile build bat file

Post by Delaide » Fri Jan 16, 2015 8:25 am

np, I was just about to rebuild. I will rebuild as release, and post the crash thing I get.
Report back later.

Okay, here is what I see when I close the login server and game server. I don't have the same problem with the search server, and I only have this problem with release build, not debug.

Login server:
Login Server.png
Game server:
Game Server.png
Finally was able to catch the message:
Capture.JPG

nasomi
Posts: 141
Joined: Wed Feb 13, 2013 8:51 am

Re: compile build bat file

Post by nasomi » Fri Jan 16, 2015 10:42 am

Weird, I could have sworn i posted this already. It's most effective to clean your build before rebuilding. Prevents "leftovers" from getting messed up. This will do a complete rebuild and reimport. you can put it all in one file, but it's faster to separate them out. game taking the longest to compile it's by itself.

start.bat

Code: Select all

start 1.bat
start 2.bat
start 3.bat
1.bat

Code: Select all

cd c:\program files (x86)\msbuild\12.0\bin
msbuild "c:\repo\win32\dssearch-server\dssearch-server.sln" /t:clean
msbuild "c:\repo\win32\dssearch-server\dssearch-server.sln" /t:build
msbuild "c:\repo\win32\dsconnect-server\dsconnect-server.sln" /t:clean
msbuild "c:\repo\win32\dsconnect-server\dsconnect-server.sln" /t:build
2.bat

Code: Select all

cd c:\program files (x86)\msbuild\12.0\bin
msbuild "c:\repo\win32\dsgame-server\dsgame-server.sln" /t:clean
msbuild "c:\repo\win32\dsgame-server\dsgame-server.sln" /t:build
3.bat

Code: Select all

cd c:\repo\sql
del auction_house.sql
del chars.sql
del accounts.sql
del char_effects.sql
del char_equip.sql
del char_exp.sql
del char_inventory.sql
del char_jobs.sql
del char_look.sql
del char_pet.sql
del char_pet_name.sql
del char_points.sql
del char_profile.sql
del char_skills.sql
del char_stats.sql
del char_storage.sql
del char_vars.sql
del char_weapon_skill_points.sql
del conquest_system.sql
del delivery_box.sql
del linkshells.sql
FOR %%X IN (*.sql) DO ECHO Importing %%X & "c:\mysql\mysql" dspdb -h 127.0.0.1 -u user -ppass < %%X

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: compile build bat file

Post by Delaide » Fri Jan 16, 2015 11:45 am

Clean my build?
I delete the old server files completely, and put the pure git code in that folder, which is empty. There are no old builds there. It is basically a build using nothing but pure git code with the conf and lua files modified as needed.

Sorry, sleepy right now so I will explain what I do.
I have two folders, one for git pulls, one for server.
So, I pull in the git folder, and once I feel it has changed enough, or I am up for it, I will update the servers.
When I do, I zip up my separate server folder, then I delete everything in the darkstar folder.
I then copy over everything in my git folder except the .git folder itself, and paste it in the server folder.
I then modify the config files, the lua files, and the cpp file for AH.
Then, I build. Nothing to clean up since it is just like doing a build from scratch.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: compile build bat file

Post by kjLotus » Sun Jan 25, 2015 11:50 pm

Delaide wrote:np, I was just about to rebuild. I will rebuild as release, and post the crash thing I get.
Report back later.

Okay, here is what I see when I close the login server and game server. I don't have the same problem with the search server, and I only have this problem with release build, not debug.

Finally was able to catch the message:
Capture.JPG
shouldn't do that anymore in release build, sorry if it's pretty late :p

Post Reply