Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTANBanManager104.MutUTAN

Extends
Mutator
Modifiers
config

UTAN Ban Manager v1.04

Core.Object
|   
+-- Engine.Actor
   |   
   +-- Engine.Info
      |   
      +-- Engine.Mutator
         |   
         +-- UTANBanManager104.MutUTAN

Constants Summary
HASH_SIZE=2048

Variables Summary
stringAppealContactInfo
stringBanDatabaseName
UTANBanDatabaseBanDB
array<TListEntry>BanList
stringBanMessage
stringBanMessageGUID
stringBanMessageIP
array<IPBan>BannedIPs
boolbForceCreateDatabaseFile
boolbGetFreshList
boolbLogFileOpened
boolbLogFileSaved
boolbReceivedInitialUpdate
boolbSendNamesAsUTF8
boolbShowInServerName
boolbStoreDatabaseInINI
boolbTrackPlayerJoins
stringCurrentLogFileName
TListEntryDefaultBan
array<string>DelayedLogs
stringdescAppealContactInfo
stringdescBanDatabaseName
stringdescForceCreateDatabaseFile
stringdescGetFreshList
stringdescLogFileNameMask
stringdescLogFileTimeStamp
stringdescMasterserverAuthPass
stringdescMasterserverAuthUser
stringdescMasterserverHost
stringdescMasterserverPort
stringdescMasterserverTrackURL
stringdescMasterserverUpdateURL
stringdescSendNamesAsUTF8
stringdescShowInServerName
stringdescStoreDatabaseInINI
stringdescTrackPlayerJoins
intExcludesHash[HASH_SIZE]
intGUIDsHash[HASH_SIZE]
floatLastLogSaveTime
floatLastLogWriteTime
stringlblAppealContactInfo
stringlblBanDatabaseName
stringlblForceCreateDatabaseFile
stringlblGetFreshList
stringlblLogFileNameMask
stringlblLogFileTimeStamp
stringlblMasterserverAuthPass
stringlblMasterserverAuthUser
stringlblMasterserverHost
stringlblMasterserverPort
stringlblMasterserverTrackURL
stringlblMasterserverUpdateURL
stringlblSendNamesAsUTF8
stringlblShowInServerName
stringlblStoreDatabaseInINI
stringlblTrackPlayerJoins
FileLogLogFile
stringLogFileNameMask
stringLogFileTimeStamp
stringMasterserverAuthPass
stringMasterserverAuthUser
stringMasterserverHost
intMasterserverPort
stringMasterserverTrackURL
stringMasterserverUpdateURL
stringMatchStartTime
array<PlayerController>PendingKicks
array<PlayerController>Players
array<TQueuedPlayerData>QueuedTrackReports
UTANUplinkUplink
UTAN
stringBuild
stringCopyright
Inherited Variables from Engine.Mutator
bAddToServerPackages, bUserAdded, ConfigMenuClassName, DefaultWeapon, DefaultWeaponName, Description, FriendlyName, GroupName, IconMaterialName, NextMutator
Inherited Variables from Engine.Info
BotsGroup, ChatGroup, GameGroup, KickVoteGroup, MapVoteGroup, RulesGroup, ServerGroup

Enumerations Summary
ELogLevel
LL_Status, LL_DumpBans, LL_Update, LL_Message, LL_Warning, LL_Kick, LL_ExternalKick, LL_Error

Structures Summary
CIDR
IP, Prefix
IPBan
Index, IP
TListEntry
ID, GUID, IP, bIsRemote, bIsExclude, bIsCheater, bIsDisabled, HashNext
TQueuedPlayerData
PlayerName, PlayerGUID, PlayerIP

