- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=ed9be8d1b1a544f89bcdd7d36876fede
+ - EXPECT=3fb0c7a99263dd44e026804c12da2fa2
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
set g_dynamic_handicap_min 0 "The minimum value of the handicap."
set g_dynamic_handicap_max 0 "The maximum value of the handicap."
+// ===============
+// kick teamkiller
+// ===============
+set g_kick_teamkiller_rate 0 "Limit for teamkills per minute before the client gets dropped. 0 means that the teamkillers don't get kicked automatically"
+set g_kick_teamkiller_lower_limit 5 "Minimum number of teamkills before the teamkill rate is considered"
+
// =====================
// stale-move negation
// =====================
case "kd": return CTX(_("SCO^k/d"));
case "kdr": return CTX(_("SCO^kdr"));
case "kills": return CTX(_("SCO^kills"));
+ case "teamkills": return CTX(_("SCO^teamkills"));
case "laps": return CTX(_("SCO^laps"));
case "lives": return CTX(_("SCO^lives"));
case "losses": return CTX(_("SCO^losses"));
LOG_INFO(_("^3deaths^7 Number of deaths"));
LOG_INFO(_("^3suicides^7 Number of suicides"));
LOG_INFO(_("^3frags^7 kills - suicides"));
+ LOG_INFO(_("^3teamkills^7 Number of teamkills"));
LOG_INFO(_("^3kd^7 The kill-death ratio"));
LOG_INFO(_("^3dmg^7 The total damage done"));
LOG_INFO(_("^3dmgtaken^7 The total damage taken"));
" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
" -teams,lms/deaths +ft,tdm/deaths" \
" -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
+" +teams/teamkills"\
" -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \
" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \
" +ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes" \
#include <common/mutators/mutator/instagib/_mod.inc>
#include <common/mutators/mutator/invincibleproj/_mod.inc>
#include <common/mutators/mutator/itemstime/_mod.inc>
+#include <common/mutators/mutator/kick_teamkiller/_mod.inc>
#include <common/mutators/mutator/melee_only/_mod.inc>
#include <common/mutators/mutator/midair/_mod.inc>
#include <common/mutators/mutator/multijump/_mod.inc>
#include <common/mutators/mutator/instagib/_mod.qh>
#include <common/mutators/mutator/invincibleproj/_mod.qh>
#include <common/mutators/mutator/itemstime/_mod.qh>
+#include <common/mutators/mutator/kick_teamkiller/_mod.qh>
#include <common/mutators/mutator/melee_only/_mod.qh>
#include <common/mutators/mutator/midair/_mod.qh>
#include <common/mutators/mutator/multijump/_mod.qh>
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc>
+#endif
--- /dev/null
+// generated file; do not modify
--- /dev/null
+
+float autocvar_g_kick_teamkiller_rate;
+float autocvar_g_kick_teamkiller_lower_limit;
+
+REGISTER_MUTATOR(kick_teamkiller, (autocvar_g_kick_teamkiller_rate > 0));
+
+MUTATOR_HOOKFUNCTION(kick_teamkiller, PlayerDies)
+{
+ if (!teamplay)
+ {
+ return;
+ }
+ if (warmup_stage)
+ {
+ return;
+ }
+ entity attacker = M_ARGV(1, entity);
+ if (!IS_REAL_CLIENT(attacker))
+ {
+ return;
+ }
+
+ int teamkills = PlayerScore_Get(attacker, SP_TEAMKILLS);
+ // use the players actual playtime
+ float playtime = time - CS(attacker).startplaytime;
+ // rate is in teamkills/minutes, playtime in seconds
+ if (teamkills >= autocvar_g_kick_teamkiller_lower_limit &&
+ teamkills >= autocvar_g_kick_teamkiller_rate*playtime/60.0)
+ {
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_TEAMKILL, attacker.netname);
+ dropclient(attacker);
+ }
+}
MSG_INFO_NOTIF(QUIT_DISCONNECT, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 disconnected"), "")
MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for idling"), "")
MSG_INFO_NOTIF(QUIT_KICK_SPECTATING, N_CONSOLE, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
+ MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for excessive teamkilling"), "")
MSG_INFO_NOTIF(QUIT_SPECTATE, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "")
MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "")
REGISTER_SP(KILLS);
REGISTER_SP(DEATHS);
REGISTER_SP(SUICIDES);
+REGISTER_SP(TEAMKILLS);
REGISTER_SP(FRAGS);
REGISTER_SP(ELO);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
+ // player was spectator
if (CS(this).killcount == FRAGS_SPECTATOR) {
PlayerScore_Clear(this);
CS(this).killcount = 0;
+ CS(this).startplaytime = time;
}
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
ATTRIB(Client, motd_actived_time, float, this.motd_actived_time);
ATTRIB(Client, jointime, float, this.jointime);
ATTRIB(Client, spectatortime, float, this.spectatortime);
+ ATTRIB(Client, startplaytime, float, this.startplaytime);
ATTRIB(Client, version_nagtime, float, this.version_nagtime);
ATTRIB(Client, netname_previous, string, this.netname_previous);
ATTRIB(Client, allowed_timeouts, int, this.allowed_timeouts);
float game_completion_ratio; // 0 at start, 1 near end
.float winning;
-.float jointime; // time of joining
+.float jointime; // time of connecting
+.float startplaytime; // time of switching from spectator to player
.float alivetime; // time of being alive
.float motd_actived_time; // used for both motd and campaign_message
else
{
// teamkill
- GameRules_scoring_add(attacker, KILLS, -1); // or maybe add a teamkills field?
+ GameRules_scoring_add(attacker, TEAMKILLS, 1);
}
}
else
PlayerStats_GameReport_AddTeam(t);
}
-float TeamScore_AddToTeam(float t, float scorefield, float score)
+float TeamScore_AddToTeam(int t, float scorefield, float score)
{
entity s;
* NEVER call this if team has not been set yet!
* Returns the new score.
*/
-float TeamScore_AddToTeam(float t, float scorefield, float score);
+float TeamScore_AddToTeam(int t, float scorefield, float score);
/**
* Returns a value indicating the team score (and higher is better).
ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
if (!INDEPENDENT_PLAYERS)
+ {
ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
+ ScoreInfo_SetLabel_PlayerScore(SP_TEAMKILLS, "teamkills", SFL_LOWER_IS_BETTER);
+ }
if(score_enabled)
ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);