1 Star 1 Fork 0

xfwg / StygianCore-Controls

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
StygianCoreTools.bat 26.94 KB
一键复制 编辑 原始数据 按行查看 历史
StygianTheBest 提交于 2018-12-20 03:06 . v2018.12.20
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
@echo off
REM ########################################################################################
REM ____ __ ____
REM /\ _`\ /\ \__ __ /\ _`\
REM \ \,\L\_\ \ ,_\ __ __ __ /\_\ __ ___\ \ \/\_\ ___ _ __ __
REM \/_\__ \\ \ \/ /\ \/\ \ /'_ `\/\ \ /'__`\ /' _ `\ \ \/_/_ / __`\/\`'__\/'__`\
REM /\ \L\ \ \ \_\ \ \_\ \/\ \L\ \ \ \/\ \L\.\_/\ \/\ \ \ \L\ \/\ \L\ \ \ \//\ __/
REM \ `\____\ \__\\/`____ \ \____ \ \_\ \__/.\_\ \_\ \_\ \____/\ \____/\ \_\\ \____\
REM \/_____/\/__/ `/___/ \/___L\ \/_/\/__/\/_/\/_/\/_/\/___/ \/___/ \/_/ \/____/
REM /\___/ /\____/
REM \/__/ \_/__/ http://stygianthebest.github.io
REM
REM ########################################################################################
REM ########################################################################################
REM CHECK FOR RESTORATION ARCHIVES
REM ########################################################################################
IF EXIST %CD%\Tools\restore_stygiancore.zip. (
goto initialize
)
(
CLS
echo.
echo [-------------------]
echo [- !!! WARNING !!! -]
echo [-------------------]
echo.
echo THE REQUIRED RESTORATION ARCHIVE, restore_stygiancore.zip, WAS NOT
echo FOUND IN THE TOOLS FOLDER. PLEASE LOCATE THIS FILE AND TRY AGAIN.
echo -------------------------------------------------------------------
echo ... Server
echo ... Support
echo ... Tools
echo .. [X] restore_stygiancore.zip - Required for server restore.
IF NOT EXIST %CD%\Tools\restore_azerothcore.zip. (
echo .. [X] restore_azerothcore.zip - Required for sandbox.)
)
(
echo.
)
echo.
pause
exit
)
REM ########################################################################################
: initialize
REM // Version
set acoredbrev=2018.12.04
set toolsrev=2018.12.18
set stygianrev=2018.12.25
set wowbuild=12340
REM // This is for launching the deploy batch file that automates debug and release testing
REM // This batch file is located in the AzerothCore Solution root folder
set solutiondir=..\Dev\StygianCore\StygianBuild
REM // DevTemp
REM // TODO: PATCH OR UPDATE SPECIFIC SQL TABLES
set quickupdate=item_pricing.sql
REM // Command
REM 1(Blue), 2(Green), 3(Cyan), 4(Red), 5(Purple), 6(Yellow), 7(LGray), 8(Gray)
MODE con:cols=88 lines=45
COLOR 2F
SET mod=%1
SET NAME=StygianCore Tools
TITLE %NAME%
REM // MySQL 5.6.42 x64
set host=127.0.0.1
set port=3306
set user=azerothcore
set pass=azerothcore
REM // Database
set login=stygian_auth
set characters=stygian_characters
set world=stygian_world
REM // Try to turn on the lights
cls
:init
IF EXIST %CD%\Tools\Temp\NUL (
goto mysql
) ELSE (
mkdir Tools\Temp
goto mysql
)
REM
REM [- 0 -]
REM
:setup
cls
echo.
set /P host=Host [%host%]:
set /P port=Port [%port%]:
set /P user=User [%user%]:
set /P login=DB Auth [%login%]:
set /P pass=DB Char[%characters%]:
set /P pass=DB World [%world%]:
echo.
pause
:mysql
rem echo Checking MySQL...
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld">NUL
if "%ERRORLEVEL%"=="0" goto menu
if "%ERRORLEVEL%"=="1" goto start_mysql
:start_mysql
echo Starting MySQL...
start start_database.bat
ping -n 10 127.0.0.1>nul
goto mysql
:menu
cls
echo ########################################################################################
echo ____ __ ____
echo /\ _`\ /\ \__ __ /\ _`\
echo \ \,\L\_\ \ ,_\ __ __ __ /\_\ __ ___\ \ \/\_\ ___ _ __ __
echo \/_\__ \\ \ \/ /\ \/\ \ /'_ `\/\ \ /'__`\ /' _ `\ \ \/_/_ / __`\/\`'__\/'__`\
echo /\ \L\ \ \ \_\ \ \_\ \/\ \L\ \ \ \/\ \L\.\_/\ \/\ \ \ \L\ \/\ \L\ \ \ \//\ __/
echo \ `\____\ \__\\/`____ \ \____ \ \_\ \__/.\_\ \_\ \_\ \____/\ \____/\ \_\\ \____\
echo \/_____/\/__/ `/___/ \/___L\ \/_/\/__/\/_/\/_/\/_/\/___/ \/___/ \/_/ \/____/
echo /\___/ /\____/
echo \/__/ \_/__/ http://stygianthebest.github.io
echo.
echo.
REM CHECK FOR SAVE GAME STATE
IF EXIST %CD%\Tools\SaveGameState\savestate-%world%.sql. (
REM SAVE STATE EXISTS - SHOW RESTORE OPTIONS
) ELSE (
echo ### IMPORT/EXPORT ######################################################################
echo [ 1 ] - Export World
echo [ 2 ] - Export Accounts/Characters
IF EXIST %CD%\Tools\Temp\%world%.sql. (
echo [ 3 ] - Import World
)
IF EXIST %CD%\Tools\Temp\%login%.sql. (
echo [ 4 ] - Import Accounts/Characters
)
)
echo.
echo ### RESTORE SERVER #####################################################################
IF EXIST %CD%\Tools\SaveGameState\savestate-%world%.sql. (
echo [ 1 ] - Reset Sandbox World
echo [ 2 ] - Reset Sandbox Accounts
echo [ 3 ] - Exit Sandbox Mode
) ELSE (
IF EXIST %CD%\Tools\restore_stygiancore.zip. (
echo [ 5 ] - Restore Server: StygianCore %stygianrev% Release
)
IF EXIST %CD%\Tools\restore_azerothcore.zip. (
echo [ 6 ] - SandBox Mode: AzerothCore %acoredbrev% Release
)
)
echo.
echo ### TOOLS ##############################################################################
echo [ 7 ] - Update MySQL Configuration
IF EXIST %solutiondir%\bin\RelWithDebInfo\worldserver.exe. (
echo [ 8 ] - Deploy Visual Studio Builds
)
echo.
echo ########################################################################################
echo # Tools v%toolsrev% #
echo.
set /P menu=%host% @ %port%:
if "%menu%"=="0" (goto menu)
IF EXIST %CD%\Tools\SaveGameState\savestate-%world%.sql. (
if "%menu%"=="1" (goto import_world)
if "%menu%"=="2" (goto import_accounts)
if "%menu%"=="3" (goto restore_savestate)
) ELSE (
if "%menu%"=="1" (goto export_world)
)
if "%menu%"=="2" (goto export_accounts)
if "%menu%"=="3" (goto import_world)
if "%menu%"=="4" (goto import_accounts)
if "%menu%"=="5" (goto restore_default_sc)
if "%menu%"=="6" (goto restore_default_ac)
if "%menu%"=="7" (goto setup)
if "%menu%"=="8" (goto deploy)
if "%menu%"=="9" (goto restore_savestate)
if "%menu%"=="" (goto menu)
REM ########################################################################################
REM [- 1 -]
REM ########################################################################################
:export_world
cls
echo.
echo ###] .\TOOLS\TEMP DIRECTORY CONTENTS [##################################################
dir Tools\Temp /N /ON
echo.
echo ########################################################################################
echo.
set /P menu=Are you sure want to EXPORT the current WORLD database? [Y/N]:
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto export_world_go)
:export_world_go
cls
echo.
if exist Tools\Temp\%world%.sql (
echo [- Archiving Existing World -]
ren "Tools\Temp\%world%.sql" "stygian_world-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No World Backup Found *** -]
)
echo [- Exporting World -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %world% > Tools\Temp\%world%.sql
echo.
pause
goto menu
REM ########################################################################################
REM [- 2 -]
REM ########################################################################################
:export_accounts
cls
cls
echo.
echo ###] .\TOOLS\TEMP DIRECTORY CONTENTS [##################################################
dir Tools\Temp /N /ON
echo.
echo ########################################################################################
echo.
set /P menu=Are you sure want to EXPORT ACCOUNTS/CHARACTERS? [Y/N]:
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto export_accounts_go)
:export_accounts_go
cls
echo.
if exist Tools\Temp\%login%.sql (
echo [- Archiving Existing Accounts -]
ren "Tools\Temp\%login%.sql" "stygian_auth-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No Account Backup Found *** -]
)
echo [- Exporting Accounts -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 %login% > Tools\Temp\%login%.sql
if exist Tools\Temp\%characters%.sql (
echo.
echo [- Archiving Existing Characters -]
ren "Tools\Temp\%characters%.sql" "stygian_characters-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No Character Backup Found *** -]
)
echo [- Exporting Characters -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 %characters% > Tools\Temp\%characters%.sql
pause
goto menu
REM ########################################################################################
REM [- 3 -]
REM ########################################################################################
:import_world
cls
echo.
IF EXIST Tools\SaveGameState\savestate-%world%.sql. (
SET action=sandbox_world
) ELSE (
SET action=saved_world
)
set /P menu=Are you sure want to RESTORE %action% DATABASE [Y/N]?
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto do_import_%action%)
:do_import_saved_world
cls
echo.
if exist Tools\Temp\stygian_world.sql. (
echo [- Importing World from Tools\Temp\%world%.sql -]
Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "DROP DATABASE %world%"
Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "CREATE DATABASE %world%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%world% < Tools\Temp\stygian_world.sql
echo.
pause
goto menu
) else (
echo [- *** ERROR - No World Backup Found *** -]
echo.
pause
goto menu
)
:do_import_sandbox_world
cls
echo.
if exist Tools\SaveGameState\savestate-stygian_world.sql. (
echo [- Resetting World -]
echo.
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %world%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %world%"
for %%i in (Tools\Temp\restore_azerothcore\01_default\db_world\*sql) do if %%i neq Tools\Temp\restore_azerothcore\01_default\db_world\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
echo.
pause
goto menu
) else (
echo [- *** ERROR - No World Save State Found *** -]
echo.
pause
goto menu
)
REM ########################################################################################
REM [- 4 -]
REM ########################################################################################
:import_accounts
cls
echo.
IF EXIST Tools\SaveGameState\savestate-%characters%.sql. (
SET action=sandbox_accounts
) ELSE (
SET action=saved_accounts
)
set /P menu=Are you sure want to RESTORE %action% DATABASE [Y/N]?
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto do_import_%action%)
:do_import_saved_accounts
cls
echo.
if exist Tools\Temp\stygian_characters.sql. (
echo [- Restoring Default Accounts -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %login%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %login%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_characters\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_characters\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Default Characters -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %characters%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %characters%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_auth\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_auth\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
pause
goto menu
) else (
echo [- *** ERROR - No Account Backup Found *** -]
echo.
pause
goto menu
)
:do_import_sandbox_accounts
cls
echo.
if exist Tools\Temp\restore_azerothcore\01_default\db_world\waypoints.sql. (
echo [- Reset Accounts -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %login%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %login%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_characters\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_characters\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Reset Characters -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %characters%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %characters%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_auth\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_auth\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
pause
goto menu
) else (
echo [- *** ERROR - FILE NOT FOUND *** -]
echo.
pause
goto menu
)
REM ########################################################################################
REM [- 5 -]
REM ########################################################################################
:restore_default_sc
cls
REM Check for restoration archive
IF NOT EXIST %CD%\Tools\restore_stygiancore.zip. (
echo [- *** No Default Restoration Archive Found *** -]
echo.
pause
goto menu
)
echo.
echo [-------------------]
echo [- !!! WARNING !!! -]
echo [-------------------]
echo.
echo This process will RESTORE the StygianCore databases which will
echo overwrite existing Accounts, Characters, and World database files
echo and the contents of any temporary restoration data in the Tools folder.
echo It will first build a new restoration archive from the Tools\Work
echo folder and then use it to restore the server.
echo.
echo.
set /P menu=Are you sure want to RESTORE STYGIANCORE DEFAULT DATABASES? [Y/N]:
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto restore_sc_prep)
:restore_sc_prep
cls
RD /S /Q "Tools\Temp\restore_stygiancore"
CD Tools\Work
CALL build_restore_stygiancore.bat
CD ..
CD ..
Tools\7Z x -y Tools\restore_stygiancore.zip -o.\Tools\Temp\
echo.
goto restore_default_sc
:restore_default_sc
echo.
echo [- Restoring Default Accounts -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %login%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %login%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_auth\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_auth\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Default Characters -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %characters%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %characters%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_characters\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_characters\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Default World -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %world%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %world%"
for %%i in (Tools\Temp\restore_stygiancore\01_default\db_world\*sql) do if %%i neq Tools\Temp\restore_stygiancore\01_default\db_world\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
REM -- UPDATES --
echo [- Restoring Updates Accounts -]
for %%i in (Tools\Temp\restore_stygiancore\02_update\db_auth\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\02_update\db_auth\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Updates Characters -]
for %%i in (Tools\Temp\restore_stygiancore\02_update\db_characters\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\02_update\db_characters\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Updates World -]
for %%i in (Tools\Temp\restore_stygiancore\02_update\db_world\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\02_update\db_world\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
REM -- CUSTOM --
echo [- Restoring Custom Accounts -]
for %%i in (Tools\Temp\restore_stygiancore\03_custom\db_auth\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\03_custom\db_auth\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Custom Characters -]
for %%i in (Tools\Temp\restore_stygiancore\03_custom\db_characters\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\03_custom\db_characters\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Custom World -]
for %%i in (Tools\Temp\restore_stygiancore\03_custom\db_world\*sql) do if %%i neq .\Tools\Temp\restore_stygiancore\03_custom\db_world\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
echo.
pause
goto menu
REM ########################################################################################
REM [- 6 -]
REM ########################################################################################
:restore_default_ac
cls
REM Check for restoration archive
IF NOT EXIST %CD%\Tools\restore_azerothcore.zip. (
echo [- *** No Default Restoration Archive Found *** -]
echo.
pause
goto menu
)
echo.
echo [-------------------]
echo [- !!! WARNING !!! -]
echo [-------------------]
echo.
echo You are about to enter Sandbox Mode
echo.
echo This process will RESTORE the default AzerothCore binaries and databases.
echo A backup of the current game state will be made before the restore begins.
echo.
echo.
set /P menu=Are you sure want to ENTER SANDBOX MODE? [Y/N]:
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto sandbox_mode)
:sandbox_mode
cls
echo.
if exist Tools\SaveGameState\savestate-%world%.sql (
echo [- Existing Save State Found - Exiting... -]
goto menu
) else (
IF EXIST %CD%\Tools\SaveGameState\NUL (
REM Folder Exists
) ELSE (
mkdir %CD%\Tools\SaveGameState
)
echo [- Saving Game State: Auth -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %login% > Tools\SaveGameState\savestate-%login%.sql
echo [- Saving Game State: Characters -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %characters% > Tools\SaveGameState\savestate-%characters%.sql
echo [- Saving Game State: World -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %world% > Tools\SaveGameState\savestate-%world%.sql
echo [- Saving Game State: Binaries -]
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
xcopy /y /q Server\Core\authserver.conf Tools\SaveGameState\
xcopy /y /q Server\Core\authserver.conf.dist Tools\SaveGameState\
xcopy /y /q Server\Core\worldserver.conf Tools\SaveGameState\
xcopy /y /q Server\Core\worldserver.conf.dist Tools\SaveGameState\
xcopy /y /q Server\Core\ace.dll Tools\SaveGameState\
xcopy /y /q Server\Core\authserver.exe Tools\SaveGameState\
xcopy /y /q Server\Core\worldserver.exe Tools\SaveGameState\
goto restore_default_ac
)
:restore_default_ac
RD /S /Q "Tools\Temp\restore_azerothcore"
CD Tools\Work
CALL build_restore_azerothcore.bat
CD ..
CD ..
Tools\7Z x -y Tools\restore_azerothcore.zip -o.\Tools\Temp\
echo.
echo [- Restoring Default Accounts -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %login%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %login%"
for %%i in (Tools\Temp\restore_azerothcore\01_default\db_auth\*sql) do if %%i neq Tools\Temp\restore_azerothcore\01_default\db_auth\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Default Characters -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %characters%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %characters%"
for %%i in (Tools\Temp\restore_azerothcore\01_default\db_characters\*sql) do if %%i neq Tools\Temp\restore_azerothcore\01_default\db_characters\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Default World -]
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "DROP DATABASE %world%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf -e "CREATE DATABASE %world%"
for %%i in (Tools\Temp\restore_azerothcore\01_default\db_world\*sql) do if %%i neq Tools\Temp\restore_azerothcore\01_default\db_world\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
REM -- UPDATES --
echo [- Restoring Updates Accounts -]
for %%i in (Tools\Temp\restore_azerothcore\02_update\db_auth\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\02_update\db_auth\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Updates Characters -]
for %%i in (Tools\Temp\restore_azerothcore\02_update\db_characters\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\02_update\db_characters\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Updates World -]
for %%i in (Tools\Temp\restore_azerothcore\02_update\db_world\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\02_update\db_world\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
REM -- CUSTOM --
echo [- Restoring Custom Accounts -]
for %%i in (Tools\Temp\restore_azerothcore\03_custom\db_auth\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\03_custom\db_auth\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%login% < %%i
echo [- Restoring Custom Characters -]
for %%i in (Tools\Temp\restore_azerothcore\03_custom\db_characters\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\03_custom\db_characters\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%characters% < %%i
echo [- Restoring Custom World -]
for %%i in (Tools\Temp\restore_azerothcore\03_custom\db_world\*sql) do if %%i neq .\Tools\Temp\restore_azerothcore\03_custom\db_world\*sql .\Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
echo [- Restoring Binaries -]
xcopy /y /q Tools\Temp\restore_azerothcore\00_core\worldserver.exe Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\00_core\authserver.exe Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\00_core\ace.dll Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\04_conf\authserver.conf Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\04_conf\authserver.conf.dist Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\04_conf\worldserver.conf Server\Core\
xcopy /y /q Tools\Temp\restore_azerothcore\04_conf\worldserver.conf.dist Server\Core\
pause
goto menu
REM ########################################################################################
REM [- 7 -]
REM ########################################################################################
:deploy
start start_deploy.bat
goto menu
REM ########################################################################################
REM [- 9 -]
REM ########################################################################################
:restore_savestate
cls
echo.
echo [------------------]
echo [- !!! NOTICE !!! -]
echo [------------------]
echo.
echo YOU ARE ABOUT TO EXIT SANDBOX MODE
echo.
echo This process will EXIT SANDBOX MODE and restore the previously saved
echo game state.
echo.
set /P menu=Are you sure want to EXIT SANDBOX MODE? [Y/N]:
if /i "%menu%"=="n" (goto menu)
if /i "%menu%"=="y" (goto restore_game)
:restore_game
IF EXIST %CD%\Tools\SaveGameState\savestate-%world%.sql (
goto restore_game_data
) ELSE (
echo [- *** ERROR - No Save State Found *** -]
pause
goto menu
)
:restore_game_data
cls
echo.
echo [- Importing Accounts from Tools\SaveGameState\savestate-%login%.sql -]
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "DROP DATABASE %login%"
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "CREATE DATABASE %login%"
%CD%\Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%login% < %CD%\Tools\SaveGameState\savestate-%login%.sql
echo [- Importing Characters from Tools\SaveGameState\savestate-%characters%.sql -]
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "DROP DATABASE %characters%"
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "CREATE DATABASE %characters%"
%CD%\Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%characters% < %CD%\Tools\SaveGameState\savestate-%characters%.sql
echo [- Importing World from Tools\SaveGameState\savestate-%world%.sql -]
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "DROP DATABASE %world%"
%CD%\Tools\mysql --defaults-extra-file=Server\MySQL\my.cnf -e "CREATE DATABASE %world%"
%CD%\Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%world% < %CD%\Tools\SaveGameState\savestate-%world%.sql
echo [- Restoring Binaries -]
xcopy /y /q Tools\SaveGameState\worldserver.exe Server\Core\
xcopy /y /q Tools\SaveGameState\authserver.exe Server\Core\
xcopy /y /q Tools\SaveGameState\ace.dll Server\Core\
xcopy /y /q Tools\SaveGameState\authserver.conf Server\Core\
xcopy /y /q Tools\SaveGameState\authserver.conf.dist Server\Core\
xcopy /y /q Tools\SaveGameState\worldserver.conf Server\Core\
xcopy /y /q Tools\SaveGameState\worldserver.conf.dist Server\Core\
echo [- Clean Up -]
RD /S /Q "Tools\SaveGameState"
IF EXIST %CD%\Tools\SaveGameState\savestate-%world%.sql (
echo [- *** ERROR - Restore Failed *** -]
pause
goto menu
) ELSE (
echo [- Restore Complete - Press Any Key To Restart World -]
pause
taskkill /F /FI "IMAGENAME eq worldserver.exe"
start Server\Core\worldserver.exe
goto menu
)
goto menu
exit
1
https://gitee.com/xfwg/StygianCore-Controls.git
git@gitee.com:xfwg/StygianCore-Controls.git
xfwg
StygianCore-Controls
StygianCore-Controls
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891