mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-27 14:32:15 +00:00
Added resetMatch command for MM
This commit is contained in:
parent
757e032c08
commit
7077970c9c
4 changed files with 39 additions and 6 deletions
|
@ -17,6 +17,7 @@
|
||||||
* UI model preview and selection now controls DM gametype models, not team models.
|
* UI model preview and selection now controls DM gametype models, not team models.
|
||||||
* Added a radiosoundset selection dialog to the UI
|
* Added a radiosoundset selection dialog to the UI
|
||||||
* Doors with health and the "wait" key set to a negative value should work as expected now
|
* Doors with health and the "wait" key set to a negative value should work as expected now
|
||||||
|
* MM: Added "resetMatch" for rcon and referee use, to reset the current server Match Stuff
|
||||||
|
|
||||||
|
|
||||||
# List fixes here for the 2.1 release
|
# List fixes here for the 2.1 release
|
||||||
|
|
|
@ -348,7 +348,7 @@ void MM_Referee_f(gentity_t * ent)
|
||||||
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain to assign a referee\n\""));
|
trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"You need to be a captain to assign a referee\n\""));
|
||||||
|
|
||||||
}
|
}
|
||||||
void MM_ClearScores(void)
|
void MM_ClearScores(qboolean clearTeamFlags)
|
||||||
{
|
{
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
int i;
|
int i;
|
||||||
|
@ -357,7 +357,10 @@ void MM_ClearScores(void)
|
||||||
ent = &g_entities[i];
|
ent = &g_entities[i];
|
||||||
if (!ent->inuse)
|
if (!ent->inuse)
|
||||||
continue;
|
continue;
|
||||||
|
if(clearTeamFlags) {
|
||||||
|
ent->client->sess.captain = TEAM_FREE;
|
||||||
|
ent->client->sess.sub = TEAM_FREE;
|
||||||
|
}
|
||||||
// aasimon: Clear only PERS info. Lata clear all REC information. See if more info is needed to be clean
|
// aasimon: Clear only PERS info. Lata clear all REC information. See if more info is needed to be clean
|
||||||
ent->client->ps.persistant[PERS_SCORE] = 0;
|
ent->client->ps.persistant[PERS_SCORE] = 0;
|
||||||
ent->client->ps.persistant[PERS_KILLED] = 0;
|
ent->client->ps.persistant[PERS_KILLED] = 0;
|
||||||
|
@ -430,6 +433,23 @@ qboolean Ref_Auth(gentity_t * ent)
|
||||||
|
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
// MM_ResetMatch by Slicer
|
||||||
|
// Used by admin or rcon to reset Match settings, that is subs, captains, scores, teams's status and game status
|
||||||
|
//
|
||||||
|
void MM_ResetMatch() {
|
||||||
|
trap_SendServerCommand(-1, va("print \""MM_OK_COLOR" Reseting Server Match Status...\n\""));
|
||||||
|
// CleanUp Scores and Team Status
|
||||||
|
MM_ClearScores(qtrue);
|
||||||
|
// Just in case
|
||||||
|
MakeAllLivePlayersObservers();
|
||||||
|
level.team1ready = qfalse;
|
||||||
|
level.team2ready = qfalse;
|
||||||
|
level.inGame = qfalse;
|
||||||
|
level.team_game_going = 0;
|
||||||
|
level.team_round_going = 0;
|
||||||
|
level.team_round_countdown = 0;
|
||||||
|
level.matchTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// aasimon: processes comands sent from the referee
|
// aasimon: processes comands sent from the referee
|
||||||
|
@ -457,8 +477,12 @@ void Ref_Command(gentity_t * ent)
|
||||||
trap_SendServerCommand(ent - g_entities, "print \"pause\n\"");
|
trap_SendServerCommand(ent - g_entities, "print \"pause\n\"");
|
||||||
trap_SendServerCommand(ent - g_entities, "print \"cyclemap\n\"");
|
trap_SendServerCommand(ent - g_entities, "print \"cyclemap\n\"");
|
||||||
trap_SendServerCommand(ent - g_entities, "print\"lockSettings\n\"");
|
trap_SendServerCommand(ent - g_entities, "print\"lockSettings\n\"");
|
||||||
|
trap_SendServerCommand(ent - g_entities, "print \"resetMatch\n\"");
|
||||||
trap_SendServerCommand(ent - g_entities, "print\"map <map_to_go>\n\"");
|
trap_SendServerCommand(ent - g_entities, "print\"map <map_to_go>\n\"");
|
||||||
return;
|
return;
|
||||||
|
} else if (Q_stricmp(com, "resetMatch") == 0) {
|
||||||
|
MM_ResetMatch();
|
||||||
|
return;
|
||||||
} else if (Q_stricmp(com, "lockSettings") == 0) {
|
} else if (Q_stricmp(com, "lockSettings") == 0) {
|
||||||
if(level.settingsLocked) {
|
if(level.settingsLocked) {
|
||||||
level.settingsLocked = qfalse;
|
level.settingsLocked = qfalse;
|
||||||
|
@ -487,7 +511,7 @@ void Ref_Command(gentity_t * ent)
|
||||||
}
|
}
|
||||||
trap_DropClient(cn, "was kicked by the referee");
|
trap_DropClient(cn, "was kicked by the referee");
|
||||||
} else if (Q_stricmp(com, "clearscores") == 0) {
|
} else if (Q_stricmp(com, "clearscores") == 0) {
|
||||||
MM_ClearScores();
|
MM_ClearScores(qfalse);
|
||||||
return;
|
return;
|
||||||
} else if (Q_stricmp(com, "map_restart") == 0) {
|
} else if (Q_stricmp(com, "map_restart") == 0) {
|
||||||
// this is having problems, namely diference from rcon map_restart or using this trap
|
// this is having problems, namely diference from rcon map_restart or using this trap
|
||||||
|
|
|
@ -14,12 +14,13 @@ void MM_RunFrame(void);
|
||||||
void MM_Captain_f(gentity_t *);
|
void MM_Captain_f(gentity_t *);
|
||||||
void MM_Sub_f(gentity_t *);
|
void MM_Sub_f(gentity_t *);
|
||||||
void MM_Ready_f(gentity_t *);
|
void MM_Ready_f(gentity_t *);
|
||||||
void MM_ClearScores(void);
|
void MM_ClearScores(qboolean);
|
||||||
void MM_TeamName_f(gentity_t *);
|
void MM_TeamName_f(gentity_t *);
|
||||||
void MM_TeamModel_f(gentity_t *);
|
void MM_TeamModel_f(gentity_t *);
|
||||||
void MM_Referee_f(gentity_t *);
|
void MM_Referee_f(gentity_t *);
|
||||||
void MM_Settings_f(gentity_t *);
|
void MM_Settings_f(gentity_t *);
|
||||||
void SendEndMessage();
|
void SendEndMessage();
|
||||||
|
void MM_ResetMatch();
|
||||||
|
|
||||||
// aasimon: Declarations for Ref system
|
// aasimon: Declarations for Ref system
|
||||||
qboolean Ref_Exists(void);
|
qboolean Ref_Exists(void);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.14 2002/08/02 22:44:37 slicer
|
||||||
|
// Added resetMatch command for MM
|
||||||
|
//
|
||||||
// Revision 1.13 2002/06/19 18:13:57 jbravo
|
// Revision 1.13 2002/06/19 18:13:57 jbravo
|
||||||
// New TNG spawning system :)
|
// New TNG spawning system :)
|
||||||
//
|
//
|
||||||
|
@ -473,8 +476,12 @@ qboolean ConsoleCommand(void)
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
//sLiCeR: adding a clearScores
|
//sLiCeR: adding a clearScores
|
||||||
if (Q_stricmp(cmd, "clearscores") == 0) {
|
if (Q_stricmp(cmd, "clearscores") == 0 && g_RQ3_matchmode.integer) {
|
||||||
MM_ClearScores();
|
MM_ClearScores(qfalse);
|
||||||
|
return qtrue;
|
||||||
|
}
|
||||||
|
if (Q_stricmp(cmd, "resetmatch") == 0 && g_RQ3_matchmode.integer) {
|
||||||
|
MM_ResetMatch();
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue