Package: ServerDog
Version: 0.96
 Author: }TCP{Wolf aka Mia_The_Chaotic

Purpose of this mod: server side administration mod to simplify changing some
settings either complicated to do otherwise, hard to find or just unpractical
to use.

Mail bug reports, ideas or whatever to ChaosWorx@gmx.net


Install:
--------
Copy the u and int file to your Unreal\system directory.
Go to Unreal.ini, add to [Engine.GameEngine] this line:
ServerActors=ServerDog.a

Version 0.9 and up have a fixed Server UDP query beacon (Gamespy protocol
compatible, of course :) - to use it, you must further modify your Unreal.ini:
look for this text line:
ServerActors=IpServer.UdpServerQuery
and write a ";" in front of it so it reads
;ServerActors=IpServer.UdpServerQuery
Now the old ServerQuery is disabled, let's add the ServerDog version of it by
adding this line:
ServerActors=ServerDog.UdpServerQueryWFIX



USAGE:
------
Login as admin, hit type (or your console key) and enter commands like this:
admin set a a <command>

<> brackets indicate placeholders for which you must enter something else.
   E.g. <id> would be a (player) id, just a number you have to determine first.
<0/1> means either "0" or "1", nothing else allowed, where 0 stands for "off"
   or "false", and "1" for "on" or "true", so actually you may also write
   "True", "true", "False" or "false", but "0" or "1" will be easier and
   faster.
<0-1> means any value between 0 and one, so from 0.00000 to 1.00000 :)
Other non-selfexplaining placeholders will be detailed at the command info
below...

Restrictions: *<gamemode/gamepackage>* These stars indicate a command not
functional or useful in combination with a specific gamemode. For example
*UCop* would indicate a command not available/useful if UCop is running.
This may be if the game modes / packages have internal functions doing the
same and using the ServerDog functions would conflict, it just makes no
sense to use it in that gamemode or the side effects are unpredictable so
use is not recommended.

Note: Since version 0.8 I included an int file which enables you to execute
commands over the advanced options, just go there and type something in
"A" :) You can often see results as some are logged too in the server console.



Settings (ServerDog):
---------------------
Infomercials
   Type in up to 5 text strings you want displayed to all players at the end
   of each map... this might be something like "visis our site at blah..."
   ServerDog will randomely choose ONE of the strings to be displayed.
   Infomercial broadcasts will NOT beep.

Infomercials_delay
   The number of ticks ServerDog will delay the first Infomercial broadcast.

Infomercials_repeat
   The number of times ServerDog will broadcast the chosen message. Once per
   tick it will count up... On normal servers, just set this HIGH. THat's
   because on normal huds, the blue text messages just disappear as soon as
   another message (like players saying "gg") appear. Thus, to keep those
   infomercials displayed they need to be broadcast again.
   Some mods use different and smarter HUDs, though, on RealCTF servers you
   may want to limit the repeat to 3 or 4, because the messages will not
   interfere with player talk there and will nicely fade out :)
   Test it yourself what's better for your server depending on which mod
   you run.



Settings (ServerDog UDP Fixed Server Query)
-------------------------------------------
The fixed query beacon is a special feature eliminating 2 problems:
1) The "Spectators" mess up UBrowser report bug
2) The GameSpy protocol spoofed DOS attack vulnerability exploit

LogAllRequests
   Debug feature. If turned on, you will log all incoming requests and their
   contents.

MaxConsecutiveRequestsPerSecond
   If the same user (IP address) sends more than one request in a row before
   any other request is sent from a different IP, this is called a consecutive
   request. Normally to get a good result a normal browser (player) will only
   need to send 2 consecutive requests: \\info\\ and \\status\\
   If too many requests are received from the same IP in a row, the extra
   requests above the set limit are dropped and counted as "denied".

MaxRequestsPerSecond
   This is the maximum number of requests from ANY ip address the UDP beacon
   will answer at all. Any number above this are dropped and counted as
   "denied". This way someone spoofing to random IPs will still hit the
   denied counter...

Report<XYZ>
   Well these settings are all self-explaining, only note that "Cameras" are
   not spectators, while "DemoRecorders" are! So if you enable or disable
   "ReportSpectators" you will always affect that report too (that's because
   "DemoRecorder" is a direct subclass of "Spectator"). UCopLite Spectator
   class is also identified correctly, other mods using their own classes of
   spectators which are NOT a subclass of "UnrealShare.Spectator" may NOT be
   identified correctly (but will still be reported if you have all reports
   on).
   "ReportOthers" will just pick up everything not yet identified and list
   it, so in case you just leave all "True" there will always be a complete
   list of things on the server.

ShutDownDeniedRequests
   Whenever requests were dropped either because too many in a row from same
   IP (consecutive) or just too many per second, the denied counter is upped
   by one.
   Each second, the denied counter is also reduced by one until it is zero
   again but during a DOS attack attempt, the denied counter will still go up
   MUUUCH faster than the reduction takes place. Once the denied limit is
   reached, the beacon will self-destruct, making the game server invisible
   to the master server and players not currently connected.
   If this happens, people can still play on the server and even connect to
   it, just no one will get the scores and player names from outside.
   After a map restart, the beacon is restarted (since it is a server actor).

Issues:
1) NumPlayers MUST be >0 before any report is sent (gamespy protocol states
   the call of "SendPlayers()" only when NumPlayers>0 - client side fix not
   possible!) - so in effect, if no human player is connected, no report will
   show, one single human normal player and all is displayed just fine.
2) Pings may be incorrect if a class is NOT identified correctly. May happen
   if you use that on "Unreal Tournament" (doh!!!) or other Unreal Classic
   mods using custom player classes or whatever...



Commands:
---------

adminpass <password>
Sets a new admin password (needs map restart). Trying to set an empty admin
password will be prevented.
UCop extra handling? -> UPak.u

consoleid <id> <command>
Execute a console command as if you are that player number <id>. Too bad only
so few commands work... and be careful you quickly crash your server with
this.

fraglimit <nr>
Sets the new fraglimit/teamscorelimit.
*RealCTF* *RealCTF-C* *RealCreeper* *coop*
!!NOTE!! There exists a variable "TeamScoreLimit" for Teamgames, but in
reality the "fraglimit" is taken as the teamscore limit.
Example -> fraglimit is 10, TeamScoreLimit is 5, 2 red team players have
           scores 3 and 6
           -> Result: NOTHING, game continues!
           Player 2 scores his 7th kill
           -> Result: Game ends, fraglimit reached (10)
As you see the variable "TeamScoreLimit" was intended to serve the purpose of
a team-fraglimit, but was forgotten to use after all :(

friendlyfire <0-1>
Sets the friendly fire scale in teamgames... *RealCTF-C* *non-team DM*

game <game-name>
...UPak games!?
Will start a new game, DM, Team-DM, or any other "supported" game mode. If you
enter an unknown game-name (or none), a list of supported game modes will be
shown to you.
If you try to start a supported game, but the server does not have all needed
files to start it (for example you try to start an Infiltration Standoff game
on a RealCTF-only server) the server will crash for certain!

gamepass <password>
Sets a new gamepassword (needs map restart). An empty password will make the
server public so anyone can join with no password.

getnetspeed
Displays the current maxclientrate (maximum speed clients can connect).
NOTE: Clients ignore that setting if they connect, the only time that value
 TO   comes into account is when they change netspeed DURING play (almost
 UC   never).

getpass
Will display the current gamepass. It will not display the admin pass because
if you don't know it you can't login as admin and execute the command anyway...

getticks
Displays the current tickrate of the server.

hardcore <0/1>
Hardcoremode on/off. *RealCTF-C*

ids <log>
Show IDs of all players. This will also show all IP addresses (and used ports)
of players type "admin set a a ids log" to get log it. Note that you will also
get a raw parserdump by "log" (500 scriptlog lines) which is useful in case
something goes wrong or you just wanna log it immediately.
The original IP parser was written by the author of INFCheatDetector, now all
that code has been removed and replaced by self-written stuff. I believe the
new code works a lot more reliable. Also, you will see who downloads at the
moment, which file it currently is and how many bytes of it were already sent
compared to the total filesize.

info
Displays current info on level...

kickid <id>
Kicks the player with the given id.

kicklast
Kicks the player who entered last (having the highest id). *UCop* *RealCTF-C*

killid <id>
Causes 5000 points of damage to player <id>. Should result in immediate
death....

makeadmin <id> <0/1>
If you want someone to be admin for a short period of time, just make him one
with this command and entering "1" for yes and "0" for no after his <id> :)
Of course this will not stop him from MANUALLY getting the admin pass during
that time or disabling YOUR admin privileges... but the people you make
admins you do trust... if not it's your problem anyway :P
This was made to show your trusted fellows the messages ServerDog only sends
to admins in particular...

maxplayers <nr>
Sets number of maximum allowed game clients.

maxspecs <nr>
Sets number of maximum allowed spectators.

maxteams <nr>
Sets maximum number of teams.
*coop* *RealCTF-C* *non-team DM*

maxteamsize <nr>
Sets the maximum number of players within a team.
*RealCTF-C* *non-team DM games* *coop*

megaspeed <0/1>
Megaspeed on/off. *RealCTF-C*

putteamid <id> <team>
Puts player number <id> into team <team>, where <team> may be:
0=red, 1=blue, 2=green, 3=gold (yellow)
*non-team DM* *coop* (*RealCTF-C*)

resetscores
Will reset all scores without map change.
UCop? Inf? Serp? RealCTF? (*RealCTF-C*)

sayblue <msg>
Blue text message in middle of screen. (green in Real-CTF)

saypick <msg>
Pickup message (usually white at lower end of screen).

sayred <msg>
Red text message in middle of screen.

setnetspeed <value>
Sets the maxclientrate (max speed clients can connect).
NOTE: Clients ignore that setting if they connect, the only time that value
 TO   comes into account is when they change netspeed DURING play (almost
 UC   never).

setscore <id> <score>
Immediately sets the score of this player to <score>.

setservername <name>
If you really want to, you can quickly totally rename your server with this
easy command (though longer names with descriptions and http addresses in the
name may make it rather tricky). But normally you will never use it...

setticks <value>
Sets the tickrate of the server IMMEDIATELY!

skip
Immediately end current game to skip to next map. *coop*

timelimit <minutes>
Will set the new timelimit in minutes. *RealCTF-C* *coop*

travelpause <seconds>
Will set the amount of time a server waits after game ends before loading the
next map.

view <your id> <viewplayer id>
With the command method working like this, all the serverdog knows is that an
admin issues commands, but not, WHO! Thus, if YOU spectate and want to view
someone else (by id) you also have to give your own id so the dog knows who
wants to view and who is to be viewed...



PLANNED:
--------
-ideas??

Support for:
-UPak games
-UPak automatic destruction of UPakPlayers (already handled by hackbuster and
 other protections, not needed)
-Napali patched coop game(s)
-UT games
-Rune games
-Server side skin handling
