Fixed per-client callvote limit; added a new cvar - g_RQ3_maxClientVotes

This commit is contained in:
Andrei Drexler 2002-08-13 16:59:16 +00:00
parent 07e9fe7913
commit d2858e253c
5 changed files with 45 additions and 11 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.158 2002/08/13 16:59:16 makro
// Fixed per-client callvote limit; added a new cvar - g_RQ3_maxClientVotes
//
// Revision 1.157 2002/08/07 20:49:21 slicer
// Adapted Vote system to Matchmode
//
@ -1872,8 +1875,10 @@ void Cmd_CallVote_f(gentity_t * ent)
trap_SendServerCommand(ent - g_entities, "print \"A vote is already in progress.\n\"");
return;
}
if (ent->client->pers.voteCount >= MAX_VOTE_COUNT) {
trap_SendServerCommand(ent - g_entities, "print \"You have called the maximum number of votes.\n\"");
//Makro - replaced the constant with a cvar
if (ent->client->pers.voteCount >= g_RQ3_maxClientVotes.integer) {
//Makro - added cvar info
trap_SendServerCommand(ent - g_entities, va("print \"You have called the maximum number of votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
return;
}
// JBravo: Lets allow spectators to vote in TP
@ -1971,6 +1976,8 @@ void Cmd_CallVote_f(gentity_t * ent)
level.clients[i].ps.eFlags &= ~EF_VOTED;
}
ent->client->ps.eFlags |= EF_VOTED;
//Makro - added
ent->client->pers.voteCount++;
trap_SetConfigstring(CS_VOTE_TIME, va("%i", level.voteTime));
trap_SetConfigstring(CS_VOTE_STRING, level.voteDisplayString);
@ -2055,9 +2062,11 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
trap_SendServerCommand(ent - g_entities, "print \"A team vote is already in progress.\n\"");
return;
}
if (ent->client->pers.teamVoteCount >= MAX_VOTE_COUNT) {
//Makro - replaced the constant with a cvar
if (ent->client->pers.teamVoteCount >= g_RQ3_maxClientVotes.integer) {
//Makro - added cvar info
trap_SendServerCommand(ent - g_entities,
"print \"You have called the maximum number of team votes.\n\"");
va("print \"You have called the maximum number of team votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
return;
}
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR) {
@ -2151,6 +2160,9 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
level.clients[i].ps.eFlags &= ~EF_TEAMVOTED;
}
ent->client->ps.eFlags |= EF_TEAMVOTED;
//Makro - added
ent->client->pers.teamVoteCount++;
trap_SetConfigstring(CS_TEAMVOTE_TIME + cs_offset, va("%i", level.teamVoteTime[cs_offset]));
trap_SetConfigstring(CS_TEAMVOTE_STRING + cs_offset, level.teamVoteString[cs_offset]);

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.113 2002/08/13 16:59:16 makro
// Fixed per-client callvote limit; added a new cvar - g_RQ3_maxClientVotes
//
// Revision 1.112 2002/08/07 03:35:57 jbravo
// Added dynamic radio and stopped all radio usage during lca
//
@ -1329,6 +1332,8 @@ extern vmCvar_t g_RQ3_radioFloodTime;
//Makro - for server browsers
extern vmCvar_t g_RQ3_version;
//Makro - max votes per client;
extern vmCvar_t g_RQ3_maxClientVotes;
void trap_Printf(const char *fmt);
void trap_Error(const char *fmt);

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.107 2002/08/13 16:59:16 makro
// Fixed per-client callvote limit; added a new cvar - g_RQ3_maxClientVotes
//
// Revision 1.106 2002/08/07 20:49:21 slicer
// Adapted Vote system to Matchmode
//
@ -429,6 +432,8 @@ vmCvar_t g_RQ3_cvarfile;
//Makro - for server browsers
vmCvar_t g_RQ3_version;
//Makro - max votes per client
vmCvar_t g_RQ3_maxClientVotes;
// bk001129 - made static to avoid aliasing
static cvarTable_t gameCvarTable[] = {
@ -564,7 +569,9 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_NextMapID, "g_RQ3_NextMapID", "-1", CVAR_SYSTEMINFO, 0, qfalse},
{&g_RQ3_NextMap, "g_RQ3_NextMap", "", CVAR_SYSTEMINFO, 0, qfalse},
//Makro - for server browsers
{&g_RQ3_version, "g_RQ3_version", "Beta 2.2", CVAR_SERVERINFO | CVAR_SYSTEMINFO | CVAR_ROM, 0, qfalse}
{&g_RQ3_version, "g_RQ3_version", "Beta 2.2", CVAR_SERVERINFO | CVAR_SYSTEMINFO | CVAR_ROM, 0, qfalse},
//Makro - max votes per client
{&g_RQ3_maxClientVotes, "g_RQ3_maxClientVotes", "3", CVAR_ARCHIVE, 0, qfalse}
};
// bk001129 - made static to avoid aliasing

View file

@ -15,13 +15,13 @@ cgamex86.dll - 0 error(s), 0 warning(s)
--------------------Configuration: game - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPD.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP7F.tmp" with contents
[
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"c:\reactionoutput/" /Fp"c:\reactionoutput/game.pch" /YX /Fo"c:\reactionoutput/" /Fd"c:\reactionoutput/" /FD /c
"C:\Games\Quake3\rq3source\reaction\game\g_mover.c"
"C:\Games\Quake3\rq3source\reaction\game\g_cmds.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPD.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPE.tmp" with contents
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP7F.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP80.tmp" with contents
[
kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"c:\reactionoutput/qagamex86.pdb" /map:"c:\reactionoutput/qagamex86.map" /machine:I386 /def:".\game.def" /out:"..\Release/qagamex86.dll" /implib:"c:\reactionoutput/qagamex86.lib"
\reactionoutput\ai_chat.obj
@ -64,10 +64,10 @@ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows
\reactionoutput\zcam.obj
\reactionoutput\zcam_target.obj
]
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPE.tmp"
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP80.tmp"
<h3>Output Window</h3>
Compiling...
g_mover.c
g_cmds.c
Linking...
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.19 2002/08/13 16:59:16 makro
// Fixed per-client callvote limit; added a new cvar - g_RQ3_maxClientVotes
//
// Revision 1.18 2002/08/03 19:27:37 jbravo
// Made a booboo in my tracking message code
//
@ -710,6 +713,7 @@ static gentity_t *CameraSwingTarget(gentity_t * ent)
// JBravo: take teamnames into account
// JBravo: added who you are following to the zcam swing output.
/*
trap_SendServerCommand(ent->client->ps.clientNum,
va("cp \"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%sFollowing " S_COLOR_WHITE "%s" S_COLOR_RED "/"
S_COLOR_MAGENTA "%s\n%sTracking " S_COLOR_WHITE "%s" S_COLOR_RED "/"
@ -717,6 +721,12 @@ static gentity_t *CameraSwingTarget(gentity_t * ent)
(target1st->client->sess.sessionTeam == TEAM_RED) ? g_RQ3_team1name.string : g_RQ3_team2name.string,
color, target2nd->client->pers.netname,
(target2nd->client->sess.sessionTeam == TEAM_RED) ? g_RQ3_team1name.string : g_RQ3_team2name.string));
*/
trap_SendServerCommand(ent->client->ps.clientNum,
va("specPrint \"%s\" \"%s\" \"%s\" \"%s\"\n", target1st->client->pers.netname,
(target1st->client->sess.sessionTeam == TEAM_RED) ? g_RQ3_team1name.string : g_RQ3_team2name.string,
target2nd->client->pers.netname,
(target2nd->client->sess.sessionTeam == TEAM_RED) ? g_RQ3_team1name.string : g_RQ3_team2name.string));
/* if (target2nd->client->sess.sessionTeam == TEAM_RED)
trap_SendServerCommand(ent->client->ps.clientNum,