Functions Summary
operatorbool < (GUID A, GUID B))
preoperatorint < (CIDR A))
operatorbool < (MutUTAN.TListEntry A, MutUTAN.TListEntry B))
preoperatorint > (CIDR A))
functionstring CharToUTF8 (int Code))
function CheckForUTANBan (PlayerController Login))
functionstring CidrToString (CIDR IP))
function CompactIPBans ()))
functionstring FillMaskValues (string str))
function FillPlayInfo (PlayInfo PlayInfo))
functionint FindIPBan (int IP))
functionstring GetAdminContact ()))
functionarray<string> GetCurrentLog (optional out string LogFileName, optional out string StartTime))
eventstring GetDescriptionText (string PropName))
functionstring GetServerIP ()))
functionstring GetVersionString (optional bool bNoBuild))
functionstring GuidToString (GUID ID))
function HashBan (int Index))
functionint HashGUID (GUID g))
functionint HexToInt (string HexNumber))
functionstring IntToHex (int i))
functionstring IpToString (int IP))
function LogLine (string Text, ELogLevel LogLevel))
function Mutate (string MutateString, PlayerController Sender))
function OpenLog ()))
functionstring Plural (string Word, int Num))
event PostBeginPlay ()))
function PostLogin (PlayerController Login))
function ProcessDatabaseUpdate ()))
function RecheckForUTANBans ()))
functionCIDR StringToCidr (string IP))
functionGUID StringToGuid (string ID))
functionint StringToIP (string IP))
functionstring StripInvalidChars (string PlayerName))
event Tick (float DeltaTime))
event Timer ()))
functionstring URLEncode (coerce string InputString, bool bEncodeAsUTF8))
functionstring UTF8Encode (string str))
operatorbool ~= (CIDR A, int B))
operatorbool ~= (CIDR A, CIDR B))
Inherited Functions from Engine.Mutator
AddMutator, AlwaysKeep, CanEnterVehicle, CanLeaveVehicle, CheckRelevance, CheckReplacement, Destroyed, DriverEnteredVehicle, DriverLeftVehicle, GetDefaultWeapon, GetInventoryClass, GetInventoryClassOverride, GetServerDetails, GetServerPlayers, IsRelevant, ModifyLogin, ModifyPlayer, Mutate, MutatorFillPlayInfo, MutatorIsAllowed, MyDefaultWeapon, NewRecommendCombo, NotifyLogout, OverrideDownload, ParseChatPercVar, PlayerChangedClass, PreBeginPlay, RecommendCombo, ReplaceWith, ServerTraveling
Inherited Functions from Engine.Info
AcceptPlayInfoProperty, AllowClassRemoval, FillPlayInfo, GetDescriptionText, GetSecurityLevel


Constants Detail

HASH_SIZE Source code

const HASH_SIZE = 2048;


Variables Detail

AppealContactInfo Source code

var private config string AppealContactInfo;

BanDatabaseName Source code

var private config string BanDatabaseName;

BanDB Source code

var UTANBanDatabase BanDB;

BanList Source code

var array<TListEntry> BanList;

BanMessage Source code

var private localized string BanMessage;

BanMessageGUID Source code

var private localized string BanMessageGUID;

BanMessageIP Source code

var private localized string BanMessageIP;

BannedIPs Source code

var array<IPBan> BannedIPs;

bForceCreateDatabaseFile Source code

var private config bool bForceCreateDatabaseFile;

bGetFreshList Source code

var private config bool bGetFreshList;

bLogFileOpened Source code

var bool bLogFileOpened;

bLogFileSaved Source code

var bool bLogFileSaved;

bReceivedInitialUpdate Source code

var bool bReceivedInitialUpdate;

bSendNamesAsUTF8 Source code

var private config bool bSendNamesAsUTF8;

bShowInServerName Source code

var private config bool bShowInServerName;

bStoreDatabaseInINI Source code

var private config bool bStoreDatabaseInINI;

bTrackPlayerJoins Source code

var private config bool bTrackPlayerJoins;

CurrentLogFileName Source code

var string CurrentLogFileName;

DefaultBan Source code

var const editconst TListEntry DefaultBan;
A default ban entry for the UT2004 demo GUID.

DelayedLogs Source code

var array<string> DelayedLogs;

descAppealContactInfo Source code

var localized string descAppealContactInfo;

descBanDatabaseName Source code

var localized string descBanDatabaseName;

descForceCreateDatabaseFile Source code

var localized string descForceCreateDatabaseFile;

descGetFreshList Source code

var localized string descGetFreshList;

descLogFileNameMask Source code

var localized string descLogFileNameMask;

descLogFileTimeStamp Source code

var localized string descLogFileTimeStamp;

descMasterserverAuthPass Source code

var localized string descMasterserverAuthPass;

descMasterserverAuthUser Source code

var localized string descMasterserverAuthUser;

descMasterserverHost Source code

var localized string descMasterserverHost;

descMasterserverPort Source code

var localized string descMasterserverPort;

descMasterserverTrackURL Source code

var localized string descMasterserverTrackURL;

