Added an AntiIdle system. Can play insane sounds for idle players, drop them

from teams or kick them.   Upped version to Beta 2.1
This commit is contained in:
Richard Allen 2002-07-07 18:36:13 +00:00
parent a0416f5192
commit f73e5c1f02
11 changed files with 97 additions and 7 deletions

View file

@ -63,3 +63,4 @@
* Subs are no longer ignored during TP spawns. Now they are forced into following live players.
* Dead players could talk to the living during the time before they respawned as spectators.
* Spectators in in-eyes mode now witness the death of the player they follow before moving on
* Added g_RQ3_ppl_idletime and g_RQ3_idleaction cvars.

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.66 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
//
// Revision 1.65 2002/06/16 20:06:13 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
//
@ -455,6 +459,10 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
// CG_CalcViewDir2(es->origin2, position, viewDir);
switch (event) {
case EV_INSANESOUND:
DEBUGNAME("EV_INSANESOUND");
trap_S_StartSound(NULL, es->number, CHAN_BODY, cgs.media.insanesounds[rand() & 7]);
break;
//
// movement generated events
//

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.104 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
//
// Revision 1.103 2002/06/30 17:33:01 jbravo
// New radio sounds and the 0wned sound was added.
//
@ -1344,6 +1348,7 @@ typedef struct {
sfxHandle_t cameraSound;
sfxHandle_t actionSound;
sfxHandle_t lca10_0Sound;
sfxHandle_t insanesounds[9];
// JBravo: Radio sounds
//Slicer

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.93 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
//
// Revision 1.92 2002/07/01 02:18:41 jbravo
// Small fixes to CTB and possible fix for subs and limchasecam
//
@ -861,6 +865,16 @@ static void CG_RegisterSounds(void)
cgs.media.count1Sound = trap_S_RegisterSound("sound/feedback/one.wav", qtrue);
cgs.media.countFightSound = trap_S_RegisterSound("sound/feedback/fight.wav", qtrue);
cgs.media.countPrepareSound = trap_S_RegisterSound("sound/feedback/prepare.wav", qtrue);
// JBravo: The insane sounds
cgs.media.insanesounds[0] = trap_S_RegisterSound("sound/insane/insane1.wav", qtrue);
cgs.media.insanesounds[1] = trap_S_RegisterSound("sound/insane/insane2.wav", qtrue);
cgs.media.insanesounds[2] = trap_S_RegisterSound("sound/insane/insane3.wav", qtrue);
cgs.media.insanesounds[3] = trap_S_RegisterSound("sound/insane/insane4.wav", qtrue);
cgs.media.insanesounds[4] = trap_S_RegisterSound("sound/insane/insane5.wav", qtrue);
cgs.media.insanesounds[5] = trap_S_RegisterSound("sound/insane/insane6.wav", qtrue);
cgs.media.insanesounds[6] = trap_S_RegisterSound("sound/insane/insane7.wav", qtrue);
cgs.media.insanesounds[7] = trap_S_RegisterSound("sound/insane/insane8.wav", qtrue);
cgs.media.insanesounds[8] = trap_S_RegisterSound("sound/insane/insane9.wav", qtrue);
if (cgs.gametype >= GT_TEAM || cg_buildScript.integer) {
// JBravo: registering the LCA sounds.
cgs.media.lightsSound = trap_S_RegisterSound("sound/lca/lights.wav", qtrue);

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.84 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
//
// Revision 1.83 2002/06/30 17:33:01 jbravo
// New radio sounds and the 0wned sound was added.
//
@ -1088,6 +1092,7 @@ typedef enum {
EV_JUICED, // invulnerability juiced effect
EV_LIGHTNINGBOLT, // lightning bolt bounced of invulnerability sphere
EV_INSANESOUND, // JBravo: for insanesounds
EV_DEBUG_LINE,
EV_STOPLOOPINGSOUND,
EV_TAUNT,

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.83 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
//
// Revision 1.82 2002/07/02 19:15:17 jbravo
// Drop weapon with akimbos now behaves like AQ, plus no suicides during LCA
//
@ -1218,6 +1222,32 @@ void ClientThink_real(gentity_t * ent)
}
return;
}
// JBravo: Idle sounds
if (g_RQ3_ppl_idletime.integer) {
if (ucmd->forwardmove == 0 && ucmd->rightmove == 0) {
if (client->idletime) {
if (level.time >= client->idletime + (g_RQ3_ppl_idletime.integer *1000)) {
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_idleaction.integer == 1 &&
(ent->client->sess.sessionTeam == TEAM_RED || ent->client->sess.sessionTeam == TEAM_BLUE)) {
trap_SendServerCommand( -1, va("print \"Removing %s^7 from his team for excessive Idling\n\"",
ent->client->pers.netname));
trap_SendServerCommand(ent - g_entities, "stuff team none\n");
} else if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_idleaction.integer == 2 &&
(ent->client->sess.sessionTeam == TEAM_RED || ent->client->sess.sessionTeam == TEAM_BLUE)) {
trap_SendServerCommand( -1, va("print \"Kicking %s^7 for excessive Idling\n\"",
ent->client->pers.netname));
trap_DropClient(ent - g_entities, "Dropped due to excessive Idling");
} else
G_TempEntity(ent->r.currentOrigin, EV_INSANESOUND);
client->idletime = 0;
}
} else {
client->idletime = level.time;
}
} else {
client->idletime = 0;
}
}
// perform once-a-second actions
ClientTimerActions(ent, msec);
}

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.109 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
//
// Revision 1.108 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
@ -530,7 +534,7 @@ void body_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, int
return;
}
if (attacker->client && (g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY)
if (attacker->client && ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY))
attacker->client->pers.records[REC_GIBSHOTS]++;
GibEntity(self, 0);

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.107 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
//
// Revision 1.106 2002/07/02 09:16:12 makro
// Added g_RQ3_version cvar for server browsers
//
@ -653,6 +657,7 @@ struct gclient_s {
int team_wounds_before;
int ff_warning;
int team_kills;
int idletime;
qboolean gibbed;
//Slicer Flood protect:
@ -1261,20 +1266,22 @@ extern vmCvar_t g_RQ3_messageProtect; // Elder: 0 disable, non-zero enable
// JBravo
extern vmCvar_t g_RQ3_roundlimit; // JBravo: No. of rounds pr. map
extern vmCvar_t g_RQ3_roundtimelimit; // JBravo: Time pr. round
extern vmCvar_t g_RQ3_tgren; // JBravo: no. of team grenades
extern vmCvar_t g_RQ3_tgren; // JBravo: no. of team grenades
extern vmCvar_t g_RQ3_limchasecam; // JBravo: 0 = no chasecam limit, 1 = limited to same team.
extern vmCvar_t g_RQ3_sniperup; // JBravo: 0 = snipers begin with pistol, 1 = begin with sniper
extern vmCvar_t g_RQ3_sniperup; // JBravo: 0 = snipers begin with pistol, 1 = begin with sniper
extern vmCvar_t g_RQ3_team1name; // JBravo: cvar for the name of team 1
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_tpcountdown; // JBravo: to disable the pregame countdown
extern vmCvar_t g_RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress
extern vmCvar_t g_RQ3_lca; // JBravo: cvar to signal cgame that LCA is in progress
extern vmCvar_t g_RQ3_showOwnKills; // JBravo: cvar to control if attaker sees his own obits and $K behavior
extern vmCvar_t g_RQ3_gib; // JBravo: cvar for gib control
extern vmCvar_t g_RQ3_gib; // JBravo: cvar for gib control
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
extern vmCvar_t g_RQ3_ppl_idletime; // JBravo: Seconds Idle before playing an insane sound
extern vmCvar_t g_RQ3_idleaction; // JBravo: what to do with Idlers. 0 = sound, 1 = team none, 2 = kick
//Slicer: Team Status Cvars for MM
//extern vmCvar_t g_RQ3_team1ready;

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.100 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
//
// Revision 1.99 2002/07/02 09:16:12 makro
// Added g_RQ3_version cvar for server browsers
//
@ -369,6 +373,8 @@ vmCvar_t g_RQ3_gib;
vmCvar_t g_RQ3_maxteamkills;
vmCvar_t g_RQ3_twbanrounds;
vmCvar_t g_RQ3_tkbanrounds;
vmCvar_t g_RQ3_ppl_idletime;
vmCvar_t g_RQ3_idleaction;
//Slicer: Team Status Cvars for MM
//vmCvar_t g_RQ3_team1ready;
@ -520,6 +526,8 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_maxteamkills, "g_RQ3_maxteamkills", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_twbanrounds, "g_RQ3_twbanrounds", "2", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_tkbanrounds, "g_RQ3_tkbanrounds", "2", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_ppl_idletime, "g_RQ3_ppl_idletime", "0", CVAR_ARCHIVE, 0, qtrue},
{&g_RQ3_idleaction, "g_RQ3_idleaction", "0", CVAR_ARCHIVE, 0, qtrue},
//Blaze: let cvar.cfg be set by the server admins
{&g_RQ3_cvarfile, "g_RQ3_cvarfile", "cvar.cfg", CVAR_ARCHIVE, 0, qtrue},
//Slicer: Team Status Cvars for MM

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.122 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
//
// Revision 1.121 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
@ -923,6 +927,7 @@ void SpawnPlayers()
clientNum = client - level.clients;
client->sess.teamSpawn = qtrue;
client->idletime = 0;
if (client->sess.savedTeam == TEAM_RED) {
client->sess.sessionTeam = TEAM_RED;
client->ps.persistant[PERS_TEAM] = TEAM_RED;
@ -1938,7 +1943,6 @@ void RQ3_Cmd_Use_f(gentity_t * ent)
if (weapon != WP_NONE) {
if (weapon == ent->client->ps.weapon)
return;
G_Printf("ps.weapon = %i, ps.weaponTime = %i\n", ent->client->ps.weapon, ent->client->ps.weaponTime);
if (ent->client->ps.weaponTime == 0)
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %i", SETWEAPON, weapon));
Com_sprintf(buf, sizeof(buf), "stuff weapon %d\n", weapon);

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// 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
//
// Revision 1.42 2002/07/04 16:07:54 slicer
// Small fix for the "settings" cmd
//
@ -4674,7 +4678,7 @@ static void UI_BuildServerDisplayList(qboolean force)
if (len == 0) {
//Makro - changing from Team Arena to RQ3 beta2
//strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!");
strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 beta 2 *** ");
strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 beta 2.1 *** ");
len = strlen(uiInfo.serverStatus.motd);
}
if (len != uiInfo.serverStatus.motdLen) {