//=============================================================================
// IPLogger (Version 0.3 beta) source code by 
// Gerald Lance Tindall aka. <NDP>BOZO
// Email Address: bozo@newdefinitionsofpain.com
// November 29, 2002
// CODE NOT FOR REUSE WITHOUT PRIOR PERMISSION OF AUTHOR
//=============================================================================

==========================
Overview 
==========================
This is designed to allow Unreal I servers to have an IP Logging and Banning Capabilities.

==========================
General Notes 
==========================
Special Thanks to <NDP>Scorpion aka. }TCP{Wolf for providing some working code and making my life easier...

Thanks to all my beta testers out there!!! Wolf, butters, a_lesser_talent, JonahHex, RuDe, CrAzY, Havok, A-ass-in, Ripit, Bubbles, Zeus, Dookie, Incoming, & Hellbent. Plus all the folks that got kicked by accident...

I have decided that the console checking capabilities will not be added any time in the near future to the IPLogger code. I have determined that Hackbuster 3.0 will serve to provide an extensive console checking capability that will well complement IPLogger well and I recommend that all server admins upgrade to the new version and run this concurrently with IPLogger.

I have also reviewed other console checking/ip logging utilities that are currently in the works: 
Specifically, kickban by a_lesser_talent (email: ggargett@attbi.com) and mcp by butters (email: effect_ed@hotmail.com). Both are excellent utilities. Interested parties may with to contact the authors directly for the code. 

kickban is a server side only tool that allows ip logging, banning, and remote administration. It is highly based on }TCP{Wolf's ServerDog code.

mcp is a dual server/client package that allows ip logging, banning, console checking, and remote administration. It is also highly based on }TCP{Wolf's ServerDog code.     

IPLogger is a dual server/client package that allows ip logging and banning. Currently, there are no remote admin capabilities built in to the tool but this seems to be its only major fault.

Of all of the tools, each has its own strengths and weaknesses, but I believe that the IPLogger method of implementation will turn out to produce a more robust tool in the long run. 

The authors and I have corresponded and spoke about combining our efforts on a single tool. Unfortunately it seems we are approaching the same problem with totally different methods. Thus it may be difficult to pursue this option.
 
I believe we may be able to reuse some of the server admin code that is based off of }TCP{Wolf's ServerDog code and has been implemented in these tools listed above. Although I have been looking at a completely different means of implementing this functionality...Time will tell.


==========================
Files Included
==========================
IPLoggerVer0.3beta.txt - Help File

IPLogger.int - System File - allows IPLogger Server settings to be adjusted under advanced settings

IPLogger.ini - System File - contains server IPLogger configuration settings and IP Ban/Allow lists

IPLogger.u - System File - IPLogger Server side executable 

IPL.u - System File - IPLogger Client side executable
==========================
Installation
==========================
Extract the IPLogger.u, IPL.u, IPLogger.int, and IPLogger.ini files to your Unreal\system directory.

Open up your Unreal.ini file located in the Unreal\system directory.

Find the ServerPackages lines.

After them add:
ServerPackages=IPL
ServerActors=IPLogger.IPLoggerServer
Save the file. 

NOTE: Delete any ServerPackages and ServerActors lines from previous installations of IPLogger.

IPLogger is now installed and will run automatically when the server is restarted.

===========================
Operation
===========================
The IPLogger program runs transparently in the background without input from the users. It collects Client IP address data, Computer Name, and Engine Version information and writes this data to the Unreal.log file.

A log entry will be made each time a new client joins the server and at the beginning of each new map change a full listing will be made of all current client machines.

A sample log section containing a log entry has been included below for your reference. Excerpt for Unreal.log:

ScriptLog: -- IPLoggerServer:LOG ENTRY --
ScriptLog: -- Name: <NDP>BOZO --
ScriptLog: -- PlayerNumber: 1 --
ScriptLog: -- IP: 192.168.0.1 --
ScriptLog: -- ComputerName: BOZOWORLD --
ScriptLog: -- EngineVersion: 225 --
ScriptLog: Ban[x]=<NDP>BOZO,192.168.0.1,BOZOWORLD,StandardLogEntry

Note that the last line is included after each log entry just to make it easier on you people when you want to add someone to the ban or allow lists. Basically just copy and paste this line to the end of your IPLogger.ini file - Add one to the previous Ban[x] line and enter that value at the [x] and save the file and they will be banned automatically at the next map change. You won't even have to restart the server....Start numbering with 0 please....I think it will work even if you screw up the numbering but I haven't tested that kinda stuff yet....Haven't made things very dummy proof at this time. 

The server can ban or allow client machines based on IP Address (single IP ban or range ban), PlayerName, or ComputerName. In addition, you are able to check for successful client communication. If there is no communication then you can ban based on this. Settings to ban/allow based on each criteria are set in the IPLogger.ini file. 

A sample section containing server configuration information has been included below for your reference. Excerpt from IPLogger.ini:

[IPLogger.IPLoggerServer]
ServerPort=8500
checktime=3.0
startchecktime=10
nocommbantime=10.0
Debug=0
bDisplayBanMessage=1
bCruelBan=0
BanJoiners=1
BanByPlayerName=1
BanByIPAddress=1
BanByComputerName=1
BanForNotCommunicating=1
AllowAccess=1
AllowByPlayerName
AllowByIPAddress
AllowByComputerName
Ban[0]={ABC}TEST,192.168.0.1,ABC001,LoserWhoWroteThisIPs
Ban[1]=<ABC>TEST2,192.168.0.1:192.168.255.255,ABC002,SomeMoreofTheLoserWhoWroteThisIPs
Allow[0]=<NDP>BOZO,,,MakersRights!!


[ServerPort] sets a particular port for use by the IPLoggerServer messaging. This was made adjustable in case of port conflicts at a server location.
IMPORTANT: THIS PORT MUST BE OPENED IN YOUR FIREWALL.

[checktime] sets how often the server will look for a new joiner. You should not set this too low or too high. 5 seconds would be about the minimum and 10 about the maximum I would set it at. 


[startchecktime] sets a delay to not begin logging after a map change/restart or server start. This is included because the server is usually really busy right then and I don't want to slow it down too much.
No issues have been noted with this setting.


[nocommbantime] sets a minimum time required for successful communication. 
{NDP}Bubbles has reported that for some slower connections the default nocommbantime seems to be too short. Doubling this value to 20.0 seemed to allow players to join that were previously being banned for not communicating. Thanks for the test help Bubbles!! 

[Debug] this is a boolean [0=no, 1=yes] whether to comment profusely to the log. Used for debugging. Turn this off if everything runs fine. It will really reduce the amount of log entries made and speed up the server.

[bDisplayBanMessage] this is a boolean [0=no, 1=yes] whether to display a message when a joining player has been banned in the standard message window. 

[bCruelBan] this is a boolean [0=no, 1=yes] whether to attempt a console lockup on the player being banned from the server and then kicking them. Otherwise just kicks them. NOT WORKING!!

[BanJoiners] this is a boolean [0=no, 1=yes] this enables/disables banning. Will override BanByPlayerName, BanByIPAddres, BanByComputerName, and BanForNotCommunicating settings if set to false.

[BanByPlayerName] this is a boolean [0=no, 1=yes] whether to check for a PlayerName match for ban.

[BanByIPAddress] this is a boolean [0=no, 1=yes] whether to check for a IPAddress match for ban.

[BanByComputerName] this is a boolean [0=no, 1=yes] whether to check for a ComputerName match for ban.

[BanForNotCommunicating] this is a boolean [0=no, 1=yes] whether to check for a no communication for ban. Slower servers seem to have problems with this being activated. Disable this check if you are having people drop for no communication...
 
[AllowAccess] this is a boolean [0=no, 1=yes] this enables/disables allowing access. Will override AllowByPlayerName, AllowByIPAddress, AllowByComputerName settings if set to false.

[AllowByPlayerName] this is a boolean [0=no, 1=yes] whether to check for a PlayerName match for allowing access.
[AllowByIPAddress] this is a boolean [0=no, 1=yes] whether to check for a IPAddress match for allowing access.
[AllowByComputerName] this is a boolean [0=no, 1=yes] whether to check for a ComputerName match for allowing access.


The following two lines contain ban information.

Ban[0]={ABC}TEST,192.168.0.1,ABC001,LoserWhoWroteThisIPs
Ban[1]=<ABC>TEST2,192.168.0.1:192.168.255.255,ABC002,SomeMoreofTheLoserWhoWroteThisIPs

It is in the following format:

Ban[x]=PlayerName,IPAddressorRange,ComputerName,DescriptionorReasonforBan

For each new line to be added add one to the value in the parenthesis [x]. Thus if we wanted to add a new line the next one would be x=2;Then include data in each of the Fields following the equals sign. DO NOT USE SPACES, COMMAS, OR COLONS EXCEPT AS SEPARATORS!!! Commas are used to separate the fields and colons are used to separate an IPAddress Range. Spac                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          