The /ban Command
The first way to ban a player is by using the /ban command followed by the player's name or index number. This type of ban is lifted once Battlezone II is shut down so it is not a good permanent solution. This method works great if you want someone banned right now. I recommend banning by Index due to muffin. He will join in with a name that looks 100% identical to a player already in-game. He will join a game as Leutenant-ita while his name is Ieutenant-ita. The uppercase i and lowercase L look completely identical in Battlezone II's font.
To ban a player, type in /list. This gives you a list of player names in-game along with their player index number. Once you have that index number, type /ban [index #]. For example /ban 1. The same applies to the kick command. For muffin, I recommend a kick, followed by a ban.
Editing banlist.ini
This is the second way you can ban players from your server. This method is permanent, unless you remove a banned IP from your list or you edit the banlist.ini file. To use this option, it is best you understand binary as that is how the netmask works.
Binary Basics
Binary exists of purely 1's and 0's. You read binary going from right to left. The digits, in an IPv4 address are 128 64 32 16 8 4 2 1. The very far right digit being 1, the next being 2, etc. For example the number 5 is 101. You take the 1 plus the 4 to come up with 5. I'll get more into this when I provide example IPs that I have banned.
If you want to calculate 192 it is 11000000 because 128 + 64 is 192. If you want to calculate 224, it is 11100000 because 128 + 64 + 32 is 244. For something different. If you want to calculate 129, it is 10000001 because 128 + 1 = 129. If you wanted to calculate 130 it is 10000010 because 128 + 2 = 130.
My Banlist
Ban IP Settings//BanIP1 = "68.3.228.114/24" // Sean/SeanTheGreat, who seems to be trying to cause lag in games
BanIP2 = "194.45.228.126/24"
BanIP3 = "46.16.33.209/24"
BanIP4 = "69.180.10.90/24" //Claims to be Nielk1
BanIP5 = "199.255.209.168/24" //Using Axeminister's Name
When you ban a player, you must specify the ip address followed by the netmask. For example for BanIP2, 194.45.228.126 is Muffin's IP, and the /24 is the netmask.
Basics on netmask
I am going to use the BanIP = 194.45.228.126/24" to describe how this works. If I specify 194.45.228.126/32, only the single IP address 194.45.228.126 is banned. If his IP changes at all, he will get around the ban. If you use 194.45.228.126/24, any IP addresses starting with 194.45.228.* will be banned. The * is a range of 0 to 255. If you use 194.45.228.126, any IP starting with 194.45.*.* will be banned. Again * is a wild card meaning anything between the number of 0 to 255 are banned.
With netmask you want to be careful. You can easily ban more IPs than intended.
Where the netmask comes from
IPv4 is a 32-bit numeric address consisting of 1's and 0's. Each section consists of 8 1's and 0's. 194 is 11000010 in binary. If you count the digits, there should be 8.
Converting from Decimal to Binary]There are multiple ways to convert from decimal to binary. I'll cover the manual way and using the windows calculator.
Using Windows Calculator to Convert Decimal to Binary
1) Open up Windows Calculator located in Start -> All Programs - Accessories -> Calculator
2) Click View -> Programmer. This switches it to programmer mode which does decimal to binary conversions and vice versa.
3) Type in the number you want converted, for example 194. Once you see the number in the calculator, click on the Bin radio button.
This gives the output 11000010. This worked out perfectly because it gave an eight digit result.
4) Now click on the Dec radio button to switch back to decimal.
5. Now type in 45, then switch back to binary. This gives you the result 101101. This isn't as helpful as it only gives you six of the eight digits.
This is easy enough to fix. Just add two leading zeros 101101 now becomes 00101101.
Manually Converting Decimal to Binary
Converting from Decimal to Binary is fortunately fairly straight forward. The only math required is basic addition. The way I do it is to write out the following.
0 0 0 0 0 0 0 0
128 064 032 016 008 004 002 001
Going from right to left, you change the 0's to 1's. Then you add up the buttom numbers until your result is what you are trying to calculate.
1) You can also take the number you want to calculate, for example 145.
2) Since 128 is smaller then 145, change the 0 above the 128 to a 1. Now subtract 128 from 145. This gives you a remainder of 17.
3) Now work on towards the right until you find a digit less than or equal to 17. As 64 is greater than 17, leave the zero. Move on until you find the next number smaller than 17 which happens to be 16.
4) Change the zero above 16 to a 1. Again subtract 16 from 17 to give you a remainder of 1.
5) Now move on to the right until you find the digit equal or less than 1. Then change this to a 1.
6) The end result gives you 10010001
Banning a Changing IP Address
If a player's IP changes slightly, you will want to convert the player's IP address to binary (see above). That way you can see what portion of the IP is consistent vs. what portion changes. I am again going to use the IP address 194.45.228.126 as a demonstration IP address.
A Second IP ExampleIP in Decimal Notation: 194.45.228.126
IP in Binary Notation: 11000010 00101101 11100100 01111110
Example IP: 11000010 00101101 11100100 01000001
Example IP 2: 11000010 00101101 11100100 01100000
Example IP 3: 11000010 00101101 11100100 01111101
I have bolded the portions of the IP address that remain the same for ease of reading. If you count the number of 1's and 0's, from left to right, you will count a total of 24. In this case, a /24 will suffice. Depending on the IP and the ISP, you may not run into a perfect /8, /16, /24, /32 IP netmask. That was the case with Vearie. Look below for the Vearie example.
The following is Vearie's IP address.
98.206.106.199/16 = Banlist entry
98.206.113.173 = veary new IP
That is why I added the /16 since that third octet has changed once before.
1100010.11001110.1101010.11000111
1100010.11001110.1110001.10101101
With the above IPs, a /18 would cover the ban as the first 18 bits have not changed. That doesn't mean they WON'T change.