More Matchmode work

This commit is contained in:
Daniel Simoes 2002-06-23 19:12:17 +00:00
parent 516cba8b91
commit 46cb527995
4 changed files with 44 additions and 15 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.103 2002/06/23 19:12:17 slicer
// More Matchmode work
//
// Revision 1.102 2002/06/23 15:22:53 slicer // Revision 1.102 2002/06/23 15:22:53 slicer
// Future 2.1 Matchmode Features - PART II // Future 2.1 Matchmode Features - PART II
// //
@ -1228,6 +1231,7 @@ extern vmCvar_t g_proxMineTimeout;
extern vmCvar_t g_RQ3_matchmode; extern vmCvar_t g_RQ3_matchmode;
extern vmCvar_t g_RQ3_forceteamtalk; extern vmCvar_t g_RQ3_forceteamtalk;
extern vmCvar_t g_RQ3_maxplayers; extern vmCvar_t g_RQ3_maxplayers;
extern vmCvar_t g_RQ3_mmflags;
//Blaze: Reaction cvars //Blaze: Reaction cvars
extern vmCvar_t g_rxn_knifelimit; extern vmCvar_t g_rxn_knifelimit;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.97 2002/06/23 19:12:17 slicer
// More Matchmode work
//
// Revision 1.96 2002/06/23 15:22:53 slicer // Revision 1.96 2002/06/23 15:22:53 slicer
// Future 2.1 Matchmode Features - PART II // Future 2.1 Matchmode Features - PART II
// //
@ -326,6 +329,7 @@ vmCvar_t g_listEntity;
vmCvar_t g_RQ3_matchmode; vmCvar_t g_RQ3_matchmode;
vmCvar_t g_RQ3_forceteamtalk; vmCvar_t g_RQ3_forceteamtalk;
vmCvar_t g_RQ3_maxplayers; vmCvar_t g_RQ3_maxplayers;
vmCvar_t g_RQ3_mmflags;
//Blaze: Reaction cvars //Blaze: Reaction cvars
vmCvar_t g_rxn_knifelimit; vmCvar_t g_rxn_knifelimit;
@ -469,6 +473,7 @@ static cvarTable_t gameCvarTable[] = {
//Slicer: Matchmode //Slicer: Matchmode
{&g_RQ3_matchmode, "g_RQ3_matchmode", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_SYSTEMINFO, 0, qfalse}, {&g_RQ3_matchmode, "g_RQ3_matchmode", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_SYSTEMINFO, 0, qfalse},
{&g_RQ3_forceteamtalk, "g_RQ3_forceteamtalk", "0", 0, 0, qtrue}, {&g_RQ3_forceteamtalk, "g_RQ3_forceteamtalk", "0", 0, 0, qtrue},
{&g_RQ3_mmflags, "g_RQ3_mmflags", "31", 0, 0, qtrue},
{&g_RQ3_maxplayers, "g_RQ3_maxplayers", "0", 0, 0, qtrue}, {&g_RQ3_maxplayers, "g_RQ3_maxplayers", "0", 0, 0, qtrue},
//Slicer: radio protect //Slicer: radio protect
{&g_RQ3_radioFlood, "g_RQ3_radioFlood", "3", 0, 0, qfalse}, {&g_RQ3_radioFlood, "g_RQ3_radioFlood", "3", 0, 0, qfalse},

View file

@ -5,20 +5,7 @@ int ClientNumberFromString(gentity_t * to, char *s);
int refVotes[2]; // refVotes[0] is the clientnumber red team voted int refVotes[2]; // refVotes[0] is the clientnumber red team voted
// refVotes[1] is the clientnumber blue team voted // refVotes[1] is the clientnumber blue team voted
/*
#define S_COLOR_BLACK "^0"
#define S_COLOR_RED "^1"
#define S_COLOR_GREEN "^2"
#define S_COLOR_YELLOW "^3"
#define S_COLOR_BLUE "^4"
#define S_COLOR_CYAN "^5"
#define S_COLOR_MAGENTA "^6"
#define S_COLOR_WHITE "^7"
*/
#define MM_OK_COLOR S_COLOR_GREEN
#define MM_DENY_COLOR S_COLOR_RED
#define MM_NAMES_COLOR S_COLOR_BLUE
#define MM_OK_COLOR S_COLOR_GREEN
void SendEndMessage() void SendEndMessage()
{ {
@ -148,6 +135,11 @@ void MM_Ready_f(gentity_t * ent)
if (!g_RQ3_matchmode.integer) if (!g_RQ3_matchmode.integer)
return; return;
if(level.inGame && (g_RQ3_mmflags.integer & MMF_UNREADY) != MMF_UNREADY) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow you to un-ready your team after the match started\n\""));
return;
}
if (ent->client->sess.captain != TEAM_FREE) { if (ent->client->sess.captain != TEAM_FREE) {
if (ent->client->sess.savedTeam == TEAM_RED) { if (ent->client->sess.savedTeam == TEAM_RED) {
trap_SendServerCommand(-1, va("cp \"%s are%s Ready.\n\"", trap_SendServerCommand(-1, va("cp \"%s are%s Ready.\n\"",
@ -192,6 +184,10 @@ void MM_TeamModel_f(gentity_t * ent)
string)); string));
return; return;
} else { } else {
if((g_RQ3_mmflags.integer & MMF_TEAMMODEL) != MMF_TEAMMODEL) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow you to change team model\n\""));
return;
}
if (ent->client->sess.captain == TEAM_FREE) { if (ent->client->sess.captain == TEAM_FREE) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain for that\n\"")); trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain for that\n\""));
return; return;
@ -246,6 +242,11 @@ void MM_TeamName_f(gentity_t * ent)
string)); string));
return; return;
} else { } else {
if((g_RQ3_mmflags.integer & MMF_TEAMNAME) != MMF_TEAMNAME) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow you to change team name\n\""));
return;
}
if (ent->client->sess.captain == TEAM_FREE) { if (ent->client->sess.captain == TEAM_FREE) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain for that\n\"")); trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain for that\n\""));
return; return;
@ -327,7 +328,10 @@ void MM_Referee_f(gentity_t * ent)
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 "MM_NAMES_COLOR"referee <name>"MM_DENY_COLOR" to assign\n\""));
return; return;
} }
if((g_RQ3_mmflags.integer & MMF_VOTEREF) != MMF_VOTEREF) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow captains to vote for a Referee\n\""));
return;
}
if (captain != TEAM_FREE) { if (captain != TEAM_FREE) {
buff = ConcatArgs(1); buff = ConcatArgs(1);
if ((ref = getEntByName(buff)) != NULL) { if ((ref = getEntByName(buff)) != NULL) {
@ -563,6 +567,11 @@ void MM_Settings_f(gentity_t * ent) {
//Invalid Data SENT //Invalid Data SENT
if(trap_Argc()!= NR_SETTVARS) if(trap_Argc()!= NR_SETTVARS)
return; return;
if((g_RQ3_mmflags.integer & MMF_SETTINGS) != MMF_SETTINGS) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR "This server does not allow you to change settings\n\""));
return;
}
if(ent->client->sess.captain == TEAM_FREE && ent - g_entities != g_RQ3_RefID.integer) { if(ent->client->sess.captain == TEAM_FREE && ent - g_entities != g_RQ3_RefID.integer) {
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"Only Captains and Referees can change match Settings\n\"")); trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"Only Captains and Referees can change match Settings\n\""));
return; return;

View file

@ -1,3 +1,14 @@
#define MM_OK_COLOR S_COLOR_GREEN
#define MM_DENY_COLOR S_COLOR_RED
#define MM_NAMES_COLOR S_COLOR_BLUE
#define MM_OK_COLOR S_COLOR_GREEN
//g_RQ3_mmflags
#define MMF_TEAMNAME 1
#define MMF_TEAMMODEL 2
#define MMF_UNREADY 4
#define MMF_SETTINGS 8
#define MMF_VOTEREF 16
void MM_RunFrame(void); void MM_RunFrame(void);
void MM_Captain_f(gentity_t *); void MM_Captain_f(gentity_t *);