Package: The Unreal Server DOWNLOAD Enabler/Disabler (DL)
Version: 0.1
 Author: }TCP{Wolf aka Mia_The_Chaotic

Note: This is a c/c++ program, not an Unreal Script!


CONTENTS
--------
  I. What is this again... (yummie yummie yummie...)
 II. Install
III. How to use
 IV. Some common sense
  V. Programmer's notes
 IV. Credits



I. Introduction - What is this?
-------------------------------
If I was following the official Linux / UNIX joke guide, I would just call
this program YAUP ("Yet Another Useless Program") but I'm afraid I compiled it
for Win32... hmm...

Anyway, you run your Unreal server, and although it runs fine even with
several players, it becomes unplayable with lag, just because more players
try to join who do not have all the necessary files to join your server.
What happens? They start downloading and thus create lag for already connected
players.

"But hey, I have this variable set in my server Unreal.ini - what was it, oh
yea 'AllowDownloads=False'..."

Tough luck man, that variable is a CLIENT setting, the only one who can't
download with this setting is YOU, all others can - that blows, doesn't it!

"And what about the netspeed limit I have set?"

Did you have the impression it helps?

...

See?

All right... long intro, short sense. This program (shortly called "dl") can
put an end to any and all downlaoders from your servers. IT IS IMPERATIVE THAT
YOU OFFER ALL FILES FOR DOWNLOAD ON A WEBSITE OR AN FTP SERVER WHICH YOU DO
NOT ALLOW TO BE DOWNLOADED FROM YOUR SERVER, OTHERWISE NO ONE WILL EVER BE
ABLE TO JOIN YOUR SERVER! IT IS ALSO IMPERATIVE THAT PEOPLE EASILY AND QUICKLY
SEE WHERE THEY HAVE TO GO IN ORDER TO GET THE FILES THEY NEED! SO ONE PLACE
TO PUT YOUR WEBSITE ADDRESS MIGHT BE YOUR SERVERNAME!!!



II. Install
-----------
Just unzip and put all files into your "Unreal" directory. Not
"Unreal\System", just "Unreal"! Done.

Hmm that "cpp" file looks like the sourcecode... Do I need that for execution?
No, you don't... it IS the sourcecode :P

Well you said "put ALL files...."
Yea you know I'm getting tired of writing "hold my hands" type instructions...



III. Usage
----------
BEFORE YOU USE THIS PROGRAM, I STRONGLY SUGGEST YOU MAKE A BACKUP COPY OF YOUR
ENTIRE UNREAL GAME DIRECTORY JUST IN CASE...

You should understand, that "dl" physically modifies your server files! The
"allow download" flag is stored in all "Unreal files" in byte "0x08". Each
file you want to be modified in order to disable download will be checked
first, if the value there is either "00" (download disabled) or "01"
(download enabled). If the value there is anything else, dl won't touch the
file! So now... you need a dos-prompt, then go to your "Unreal" directory
and type

dl

to get the usage, it will tell you it is;
dl <wildcard> <0/1>

That means basically, if you want to protect all your MAPS from download,
you need to go to your maps directory ("cd maps") and then type
"..\dl *.unr 0". Directly typing "dl maps\*.unr 0" will not work. You will
see it goes through all maps but can't open any.... stupid c routine....

All right. Well, "*.unr" is the wildcard defining your maps, and the "0"
stands for "disabled". Likewise, to re-enable downlaods for your maps type
"dl ..\dl *.unr 1" (again from your MAPS directory).

Hmm... easy enough?

Same for your Texture files that would go...
..\dl *.utx 1
and...
..\dl *.utx 0
(typed in your Textures directory)

same for sounds (Sounds\*.uax), music (Music\*.umx) and scripts (System\*.u)
however, I strongly suggest you ONLY disable maps from downloads, please read
chapter "IV - Common sense" carefully to understand that.

Since that is what I recommand, disable only MAPS, I made it even easier for
you, with the batchfile "dlmaps.bat" your typing will be reduced to
"dlmaps 1" and "dlmaps 0" or even easier... "mon" and "moff" (maps on, maps
off).

Open these bat files with your favorite ASCII editor (Notepad? VI? LOL?) to
see how easy they work. You want reports?

Hmm e.g. "..\dl *.unr 1 >>myreport.txt" will make the program enable all
maps for download and write the results into the file "myreport.txt", but not
give any response on the screen then - this is a console PIPE feature, not
part of the program... also note that ">>" instead of ">" will make sure if
the report file exists, the new report will be ADDED instead of overwriting
the old report.

Hey wait a second... my files get modified??? Won't I create version conflicts
just by modifying them?
Normally: YES! Here: NO! You only change ONE SINGLE BIT!



IV. Common Sense - What to "protect", what NEVER to "protect"
-------------------------------------------------------------
Why only maps?
That's because if there is a downloader, he will ALWAYS get the map first,
textures, sounds and anything else - regardless wether associated with the map
or ServerPackages - later. Due to that, if the downloader can't get the map,
he'll disconnect immediately and not get any other files either!

Next reason... think! You have your FTP server where all your maps you run on
your server are. Okay... for some stupid reason you have taken one map from
your maps directory and put it on your FTP for download, but you didn't know
there needs to be a texture file together with the map...
Hmm... If you protect all files, a player will come to your server and see
that he "can't download some texture file". He'll be like "what the f*ck I
have downloaded everything...". If you have only protected your maps, the
player will download the missing texture, and can later tell you that you
forgot that file in the zip on the FTP. Even easier!!! Your server.log file
will contain "downloaded file" reports, so when you see one, you can see
"ohh, that map was running and people still downloaded a file... hmm..."
Then you can look into your zip file on your FTP and discover "Ooops, I was
so stupid to forget to include it... damn..." :)

Next thing... protecting "small" files is just plain dumb! If you have
Jumpad.u or NBSpecials.u it is so that these files exist on many servers in
different versions. If you protect these files too, it will be pure
conicidence if a player has the correct version of it in his system directory.
If you protect these files, you will likely create more frustration than is
good for you!

Another thing... you should know that people who can't download files from
your server cannot resolve version conflicts by renaming the offending file.
They really have to get the file from the address you point them to! Since
there are maps out there which exist in various versions (and the map authors
are sometimes so plain stupid and never change the name of their map when they
modify it) people will need to have several versions on "stand by" and
renaming them until they find the correct one... that's a daunting and very
frustrating task. "DMProng" is such a map you should not protect, other well
known "version conflict creaters" should not be protected either!
!!NOTE!!
Since dl will go through entire directories modifying files, to prevent it
from changing these "version conflict creator" files, just put the write
protection on these special files (so here: write protect "DMProng.unr").
You might also want to write protect the maps deck16, radikus, morbias,
tundra, elsinore, curse etc etc (those original maps that come with the
game).

Another idea... maybe you should have only certain times of day (or week)
when downloading is possible and when not. Often people join a server as
spectator and go away the whole day, only to get all the files they need. Why
not allow downloads in times where only few people play, and disable them in
the tough hours? The batch files make this fairly easy... if you have an
autmated scheduling system, you might even have them executed automatically
at certain times, just make sure you have the correct "working directory"
(your Unreal dir).

Singular File Protection:
It might be rather useful to also download protect certain specific files.
That might be "Infiltration.u" if you run an Infiltration server or any other
LARGE mod files, WHICH DO NOT GET UPDATED anymore. Unfortunately, there often
exist several versions of these mods out there, too, and not every server
admin may have the latest version. So IF you protect such files, make double
extra sure you are totally up to date and you tell people EXACTLY which
version of the file you are using!
To protect a singular file, move it to your "Unreal" dir (where the dl
program is) and type something like "dl <your file> 0" - or even "dl *.* 0"
might work smoothly since it won't go into subdirs, and skip files with an
"illegal flag" (like the exe). When done, move the protected file back to
where it belongs...

Protect Skins?
Hmm well... private skins: NEVER !! If you do, no one can join your server.
Public large skin packs: MAYBE!! I have seen several "bk" skin packs and seen
different versions, or even identical files (by content) but with a different
GUID... so in case of doubt: NO! People may not be able to resolve version
conflicts.

One last thing...
Include some "emergency" email in your server infos (when people read the
details and scroll down in the u-browser) so they can inform you about missing
files in zips or completely missing maps on your download site etc etc...

All right... now have a lag free game :)