descMasterserverUpdateURL Source code

var localized string descMasterserverUpdateURL;

descSendNamesAsUTF8 Source code

var localized string descSendNamesAsUTF8;

descShowInServerName Source code

var localized string descShowInServerName;

descStoreDatabaseInINI Source code

var localized string descStoreDatabaseInINI;

descTrackPlayerJoins Source code

var localized string descTrackPlayerJoins;

ExcludesHash[HASH_SIZE] Source code

var int ExcludesHash[HASH_SIZE];

GUIDsHash[HASH_SIZE] Source code

var int GUIDsHash[HASH_SIZE];

LastLogSaveTime Source code

var float LastLogSaveTime;

LastLogWriteTime Source code

var float LastLogWriteTime;

lblAppealContactInfo Source code

var localized string lblAppealContactInfo;

lblBanDatabaseName Source code

var localized string lblBanDatabaseName;

lblForceCreateDatabaseFile Source code

var localized string lblForceCreateDatabaseFile;

lblGetFreshList Source code

var localized string lblGetFreshList;

lblLogFileNameMask Source code

var localized string lblLogFileNameMask;

lblLogFileTimeStamp Source code

var localized string lblLogFileTimeStamp;

lblMasterserverAuthPass Source code

var localized string lblMasterserverAuthPass;

lblMasterserverAuthUser Source code

var localized string lblMasterserverAuthUser;

lblMasterserverHost Source code

var localized string lblMasterserverHost;

lblMasterserverPort Source code

var localized string lblMasterserverPort;

lblMasterserverTrackURL Source code

var localized string lblMasterserverTrackURL;

lblMasterserverUpdateURL Source code

var localized string lblMasterserverUpdateURL;

lblSendNamesAsUTF8 Source code

var localized string lblSendNamesAsUTF8;

lblShowInServerName Source code

var localized string lblShowInServerName;

lblStoreDatabaseInINI Source code

var localized string lblStoreDatabaseInINI;

lblTrackPlayerJoins Source code

var localized string lblTrackPlayerJoins;

LogFile Source code

var FileLog LogFile;

LogFileNameMask Source code

var private config string LogFileNameMask;

LogFileTimeStamp Source code

var private config string LogFileTimeStamp;

MasterserverAuthPass Source code

var private config string MasterserverAuthPass;

MasterserverAuthUser Source code

var private config string MasterserverAuthUser;

MasterserverHost Source code

var private config string MasterserverHost;

MasterserverPort Source code

var private config int MasterserverPort;

MasterserverTrackURL Source code

var private config string MasterserverTrackURL;

MasterserverUpdateURL Source code

var private config string MasterserverUpdateURL;

MatchStartTime Source code

var string MatchStartTime;

PendingKicks Source code

var array<PlayerController> PendingKicks;

Players Source code

var array<PlayerController> Players;

QueuedTrackReports Source code

var array<TQueuedPlayerData> QueuedTrackReports;

Uplink Source code

var UTANUplink Uplink;

UTAN

Build Source code

var(UTAN) noexport const editconst string Build;

Copyright Source code

var(UTAN) noexport const editconst string Copyright;


Enumerations Detail

ELogLevel Source code

enum ELogLevel
{
LL_Status, LL_DumpBans, LL_Update, LL_Message, LL_Warning, LL_Kick, LL_ExternalKick, LL_Error
};


Structures Detail

CIDR Source code

struct CIDR
{
var int IP;
var byte Prefix;
};


IPBan Source code

struct IPBan
{
var int Index;
var CIDR IP;
};


TListEntry Source code

struct TListEntry
{
var bool bIsCheater;
var bool bIsDisabled;
var bool bIsExclude;
var bool bIsRemote;
var GUID GUID;
var int HashNext;
var int ID;
var CIDR IP;
};


TQueuedPlayerData Source code

struct TQueuedPlayerData
{
var string PlayerGUID;
var string PlayerIP;
var string PlayerName;
};



Functions Detail

< Source code

static final operator bool < ( GUID A, GUID B) )
Returns True if GUID value A comes before B. Components are treated as unsigned ints with A being more significant that B, etc.

< Source code

static final preoperator int < ( CIDR A) )
Returns the smallest IP in the range.

< Source code

static final operator bool < ( MutUTAN.TListEntry A, MutUTAN.TListEntry B) )
Returns True if A should come before B.

