mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-01-18 23:52:05 +00:00
Fixed the MM settings stuff so it works on remote servers also.
Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
This commit is contained in:
parent
7a62e8d8b5
commit
c28df47de8
7 changed files with 116 additions and 28 deletions
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.111 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.110 2002/07/21 18:46:32 niceass
|
||||
// weaponprediction cvar added
|
||||
//
|
||||
|
@ -1720,6 +1724,17 @@ extern vmCvar_t ui_RQ3_teamCount1;
|
|||
extern vmCvar_t ui_RQ3_teamCount2;
|
||||
extern vmCvar_t ui_RQ3_numSpectators;
|
||||
|
||||
// JBravo: MM ingame menu cvars.
|
||||
extern vmCvar_t cg_RQ3_timelimit;
|
||||
extern vmCvar_t cg_RQ3_roundlimit;
|
||||
extern vmCvar_t cg_RQ3_roundtimelimit;
|
||||
extern vmCvar_t cg_RQ3_fraglimit;
|
||||
extern vmCvar_t cg_RQ3_maxplayers;
|
||||
extern vmCvar_t cg_RQ3_forceteamtalk;
|
||||
extern vmCvar_t cg_RQ3_limchasecam;
|
||||
extern vmCvar_t cg_RQ3_tgren;
|
||||
extern vmCvar_t cg_RQ3_friendlyFire;
|
||||
|
||||
//Slicer: matchmode team status cvars
|
||||
//extern vmCvar_t cg_RQ3_RefID;
|
||||
extern vmCvar_t cg_RQ3_matchmode;
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.100 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.99 2002/07/21 18:46:57 niceass
|
||||
// weaponprediction cvar added
|
||||
//
|
||||
|
@ -471,6 +475,17 @@ vmCvar_t cg_enableLaserFog;
|
|||
// JBravo: ditto
|
||||
vmCvar_t cg_enableDust;
|
||||
|
||||
// JBravo: cvars for the MM ingame menu
|
||||
vmCvar_t cg_RQ3_timelimit;
|
||||
vmCvar_t cg_RQ3_roundlimit;
|
||||
vmCvar_t cg_RQ3_roundtimelimit;
|
||||
vmCvar_t cg_RQ3_fraglimit;
|
||||
vmCvar_t cg_RQ3_maxplayers;
|
||||
vmCvar_t cg_RQ3_forceteamtalk;
|
||||
vmCvar_t cg_RQ3_limchasecam;
|
||||
vmCvar_t cg_RQ3_tgren;
|
||||
vmCvar_t cg_RQ3_friendlyFire;
|
||||
|
||||
typedef struct {
|
||||
vmCvar_t *vmCvar;
|
||||
char *cvarName;
|
||||
|
@ -640,6 +655,16 @@ static cvarTable_t cvarTable[] = { // bk001129
|
|||
{&cg_gravity, "g_gravity", "800", 0},
|
||||
//Slicer: Team Status Cvars for MM
|
||||
{&cg_RQ3_matchmode, "g_RQ3_matchmode", "0", 0},
|
||||
// JBravo: more MM ingame cvars.
|
||||
{&cg_RQ3_timelimit, "cg_RQ3_timelimit", "0", CVAR_ROM},
|
||||
{&cg_RQ3_roundlimit, "cg_RQ3_roundlimit", "0", CVAR_ROM},
|
||||
{&cg_RQ3_roundtimelimit, "cg_RQ3_roundtimelimit", "0", CVAR_ROM},
|
||||
{&cg_RQ3_fraglimit, "cg_RQ3_fraglimit", "0", CVAR_ROM},
|
||||
{&cg_RQ3_maxplayers, "cg_RQ3_maxplayers", "0", CVAR_ROM},
|
||||
{&cg_RQ3_forceteamtalk, "cg_RQ3_forceteamtalk", "0", CVAR_ROM},
|
||||
{&cg_RQ3_limchasecam, "cg_RQ3_limchasecam", "0", CVAR_ROM},
|
||||
{&cg_RQ3_tgren, "cg_RQ3_tgren", "0", CVAR_ROM},
|
||||
{&cg_RQ3_friendlyFire, "cg_RQ3_friendlyFire", "0", CVAR_ROM},
|
||||
//{ &cg_RQ3_RefID, "g_RQ3_RefID", "0", 0}
|
||||
|
||||
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.59 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.58 2002/07/20 02:25:53 jbravo
|
||||
// Added the AQDT CTB sounds to the base radio paks
|
||||
//
|
||||
|
@ -1079,6 +1083,17 @@ void CG_Stuffcmd(void)
|
|||
trap_SendConsoleCommand(cmd);
|
||||
}
|
||||
|
||||
// JBravo: generic cvar setting command. Used from game
|
||||
void CG_CvarSet(void)
|
||||
{
|
||||
char cvar[128], value[128];
|
||||
|
||||
Q_strncpyz(cvar, CG_Argv(2), 128);
|
||||
Q_strncpyz(value, CG_Argv(3), 128);
|
||||
|
||||
trap_Cvar_Set(cvar, value);
|
||||
}
|
||||
|
||||
/*void CG_SetTeamPlayers(void) {
|
||||
int team, number;
|
||||
char teamz[64];
|
||||
|
@ -1295,6 +1310,10 @@ void CG_RQ3_Cmd()
|
|||
case OWNED:
|
||||
if (cg_RQ3_anouncer.integer == 1)
|
||||
CG_AddBufferedSound(cgs.media.humiliationSound);
|
||||
break;
|
||||
case CVARSET:
|
||||
CG_CvarSet();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.91 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.90 2002/07/22 07:26:43 niceass
|
||||
// better fog laser support
|
||||
//
|
||||
|
@ -354,7 +358,8 @@ enum {
|
|||
STARTDEMO,
|
||||
STOPDEMO,
|
||||
SCREENSHOT,
|
||||
OWNED
|
||||
OWNED,
|
||||
CVARSET
|
||||
};
|
||||
|
||||
//Elder: sound events for EV_RQ3_SOUND
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.108 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.107 2002/07/16 04:09:14 niceass
|
||||
// stupid team scoreboard fix
|
||||
//
|
||||
|
@ -284,6 +288,9 @@ breakable_t rq3_breakables[RQ3_MAX_BREAKABLES];
|
|||
extern legitmodel_t legitmodels[MAXMODELS];
|
||||
int RQ3_Validatemodel(char *model);
|
||||
|
||||
extern char *settings[];
|
||||
extern char *settings2[];
|
||||
|
||||
// g_client.c -- client functions that don't happen every frame
|
||||
|
||||
static vec3_t playerMins = { -15, -15, -24 };
|
||||
|
@ -1546,6 +1553,14 @@ void ClientBegin(int clientNum)
|
|||
}
|
||||
G_LogPrintf("ClientBegin: %i\n", clientNum);
|
||||
|
||||
// JBravo: synching the cvars over to clients for the MM ingame menu.
|
||||
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_matchmode.integer) {
|
||||
for (i = 0; i < 9 ; ++i) {
|
||||
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %s %i", CVARSET, settings2[i],
|
||||
trap_Cvar_VariableIntegerValue(settings[i])));
|
||||
}
|
||||
}
|
||||
|
||||
// count current clients and rank for scoreboard
|
||||
CalculateRanks();
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ void MM_TeamName_f(gentity_t * ent)
|
|||
return;
|
||||
}
|
||||
trap_Cvar_Set("g_RQ3_team1name", buff);
|
||||
trap_SendServerCommand(-1, va("print \"New Team 1 Name: "MM_NAMES_COLOR"%s\n\"", buff));
|
||||
trap_SendServerCommand(-1, va("print \"New Team 1 Name: %s\n\"", buff));
|
||||
} else {
|
||||
if (level.team2ready) {
|
||||
trap_SendServerCommand(ent - g_entities,
|
||||
|
@ -277,7 +277,7 @@ void MM_TeamName_f(gentity_t * ent)
|
|||
return;
|
||||
}
|
||||
trap_Cvar_Set("g_RQ3_team2name", buff);
|
||||
trap_SendServerCommand(-1, va("print \"New Team 2 Name: "MM_NAMES_COLOR"%s\n\"", buff));
|
||||
trap_SendServerCommand(-1, va("print \"New Team 2 Name: %s\n\"", buff));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -322,10 +322,10 @@ void MM_Referee_f(gentity_t * ent)
|
|||
if (Ref_Exists()) {
|
||||
ref = g_entities + g_RQ3_RefID.integer;
|
||||
trap_SendServerCommand(ent - g_entities,
|
||||
va("print \"Current Referee: "MM_NAMES_COLOR"%s\n\"", ref->client->pers.netname));
|
||||
va("print \"Current Referee: %s\n\"", ref->client->pers.netname));
|
||||
} else
|
||||
trap_SendServerCommand(ent - g_entities,
|
||||
va("print \""MM_DENY_COLOR"No Referee currently assigned, use "MM_NAMES_COLOR"referee <name>"MM_DENY_COLOR" to assign\n\""));
|
||||
va("print \""MM_DENY_COLOR"No Referee currently assigned, use referee <name>"MM_DENY_COLOR" to assign\n\""));
|
||||
return;
|
||||
}
|
||||
if((g_RQ3_mmflags.integer & MMF_VOTEREF) != MMF_VOTEREF) {
|
||||
|
@ -337,7 +337,7 @@ void MM_Referee_f(gentity_t * ent)
|
|||
if ((ref = getEntByName(buff)) != NULL) {
|
||||
refVotes[captain - 1] = ref - g_entities;
|
||||
trap_SendServerCommand(-1,
|
||||
va("print \""MM_OK_COLOR"%s has voted "MM_NAMES_COLOR"%s"MM_OK_COLOR" for referee\n\"",
|
||||
va("print \""MM_OK_COLOR"%s has voted %s"MM_OK_COLOR" for referee\n\"",
|
||||
ent->client->pers.netname, ref->client->pers.netname));
|
||||
checkRefVotes();
|
||||
} else {
|
||||
|
@ -421,7 +421,7 @@ qboolean Ref_Auth(gentity_t * ent)
|
|||
Com_sprintf(teste, 3, "%i", cn);
|
||||
trap_Cvar_Set("g_RQ3_RefID", teste);
|
||||
trap_SendServerCommand(-1,
|
||||
va("print \""MM_NAMES_COLOR"%s "MM_OK_COLOR"is the new Referee\n\"",
|
||||
va("print \"%s "MM_OK_COLOR"is the new Referee\n\"",
|
||||
ent->client->pers.netname));
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -475,14 +475,14 @@ void Ref_Command(gentity_t * ent)
|
|||
trap_Argv(2, com, sizeof(com));
|
||||
if (Q_stricmp(com, "") == 0) {
|
||||
trap_SendServerCommand(ent - g_entities,
|
||||
va("print \""MM_DENY_COLOR"You must name a player. Use: "MM_NAMES_COLOR"ref kick <player_name>\n\""));
|
||||
va("print \""MM_DENY_COLOR"You must name a player. Use: ref kick <player_name>\n\""));
|
||||
return;
|
||||
}
|
||||
|
||||
cn = ClientNumberFromString(ent, com);
|
||||
if (cn == -1) {
|
||||
trap_SendServerCommand(ent - g_entities,
|
||||
va("print \""MM_NAMES_COLOR"%s "MM_DENY_COLOR"is not on the server\n\"", com));
|
||||
va("print \"%s "MM_DENY_COLOR"is not on the server\n\"", com));
|
||||
return;
|
||||
}
|
||||
trap_DropClient(cn, "was kicked by the referee");
|
||||
|
@ -525,7 +525,7 @@ void Ref_Command(gentity_t * ent)
|
|||
else{
|
||||
trap_Cvar_Set("g_RQ3_ValidIniFile", "3");
|
||||
g_RQ3_ValidIniFile.integer = 3;
|
||||
trap_SendServerCommand(-1, va("print \""MM_OK_COLOR"Referee changed next map to: "MM_NAMES_COLOR"%s\n\"", param));
|
||||
trap_SendServerCommand(-1, va("print \""MM_OK_COLOR"Referee changed next map to: %s\n\"", param));
|
||||
Com_sprintf(level.voteMap, sizeof(level.voteMap), "map %s",param);
|
||||
BeginIntermission();
|
||||
}
|
||||
|
@ -560,8 +560,11 @@ Force Team Talk
|
|||
*/
|
||||
#define NR_SETTVARS 9
|
||||
|
||||
const char *settings[] = {"timelimit","g_RQ3_roundlimit","g_RQ3_roundtimelimit","fraglimit","g_RQ3_maxplayers","g_RQ3_forceteamtalk",
|
||||
"g_RQ3_limchasecam","g_RQ3_tgren","g_friendlyFire"};
|
||||
const char *settings[] = {"timelimit", "g_RQ3_roundlimit", "g_RQ3_roundtimelimit", "fraglimit", "g_RQ3_maxplayers",
|
||||
"g_RQ3_forceteamtalk", "g_RQ3_limchasecam","g_RQ3_tgren","g_friendlyFire"};
|
||||
// JBravo: adding settings2 for cvars to set in the client for the MM ingame menu.
|
||||
const char *settings2[] = {"cg_RQ3_timelimit", "cg_RQ3_roundlimit", "cg_RQ3_roundtimelimit", "cg_RQ3_fraglimit",
|
||||
"cg_RQ3_maxplayers", "cg_RQ3_forceteamtalk", "cg_RQ3_limchasecam", "cg_RQ3_tgren", "cg_RQ3_friendlyFire"};
|
||||
|
||||
void MM_Settings_f(gentity_t * ent) {
|
||||
int i;
|
||||
|
@ -597,8 +600,10 @@ void MM_Settings_f(gentity_t * ent) {
|
|||
for (i = 0; i < NR_SETTVARS; ++i) {
|
||||
trap_Argv(i+1, str, sizeof(str));
|
||||
trap_Cvar_Set(settings[i],str);
|
||||
// JBravo: setting the cvars in cgame now.
|
||||
trap_SendServerCommand(-1, va("rq3_cmd %i %s %s", CVARSET, settings2[i], str));
|
||||
}
|
||||
|
||||
trap_SendServerCommand(-1,va("print \""MM_OK_COLOR"Match Settings have been changed by "MM_NAMES_COLOR"%s\n\"",ent->client->pers.netname));
|
||||
trap_SendServerCommand(-1,va("print \""MM_OK_COLOR"Match Settings have been changed by %s\n\"",ent->client->pers.netname));
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.44 2002/07/26 06:21:43 jbravo
|
||||
// Fixed the MM settings stuff so it works on remote servers also.
|
||||
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
|
||||
//
|
||||
// Revision 1.43 2002/07/07 18:36:13 jbravo
|
||||
// Added an AntiIdle system. Can play insane sounds for idle players, drop them
|
||||
// from teams or kick them. Upped version to Beta 2.1
|
||||
|
@ -4033,15 +4037,15 @@ static void UI_RunMenuScript(char **args)
|
|||
ui_RQ3_friendlyFire.integer));
|
||||
//Makro - sync ui MM cvars with the real ones
|
||||
} else if (Q_stricmp(name, "readMMsettings") == 0) {
|
||||
trap_Cvar_SetValue("ui_RQ3_timelimit", trap_Cvar_VariableValue("timelimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_roundlimit", trap_Cvar_VariableValue("g_RQ3_roundlimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_roundtimelimit", trap_Cvar_VariableValue("g_RQ3_roundtimelimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_fraglimit", trap_Cvar_VariableValue("fraglimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_maxplayers", trap_Cvar_VariableValue("g_RQ3_maxplayers"));
|
||||
trap_Cvar_SetValue("ui_RQ3_forceteamtalk", trap_Cvar_VariableValue("g_RQ3_forceteamtalk"));
|
||||
trap_Cvar_SetValue("ui_RQ3_limchasecam", trap_Cvar_VariableValue("g_RQ3_limchasecam"));
|
||||
trap_Cvar_SetValue("ui_RQ3_tgren", trap_Cvar_VariableValue("g_RQ3_tgren"));
|
||||
trap_Cvar_SetValue("ui_RQ3_friendlyFire", trap_Cvar_VariableValue("g_friendlyFire"));
|
||||
trap_Cvar_SetValue("ui_RQ3_timelimit", trap_Cvar_VariableValue("cg_RQ3_timelimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_roundlimit", trap_Cvar_VariableValue("cg_RQ3_roundlimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_roundtimelimit", trap_Cvar_VariableValue("cg_RQ3_roundtimelimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_fraglimit", trap_Cvar_VariableValue("cg_RQ3_fraglimit"));
|
||||
trap_Cvar_SetValue("ui_RQ3_maxplayers", trap_Cvar_VariableValue("cg_RQ3_maxplayers"));
|
||||
trap_Cvar_SetValue("ui_RQ3_forceteamtalk", trap_Cvar_VariableValue("cg_RQ3_forceteamtalk"));
|
||||
trap_Cvar_SetValue("ui_RQ3_limchasecam", trap_Cvar_VariableValue("cg_RQ3_limchasecam"));
|
||||
trap_Cvar_SetValue("ui_RQ3_tgren", trap_Cvar_VariableValue("cg_RQ3_tgren"));
|
||||
trap_Cvar_SetValue("ui_RQ3_friendlyFire", trap_Cvar_VariableValue("cg_RQ3_friendlyFire"));
|
||||
//Makro - build server info list
|
||||
} else if (Q_stricmp(name, "refreshIngameServerInfo") == 0) {
|
||||
UI_BuildIngameServerInfoList();
|
||||
|
|
Loading…
Reference in a new issue