Skip to content

Commit

Permalink
Tools Update
Browse files Browse the repository at this point in the history
  • Loading branch information
StygianTheBest committed Mar 6, 2019
1 parent 233d360 commit 3bf4ee5
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 54 deletions.
71 changes: 50 additions & 21 deletions StygianCoreTools.bat
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ echo \/__/ \_/__/ http://stygianthebest.github.
echo.
echo.
echo ### IMPORT/EXPORT ######################################################################
IF EXIST %CD%\Tools\Temp\PatchCore\patch_core_ready.txt. (
IF EXIST Tools\Temp\PatchCore\patch_core_ready.txt. (
echo [ 0 ] - Patch Core: StygianCore %stygianrev% Release
)
echo [ 1 ] - Export World
echo [ 2 ] - Export Accounts/Characters
IF EXIST %CD%\Tools\Temp\%world%.sql. (
IF EXIST Tools\Temp\%world%.sql. (
echo [ 3 ] - Import World
)
IF EXIST %CD%\Tools\Temp\%login%.sql. (
IF EXIST Tools\Temp\%login%.sql. (
echo [ 4 ] - Import Accounts/Characters
)
)
Expand Down Expand Up @@ -220,7 +220,9 @@ REM Create Patch Folder
IF EXIST %CD%\Tools\PatchBackup\NUL (
REM Folder Exists
) ELSE (
mkdir %CD%\Tools\PatchBackup
mkdir Tools\PatchBackup
mkdir Tools\PatchBackup\DB
mkdir Tools\PatchBackuP\Core
)

REM Shutdown Server Processes
Expand All @@ -229,50 +231,77 @@ taskkill /F /FI "IMAGENAME eq authserver.exe"
CLS

echo.
echo [- Backing Up Current Core To Tools\PatchBackup -]
xcopy /y /q Server\Core\* Tools\PatchBackup\
echo [- Backing Up Current Core To Tools\PatchBackup\Core -]
xcopy /y /q Server\Core\* Tools\PatchBackup\Core\

echo.
echo [- Backing Up Current World To Tools\PatchBackup -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %world% > Tools\PatchBackup\%world%.sql
echo [- Backing Up Current World To Tools\PatchBackup\DB -]
Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf %world% > Tools\PatchBackup\DB\%world%.sql

echo.
echo [- Backup Restoration Archive With Existing Restoration Files -]
IF EXIST Tools\Work\restore_stygiancore\01_default\db_world\creature.sql. (
echo [- Building Backup Restoration Archive To Tools\PatchBackup -]
rem echo [- Building Backup Restoration Archive To Tools\PatchBackup -]
CD Tools\Work
CALL build_restore_stygiancore.bat
CD ..
CD ..
xcopy /y /q Tools\Work\restore_stygiancore.zip Tools\PatchBackup\
xcopy /y /q Tools\Work\restore_stygiancore.zip Tools\PatchBackup\
) ELSE (
IF EXIST Tools\Work\restore_stygiancore.zip. (
echo [- WARNING!!! RESTORATION ARCHIVE DATA CORRUPT! CAN'T REBUILD! COPYING EXISTING ARCHIVE! -]
echo.
echo [- WARNING!!! RESTORATION DATA CORRUPT! CAN'T REBUILD! COPYING EXISTING ARCHIVE! -]
xcopy /y /q Tools\Work\restore_stygiancore.zip Tools\PatchBackup\
) ELSE (
echo [- WARNING!!! RESTORATION ARCHIVE DATA CORRUPT! CAN'T BACKUP! -]
echo [- WARNING!!! RESTORATION ARCHIVE AND DATA MISSING! CAN'T BACKUP! -]
)
)

echo.
echo [- Patching Core -]
xcopy /y /q Tools\Temp\PatchCore\*.dll Server\Core\
xcopy /y /q Tools\Temp\PatchCore\*.exe Server\Core\
xcopy /y /q Tools\Temp\PatchCore\*.dist Server\Core\
xcopy /y /q Tools\Temp\PatchCore\Server\Core\*.dll Server\Core\
xcopy /y /q Tools\Temp\PatchCore\Server\Core\*.exe Server\Core\
xcopy /y /q Tools\Temp\PatchCore\Server\Core\*.dist Server\Core\

REM IF a world update exists...
IF EXIST Tools\Temp\PatchCore\DB\stygiancore_worldupdate.sql. (
echo.
echo [- Patching 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\PatchCore\*sql) do if %%i neq Tools\Temp\PatchCore\*sql Tools\mysql --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 -f --database=%world% < %%i
) ELSE (
echo.
echo [- No World Updates Found -]
)

echo.
echo [- Patching Restoration Archive -]
RD /S /Q "Tools\Work\restore_stygiancore"
Tools\7Z x -y Tools\Temp\PatchCore\restore_stygiancore.zip -o.\Tools\Work\
echo [- Pulling Restoration Archive Data -]
xcopy /y /s /q Tools\Work\restore_stygiancore\*.* Tools\Temp\PatchCore\restore_stygiancore\

echo [- Updating db_auth -]
rem xcopy /y /q Tools\Temp\PatchCore\Tools\Work\restore_stygiancore\db_auth\*.sql Tools\Temp\PatchCore\restore_stygiancore\03_custom\db_auth\

echo [- Updating db_character -]
rem xcopy /y /q Tools\Temp\PatchCore\Tools\Work\restore_stygiancore\db_characters\*.sql Tools\Temp\PatchCore\restore_stygiancore\03_custom\db_characters\

echo [- Updating db_world -]
xcopy /y /q Tools\Temp\PatchCore\Tools\Work\restore_stygiancore\03_custom\db_world\*.sql Tools\Temp\PatchCore\restore_stygiancore\03_custom\db_world\

echo [- Updating 04_conf -]
xcopy /y /q Tools\Temp\PatchCore\Tools\Work\restore_stygiancore\04_conf\*.dist Tools\Temp\PatchCore\restore_stygiancore\04_conf\

echo [- Pushing Restoration Archive Data -]
xcopy /y /s /q Tools\Temp\PatchCore\restore_stygiancore\*.* Tools\Work\restore_stygiancore\

echo.
echo [- Cleaning Up -]
RD /S /Q "Tools\Temp\PatchCore"

echo.
echo [- Patch Complete -]
echo.

pause
goto menu

Expand All @@ -298,7 +327,7 @@ cls
echo.
if exist Tools\Temp\%world%.sql (
echo [- Archiving Existing World -]
ren "Tools\Temp\%world%.sql" "%world%-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
ren "Tools\Temp\%world%.sql" "%world%-%date:~10,4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No World Backup Found *** -]
)
Expand Down Expand Up @@ -330,7 +359,7 @@ cls
echo.
if exist Tools\Temp\%login%.sql (
echo [- Archiving Existing Accounts -]
ren "Tools\Temp\%login%.sql" "%login%-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
ren "Tools\Temp\%login%.sql" "%login%-%date:~10,4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No Account Backup Found *** -]
)
Expand All @@ -340,7 +369,7 @@ Tools\mysqldump.exe --defaults-extra-file=Server/MySQL/my.cnf --default-characte
if exist Tools\Temp\%characters%.sql (
echo.
echo [- Archiving Existing Characters -]
ren "Tools\Temp\%characters%.sql" "%characters%-%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%.sql"
ren "Tools\Temp\%characters%.sql" "%characters%-%date:~10,4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%.sql"
) else (
REM echo [- *** No Character Backup Found *** -]
)
Expand Down
44 changes: 27 additions & 17 deletions Tools/Patch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,51 @@

#### <p align="center"> A World of Warcraft 3.3.5a Solo/LAN repack by StygianTheBest | [GitHub](https://github.com/StygianTheBest) | [Website](http://stygianthebest.github.io)</p>

# How to update the StygianCore Repack
# StygianCore Repack Update

### Welcome to StygianCore. This update will upgrade the server binaries, module config files, world database, and restoration archive to the latest release.
> #### When a patch is released the entire repack is updated within _72 hours_, so re-downloading the repack from the [StygianCore Project](#) page at that time will also include any changes introduced in this patch.
### 1) Download the Repack Update
## 1) Download the Patch

- [Download Repack Update](#)
- **start_corepatch.bat** - The tool for preparing the patch archive for install.
- **StygianCorePatch_Revision_XXXX_XX_XX.zip** - The core patch archive.
- [Mirror 1 (MEGA)](https://rebrand.ly/stygiancorepatch_mega) - StygianCore Patch v2019.03.05

### 2) Prepare the Update
## 1) Prepare the Update

- Copy the downloaded files to the StygianCore root folder.
- Run the start_corepatch.bat file.
#### Patch updates will upgrade server binaries, databases, module config files, and the restoration archive as needed.

### 3) Upgrade the World
- Copy the downloaded patch file, **_StygianCore_Revision_XXXX_XX_XX.zip_**, to the StygianCore root folder.
- Run the **_start_corepatch.bat_** file.

## 2) Upgrade the World

- Once the patch has been prepared for install, it will launch StygianCoreTools.
- A **[0] Patch Core** menu option should be visible. Choose this to start the update process.
- This will backup the contents of your **Server\Core** folder and your World database to the **Tools\PatchBackup** folder.
- The update process will backup the following to the **Tools\PatchBackup** folder before applying the update:
- **stygian_world** database
- **Server\Core** folder contents
- **restore_stygiancore** folder contents and archive
- Once the backup is complete, it will patch your core with the updates.
- **This update will not affect any existing accounts, players, mail, or other player data.**
- Once complete, you should be able to launch the server via the launcher or batch files.
- You can safely delete the **StygianCore_Revision_XXXX_XX_XX.zip**.
- **DO NOT DELETE** the **start_corepatch.bat** as it will be used for future updates.
- Once complete, you should be able to restart the server via the launcher or batch files.
- You can delete the **StygianCore_Revision_XXXX_XX_XX.zip** in the repack root folder.

## Changelog

- **v2019.03.05**
- Fixed an issue with Custom Login Abilities being unlearned on logoff
- All abilities are now configurable in the Custom Login module's config file
- Learning Town Portals is now a configurable option
- Fixed an NPC dialogue typo

### Notes
## Notes

- The **[5] Restore StygianCore** option in StygianCoreTools will now use the updated restoration archive.

### Bugs or problems?
## Bugs or problems?

Please [submit a bug report on Github](https://github.com/StygianTheBest/StygianCore) and I'll take a look when time permits.

### Have fun!
## Have fun!
_- StygianTheBest_


Expand Down
19 changes: 3 additions & 16 deletions start_corepatch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ REM
REM ########################################################################################

REM 1(Blue), 2(Green), 3(Cyan), 4(Red), 5(Purple), 6(Yellow), 7(LGray), 8(Gray)
COLOR 8F
COLOR 4F
SET NAME=StygianCore Patch Utility
TITLE %NAME%

CLS

IF EXIST %CD%\StygianCore_Revision*. (
IF EXIST StygianCore_Revision*. (
echo.
echo [-------------------]
echo [- # CORE PATCH # -]
Expand Down Expand Up @@ -59,24 +59,11 @@ echo.
echo [- Preparing Patch Archive -]
echo.

REM Create Patch Folder
IF EXIST %CD%\Tools\Temp\PatchCore\NUL (
REM Folder Exists
) ELSE (
mkdir %CD%\Tools\Temp\PatchCore
)

REM Clear Temp\PatchCore
RD /S /Q "Tools\Temp\PatchCore"

REM Unzip Patch Archive
Tools\7Z x -y StygianCore_Revision_*.* -o.\Tools\Temp\PatchCore\
Tools\7Z x -y Tools\Temp\PatchCore\StygianCorePatch.zip -o.\Tools\Temp\PatchCore\

REM Upgrade StygianCoreTools.bat
xcopy /y /q Tools\Temp\PatchCore\StygianCoreTools.bat

Call StygianCoreTools.bat
exit


exit

0 comments on commit 3bf4ee5

Please sign in to comment.