> Source code

static final preoperator int > ( CIDR A) )
Returns the largest IP in the range.

CharToUTF8 Source code

static final function string CharToUTF8 ( int Code) )

CheckForUTANBan Source code

private function CheckForUTANBan ( PlayerController Login) )
Check, whether the player is banned.

CidrToString Source code

static final function string CidrToString ( CIDR IP) )
Converts a CIDR value to an IP string.

CompactIPBans Source code

function CompactIPBans ( ) )
Removes redundant IP bans from the quick-access list.

FillMaskValues Source code

protected function string FillMaskValues ( string str) )

FillPlayInfo Source code

static function FillPlayInfo ( PlayInfo PlayInfo) )
Add the configuration options to the PlayInfo.

FindIPBan Source code

function int FindIPBan ( int IP) )
Return the ban list entry covering the specified IP, or -1 if the IP isn't banned.

GetAdminContact Source code

function string GetAdminContact ( ) )

GetCurrentLog Source code

function array<string> GetCurrentLog ( optional out string LogFileName, optional out string StartTime) )

GetDescriptionText Source code

static event string GetDescriptionText ( string PropName) )
Returns a description for the specified configuration option.

GetServerIP Source code

protected function string GetServerIP ( ) )

GetVersionString Source code

static function string GetVersionString ( optional bool bNoBuild) )

GuidToString Source code

static final function string GuidToString ( GUID ID) )
Reads a GUID and returns a PlayerID string.

HashBan Source code

function HashBan ( int Index) )
Adds the specified ban entry to the corresponding quick-access lists.

HashGUID Source code

static final function int HashGUID ( GUID g) )
Generates an 11 bit hash value from a GUID value for use in the excludes and GUID ban hashes.

HexToInt Source code

static final function int HexToInt ( string HexNumber) )
Converts a hexadecimal string to integer.

IntToHex Source code

static final function string IntToHex ( int i) )
Converts an integer to hexadecimal string.

IpToString Source code

static final function string IpToString ( int IP) )
Converts an int value to an IP string.

LogLine Source code

function LogLine ( string Text, ELogLevel LogLevel) )

Mutate Source code

function Mutate ( string MutateString, PlayerController Sender) )

OpenLog Source code

protected function OpenLog ( ) )

Plural Source code

static final function string Plural ( string Word, int Num) )

PostBeginPlay Source code

event PostBeginPlay ( ) )
Initialize the local ban database and query the UTAN database for updates.

PostLogin Source code

function PostLogin ( PlayerController Login) )
Called after a player has connected to the server.

ProcessDatabaseUpdate Source code

function ProcessDatabaseUpdate ( ) )
Process the data received from the UTAN database.

RecheckForUTANBans Source code

function RecheckForUTANBans ( ) )
Repeats the ban check for all players already verified before.

StringToCidr Source code

static final function CIDR StringToCidr ( string IP) )
Converts an IP string to a CIDR value.

StringToGuid Source code

static final function GUID StringToGuid ( string ID) )
Converts a 32-digit hexadecimal string to a GUID struct.

StringToIP Source code

static final function int StringToIP ( string IP) )
Converts an IP string to a int value.

StripInvalidChars Source code

static function string StripInvalidChars ( string PlayerName) )
Strips control codes and colors from player names.

Tick Source code

event Tick ( float DeltaTime) )
Checks for new players.

Timer Source code

event Timer ( ) )
Send pending track and kick reports and kick banned players.

URLEncode Source code

static final function string URLEncode ( coerce string InputString, bool bEncodeAsUTF8) )
Encodes illegal characters in a string so it can be used in a HTTP request URL. Non-ASCII characters may first be converted to UTF-8 bytes and then URL-encoded.

UTF8Encode Source code

static final function string UTF8Encode ( string str) )

~= Source code

static final operator bool ~= ( CIDR A, int B) )
Returns True if IP B is included in IP range A.

~= Source code

static final operator bool ~= ( CIDR A, CIDR B) )
Returns True if IP range B is included in IP range A.


Defaultproperties

