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

UTANBanManager104.BanDatabase


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
/******************************************************************************
Stores bans in an INI file.

Creation date: 2010-03-31 18:24
Last change: $Id$
Copyright (c) 2010-2011, Wormbo
******************************************************************************/

class BanDatabase extends UTANBanDatabase within UTANBanDatabase config perobjectconfig dependson(MutUTAN);


struct TEntry {
	var config int ID;
	var config string GUID;
	var config string IP;
	var config bool Remote;
	var config bool Exclude;
	var config bool Cheater;
	var config bool Disabled;
};

var config array<TEntry> Entry;


function int GetNumEntries()
{
	return Entry.Length;
}

function ClearEntries()
{
	Entry.Length = 0;
	BanReasons.Length = 0;
	SortedReasons.Length = 0;
}

function MutUTAN.TListEntry GetEntry(int Index)
{
	local MutUTAN.TListEntry Result;

	Result.ID          = Entry[Index].ID;
	Result.GUID        = class'MutUTAN'.static.StringToGuid(Entry[Index].GUID);
	Result.IP          = class'MutUTAN'.static.StringToCidr(Entry[Index].IP);
	Result.bIsRemote   = Entry[Index].Remote;
	Result.bIsExclude  = Entry[Index].Exclude;
	Result.bIsCheater  = Entry[Index].Cheater;
	Result.bIsDisabled = Entry[Index].Disabled;

	return Result;
}


function int AddEntry(MutUTAN.TListEntry ListEntry)
{
	local int i;

	i = Entry.Length;
	Entry.Length = i + 1;
	Entry[i].ID       = ListEntry.ID;
	Entry[i].GUID     = class'MutUTAN'.static.GuidToString(ListEntry.GUID);
	Entry[i].IP       = class'MutUTAN'.static.CidrToString(ListEntry.IP);
	Entry[i].Remote   = ListEntry.bIsRemote;
	Entry[i].Exclude  = ListEntry.bIsExclude;
	Entry[i].Cheater  = ListEntry.bIsCheater;
	Entry[i].Disabled = ListEntry.bIsDisabled;

	return i;
}

function bool SaveDatabase(LevelInfo Level, string BanDatabaseName)
{
	SaveConfig();
	return true;
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sa 26.3.2011 14:35:26.000 - Creation time: Sa 23.8.2014 09:18:42.308 - Created with UnCodeX