PDA

View Full Version : Better to have one big file, or many small simple ones?



VJ
16-08-10, 01:46
Ok, well i decided to write up my server manager using batch files...
right now, there's a lot of files (all batch)

This is incomplete right now. (as I haven't actually downloaded all the servers)
but should be finished sometime tomorrow if i'm not busy :D

If you're interested...
notquitewhite.dyndns.org/ServerLauncher.zip

Code of starting batch file...



@ECHO OFF
COLOR 0c
TITLE "Game Server Launcher"
goto menu

:menu
cls
echo ----------------------
echo [Game Server Launcher]
echo ----------------------
echo.
echo [Servers] [Mods]
echo -----------------------------------------------------------
echo [1] Team Fortress 2 [5] Age of Chivalry
echo [2] Counter Strike: Source [6] Alien Swarm
echo [3] Left 4 Dead [7] Synergy
echo [4] Left 4 Dead 2 [8] Zombie Panic: Source
echo -----------------------------------------------------------
echo [9] Update All
echo.
echo [10] Quit
echo.


:choice
set /P C= ?
if "%C%"=="10" goto quit
if "%C%"=="9" goto updateall
if "%C%"=="8" goto ZPS
if "%C%"=="7" goto S
if "%C%"=="6" goto AS
if "%C%"=="5" goto AoC
if "%C%"=="4" goto L4D2
if "%C%"=="3" goto L4D
if "%C%"=="2" goto CSS
if "%C%"=="1" goto TF2
goto choice


:TF2
cls
echo Server Unavailable
pause
goto menu

:CSS
cd "content\menus"
CounterStrikeSource

:L4D
cls
echo Server Unavailable
pause
goto menu

:L4D2
cls
echo Server Unavailable
pause
goto menu

:AoC
cls
echo Server Unavailable
pause
goto menu

:AS
cd "content\menus"
AlienSwarm

:S
cls
echo Server Unavailable
pause
goto menu

:ZPS
cd "content\menus"
ZombiePanicSource

:updateall
cls
cd "content\updaters"
echo (%time%) Update Start.
echo.
update_all
echo (%time%) Completed.
echo.
pause
goto menu

:quit
exit

:end

VJ
16-08-10, 17:14
Ok, I've completed it.
Features List:
- Installs to directory specified in Install.bat
- Includes HldsUpdateTool.exe
- Everything done through a UI, no typing needed
- 8 Servers ("Update all" or can be done individually)
- Each server loaded individually.
- Server will automatically restart if it crashes.

http://notquitewhite.dyndns.org/ServerLauncher.zip

Smifis
16-08-10, 21:19
With this sort of thing, the files can get quite complex and it is a head ache looking at one huge file. You know you'll always be adding to it, tweaking it etc so I think you should defiantly have separate modules/files

DoubleTop
16-08-10, 21:21
With that sort of thing i think defiantly separate modules/files

that's a typo to amuse

thou shall use many files - smifis definiantly disallows the other way

either that or he definately thinks you should use many files :lol:

Smifis
16-08-10, 21:23
Ah well its up to the reader to decided :D

I think i'll go edit it now, you can tell i'm starting to get tired. :lol:

VJ
16-08-10, 21:24
ok, cheers. haha, i'm pretty proud of this :P, first thing i've written from scratch myself :D

Smifis
16-08-10, 21:25
Got that warm feeling? Nice isn't it :lol: