Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove /ignore.
  • Loading branch information
enneract committed May 27, 2015
1 parent e532a5d commit 05e4e14
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 125 deletions.
1 change: 0 additions & 1 deletion src/cgame/cg_local.h
Expand Up @@ -1456,7 +1456,6 @@ typedef struct
cgMedia_t media;

voice_t *voices;
clientList_t ignoreList;

int alienBuildPool;
int alienBuildPoolMax;
Expand Down
7 changes: 0 additions & 7 deletions src/cgame/cg_players.c
Expand Up @@ -757,13 +757,6 @@ void CG_NewClientInfo( int clientNum )

// the old value
memset( &newInfo, 0, sizeof( newInfo ) );

// grab our own ignoreList
if( clientNum == cg.predictedPlayerState.clientNum )
{
v = Info_ValueForKey( configstring, "ig" );
Com_ClientListParse( &cgs.ignoreList, v );
}

// isolate the player's name
v = Info_ValueForKey( configstring, "n" );
Expand Down
37 changes: 12 additions & 25 deletions src/cgame/cg_servercmds.c
Expand Up @@ -948,7 +948,6 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text )
{
char *name;
char prefix[ 11 ] = "";
char *ignore = "";
char *location = "";
char *color;
char *maybeColon;
Expand All @@ -969,9 +968,6 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text )
Com_sprintf( prefix, sizeof( prefix ), "[%s%c" S_COLOR_WHITE "] ",
tcolor, toupper( *( BG_TeamName( ci->team ) ) ) );

if( Com_ClientListContains( &cgs.ignoreList, clientNum ) )
ignore = "[skipnotify]";

if( ( mode == SAY_TEAM || mode == SAY_AREA ) &&
cg.snap->ps.pm_type != PM_INTERMISSION )
{
Expand Down Expand Up @@ -1016,37 +1012,32 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text )
switch( mode )
{
case SAY_ALL:
// might already be ignored but in that case no harm is done
if( cg_teamChatsOnly.integer )
ignore = "[skipnotify]";

CG_Printf( "%s%s%s" S_COLOR_WHITE "%s %c" S_COLOR_GREEN "%s\n",
ignore, prefix, name, maybeColon, INDENT_MARKER, text );
CG_Printf( "%s%s" S_COLOR_WHITE "%s %c" S_COLOR_GREEN "%s\n",
prefix, name, maybeColon, INDENT_MARKER, text );
break;
case SAY_TEAM:
CG_Printf( "%s%s(%s" S_COLOR_WHITE ")%s%s %c" S_COLOR_CYAN "%s\n",
ignore, prefix, name, location, maybeColon, INDENT_MARKER, text );
CG_Printf( "%s(%s" S_COLOR_WHITE ")%s%s %c" S_COLOR_CYAN "%s\n",
prefix, name, location, maybeColon, INDENT_MARKER, text );
break;
case SAY_ADMINS:
case SAY_ADMINS_PUBLIC:
CG_Printf( "%s%s%s%s" S_COLOR_WHITE "%s %c" S_COLOR_MAGENTA "%s\n",
ignore, prefix,
CG_Printf( "%s%s%s" S_COLOR_WHITE "%s %c" S_COLOR_MAGENTA "%s\n",
prefix,
( mode == SAY_ADMINS ) ? "[ADMIN]" : "[PLAYER]",
name, maybeColon, INDENT_MARKER, text );
break;
case SAY_AREA:
CG_Printf( "%s%s<%s" S_COLOR_WHITE ">%s%s %c" S_COLOR_BLUE "%s\n",
ignore, prefix, name, location, maybeColon, INDENT_MARKER, text );
CG_Printf( "%s<%s" S_COLOR_WHITE ">%s%s %c" S_COLOR_BLUE "%s\n",
prefix, name, location, maybeColon, INDENT_MARKER, text );
break;
case SAY_PRIVMSG:
case SAY_TPRIVMSG:
color = ( mode == SAY_TPRIVMSG ) ? S_COLOR_CYAN : S_COLOR_GREEN;
CG_Printf( "%s%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %c%s%s\n",
ignore, prefix, name, cgs.clientinfo[ cg.clientNum ].name,
CG_Printf( "%s[%s" S_COLOR_WHITE " -> %s" S_COLOR_WHITE "]%s %c%s%s\n",
prefix, name, cgs.clientinfo[ cg.clientNum ].name,
maybeColon, INDENT_MARKER, color, text );
if( !ignore[0] )
CG_CenterPrint( va( "%sPrivate message from: " S_COLOR_WHITE "%s",
color, name ), 200, GIANTCHAR_WIDTH * 4 );
CG_CenterPrint( va( "%sPrivate message from: " S_COLOR_WHITE "%s",
color, name ), 200, GIANTCHAR_WIDTH * 4 );
break;
case SAY_RAW:
CG_Printf( "%s\n", text );
Expand Down Expand Up @@ -1191,10 +1182,6 @@ static void CG_ParseVoice( void )
if( !track )
return;

// don't play audio track for lamers
if( Com_ClientListContains( &cgs.ignoreList, clientNum ) )
return;

switch( vChan )
{
case VOICE_CHAN_ALL:
Expand Down
10 changes: 1 addition & 9 deletions src/game/g_client.c
Expand Up @@ -1064,9 +1064,8 @@ char *ClientUserinfoChanged( int clientNum, qboolean forceName )
// print scoreboards, display models, and play custom sounds

Com_sprintf( userinfo, sizeof( userinfo ),
"n\\%s\\t\\%i\\model\\%s\\ig\\%16s\\v\\%s",
"n\\%s\\t\\%i\\model\\%s\\v\\%s",
client->pers.netname, client->pers.teamSelection, model,
Com_ClientListString( &client->sess.ignoreList ),
client->pers.voice );

trap_SetConfigstring( CS_PLAYERS + clientNum, userinfo );
Expand Down Expand Up @@ -1660,13 +1659,6 @@ void ClientDisconnect( int clientNum )
G_namelog_disconnect( ent->client );
G_Vote( ent, TEAM_NONE, qfalse );

// stop any following clients
for( i = 0; i < level.maxclients; i++ )
{
// remove any /ignore settings for this clientNum
Com_ClientListRemove( &level.clients[ i ].sess.ignoreList, clientNum );
}

// send effect if they were completely connected
if( ent->client->pers.connected == CON_CONNECTED &&
ent->client->sess.spectatorState == SPECTATOR_NOT )
Expand Down
74 changes: 0 additions & 74 deletions src/game/g_cmds.c
Expand Up @@ -939,10 +939,6 @@ static qboolean G_SayTo( gentity_t *ent, gentity_t *other, saymode_t mode, const

if( other->client->pers.connected != CON_CONNECTED )
return qfalse;

// ignore messages from people in /ignore list
if( Com_ClientListContains( &other->client->sess.ignoreList, (int)( ent - g_entities ) ) )
return qfalse;

if( ( ent && !OnSameTeam( ent, other ) ) &&
( mode == SAY_TEAM || mode == SAY_AREA || mode == SAY_TPRIVMSG ) )
Expand Down Expand Up @@ -2899,74 +2895,6 @@ void Cmd_FollowCycle_f( gentity_t *ent )
G_FollowNewClient( ent, dir );
}

static void Cmd_Ignore_f( gentity_t *ent )
{
int pids[ MAX_CLIENTS ];
char name[ MAX_NAME_LENGTH ];
char cmd[ 9 ];
int matches = 0;
int i;
qboolean ignore = qfalse;

trap_Argv( 0, cmd, sizeof( cmd ) );
if( Q_stricmp( cmd, "ignore" ) == 0 )
ignore = qtrue;

if( trap_Argc() < 2 )
{
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"usage: %s [clientNum | partial name match]\n\"", cmd ) );
return;
}

Q_strncpyz( name, ConcatArgs( 1 ), sizeof( name ) );
matches = G_ClientNumbersFromString( name, pids, MAX_CLIENTS );
if( matches < 1 )
{
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"%s: no clients match the name '%s'\n\"", cmd, name ) );
return;
}

for( i = 0; i < matches; i++ )
{
if( ignore )
{
if( !Com_ClientListContains( &ent->client->sess.ignoreList, pids[ i ] ) )
{
Com_ClientListAdd( &ent->client->sess.ignoreList, pids[ i ] );
ClientUserinfoChanged( ent->client->ps.clientNum, qfalse );
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"ignore: added %s^7 to your ignore list\n\"",
level.clients[ pids[ i ] ].pers.netname ) );
}
else
{
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"ignore: %s^7 is already on your ignore list\n\"",
level.clients[ pids[ i ] ].pers.netname ) );
}
}
else
{
if( Com_ClientListContains( &ent->client->sess.ignoreList, pids[ i ] ) )
{
Com_ClientListRemove( &ent->client->sess.ignoreList, pids[ i ] );
ClientUserinfoChanged( ent->client->ps.clientNum, qfalse );
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"unignore: removed %s^7 from your ignore list\n\"",
level.clients[ pids[ i ] ].pers.netname ) );
}
else
{
trap_SendServerCommand( ent-g_entities, va( "print \"[skipnotify]"
"unignore: %s^7 is not on your ignore list\n\"",
level.clients[ pids[ i ] ].pers.netname ) );
}
}
}
}