V. Programmer's Notes
---------------------
Do you run a Linux Unreal server? Native? Umm... well you see I included the
source, but I'm not sure if you can compile it under Linux just as it is, as I
understand it, the functions "findfirst()" and "findnext()" which are used to
search a directory for files, are not available (or incompatible) in Linux.

Nevertheless, they were included via "dir.h" so just check your native Linux
if these functions exist there and if they work as used in that code, if not,
you'll have to do some serious port work at that place - sorry :(

Side-effects:
When an Unreal server REJECTS a connection, it may create "ghosts" or dead
connections. If you type "sockets" on your Unreal server console, there are
suddenly lots of dead connections listed of rejected downloads... this is a
problem of Unreal. Don't bug me about it :P Also, it will COUNT these
players in your server (not in the UBrowser, but in the server console).



VI. Credits
-----------
It's all mine mine mine mine!! All code by }TCP{Wolf aka Mia_The_Chaotic and
no one else!

But... that code is cheap so feel free to do with it whatever you feel funny
to... JUST DON'T MAKE MONEY WITH IT, PUNK!!


by }TCP{Wolf aka Mia_The_Chaotic - September 4th 2002



-------------------------------------------------------------------------------
                                   ABBENDUM
-------------------------------------------------------------------------------

The following output was generated on my test server (that's how it should look
like when disabling all downloads for maps. Note the errors indicating which
files were write protected! Why are there errors OPENING the file when we want
to READ first only? That's technically, because "fopen()" uses random access
(mode "r+") which is "read+write simultaniously", but the "write" is not
allowed so the complete "open" fails.
This report was generated using: moff >>report.txt


D:\UNREAL~1>cd Maps 

D:\UNREAL~1\Maps>dl ..\*.unr 0   

D:\UNREAL~1\Maps>cd .. 

D:\UNREAL~1>cd Maps 

D:\UNREAL~1\Maps>..\dl *.unr 0   


Unreal Server File download enabler/disabler
Author: }TCP{Wolf aka Mia_The_Chaotic
Version: 0.1
You have selected to DISABLE downloads...

Bluff.unr... ERROR OPENING FILE
Ceremony.unr... ERROR OPENING FILE
Chizra.unr... ERROR OPENING FILE
Dark.unr... ERROR OPENING FILE
DasaCellars.unr... ERROR OPENING FILE
DasaPass.unr... ERROR OPENING FILE
DCrater.unr... ERROR OPENING FILE
Dig.unr... ERROR OPENING FILE
DKNightOp.unr... ERROR OPENING FILE
Dm-Bridge.unr... is enabled... download now disabled :)
DM-Burak.unr... is enabled... download now disabled :)
DM-Clusterfuck.unr... is enabled... download now disabled :)
Dm-Crono.unr... is enabled... download now disabled :)
DM-Cybrosis.unr... is enabled... download now disabled :)
Dm-Dawn.unr... is enabled... download now disabled :)
Dm-DeathCries.unr... is enabled... download now disabled :)
DM-Deck001.unr... is enabled... download now disabled :)
DM-EsperV2.unr... is enabled... download now disabled :)
DM-Letting.unr... is enabled... download now disabled :)
DM-LongerYard.unr... is enabled... download now disabled :)
DM-Loxi.unr... is enabled... download now disabled :)
DM-Mercury.unr... is enabled... download now disabled :)
DM-mojo.unr... is enabled... download now disabled :)
dm-reliquary.unr... is enabled... download now disabled :)
Dm-Sapien.unr... is enabled... download now disabled :)
DM-shrapnel.unr... is enabled... download now disabled :)
Dm-Siberia.unr... is enabled... download now disabled :)
DM-StrictlyDiesel.unr... is enabled... download now disabled :)
DM-Sunder.unr... is enabled... download now disabled :)
DM-twilight.unr... is enabled... download now disabled :)
DM-Xenode.unr... is enabled... download now disabled :)
DM-[RVV]-BATTLE-ZONE.unr... is enabled... download now disabled :)
Dm10Seconds.unr... is enabled... download now disabled :)
DM1MoreMap.unr... is enabled... download now disabled :)
DM2001_V2.unr... is enabled... download now disabled :)
DM88.unr... is enabled... download now disabled :)
DM88_Ancient.unr... is enabled... download now disabled :)
DMAbandoned.unr... is enabled... download now disabled :)
DMAbandonedMillv2.unr... is enabled... download now disabled :)
DmAcid-Arena.unr... is enabled... download now disabled :)
DMADD2-Coughin.unr... is enabled... download now disabled :)
DMAdrenalineOverDose.unr... is enabled... download now disabled :)
DmAggressive_Tendencies.unr... is enabled... download now disabled :)
DmAgonizer.unr... is enabled... download now disabled :)
DMagroof.unr... is enabled... download now disabled :)
DMagroofdlx.unr... is enabled... download now disabled :)
DMANCadvance.unr... is enabled... download now disabled :)
dmanka.unr... is enabled... download now disabled :)
DmAnTiVeNtRoX.unr... is enabled... download now disabled :)
DMAOD2.unr... is enabled... download now disabled :)
DmAriza.unr... is disabled... skipping...
DMAsmadena.unr... is enabled... download now disabled :)
DMbagzok.unr... is enabled... download now disabled :)
DmBlackheart.unr... is enabled... download now disabled :)
DMBlunderFit-HP.unr... is enabled... download now disabled :)
DMBlunderFit-LP.unr... is enabled... download now disabled :)
dmBridgeTooFar.unr... is enabled... download now disabled :)
DMBronx.unr... is enabled... download now disabled :)
DMColdrak.unr... is enabled... download now disabled :)
DmColdRuins.unr... is enabled... download now disabled :)
DMCoosark.unr... is enabled... download now disabled :)
DmCurse.unr... ERROR OPENING FILE
DMDawn.unr... is enabled... download now disabled :)
DmDeathFan.unr... ERROR OPENING FILE
DmDeck16.unr... ERROR OPENING FILE
DMDeck17.unr... is enabled... download now disabled :)
DmdeCyberBridge.unr... is enabled... download now disabled :)
DmDoomEternal1.unr... is enabled... download now disabled :)
DmDoomEternal2.unr... is enabled... download now disabled :)
DmDropzoneV2.unr... is enabled... download now disabled :)
DmEdge01.unr... is enabled... download now disabled :)
DMElsinore.unr... ERROR OPENING FILE
DMFeekasso.unr... is enabled... download now disabled :)
DMfith.unr... ERROR OPENING FILE
dmflashback.unr... is enabled... download now disabled :)
DMForge.unr... is enabled... download now disabled :)
DMGhostMatch.unr... is enabled... download now disabled :)
DMGrooveMachine.unr... is enabled... download now disabled :)
DmHealPod.unr... ERROR OPENING FILE
DMInjector.unr... is enabled... download now disabled :)
DMKonosusR2.unr... is enabled... download now disabled :)
DmKrandura.unr... is enabled... download now disabled :)
DmLethoria.unr... is enabled... download now disabled :)
DMLohmannsLair.unr... is enabled... download now disabled :)
DMLongestyard.unr... is enabled... download now disabled :)
DMMars.unr... is enabled... download now disabled :)
DMMeenoclyps.unr... is enabled... download now disabled :)
dmmeldrak.unr... is enabled... download now disabled :)
DmMerntroxs.unr... is enabled... download now disabled :)
DMmidwinter.unr... is enabled... download now disabled :)
Dmmontron.unr... is enabled... download now disabled :)
DmMorbias.unr... ERROR OPENING FILE
DMobservatory.unr... is enabled... download now disabled :)
DMPheonix.unr... is enabled... download now disabled :)
DMPortalXGN.unr... is enabled... download now disabled :)
DmPowerHouse.unr... is enabled... download now disabled :)
DMProng.unr... ERROR OPENING FILE
DmRadikus.unr... ERROR OPENING FILE
DmRag'na.unr... is enabled... download now disabled :)
DmRefuge.unr... is enabled... download now disabled :)
dmrolus.unr... is enabled... download now disabled :)
DmRoute66.unr... is enabled... download now disabled :)
DMRyan.unr... is enabled... download now disabled :)
DmSinfonia.unr... is enabled... download now disabled :)
DmSkaarjStorage.unr... is enabled... download now disabled :)
DMTeetok.unr... is enabled... download now disabled :)
DmTempofOman.unr... is enabled... download now disabled :)
DMTheSphere.unr... is enabled... download now disabled :)
DMTOXIC.UNR... is enabled... download now disabled :)
DmTundra.unr... is disabled... skipping...
DMUnreality-SE.unr... is enabled... download now disabled :)
DMUrbanarenaSE.unr... is enabled... download now disabled :)
DMVeltor.unr... is enabled... download now disabled :)
DmVigil98.unr... is enabled... download now disabled :)
DMWASTED.unr... is enabled... download now disabled :)
DMWickedMansion.unr... is enabled... download now disabled :)
DMWindy.unr... is enabled... download now disabled :)
DMZeitkind.unr... is enabled... download now disabled :)
Dug.unr... ERROR OPENING FILE
endgame.unr... ERROR OPENING FILE
Entry.unr... ERROR OPENING FILE
ExtremeBeg.unr... ERROR OPENING FILE
ExtremeCore.unr... ERROR OPENING FILE
ExtremeDark.unr... ERROR OPENING FILE
ExtremeDGen.unr... ERROR OPENING FILE
ExtremeEnd.unr... ERROR OPENING FILE
ExtremeGen.unr... ERROR OPENING FILE
ExtremeLab.unr... ERROR OPENING FILE
Gateway.unr... ERROR OPENING FILE
Harobed.unr... ERROR OPENING FILE
illhaven_1.unr... ERROR OPENING FILE
Illhaven_2.unr... ERROR OPENING FILE
Illhaven_3.unr... ERROR OPENING FILE
Illhaven_4.unr... ERROR OPENING FILE
Illhaven_5.unr... ERROR OPENING FILE
Illhaven_6.unr... ERROR OPENING FILE
illhaven_end.unr... ERROR OPENING FILE
illhaven_st.unr... ERROR OPENING FILE
IsvDeck1.unr... ERROR OPENING FILE
IsvKran32.unr... ERROR OPENING FILE
IsvKran4.unr... ERROR OPENING FILE
NaliBoat.unr... ERROR OPENING FILE
NaliC.unr... ERROR OPENING FILE
NaliLord.unr... ERROR OPENING FILE
Noork.unr... ERROR OPENING FILE
NyLeve.unr... ERROR OPENING FILE
Passage.unr... ERROR OPENING FILE
QueenEnd.unr... ERROR OPENING FILE
Ruins.unr... ERROR OPENING FILE
SkyBase.unr... ERROR OPENING FILE
SkyCaves.unr... ERROR OPENING FILE
SkyTown.unr... ERROR OPENING FILE
SpireVillage.unr... ERROR OPENING FILE
TerraLift.unr... ERROR OPENING FILE
Terraniux.unr... ERROR OPENING FILE
TheSunspire.unr... ERROR OPENING FILE
Trench.unr... ERROR OPENING FILE
Unreal.unr... ERROR OPENING FILE
VeloraEnd.unr... ERROR OPENING FILE
Vortex2.unr... ERROR OPENING FILE

STATISTICS
----------
Files processed: 160
Files modified: 98
Errors occured: 60

done...

D:\UNREAL~1\Maps>cd .. 


-------------------------------------------------------------------------------