From 11b504ef3189cb517abf5df74f5a165568458dbf Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sun, 23 Jun 2002 23:32:29 +0000 Subject: [PATCH] Fixed logging of clients IP addresses. --- reaction/cgame/cg_consolecmds.c | 4 ++++ reaction/game/g_client.c | 23 ++++++----------------- reaction/game/g_cmds.c | 5 +++++ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/reaction/cgame/cg_consolecmds.c b/reaction/cgame/cg_consolecmds.c index 890b7a80..34c18066 100644 --- a/reaction/cgame/cg_consolecmds.c +++ b/reaction/cgame/cg_consolecmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.53 2002/06/23 23:32:29 jbravo +// Fixed logging of clients IP addresses. +// // Revision 1.52 2002/06/16 20:06:13 jbravo // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // @@ -739,6 +742,7 @@ void CG_InitConsoleCommands(void) trap_AddCommand("playerlist"); // JBravo: ignore trap_AddCommand("ignorenum"); + trap_AddCommand("unignorenum"); trap_AddCommand("ignore"); trap_AddCommand("unignore"); trap_AddCommand("clearignorelist"); diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index f43cbc40..68beb415 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.100 2002/06/23 23:32:29 jbravo +// Fixed logging of clients IP addresses. +// // Revision 1.99 2002/06/21 11:55:32 freud // Changed spawning system to move spawns up 9 pixels (q3 style) // @@ -1319,7 +1322,7 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) { char *value, *ip; gclient_t *client; - char userinfo[MAX_INFO_STRING]; + char userinfo[MAX_INFO_STRING], ipaddr[64]; gentity_t *ent; ent = &g_entities[clientNum]; @@ -1327,6 +1330,7 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) // check to see if they are on the banned IP list ip = Info_ValueForKey(userinfo, "ip"); + strcpy(ipaddr, ip); if (G_FilterPacket(ip)) { return "Banned."; } @@ -1365,10 +1369,6 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) return "BotConnectfailed"; } } - // get and distribute relevent paramters - // JBravo: make this more like AQ. Moved it down a bit. -// G_LogPrintf( "ClientConnect: %i\n", clientNum ); - // slicer : make sessionTeam = to savedTeam for scoreboard on cgame // JBravo: only for teamplay. Could break DM if (g_gametype.integer == GT_TEAMPLAY) { @@ -1380,7 +1380,7 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) // don't do the "xxx connected" messages if they were caried over from previous level if (firstTime) { trap_SendServerCommand(-1, va("print \"%s" S_COLOR_WHITE " connected\n\"", client->pers.netname)); - G_LogPrintf("%s@%s connected (clientNum %i)\n", client->pers.netname, ip, clientNum); + G_LogPrintf("%s@%s connected (clientNum %i)\n", client->pers.netname, ipaddr, clientNum); } if (g_gametype.integer >= GT_TEAM && g_gametype.integer != GT_TEAMPLAY && @@ -1404,17 +1404,6 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot) // JBravo: moved from ClientBegin client->pers.enterTime = level.time; - //Blaze: Send out the breakable names to the clients - //Blaze: moved to configstring - //if (!isBot && G_SendBreakableInfo(clientNum)) - //{ - // Com_Printf("Error sending breakable info to client\n"); - //} - // for statistics -// client->areabits = areabits; -// if ( !client->areabits ) -// client->areabits = G_Alloc( (trap_AAS_PointReachabilityAreaIndex( NULL ) + 7) / 8 ); - return NULL; } diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 6eeddc28..cf552151 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.144 2002/06/23 23:32:29 jbravo +// Fixed logging of clients IP addresses. +// // Revision 1.143 2002/06/23 21:44:08 jbravo // Fixed shots fired stats for non TP modes and some cleanups // @@ -3179,6 +3182,8 @@ void ClientCommand(int clientNum) // JBravo: adding ignore else if (Q_stricmp(cmd, "ignorenum") == 0) Cmd_Ignorenum_f(ent); + else if (Q_stricmp(cmd, "unignorenum") == 0) + Cmd_Ignorenum_f(ent); else if (Q_stricmp(cmd, "ignore") == 0) Cmd_Ignore_f(ent); else if (Q_stricmp(cmd, "unignore") == 0)