Merge branch 'menu-gamestochat' into 'master'

Add "gamestochat" cvar to Server Options

See merge request KartKrew/Kart!2202
This commit is contained in:
James R. 2024-04-02 00:41:28 +00:00
commit 327b4184c7
3 changed files with 22 additions and 2 deletions

View file

@ -1331,7 +1331,7 @@ consvar_t cv_chatwidth = Player("chatwidth", "150").min_max(64, 150);
// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.) // old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.)
consvar_t cv_consolechat = Player("chatmode", "Yes").values({{0, "Yes"}, {2, "No"}}); consvar_t cv_consolechat = Player("chatmode", "Yes").values({{0, "Yes"}, {2, "No"}});
consvar_t cv_gamestochat = Player("gamestochat", "0").values(CV_Unsigned); consvar_t cv_gamestochat = Player("gamestochat", "0").min_max(0, 99);
void Mute_OnChange(void); void Mute_OnChange(void);
consvar_t cv_mute = UnsavedNetVar("mute", "Off").on_off().onchange(Mute_OnChange); consvar_t cv_mute = UnsavedNetVar("mute", "Off").on_off().onchange(Mute_OnChange);

View file

@ -282,7 +282,24 @@ void SV_BumpMatchStats(void)
serverplayer_t *stat = SV_GetStatsByPlayerIndex(i); serverplayer_t *stat = SV_GetStatsByPlayerIndex(i);
if (!(players[i].pflags & PF_NOCONTEST)) // It should never be advantageous to idle, only count rounds where the player accomplishes something.
// If you NO CONTESTed, assume no participation...
boolean participated = !(players[i].pflags & PF_NOCONTEST);
if (gametyperules & GTR_CIRCUIT)
{
// ...unless you completed at least one lap...
if (players[i].laps > 1)
participated = true;
}
else if (gametyperules & GTR_POINTLIMIT)
{
// ...or scored at least 2 points.
if (players[i].roundscore > 1)
participated = true;
}
if (participated)
stat->finishedrounds++; stat->finishedrounds++;
} }
} }

View file

@ -81,6 +81,9 @@ menuitem_t OPTIONS_Server[] =
{IT_STRING | IT_CVAR, "Chat Spam Protection", "Prevent too many messages from a single player.", {IT_STRING | IT_CVAR, "Chat Spam Protection", "Prevent too many messages from a single player.",
NULL, {.cvar = &cv_chatspamprotection}, 0, 0}, NULL, {.cvar = &cv_chatspamprotection}, 0, 0},
{IT_STRING | IT_CVAR, "Rounds Needed To Chat", "How many rounds players must complete before they can chat. Good vs. ban evaders.",
NULL, {.cvar = &cv_gamestochat}, 0, 0},
{IT_SPACE | IT_DYBIGSPACE, NULL, NULL, {IT_SPACE | IT_DYBIGSPACE, NULL, NULL,
NULL, {NULL}, 0, 0}, NULL, {NULL}, 0, 0},