forked from Spafbi/simplified-miscreated-server-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_server.cmd
638 lines (496 loc) · 18.5 KB
/
start_server.cmd
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
@echo OFF
chcp 65001>nul
setlocal EnableDelayedExpansion
REM - This grabs and parses the directory in which this CMD file exists.
set BASEPATH=%~dp0
set BASEPATH=%BASEPATH:~0,-1%
set MAP=islands
goto main
:basescfg
set HOSTINGFILE=%SERVERDIR%\hosting.cfg
if not exist "%HOSTINGFILE%" (
echo g_gameRules_bases=^%BUILDRULE%>"%HOSTINGFILE%"
) else (
copy /v /y "%HOSTINGFILE%" "%SERVERDIR%\hosting.cfg.bak" >nul
powershell -Command "Write-Output (get-content '%HOSTINGFILE%' | select-string -pattern 'g_gameRules_bases').length">"%VARIABLESDIR%\temp.txt"
echo .>nul
set /p PSCOUNT=<"%VARIABLESDIR%\temp.txt"
del "%VARIABLESDIR%\temp.txt"
if "!PSCOUNT!" == "0" (
echo g_gameRules_bases=^%BUILDRULE%>>"%HOSTINGFILE%"
) else (
powershell -Command "& { Get-Content '%HOSTINGFILE%' | Foreach-Object {$_ -replace 'g_gameRules_bases=\w*', 'g_gameRules_bases=%BUILDRULE%'} | Set-Content '%HOSTINGFILE%.new';}"
echo .>nul
move /y "%HOSTINGFILE%.new" "%HOSTINGFILE%" >nul
)
)
goto :eof
:cleanmods
if exist "%MODSDIR%" (
echo [1m[33mCleaning up mods directory[0m ^(this ensures mods are current^)
echo [1m[33m removing directory:[0m %MODSDIR%
rmdir /s /q "%MODSDIR%"
)
goto :eof
:createlocaljoin
echo [1m[33mCreating join_local_server.cmd script[0m
echo ^@echo off > join_local_server.cmd
echo explorer steam://run/299740/connect/+connect 127.0.0.1 %GAMEPORTA% >> join_local_server.cmd
goto :eof
:createmanualremoveupnpscript
echo [1m[33mCreating firewall UPnP settings manual removal script[0m
@echo off
echo @echo off> remove_upnp.cmd
echo echo ### UPnP BEFORE ###>> remove_upnp.cmd
echo upnpc\upnpc-shared.exe -L>> remove_upnp.cmd
echo echo Removing RCON mapping...>> remove_upnp.cmd
echo upnpc\upnpc-shared.exe -N %RCONPORT% %RCONPORT% TCP>> remove_upnp.cmd
echo echo Removing Miscreated UDP port mappings...>> remove_upnp.cmd
echo upnpc\upnpc-shared.exe -N %GAMEPORTA% %GAMEPORTD% UDP>> remove_upnp.cmd
echo echo ### UPnP AFTER ###>> remove_upnp.cmd
echo upnpc\upnpc-shared.exe -L>> remove_upnp.cmd
echo pause>> remove_upnp.cmd
goto :eof
:getsqlite3
echo [1m[33mDownloading SQLite3 binaries[0m
set SQLITELIBZIP=%BASEPATH%\sqlite-dll-win32-x86-3280000.zip
set SQLITEBINZIP=%BASEPATH%\sqlite-tools-win32-x86-3280000.zip
curl -L https://sqlite.org/2019/sqlite-dll-win32-x86-3280000.zip -o "%SQLITELIBZIP%"
curl -L https://sqlite.org/2019/sqlite-tools-win32-x86-3280000.zip -o "%SQLITEBINZIP%"
powershell Expand-Archive -LiteralPath '%SQLITELIBZIP%' -DestinationPath '%SQLITEPATH%'
powershell Expand-Archive -LiteralPath '%SQLITEBINZIP%' -DestinationPath '%SQLITEPATH%'
echo Moving downloaded executables...
move "%SQLITEPATH%\sqlite-tools-win32-x86-3280000\*.*" "%SQLITEPATH%\"
rmdir "%SQLITEPATH%\sqlite-tools-win32-x86-3280000"
echo Removing downloaded zip files...
del /q *.zip
goto :eof
:getsteamcmd
echo [1m[33mDownloading steamcmd binaries[0m
set STEAMARCHIVE=%BASEPATH%\steamcmd.zip
echo curl -L https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -o "%STEAMARCHIVE%"
curl -L https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -o "%STEAMARCHIVE%"
powershell Expand-Archive -LiteralPath '%STEAMARCHIVE%' -DestinationPath '%STEAMCMDPATH%'
echo Removing downloaded zip files...
del /q *.zip
goto :eof
:getupnphelper
echo [1m[33mGrabbing the UPnP helper[0m
set UPNPCARCHIVE=%BASEPATH%\upnpc-exe-win32-20150918.zip
curl -L http://miniupnp.tuxfamily.org/files/download.php?file=upnpc-exe-win32-20150918.zip -o "%UPNPCARCHIVE%"
powershell Expand-Archive -LiteralPath '%UPNPCARCHIVE%' -DestinationPath '%UNPNCHELPER%'
echo Removing downloaded zip files...
del /q *.zip
goto :eof
:grantallguides
echo [1m[33mGranting crafting guides to all players[0m
echo DROP TRIGGER IF EXISTS grant_all_guides;|"%SQLITEBIN%" "%SERVERDIR%\miscreated.db"
echo CREATE TRIGGER IF NOT EXISTS grant_all_guides AFTER INSERT ON ServerAccountData BEGIN UPDATE ServerAccountData SET Guide00=2147483647 WHERE ServerAccountDataID=NEW.ServerAccountDataID; END; UPDATE ServerAccountData SET Guide00=2147483647;|"%SQLITEBIN%" "%SERVERDIR%\miscreated.db"
goto :eof
:passwordcfg
set HOSTINGFILE=%SERVERDIR%\hosting.cfg
if not exist "%HOSTINGFILE%" (
echo http_password=%RCONPASS%>>"%HOSTINGFILE%"
) else (
copy /v /y "%HOSTINGFILE%" "%SERVERDIR%\hosting.cfg.bak" >nul
powershell -Command "Write-Output (get-content '%HOSTINGFILE%' | select-string -pattern 'http_password').length">"%VARIABLESDIR%\temp.txt"
echo .>nul
set /p PSCOUNT=<"%VARIABLESDIR%\temp.txt"
del "%VARIABLESDIR%\temp.txt"
if "!PSCOUNT!" == "0" (
echo http_password=%RCONPASS%>>"%HOSTINGFILE%"
) else (
powershell -Command "& { Get-Content '%HOSTINGFILE%' | Foreach-Object {$_ -replace 'http_password=\w*', 'http_password=%RCONPASS%'} | Set-Content '%HOSTINGFILE%.new';}"
echo .>nul
move /y "%HOSTINGFILE%.new" "%HOSTINGFILE%" >nul
)
)
goto :eof
:printconfig
echo.
echo.
echo ══════════════════════════════════════════════════════════════════════════════
echo The servername will be: [1m[36m%SERVERNAME%[0m
echo The maximum number of players will be: [1m[36m%MAXPLAYERS%[0m
echo The base game server port will be: [1m[36m%GAMEPORTA%[0m
echo.
echo [1m[31mNOTICE:[0m Your RCON port is: [1m[36m%RCONPORT%[0m
echo.
if /I "%GRANTGUIDES%"=="y" (
echo ► Guides [1m[33mwill be granted[0m to all players
) else if /I "%GRANTGUIDES%"=="n" (
echo ► Guides [1m[33mwill not be granted[0m to all players
)
if /I "%BUILDRULE%"=="0" (
echo ► Base building is [1m[33mdisabled[0m
) else if /I "%BUILDRULE%"=="1" (
echo ► Base building is [1m[33menabled[0m[1m[33m: [0[36mdefault rules[0m
) else if /I "%BUILDRULE%"=="2" (
echo ► Base building is [1m[33menabled[0m[1m[33m: [0[36mbuild-anywhere[0m
)
if /I "%ENABLEUPNP%"=="y" (
echo ► Firewall ports [1m[33mwill be forwarded[0m
) else if /I "%ENABLEUPNP%"=="n" (
echo ► Firewall ports [1m[33mwill not be automatically forwarded[0m
)
if /I "%WHITELISTED%"=="y" (
echo ► The server [1m[33mwill be whitelisted[0m
echo ► You will need to add your Steam64ID to the whitelist before joining the server
) else (
echo ► The server [1m[33mwill not be whitelisted[0m
)
echo ══════════════════════════════════════════════════════════════════════════════
echo.
echo.
goto :eof
:removegrantallguides
echo [1m[33mRemoving grant_all_guides database trigger[0m
echo DROP TRIGGER IF EXISTS grant_all_guides;|"%SQLITEBIN%" "%SERVERDIR%\miscreated.db"
goto :eof
:removeupnp
echo [1m[33mRemoving firewall UPnP entries[0m
"%UNPNCHELPER%\upnpc-shared.exe" -N %RCONPORT% %RCONPORT% TCP >nul
"%UNPNCHELPER%\upnpc-shared.exe" -N %GAMEPORTA% %GAMEPORTD% UDP >nul
goto :eof
:servernamecfg
set HOSTINGFILE=%SERVERDIR%\hosting.cfg
if not exist "%HOSTINGFILE%" (
echo sv_servername=%SERVERNAME%>>"%HOSTINGFILE%"
) else (
copy /v /y "%HOSTINGFILE%" "%SERVERDIR%\hosting.cfg.bak" >nul
powershell -Command "Write-Output (get-content '%HOSTINGFILE%' | select-string -pattern 'sv_servername').length">"%VARIABLESDIR%\temp.txt"
echo .>nul
set /p PSCOUNT=<"%VARIABLESDIR%\temp.txt"
del "%VARIABLESDIR%\temp.txt"
if "!PSCOUNT!" == "0" (
echo sv_servername=%SERVERNAME%>>"%HOSTINGFILE%"
) else (
powershell -Command "& { Get-Content '%HOSTINGFILE%' | Foreach-Object {$_ -replace 'sv_servername=.+', 'sv_servername=%SERVERNAME%'} | Set-Content '%HOSTINGFILE%.new';}"
echo .>nul
move /y "%HOSTINGFILE%.new" "%HOSTINGFILE%" >nul
)
)
goto :eof
:setbaseport
echo [1m[33mLoading base server port setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\baseport.txt" (
set /p GAMEPORTA=<"%VARIABLESDIR%\baseport.txt"
set SPACER=0
) else (
echo The Miscreated server runs at a base port of 64090, and uses up to the next
echo four ports. Unless you are running multiple servers it is advised you leave
echo the base port set to 64090.
echo.
echo If you are running multiple servers on the same network only then will you
echo want to change this value from the default. Valid base ports are from 1024
echo through 65531. Press enter to use the default port value.
echo.
set /p GAMEPORTA="Enter the base server port [64090]: " || set GAMEPORTA=64090
)
SET "var="&for /f "delims=0123456789" %%i in ("%GAMEPORTA%") do set var=%%i
if defined var (
echo.
echo Enter only numeric values.
if exist "%VARIABLESDIR%\baseport.txt" (del "%VARIABLESDIR%\baseport.txt")
goto setbaseport
)
if %GAMEPORTA% lss 1024 (
echo.
echo The entered value must be greater than 1024.
if exist "%VARIABLESDIR%\baseport.txt" (del "%VARIABLESDIR%\baseport.txt")
goto setbaseport
)
if %GAMEPORTA% gtr 65531 (
echo.
echo The entered value must be no more than 65531
if exist "%VARIABLESDIR%\baseport.txt" (del "%VARIABLESDIR%\baseport.txt")
goto setbaseport
)
echo ^%GAMEPORTA%>"%VARIABLESDIR%\baseport.txt"
set /A GAMEPORTB=%GAMEPORTA%+1
set /A GAMEPORTC=%GAMEPORTA%+2
set /A GAMEPORTD=%GAMEPORTA%+3
set /A RCONPORT=%GAMEPORTA%+4
if "%SPACER%" == "1" echo.
goto :eof
:setbuildrule
echo [1m[33mLoading building rule setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\buildrule.txt" (
set /p BUILDRULE=<"%VARIABLESDIR%\buildrule.txt"
set SPACER=0
) else (
echo Base building rule:
echo 0 = disable bases.
echo 1 = normal ^(official^) building
echo 2 = build-anywhere
echo WARNING: Build-anywhere is not an officially supported option. Use
echo of this option may result in unpredictable base building
echo issues.
set /p BUILDRULE="Enter the desired build rule [0-2, default=1]: " || set BUILDRULE=1
)
SET "var="&for /f "delims=012" %%i in ("%BUILDRULE%") do set var=%%i
if defined var (
echo.
echo Enter a value from 0-2.
if exist "%VARIABLESDIR%\buildrule.txt" del "%VARIABLESDIR%\buildrule.txt"
goto setbuildrule
)
echo ^%BUILDRULE%>"%VARIABLESDIR%\buildrule.txt"
if "%SPACER%" == "1" echo.
goto :eof
:setfirewall
echo [1m[33mLoading firewall setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\enableupnp.txt" (
set /p ENABLEUPNP=<"%VARIABLESDIR%\enableupnp.txt"
set SPACER=0
) else (
echo To allow your server to be found in the game server browser you need to open
echo firewall ports. Would like for firewall ports to be automatically forwarded?
echo Enter Y for yes, N for no.
set /p ENABLEUPNP="Enable UPnP [Y/N, default Y]: " || set ENABLEUPNP=y
)
if /I "%ENABLEUPNP%"=="y" (
echo ^%ENABLEUPNP%>"%VARIABLESDIR%\enableupnp.txt"
) else if /I "%ENABLEUPNP%"=="n" (
echo ^%ENABLEUPNP%>"%VARIABLESDIR%\enableupnp.txt"
) else (
echo.
echo Please enter Y for yes, or N for no.
echo.
if exist "%VARIABLESDIR%\enableupnp.txt" del "%VARIABLESDIR%\enableupnp.txt"
goto setfirewall
)
if "%SPACER%" == "1" echo.
goto :eof
:setgiveallguides
echo [1m[33mLoading grant guides setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\grantguides.txt" (
set /p GRANTGUIDES=<"%VARIABLESDIR%\grantguides.txt"
set SPACER=0
) else (
echo Would you like to grant all crafting guides to players? Players may need
echo to exit and rejoin to see all crafting options.
echo Enter Y for yes, N for no.
set /p GRANTGUIDES="Grant guides to new players [Y/N, default N]: " || set GRANTGUIDES=N
)
if /I "%GRANTGUIDES%"=="y" (
echo ^%GRANTGUIDES%>"%VARIABLESDIR%\grantguides.txt"
) else if /I "%GRANTGUIDES%"=="n" (
echo ^%GRANTGUIDES%>"%VARIABLESDIR%\grantguides.txt"
) else (
echo.
echo Please enter Y for yes, or N for no.
echo.
goto setgiveallguides
)
if "%SPACER%" == "1" echo.
goto :eof
:setmaxplayers
echo [1m[33mLoading max players setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\maxplayers.txt" (
set /p MAXPLAYERS=<"%VARIABLESDIR%\maxplayers.txt"
set SPACER=0
) else (
set /p MAXPLAYERS="Enter the maximum number of players [1-50, default 36]: " || set MAXPLAYERS=36
)
SET "var="&for /f "delims=0123456789" %%i in ("%MAXPLAYERS%") do set var=%%i
if defined var (
echo.
echo Enter only numeric values.
goto setmaxplayers
)
if %MAXPLAYERS% lss 1 (
echo.
echo The entered value must be greater than zero.
if exist "%VARIABLESDIR%\maxplayers.txt" del "%VARIABLESDIR%\maxplayers.txt"
goto setmaxplayers
)
if %MAXPLAYERS% gtr 50 (
echo.
echo The entered value must be no more than 50
if exist "%VARIABLESDIR%\maxplayers.txt" del "%VARIABLESDIR%\maxplayers.txt"
goto setmaxplayers
)
echo ^%MAXPLAYERS%>"%VARIABLESDIR%\maxplayers.txt"
if "%SPACER%" == "1" echo.
goto :eof
:setrconpassword
echo [1m[33mLoading password setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\rcon_password.txt" (
set /p RCONPASS=<"%VARIABLESDIR%\rcon_password.txt"
set SPACER=0
) else (
echo Enter the password you would like to use with your server's RCON
set /p RCONPASS="Password: " || set RCONPASS=DONTJUSTPRESSENTER
)
if "%RCONPASS%"=="DONTJUSTPRESSENTER" (
echo.
echo You must enter a password.
if exist "%VARIABLESDIR%\rcon_password.txt" del "%VARIABLESDIR%\rcon_password.txt"
goto setrconpassword
)
echo ^%RCONPASS%>"%VARIABLESDIR%\rcon_password.txt"
if "%SPACER%" == "1" echo.
goto :eof
:setservername
echo [1m[33mLoading server name setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\server_name.txt" (
set /p SERVERNAME=<"%VARIABLESDIR%\server_name.txt"
set SPACER=0
) else (
echo Enter a server name. This is the name which will appear in the in game server list
set /p SERVERNAME="Enter server name: " || set SERVERNAME=DONTJUSTPRESSENTER
)
if "%SERVERNAME%"=="DONTJUSTPRESSENTER" (
echo.
echo You must enter a server name.
if exist "%VARIABLESDIR%\server_name.txt" del "%VARIABLESDIR%\server_name.txt"
goto setservername
)
echo ^%SERVERNAME%>"%VARIABLESDIR%\server_name.txt"
if "%SPACER%" == "1" echo.
goto :eof
:setupnp
echo [1m[33mCreating firewall UPnP entries[0m
"%UNPNCHELPER%\upnpc-shared.exe" -r %GAMEPORTA% UDP %GAMEPORTB% UDP %GAMEPORTC% UDP %GAMEPORTD% UDP %RCONPORT% TCP >nul
echo.
goto :eof
:setwhitelisted
echo [1m[33mLoading whitelisting setting...[0m
set SPACER=1
if exist "%VARIABLESDIR%\whitelisted.txt" (
set /p WHITELISTED=<"%VARIABLESDIR%\whitelisted.txt"
set SPACER=0
) else (
echo Would like for the server to be whitelisted? Enter Y for yes, N for no.
set /p WHITELISTED="Whitelist the server [Y/N, default N]: " || set WHITELISTED=n
)
if /I "%WHITELISTED%"=="y" (
echo ^%WHITELISTED%>"%VARIABLESDIR%\whitelisted.txt"
) else if /I "%WHITELISTED%"=="n" (
echo ^%WHITELISTED%>"%VARIABLESDIR%\whitelisted.txt"
) else (
echo.
echo Please enter Y for yes, or N for no.
echo.
if exist "%VARIABLESDIR%\whitelisted.txt" del "%VARIABLESDIR%\whitelisted.txt"
goto setwhitelisted
)
if "%SPACER%" == "1" echo.
goto :eof
:start
if /I "%GRANTGUIDES%"=="y" (
if exist "%SERVERDIR%\miscreated.db" (
call :grantallguides
)
)
if /I "%ENABLEUPNP%"=="y" call :setupnp
echo Would you like to validate or update the server files? 'Y' recommended.
echo ^( auto-validation will commence in 10 seconds ^)
CHOICE /d Y /T 10 /M "Validate and/or update the server?"
IF !ERRORLEVEL! EQU 1 call :validateserver
call :cleanmods
call :printconfig
call :startserver
echo.
echo [1m[33mThe Miscreated server exited.[0m
CHOICE /d Y /T 10 /M "Would you like to restart the server? (auto-restart in 10 seconds)"
IF !ERRORLEVEL! EQU 1 goto start
goto :eof
:startserver
echo [1m[33mStarting the Miscreated server[0m
echo |set /p="[1m[33m command: [0m"
echo [1m[36m"%MISSERVERBIN%" %OPTIONS% -sv_port %GAMEPORTA% +sv_maxplayers %MAXPLAYERS% +map %MAP% +sv_servername "%SERVERNAME%" +http_startserver[0m
"%MISSERVERBIN%" %OPTIONS% -sv_port %GAMEPORTA% +sv_maxplayers %MAXPLAYERS% +map %MAP% +sv_servername "%SERVERNAME%" +http_startserver
if /I "%ENABLEUPNP%"=="y" (
call :removeupnp
)
echo.
goto :eof
:validateserver
echo [1m[33mInstalling/Updating/Validating server files[0m
"%STEAMCMDBIN%" +login anonymous +force_install_dir "%SERVERDIR%" +app_update 302200 validate +quit
if not exist "%MISSERVERBIN%" (
echo =^> ERROR:
echo Something went wrong: The server may not have been installed by steamcmd.
pause
exit /B
)
goto :eof
:main
REM - Make sure a script variables directory exists
set VARIABLESDIR=%BASEPATH%\scriptvars
if not exist "%VARIABLESDIR%" (
echo Creating subdirectory: %VARIABLESDIR%
md "%VARIABLESDIR%"
echo.
)
call :setservername
call :setfirewall
call :setwhitelisted
set WLOPTION=
if /I "%WHITELISTED%"=="y" (
set WLOPTION=-mis_whitelist
)
call :setmaxplayers
call :setbuildrule
set SERVERDIR=%BASEPATH%\MiscreatedServer
set MODSDIR=%SERVERDIR%\Mods
set MISSERVERBIN=%SERVERDIR%\Bin64_dedicated\MiscreatedServer.exe
if not exist "%SERVERDIR%" (
echo Creating directory: "%SERVERDIR%"...
md "%SERVERDIR%"
echo.
)
call :setbaseport
call :setrconpassword
call :setgiveallguides
set STEAMCMDPATH=%BASEPATH%\SteamCMD
set STEAMCMDBIN=%STEAMCMDPATH%\steamcmd.exe
if not exist "%STEAMCMDPATH%" (
echo Creating directory: "%STEAMCMDPATH%"...
md "%STEAMCMDPATH%"
echo.
)
if not exist "%STEAMCMDBIN%" call :getsteamcmd
set SQLITEPATH=%BASEPATH%\sqlite
set SQLITEBIN=%SQLITEPATH%\sqlite3.exe
if not exist "%SQLITEPATH%" (
echo Creating directory: "%SQLITEPATH%"...
md "%SQLITEPATH%"
echo.
)
if not exist "%SQLITEBIN%" call :getsqlite3
set UNPNCHELPER=%BASEPATH%\upnpc
if not exist "%UNPNCHELPER%" (
echo Creating directory: "%UNPNCHELPER%"...
md "%UNPNCHELPER%"
echo.
call :getupnphelper
)
set OPTIONS=%WLOPTION%
if defined OPTIONS (
echo Additional command line options: %OPTIONS%
)
call :createmanualremoveupnpscript
if /I "%GRANTGUIDES%"=="n" (
if exist "%SERVERDIR%\miscreated.db" call :removegrantallguides
)
call :createlocaljoin
if not exist "%MISSERVERBIN%" call :validateserver
call :servernamecfg
call :passwordcfg
call :basescfg
call :start
echo.
echo I hope you found this script use useful.
echo -Spafbi
echo.
timeout /t 10