/*
=================
Cmd_ListMaps_f
Expand Down Expand Up @@ -3428,7 +3356,6 @@ commands_t cmds[ ] = {
{ "followprev", CMD_SPEC, Cmd_FollowCycle_f },
{ "give", CMD_CHEAT|CMD_TEAM|CMD_LIVING, Cmd_Give_f },
{ "god", CMD_CHEAT|CMD_TEAM|CMD_LIVING, Cmd_God_f },
{ "ignore", 0, Cmd_Ignore_f },
{ "itemact", CMD_HUMAN|CMD_LIVING, Cmd_ActivateItem_f },
{ "itemdeact", CMD_HUMAN|CMD_LIVING, Cmd_DeActivateItem_f },
{ "itemtoggle", CMD_HUMAN|CMD_LIVING, Cmd_ToggleItem_f },
Expand All @@ -3448,7 +3375,6 @@ commands_t cmds[ ] = {
{ "team", 0, Cmd_Team_f },
{ "teamvote", CMD_TEAM, Cmd_Vote_f },
{ "test", CMD_CHEAT, Cmd_Test_f },
{ "unignore", 0, Cmd_Ignore_f },
{ "vote", 0, Cmd_Vote_f },
{ "where", 0, Cmd_Where_f }
};
Expand Down
1 change: 0 additions & 1 deletion src/game/g_local.h
Expand Up @@ -274,7 +274,6 @@ typedef struct
spectatorState_t spectatorState;
int spectatorClient; // for chasecam and follow mode
team_t restartTeam; //for !restart keepteams and !restart switchteams
clientList_t ignoreList;
int seenWelcome; // determines if the client has seen server's welcome message
} clientSession_t;

Expand Down
12 changes: 4 additions & 8 deletions src/game/g_session.c
Expand Up @@ -50,13 +50,12 @@ void G_WriteClientSessionData( gclient_t *client )
const char *s;
const char *var;

s = va( "%i %i %i %i %i %s",
s = va( "%i %i %i %i %i",
client->sess.spectatorTime,
client->sess.spectatorState,
client->sess.spectatorClient,
client->sess.restartTeam,
client->sess.seenWelcome,
Com_ClientListString( &client->sess.ignoreList )
client->sess.seenWelcome
);

var = va( "session%i", (int)(client - level.clients) );
Expand All @@ -82,18 +81,16 @@ void G_ReadSessionData( gclient_t *client )
var = va( "session%i", (int)(client - level.clients) );
trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );

sscanf( s, "%i %i %i %i %i %16s",
sscanf( s, "%i %i %i %i %i",
&client->sess.spectatorTime,
&spectatorState,
&client->sess.spectatorClient,
&restartTeam,
&client->sess.seenWelcome,
ignorelist
&client->sess.seenWelcome
);

client->sess.spectatorState = (spectatorState_t)spectatorState;
client->sess.restartTeam = (team_t)restartTeam;
Com_ClientListParse( &client->sess.ignoreList, ignorelist );
}


Expand Down Expand Up @@ -131,7 +128,6 @@ void G_InitSessionData( gclient_t *client, char *userinfo )
sess->spectatorState = SPECTATOR_FREE;
sess->spectatorTime = level.time;
sess->spectatorClient = -1;
memset( &sess->ignoreList, 0, sizeof( sess->ignoreList ) );
sess->seenWelcome = 0;
G_WriteClientSessionData( client );
}
Expand Down

0 comments on commit 05e4e14

Please sign in to comment.