IF YOU INTEND TO USE THE SYSTEM, PLEASE READ THE WHOLE FILE.

Long ago I coded an advanced ban system. "Advanced" in terms of "not that easy to bypass". It bans players not only by their GUID and IP, but also by their name (if enabled) and by 7 other criteria.
It is probably useless as 99,999999999% of the players dont know how to bypass bans anyway but I included it in the CM so that these 1800 lines of code don't float around on my PC unused
until they are lost.
Thus also no menu exists for editing bans and only few commands are available. Furthermore I couldn't test it much so there might still be bugs and problems, although it worked for me very well.
The ban system doesn't prevent banned players from joining the server as the system needs a client-server environment but they are kicked after ~5 seconds.
Anyway, here we go:


-------------------------------------------------------------
Important things to remember
-------------------------------------------------------------
Read the next section, then read this one.^^

If some ban information is no longer up-to-date, i.e. if some ban criterion of a banned player is no longer found (e.g. the Data4 setting), it will
automatically be updated. However, there are some pitfalls here: Lets assume you have set bDontBanBySavedNames to false, i.e. a ban criterion is the players
name. Furthermore there is a ban in place which contains the saved name "Gugi". If now the real banned player joins, everything is OK, but if an innocent player joins
which happens to have the name "Gugi", he will be kicked from the server and all other settings (all Data-settings) are updated.

So, you get the point: 1 matching ban criterion is enough to kick the player and to update all others.

Generally I suggest you only use the ban system if normal GUID bans are no longer effective to avoid such problems.


-------------------------------------------------------------
Configuration of the CMBanSystem
-------------------------------------------------------------
The ban system can be enabled by setting bEnableCMBanSystem to true (available in all profiles and in the WebAdmin interface).
All other CMBanSystem-related settings (including the actual bans) are saved in the ClanManagerBans.ini.

- The configuration in the ini looks like this (these are the defaults):
    [ClanManager1h.CMBanSystem]
    BanLogTemplate=
    bDontSaveNames=False
    bDontSaveIPs=False
    bDontSaveGUIDs=False
    bDontBanBySavedNames=True
    bDontBanBySavedIPs=False
    bDontBanBySavedGUIDs=False
    KickTimeoutSeconds=200
    ExcludedNames=Spieler
    ExcludedNames=Player

  BanLogTemplate: The name of the log file where new bans and other information are logged to. Leave it empty to log to the main server log. Can contain macros like %Map or %IP.
            If bDelayedLogs (in the global profile) is enabled the log is only created when real information is logged.
  bDontSaveNames: If true, no new names of banned players are saved (they still join the server before they are kicked) (affects all bans). Note: The name used on the ban creation is always saved.
  bDontSaveIPs: Similar to bDontSaveNames: If true no IPs (not even on the ban creation) are saved (affects all bans).
  bDontSaveGUIDs: Similar to bDontSaveNames: If true no GUIDs (not even on the ban creation) are saved (affects all bans).
  bDontBanBySavedNames: If true, players will not be kicked if they wear a name which is saved in some ban (in the UsedNames array). Recommended to set this to true.
  bDontBanBySavedIPs: If true, players will not be kicked if they use an IP which is saved in some ban (in the UsedIPs array).
  bDontBanBySavedGUIDs: If true, players will not be kicked if they use a GUID which is saved in some ban (in the UsedGUIDs array).
  KickTimeoutSeconds: If this value is above 0 the player is kicked upon ban creation and ban checks if he doesn't response. Set it to 0 to disable it.
  ExcludedNames: This is a list of names which are always ignored in the name checks.
  CMBanIDs: Don't modify this list directly. It holds a list of BanIDs which are used to identify the bans.

- Besides these default settings there are some arrays which have no default value. They look like this in the ini file:
    [ClanManager1h.CMBanSystem]
    CMBanIDs=0
    CMBanIDs=1
    BannedIPRanges=32.123.23?.*
    BannedIPRanges=*.111.222.113.2

  CMBanIDs: Don't modify this list directly. It holds a list of BanIDs which are used to identify and load the bans.
  BannedIPRanges: A list of banned IPs. Use a * to skip an unknown number of characters, a ? to skip 1 character. bDontBanBySavedIPs doesn't effect this setting.
  BannedNameTemplates: A list of banned names. Same here with * and ?. bDontBanBySavedNames doesn't effect this setting.
  BannedGUIDRanges: A list of banned GUIDs. *Ahem* (useless here, but still the) same here with * and ?. bDontBanBySavedGUIDs doesn't effect this setting.


-------------------------------------------------------------
Configuration format of the bans
-------------------------------------------------------------
The actual ban data is also saved in the ClanManagerBans.ini. Its settings can only directly be modified in this ini.

A ban entry looks like this:
    [4 CMBan]
    bDeleteThisBan=False
    bDontSaveNames=False
    bDontSaveGUIDs=False
    bDontSaveIPs=False
    CMID=7815696ecbf1c96e6894b779456d330e
    Data1=a8f5f167f44f4964e6c998dee827110c
    Data2=0c1bd425fdb28662b01a8615854397cc
    Data3=02d9cbb3d8578fe4d188e32562fe8601
    Data4=4fd9f46520b8c56340b6de864f863a1f
    Data5=abdd0e188b298eae1e2f8a3a67aca05a
    Data7=e1f87faeb5091a535b9cc8dc2f59966d
    UsedNames=test
    UsedNames=IdoticPlayer
    UsedGUIDs=808c652a883364a247c9df8ae142ad20
    UsedGUIDs=60b04a1729e4ce2913c07bdba7a79ba3
    UsedIPs=242.118.128.71
    UsedIPs=122.168.38.111
    Data6=58450f20359ade55a691fb33f35c9356
    Data6=e44383950b53b422b52e4a89e389ba94

The number in the header (here 4) indicates the BanID. The ban is loaded if this ID is found in the CMBanIDs list.

The only settings you should need to modify are:
  bDeleteThisBan: If you want to delete a ban manually, do not simply remove the this section and the BanID. Instead set this to true. The next time the player joins the ban is automatically deleted.
  bDontSaveNames: If true, no new names are saved (only affects this ban).
  bDontSaveGUIDs: If true, no new GUIDs are saved (only affects this ban).
  bDontSaveIPs: If true, no new IPs are saved (only affects this ban).
  
For information purpose the UsedNames, UsedGUIDs and the UsedIPs lists are interesting, but they should not need any modifications.
The other settings are used to identify the banned player and really should not be modified.


-------------------------------------------------------------
Commands available
-------------------------------------------------------------
- CM ShowBanIDs: Shows a list of BanIDs.
- CM ShowBanData ID: Shows the saved ban data of the ban with the specified ID.
- CM CMBanPlayer Name: Bans a player. Name can be a part of the name, or the player (!) ID (you can get it with CM GetPlayerIDs, usage: "ID:4").
- CM RemoveCMBan ID: Marks the ban with the specified ID as obsolete. The ini entry is deleted the next time the player joins the server.
