From 8abb7358a12b272020bd94ed015cbba6aadea2a9 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Tue, 30 Apr 2002 11:20:12 +0000 Subject: [PATCH] Redid the teamcount cvars. --- reaction/cgame/cg_local.h | 6 ++++++ reaction/cgame/cg_main.c | 9 +++++++++ reaction/cgame/cg_servercmds.c | 23 ++++++++++++++++++++++- reaction/game/g_local.h | 9 ++++++--- reaction/game/g_main.c | 15 +++++++++------ reaction/game/g_teamplay.c | 11 ++++++++--- 6 files changed, 60 insertions(+), 13 deletions(-) diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index a7e6fb70..0b7b224e 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.69 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.68 2002/04/29 06:11:28 niceass // centerprint, pressure and matchmode stuff // @@ -1617,6 +1620,9 @@ extern vmCvar_t cg_RQ3_lca; extern vmCvar_t cg_RQ3_team_round_going; extern vmCvar_t cg_RQ3_team1name; extern vmCvar_t cg_RQ3_team2name; +extern vmCvar_t cg_RQ3_teamCount1; +extern vmCvar_t cg_RQ3_teamCount2; +extern vmCvar_t cg_RQ3_numSpectators; //Slicer: matchmode team status cvars extern vmCvar_t cg_RQ3_RefID; extern vmCvar_t cg_RQ3_matchmode; diff --git a/reaction/cgame/cg_main.c b/reaction/cgame/cg_main.c index 6e15b9c7..9a042186 100644 --- a/reaction/cgame/cg_main.c +++ b/reaction/cgame/cg_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.59 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.58 2002/04/29 06:12:40 niceass // client matchmode stuff // @@ -307,6 +310,9 @@ vmCvar_t cg_RQ3_lca; vmCvar_t cg_RQ3_team_round_going; vmCvar_t cg_RQ3_team1name; vmCvar_t cg_RQ3_team2name; +vmCvar_t cg_RQ3_teamCount1; +vmCvar_t cg_RQ3_teamCount2; +vmCvar_t cg_RQ3_numSpectators; //Slicer: matchmode team status cvars vmCvar_t cg_RQ3_RefID; @@ -473,6 +479,9 @@ static cvarTable_t cvarTable[] = { // bk001129 { &cg_RQ3_team_round_going, "cg_RQ3_team_round_going", "0", CVAR_ROM}, { &cg_RQ3_team1name, "g_RQ3_team1name", "0", 0}, { &cg_RQ3_team2name, "g_RQ3_team2name", "0", 0}, + { &cg_RQ3_teamCount1, "cg_RQ3_teamCount1", "0", CVAR_ROM}, + { &cg_RQ3_teamCount2, "cg_RQ3_teamCount2", "0", CVAR_ROM}, + { &cg_RQ3_numSpectators, "cg_RQ3_numSpectators", "0", CVAR_ROM}, { &cg_gravity, "g_gravity", "0", 0}, //Slicer: Team Status Cvars for MM { &cg_RQ3_matchmode, "g_RQ3_matchmode", "0", 0}, diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index 3c57bc36..8ad4f2f7 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.29 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.28 2002/04/18 16:13:23 jbravo // Scoreboard now shows green for live players and white for dead. // Time should not get reset on deaths any more. @@ -1338,7 +1341,25 @@ static void CG_ServerCommand( void ) { cg.showScores = qtrue; cg.scoreTPMode = 0; return; - } + } +// JBravo: Number of players hack. + if (!strcmp(cmd, "setteamplayers")) { + int team, number; + char teamz[64]; + + team = atoi(CG_Argv(1)); + number = atoi(CG_Argv(2)); + Com_sprintf (teamz, sizeof(teamz), "%i", number); + + if (team == TEAM_RED) + trap_Cvar_Set("cg_RQ3_teamCount1", teamz); + else if (team == TEAM_BLUE) + trap_Cvar_Set("cg_RQ3_teamCount2", teamz); + else if (team == TEAM_SPECTATOR || team == TEAM_FREE) + trap_Cvar_Set("cg_RQ3_numSpectators", teamz); + return; + } + // JBravo: radio. This implementation rules. Used to suck :) if (!strcmp(cmd, "playradiosound")) { int sound, gender; diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 036f61a0..128abfd5 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.73 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.72 2002/04/29 06:17:20 niceass // small change to pressure system // @@ -1124,9 +1127,9 @@ extern vmCvar_t g_RQ3_team2name; // JBravo: cvar for the name of team 2 extern vmCvar_t g_RQ3_team1model; // JBravo: team 1 model and skin extern vmCvar_t g_RQ3_team2model; // JBravo: team 2 model and skin extern vmCvar_t g_RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress -extern vmCvar_t g_RQ3_teamCount1; // JBravo: cvar for the UI join menus -extern vmCvar_t g_RQ3_teamCount2; // JBravo: cvar for the UI join menus -extern vmCvar_t g_RQ3_numSpectators; // JBravo: cvar for the UI join menus +//extern vmCvar_t g_RQ3_teamCount1; // JBravo: cvar for the UI join menus +//extern vmCvar_t g_RQ3_teamCount2; // JBravo: cvar for the UI join menus +//extern vmCvar_t g_RQ3_numSpectators; // JBravo: cvar for the UI join menus extern vmCvar_t g_RQ3_maxteamkills; // JBravo: Max teamkills extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are banned extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 911fe980..22547561 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.50 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.49 2002/04/30 01:23:05 jbravo // Changed the server logging to be more like a normal AQ server. Cleaned // all colors from the logs. @@ -212,9 +215,9 @@ vmCvar_t g_RQ3_team1name; vmCvar_t g_RQ3_team2name; vmCvar_t g_RQ3_team1model; vmCvar_t g_RQ3_team2model; -vmCvar_t g_RQ3_teamCount1; -vmCvar_t g_RQ3_teamCount2; -vmCvar_t g_RQ3_numSpectators; +//vmCvar_t g_RQ3_teamCount1; +//vmCvar_t g_RQ3_teamCount2; +//vmCvar_t g_RQ3_numSpectators; vmCvar_t g_RQ3_maxteamkills; vmCvar_t g_RQ3_twbanrounds; vmCvar_t g_RQ3_tkbanrounds; @@ -360,9 +363,9 @@ static cvarTable_t gameCvarTable[] = { { &g_RQ3_team2name, "g_RQ3_team2name", "Swat", CVAR_SYSTEMINFO | CVAR_SERVERINFO , 0, qfalse }, { &g_RQ3_team1model, "g_RQ3_team1model", "grunt/robber", CVAR_SERVERINFO, 0, qfalse }, { &g_RQ3_team2model, "g_RQ3_team2model", "grunt/police", CVAR_SERVERINFO, 0, qfalse }, - { &g_RQ3_teamCount1, "g_RQ3_teamCount1", "0", CVAR_ROM, 0, qfalse }, - { &g_RQ3_teamCount2, "g_RQ3_teamCount2", "0", CVAR_ROM, 0, qfalse }, - { &g_RQ3_numSpectators, "g_RQ3_numSpectators", "0", CVAR_ROM, 0, qfalse }, +// { &g_RQ3_teamCount1, "g_RQ3_teamCount1", "0", CVAR_ROM, 0, qfalse }, +// { &g_RQ3_teamCount2, "g_RQ3_teamCount2", "0", CVAR_ROM, 0, qfalse }, +// { &g_RQ3_numSpectators, "g_RQ3_numSpectators", "0", CVAR_ROM, 0, qfalse }, { &g_RQ3_lca, "g_RQ3_lca", "0", CVAR_ROM, 0, qfalse}, { &g_RQ3_maxteamkills, "g_RQ3_maxteamkills", "0", CVAR_ARCHIVE, 0, qtrue}, { &g_RQ3_twbanrounds, "g_RQ3_twbanrounds", "2", CVAR_ARCHIVE, 0, qtrue}, diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index 7b1b93bf..6be0472e 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.70 2002/04/30 11:20:12 jbravo +// Redid the teamcount cvars. +// // Revision 1.69 2002/04/30 01:23:05 jbravo // Changed the server logging to be more like a normal AQ server. Cleaned // all colors from the logs. @@ -615,7 +618,7 @@ int WonGame(int winner) team_t RQ3TeamCount( int ignoreClientNum, int team ) { int i, count = 0; - char buf[20]; + char buf[64]; for (i=0; i