Jump to content

Windows Kit


CodeSculptor

Recommended Posts

Because I'm a lazy git, and I like things working consistently, so I wrote a script that does as much as can be "done" in a standard order...

It makes the directories, does GIT to get the source, compiles everything, created the databases, loads them from the source as well...

One reason I did this was because I saw that the documentation (even for windows) mentioned using the mysql_import tool (doesn't work in windows).

I use Windows 7 Ultimate, 64 bit, and have Visual Studio (real, not express) so certain things work.

My minor questions are :

  • What are the OTHER github repositories? I see a mangos-zero and a mangos-one but can't find mangos development or mangos-master URLs.
  • Should I be linking in or using scriptdev from them OR using the one below (git://github.com/mangos-zero/scriptdev0.git)
  • How do I detect what database "updates" to load? Is it bad to re-apply them all?
  • Not related to the script and because I'm uber-new to this.. what clients (like 3.3.5, build xxxx) are mangos-zero for, and mangos-one (master and dev) too?

I plan on making the drive and path fully variable-dependent (configurable).

So here is what I've got :

@CLS
@ECHO OFF
@ECHO  +=====================================================================+
@ECHO !!! World Of Warcraft Emulator Reloader Script                        !!!
@ECHO !!!                                                                   !!!
@ECHO !!! This script will reload the emulator from the most recent git-hub !!!
@ECHO !!! and re-compile that source code.  It will also download all of    !!!
@ECHO !!! database data files and load those too.                           !!!
@ECHO !!!===================================================================!!!
@ECHO !!! By Tim Little -- [email][email protected][/email]                        !!!
@ECHO !!! Date : 2012/08/05                                                 !!!
@ECHO !!!      Tested on Windows 7 Ultimate - 64 bit                        !!!
@ECHO  +=====================================================================+
@ECHO .
@ECHO THIS IS YOUR LAST CHANCE TO ABORT... GO BACK NOW, BEFORE IT IS TOO LATE...
@ECHO .
@PAUSE
@ECHO .
@ECHO .
@REM =
@REM ========================================================================
@REM ===  I install my stuff on drive I...                                ===
@REM ===                            change to any other drive if you want ===
@REM ========================================================================
@REM =
@I:
@CD I:\\Source
@RMDIR /S /Q WoW_EMU
@MKDIR WoW_EMU
@CD WoW_EMU
git clone git://github.com/mangos-zero/database.git
@MKDIR Server
git clone git://github.com/mangos-zero/server.git
@CD I:\\Source\\WoW_EMU\\Server\\src\\bindings
git clone git://github.com/mangos-zero/scriptdev0.git
@CD I:\\Source\\WoW_EMU\\Server\\win
@REM =
@REM ========================================================================
@REM === devenv.exe is the executable for Visual Studio full version      ===
@REM === Change if you are using Visual Studio Express versions           ===
@REM === Also, I am doing 64 bit builds, so change the x64 to Win32       ===
@REM ========================================================================
@REM =
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\devenv.com" mangosdVC100.sln /build "Debug|x64"
CD I:\\Source\\WoW_EMU\\Server\\src\\bindings\\scriptdev0
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\devenv.com" scriptVC100.sln /build "Debug|x64"
CP I:\\Source\\WoW_EMU\\Server\\src\\mangosd\\mangosd.conf.dist.in I:\\Source\\WoW_EMU\\Server\\bin\\x64_Debug\\
CP I:\\Source\\WoW_EMU\\Server\\src\\realmd\\realmd.conf.dist.in I:\\Source\\WoW_EMU\\Server\\bin\\x64_Debug\\
CP I:\\Source\\WoW_EMU\\Server\\src\\bindings\\scriptdev0\\scriptdevzero.conf.dist.in I:\\Source\\WoW_EMU\\Server\\bin\\x64_Debug\\
CD I:\\Source\\WoW_EMU\\Server\\bin\\x64_Debug\\
@ECHO .
@ECHO .
@ECHO Completed downloading and compiling Wow_EMU
@ECHO .
@PAUSE PRESS ANY KEY TO LOAD THE DATABASES...
@REM =
@REM ========================================================================
@REM === DATABASE LOADING SECTION                                         ===
@REM ========================================================================
@REM =
@set wowemu_path=i:\\Source\\WoW_EMU\\
@set dbuser=root
@set dbpw=rootpassword
@set dbhost=localhost
@CLS
@SETLOCAL enabledelayedexpansion
@REM .
@ECHO Loading Realm...
@set db=zp_realm
CALL :Load_DB
@ECHO Loading World...
@set db=zp_world
CALL :Load_DB
@ECHO Loading Scripts...
@set db=zp_scripts
CALL :Load_DB
@ECHO Loading Characters...
@set db=zp_characters
CALL :Load_DB
GOTO:EOF
@REM .
@REM =
@REM ========================================================================
@REM === ROUTINES                                                         ===
@REM ========================================================================
@REM =
:Load_DB
mysql -u %dbuser% -p%dbpw% -h %dbhost% -e "drop database if exists %db%;"
mysql -u %dbuser% -p%dbpw% -h %dbhost% -e "create database if not exists %db%;"
@CD %wowemu_path%\\database\\%db%
@IF EXIST load_sql.bat DEL load_sql.bat
@FOR %%F IN (*.SQL) DO CALL :Parse_File %%F
CALL .\\load_sql.bat
GOTO:EOF
:Parse_File
@SET sql_fn=%*
@REM
FOR /F "usebackq delims=" %%i in (`findstr Database: %*`) do set DB_Match=%%i
SET myvar=!DB_MATCH!
FOR /F "tokens=5" %%w in ("%myvar%") DO echo mysql -u %dbuser% -p%dbpw% -h %dbhost% -D %%w ^< !sql_fn! >> load_sql.bat
GOTO:EOF

Link to comment
Share on other sites

I don't know what you wan't do reach. What should your WoWEmu contain? Because of several developement branches you can choose from some repository's.

You can use :

mangos-zero if you want the developement for 1.12.1

mangos-one if you want the developement for TBC

mangos if you want the developement for WOTLK

mangos-400 and further on mangos-434 if you want the developement for Cata

mangos-500 if you want the developement for MoP

Additional you can choose a ScriptEngine:

Scriptdev2 as example for mangos

Additional you can choose a Database that fits:

....

When you build your developement WoWEmu from zero, over and over again, your script needs only to:

clone git repository's

compile mangos and scripts

clear the database and reinstall the basic sql statements from mangos and from scripts

The sql updates are only nessesary if you want to update your existed database.

Be aware that this is only a simple quess from me what you might want. If you want automated update your WowEmu with:

source code repository's, database updates, scripts, translation

your script need a lot of more knowledge, sure.

I hope that my comment leads to more detailed developement and not to a "one click installer"

cheers

Link to comment
Share on other sites

LP, that's precisely what I wanted. Thanks bunches.

I will try 335 client WOTLK for today and see what's going on.

I'm not trying to make an actual installer. It's just that when testing and debugging, it's best to "plan the work and work the plan" and part of the plan is to make sure your environs is the same (to the best of my ability) each time.

My script is, in part, for a base for something I saw one of the people ask for regarding testing on Windows. I think that I can muck with the script and my various virtual-machine instances of Windows XP (pro, 32 and 64 bit), Windows 7 (32 and 64 bit) and others.

Since I have a pre-Mangos-installation snapshot for those virtual-machines, I can just run the script and see how they handle roll-outs.

I love doing actual coding, but I am totally not even up on the basics of the project's architecture yet, so I can at least offer to help with roll-out windows-platform testing.

And with a reasonably solid script, I can test across 6 windows versions within 30 minutes (less, but I want to see if real visual-studio and visual-studio express are both ok).

After that I want to write some management utils or get my hands dirty with whatever is otherwise needed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use