defaultproperties
{
	Build="%%%%-%%-%% %%:%%"
	Copyright="Copyright (c) 2003-2006 UTAN, 2009-2011 Wormbo"
	FriendlyName  = "UTAN Ban Manager v1.04"
	Description   = "The UTAN Ban Manager enforces bans stored in a special ban database.|This version can either load ban updates from a UTAN-compatible masterserver, or rely upon the UTAN Ban List Editor (UBLE) to modify the binary ban database file directly, or load bans from an INI file that can be edited manually with any plain text editor."
	bAlwaysTick   = True


	DefaultBan = (ID=1,GUID=(A=850354575,B=1000468354,C=1694031599,D=-1829262653),bIsDisabled=True) 

	BanDatabaseName     = ""
	bStoreDatabaseInINI = True
	LogFileNameMask     = "UTAN_%i_%p_%y-%m-%d_%h-%n-%s_%g_%l"
	LogFileTimeStamp    = "[%y-%m-%d %h:%n:%s] -"
	bShowInServerName   = False
	AppealContactInfo   = "contact %%admin%%"


	MasterserverHost      = ""
	MasterserverPort      = 80
	MasterserverAuthUser  = ""
	MasterserverAuthPass  = ""
	MasterserverUpdateURL = "/utanupdate.php" 
	MasterserverTrackURL  = "/utantrack.php" 
	bTrackPlayerJoins     = True
	bSendNamesAsUTF8      = True


	lblBanDatabaseName         = "Ban database name"
	lblForceCreateDatabaseFile = "Force creation of ban database"
	lblStoreDatabaseInINI      = "Store database in INI"
	lblLogFileNameMask         = "Log file name mask"
	lblLogFileTimeStamp        = "Time stamp mask"
	lblShowInServerName        = "Show in server name"
	lblAppealContactInfo       = "Appeal contact info"


	lblMasterserverHost      = "Masterserver host name or IP"
	lblMasterserverPort      = "Masterserver port number"
	lblMasterserverAuthUser  = "Masterserver auth username"
	lblMasterserverAuthPass  = "Masterserver auth password"
	lblMasterserverUpdateURL = "Masterserver update URL"
	lblMasterserverTrackURL  = "Masterserver tracker URL"
	lblTrackPlayerJoins      = "Track player joins"
	lblGetFreshList          = "Get fresh ban list"
	lblSendNamesAsUTF8       = "Send data as UTF-8"


	descBanDatabaseName         = "The package/INI name to use for the ban data base. Only change this if you run multiple servers from the same directory."
	descForceCreateDatabaseFile = "If the ban database file does not exist yet, create a new file for the empty database at map change. (turns off automatically)"
	descStoreDatabaseInINI      = "Store the ban database as text in a separate INI file. An INI file will be considerably larger than a binary database file, but can be edited with a simple text editor."
	descLogFileNameMask         = "A mask for the log file name. %y=year, %m=month, %d=day, %h=hour (include am or pm for 12 hours format), %n=minute, %s=second, %i=IP, %p=port, %g=gametype, %l=level"
	descLogFileTimeStamp        = "A mask for the log file name. %y=year, %m=month, %d=day, %h=hour (include am or pm for 12 hours format), %n=minute, %s=second"
	descShowInServerName        = "Add the [UTAN] tag to the server name."
	descAppealContactInfo       = "Banned players see 'Please <AppealContactInfo> for details about this ban', with %%admin%% being replaced by the server admin name and email."


	descMasterserverHost      = "The host name or IP of a HTTP server to load ban list updates from and send player tracking data to. Leave empty to disable remote updating."
	descMasterserverPort      = "The port at which the HTTP server is listening for ban list requests."
	descMasterserverAuthUser  = "The user name for HTTP authentification at the masterserver, if required."
	descMasterserverAuthPass  = "The password for HTTP authentification at the masterserver, if required."
	descMasterserverUpdateURL = "The URL to request initial ban list updates from."
	descMasterserverTrackURL  = "The URL to send player tracking data to."
	descTrackPlayerJoins      = "Whether to send player tracking data to the masterserver."
	descGetFreshList          = "Request a fresh ban list instead of only the diff on next update. (automatically unchecked after receiving a fresh list)"
	descSendNamesAsUTF8       = "Encode player names as UTF-8 instead of ISO-8859-1."


	BanMessage = "Your %%idtype%% matches ban #%%id%%.||Please %%contact%% for details about this ban, providing your GUID (%%guid%%), IP (%%ip%%) and the ban number.||"
	BanMessageIP = "IP"
	BanMessageGUID = "GUID"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Creation time: Sa 23.8.2014 09:18:21.869 - Created with UnCodeX