forked from StygianTheBest/StygianCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStygianCoreTools.bat
649 lines (544 loc) · 22.6 KB
/
StygianCoreTools.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
@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\Work\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 .. Work
echo ..[X] restore_stygiancore.zip - Required for server restore.
echo.
pause
exit
)
REM ########################################################################################
: initialize
REM // Version
set toolsrev=2019.03.11
set stygianrev=2019.03.11
set wowbuild=12340
REM // This is for launching the deploy batch file that automates debug and release testing
REM // This batch file should be placed in the AzerothCore Solution root folder
set solutiondir=..\Dev\StygianCore\StygianBuild
REM // Command
REM 1(Blue), 2(Green), 3(Cyan), 4(Red), 5(Purple), 6(Yellow), 7(LGray), 8(Gray)
COLOR 2F
MODE con:cols=89 lines=45
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 // Model Mall
set modelmax=640
set modelstart=18600
REM // Try to turn on the lights
cls
goto init
:init
REM // Create needed folders
IF EXIST %CD%\Tools\Temp\NUL (
goto mysql
) ELSE (
mkdir %CD%\Tools\Temp
goto mysql
)
IF EXIST %CD%\Server\Core\logs\NUL (
goto mysql
) ELSE (
mkdir %CD%\Server\Core\logs
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.
echo ### IMPORT/EXPORT ######################################################################
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 Tools\Temp\%world%.sql. (
echo [ 3 ] - Import World
)
IF EXIST Tools\Temp\%login%.sql. (
echo [ 4 ] - Import Accounts/Characters
)
)
echo.
echo ### RESTORE SERVER #####################################################################
echo.
IF EXIST %CD%\Tools\Work\restore_stygiancore.zip. (
echo [ 5 ] - Restore Server: StygianCore [%stygianrev% Release]
)
)
echo.
echo ### TOOLS ##############################################################################
echo [ 6 ] - Start Server
echo [ 7 ] - NPC Model Tools
IF EXIST %solutiondir%\UpdateDeploy.bat. (
echo [ 8 ] - Deploy Visual Studio Builds
)
echo [ 9 ] - Update MySQL Configuration
echo.
echo ########################################################################################
echo # Tools v%toolsrev% #
echo.
set /P menu=%host% @ %port%:
if "%menu%"=="0" (goto patch_core)
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 start_server)
if "%menu%"=="7" (goto model_tools)
if "%menu%"=="8" (goto deploy)
if "%menu%"=="9" (goto start)
if "%menu%"=="" (goto menu)
REM ########################################################################################
REM [- 0 -]
REM ########################################################################################
:patch_core
cls
echo.
IF EXIST Tools\Temp\PatchCore\patch_core_ready.txt. (
CLS
echo.
echo [-------------------]
echo [- # CORE PATCH # -]
echo [-------------------]
echo.
echo This process will patch StygianCore to the latest revision. If you
echo are seeing this, the required patch files are in the correct folder
echo and are ready to deploy. Your current binaries and world database
echo will be backed up automatically to the Tools\PatchBackup folder
echo before the patch process begins.
echo -------------------------------------------------------------------
echo.
set /P menu=Are you sure want to install the CORE PATCH? [Y/N]:
if /I "%menu%"=="n" (goto menu)
if /I "%menu%"=="y" (goto patch_backup)
) else (
echo.
echo [- *** Invalid Core Patch Installation.. Exiting *** -]
echo.
pause
goto menu
)
:patch_backup
echo.
REM Create Patch Folder
IF EXIST %CD%\Tools\PatchBackup\NUL (
REM Folder Exists
) ELSE (
mkdir Tools\PatchBackup
mkdir Tools\PatchBackup\DB
mkdir Tools\PatchBackuP\Core
)
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
CLS
echo.
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\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. (
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\
) ELSE (
IF EXIST Tools\Work\restore_stygiancore.zip. (
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 AND DATA MISSING! CAN'T BACKUP! -]
)
)
echo.
echo [- Patching 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 [- 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
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" "%world%-%date:~10,4%%date:~4,2%%date:~7,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
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" "%login%-%date:~10,4%%date:~4,2%%date:~7,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" "%characters%-%date:~10,4%%date:~4,2%%date:~7,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
echo.
pause
goto menu
REM ########################################################################################
REM [- 3 -]
REM ########################################################################################
:import_world
cls
echo.
set /P menu=Are you sure want to IMPORT THE WORLD DATABASE? [Y/N]
if /I "%menu%"=="n" (goto menu)
if /I "%menu%"=="y" (goto do_import_saved_world)
:do_import_saved_world
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
CLS
echo.
if exist Tools\Temp\%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\%world%.sql
echo.
echo [- *** WORLD IMPORT COMPLETE - RESTART SERVER *** -]
echo.
pause
goto menu
) else (
echo [- *** ERROR - No World Backup Found *** -]
echo.
pause
goto menu
)
REM ########################################################################################
REM [- 4 -]
REM ########################################################################################
:import_accounts
cls
echo.
set /P menu=Are you sure want to RESTORE THE ACCOUNT/CHARACTERS DATABASE? [Y/N]
if /I "%menu%"=="n" (goto menu)
if /I "%menu%"=="y" (goto do_import_saved_accounts)
:do_import_saved_accounts
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
CLS
echo.
if exist Tools\Temp\%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%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%login% < Tools\Temp\%login%.sql
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%"
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%characters% < Tools\Temp\%characters%.sql
echo.
echo [- *** ACCOUNT/CHARACTER IMPORT COMPLETE - RESTART SERVER *** -]
echo.
pause
goto menu
) else (
echo [- *** ERROR - No Account/Character Backup Found *** -]
echo.
pause
goto menu
)
REM ########################################################################################
REM [- 5 -]
REM ########################################################################################
:restore_default_sc
cls
REM Check for restoration archive
IF NOT EXIST %CD%\Tools\Work\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
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
RD /S /Q "Tools\Temp\restore_stygiancore"
CLS
CD Tools\Work
CALL build_restore_stygiancore.bat
CD ..
CD ..
Tools\7Z x -y Tools\Work\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.
echo [- *** SERVER RESTORE COMPLETE - RESTART SERVER *** -]
echo.
pause
goto start_server
pause
goto menu
REM ########################################################################################
REM [- 6 -]
REM ########################################################################################
:start_server
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
CLS
START start_auth.bat
START start_world.bat
goto menu
REM ########################################################################################
REM [- 7-]
REM ########################################################################################
:model_tools
CLS
CLS
echo.
echo [-------------------]
echo [- # CORE PATCH # -]
echo [-------------------]
echo.
echo ########################################################################################
echo This process will randomize the NPC models on GM Island and set
echo the models and range for the models on Programmer Isle. This process
echo is useful for previewing many different NPC models at once in addition
echo to changing things up a bit on GM Island.
echo.
echo ** WARNING: This process will stop and restart the Auth and Worldserver **
echo ########################################################################################
echo.
set /P menu=Are you sure want to Randomize NPC Models? [Y/N]:
if /I "%menu%"=="n" (goto menu)
if /I "%menu%"=="y" (goto gorandom)
:gorandom
REM Shutdown Server Processes
taskkill /F /FI "IMAGENAME eq worldserver.exe"
taskkill /F /FI "IMAGENAME eq authserver.exe"
cls
echo.
echo [- Set Model Mall Parameters -]
echo.
set /P modelmax=Max Models (Default: 640) [%modelmax%]:
set /P modelstart=Start Model (Range: 13 .. 37,254) [%modelstart%]:
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%world% --execute="CALL UpdateModelRange(%modelmax%, %modelstart%)"
echo.
echo [- Generating Model Mall -]
echo.
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%world% --execute="CALL ModelMall()"
echo [- Randomizing GM Island NPC Models -]
echo.
Tools\mysql.exe --defaults-extra-file=Server/MySQL/my.cnf --default-character-set=utf8 --database=%world% < Tools\Work\restore_stygiancore\03_custom\db_world\npc_gm_island_mall_rand.sql
echo [- NPC Models Updated :: DELETE THE WOW CLIENT CACHE! -]
echo.
pause
rem start start_auth.bat
rem start start_world.bat
goto menu
REM ########################################################################################
REM [- 8 -]
REM ########################################################################################
:deploy
start start_deploy.bat
goto menu
REM ########################################################################################
REM [- 9 -]
REM ########################################################################################
REM :setup