As we often try to answer questions about teamkilling process, I've tried to find out how it works once in for all, but I didn't manage to find some documentation about it. Those on the official b3 website are quite light, so I dug into the code to see how it works. I don't give any warranty on what I found, I'm just sharing =)
As you know, the TK system is based on the warning system. Warning TKers was done manually by admins, then the TK plugin has been developped to automatically warn teamkills and teamdamages. The TK plugin also handle the forgiving commands.
When you TK someone,
2 things happen :
the damage points you give are recorded and a warning is sent to you. Damage points depend on
2 parameters : the client level, which acts like a damage multiplier (related to regular user/moderator/admin status) and the fact that you kill or not the victim. There is a third value called ban_length, I will talk about it later. Here is the (simplified) multiplier table for the TDM server :
______level_______|_kill multi_|_damage multi_| ban length
------------------------------------------------------------------------
normal user ______|____2____|_____1_______|___2
moderator (lev 40)_|__0.75 ___|___0.5_______|___0
admin (lev > 40)___|__ 0.75___|___0.5_______|___0
For example, if you are a normal user, you get 100*2 = 200 damage points for killing someone. If you are a moderator and you shoot someone in the helmet with LR300 without killing him, you get round(51*0.5) = 25 damage points.
The second thing is the client warning. A warning sent to a client doesn't mean he will actually get a message, it depends on some additional conditions I won't describe here. When an attacker get a warning from the TK plugin, some values are stored :
the message ("Do not attack teammates, Attacked:") and the
warning duration (to simplify). The warning duration determines the expiration time of the warning. The default value for a TK is 1 hour (
plugin_admin.xml:spamages/warn_reasons/generic). It means that the warning will be deactivated 1h later after the TK. There is a specific case : when you get the message "Rule #9: Do NOT fire at teammates or within 10 seconds of spawning", that means you have killed someone within 7 secondes of spawning when the map starts (
plugin_tk.xml:settings/round_grace). In this case, you will get a warning duration of 3h (
plugin_admin.xml:spamages/warn_reasons/rule9), plus tripled amount of damage points.
Now I will try to describe how the kick/tempban process works. The important thing to understand is that
you can be banned from two different b3 systems : the TK plugin or the standard b3 warning system (actually the admin plugin). The main difference is that the global b3 warning system takes in account other warnings, like saying bad words or be warned by admins for camping, so it cumulates standard warning and TK warnings.
For the TK plugin way of ban:The first thing to know is that all the
damage points you have are divided by 2 when the round ends. All players get a maximal amount of points when they connect, which is
400 on the TDM server (
plugin_tk.xml:settings/max_points). When you damage or kill someone, the TK plugin compares the total amount of damage points with the maximal amount. If it exceeds this limit, there are 2 possibilities : if the amount of damage points is greater or equal to the max amount * 1.5 (= 600 on the server), the attacker is banned for a duration equal to the "ban length" value written above in the table, after having been sent the "team damage over limit" message. If it's not the case, the famous message "Alert: X auto-kick if not forgiven" is sent to all players, who have 30 seconds to forgive the attacker and prevent him to being banned. After these 30 seconds, if the damage points are still greater than the maximal amount, the attacker get banned for a duration equal to ban length * number of players attacked.
For the standard warning way of ban:The ban mechanism is quite different from the TK plugin. As I said before, players get warned for
various reasons, including of course TK, but also bad words and manual warnings. In fact, bad words warnings are automatically sent by the Censor plugin, which analyses each sentences said by players. Every warnings sent to players are stored until they expire. As you know, some warnings are predefined : if you type !warn X camp, a warning will be sent to the player. It is composed of a message "stop camping or you will be kicked!" as well as a duration (1h in this case). So after a while if you are nasty, you have a warning list.
As soon as there are 4 warnings in this list, (4 is a value set in
plugin_admin.xml:warns/alert_kick_num), the message "ALERT: X auto-kick from warnings if not cleared" is displayed. If not enough warnings are cleared in the 25 seconds following the message the player get banned temporary, in some cases with the "peeing in the gene pool" message. The length of the ban is a little more difficult to calculate than TK, so not described here.
To illustrate these actions, let's take some case studies.
1. Jochen, the day he wrote the post about TKFor those who don't know, ban data are extracted from the echelon system which logs warnings and ban for everyone.
| Penalty-type | Added | Expires | Reason
Warning___Sunday, 28/06/2009 (18:59)___Sunday, 28/06/2009 (19:59)___Do not attack teammates, Attacked: stupidHUNter (200)
Warning___Sunday, 28/06/2009 (19:23)___Sunday, 28/06/2009 (20:23)___Do not attack teammates, Attacked: Libertaire_Pengu (200)
Warning___Sunday, 28/06/2009 (19:35)___Sunday, 28/06/2009 (20:35)___Do not attack teammates, Attacked: stupidHUNter (200)As you can see the total amount of damage would be 600 if the "divided by 2 at each round end" rule wasn't applied. Then Jochen teamkills someone again :
Warning___Sunday, 28/06/2009 (19:45)___Sunday, 28/06/2009 (20:45)___Do not attack teammates, Attacked: MEZARCI_Player (200)At this moment, we can assume that the total amount of damage is less than 400, because :
- first warning takes place at 18:59. We can imagine that rounds last about 10 minutes (for example 18:57, 19:07, 19:17, 19:27, 19:37). So the amount of damage points for the first warning is, thanks to the divisions by 2 : 200*(1/2)^4 = 12 (rounded).
- second warning : 200*(1/2)^2 = 50
- third warning : 200*1/2 = 100
- last warning : 200
Sum = 375 points < 400, so the TK plugin doesn't ban him. But a 4th warning occurs, and at time 19:45 no warning has expired yet, so the warning system still ban him :
TempBan___Sunday, 28/06/2009 (19:46)___Sunday, 28/06/2009 (19:54)___too many warnings: Do not attack teammates, Attacked: MEZARCI_Player (200)You can see that the duration is equal to 8 minutes : duration = ban length * number of TK warnings, so 4*2m for a regular player.
2. Still from Jochen, a little bit laterWarning___Sunday, 28/06/2009 (22:41)___Monday, 29/06/2009 (01:41)___Rule #9: Do NOT fire at teammates or within 10 seconds of spawningAs you can see, teamkilling at the beginning of the round gives you a 3h penalty (
plugin_admin.xml:spamages/warn_reasons/rule9)
TempBan___Sunday, 28/06/2009 (22:42)___Sunday, 28/06/2009 (22:44)___team damage over limitHe got banned just after, but no additional lines in echelon because it only logs teamkills and not team damages. The previous penalty added to some damage make the total damage points greater than 400, so this time the TK plugin banned him.
3. From Fedakyn, to illustrate combination between bad word and team killing warningsWarning___Monday, 29/06/2009 (00:23)___Thursday, 02/07/2009 (00:23)___Rule #8: No profanity or offensive language (in any language) ( bitches => bitches )Using some bad word for a regular player cost him a 3 days warning... (
plugin_admin.xml:spamages/warn_reasons/rule9)
Warning___Monday, 29/06/2009 (15:16)___Thursday, 02/07/2009 (15:16)___Rule #8: No profanity or offensive language (in any language) ( fuck => fuck )
Warning___Monday, 29/06/2009 (15:16)___Monday, 29/06/2009 (16:16)___Do not attack teammates, Attacked: neuner96 (200)
Warning___Monday, 29/06/2009 (15:40)___Thursday, 02/07/2009 (15:40)___Rule #8: No profanity or offensive language (in any language) ( asshole => asshole )4 warnings with different reasons, then :
TempBan___Monday, 29/06/2009 (15:41)___Monday, 29/06/2009 (22:55)___too many warnings: peeing in the gene pool ( asshole => asshole )The 3 days warning duration is quite long : this may explain the "I was kicked although I didn't kill anyone" thing that some people complain about. It reminds me an old thread about that (
forum-gameserver-support/was-kicked-but-why-t156.html). Imagine you have said 2 bad words in the past 3 days, that you got a warning for "spectator too long on full server", and then you teamkill only one guy : you are banned for too many warnings. The ban can last hours, because ban duration for too many warnings is calculated by taking the whole duration of the warnings divided by 30, which would mean in this case 6 days divided by 30 = almost 5 hours only for the first two warnings...
I hope I've been clear... anyway this is not exhaustive, it just gives the general behavior of teamkilling management system as I think it works from the source code point of view...