[PATCH] Remove the IDGODS network testing code

Remove all references to the IDGODS network testing code. Also remove the
"privileged" flag from the client struct, as that was it's only purpose.

diff -urN a/NQ/host_cmd.c head/NQ/host_cmd.c
--- a/NQ/host_cmd.c	2006-03-11 23:06:25.000000000 +1030
+++ head/NQ/host_cmd.c	2006-03-11 23:16:27.000000000 +1030
@@ -128,7 +128,7 @@
 	return;
     }
 
-    if (pr_global_struct->deathmatch && !host_client->privileged)
+    if (pr_global_struct->deathmatch)
 	return;
 
     sv_player->v.flags = (int)sv_player->v.flags ^ FL_GODMODE;
@@ -146,7 +146,7 @@
 	return;
     }
 
-    if (pr_global_struct->deathmatch && !host_client->privileged)
+    if (pr_global_struct->deathmatch)
 	return;
 
     sv_player->v.flags = (int)sv_player->v.flags ^ FL_NOTARGET;
@@ -166,7 +166,7 @@
 	return;
     }
 
-    if (pr_global_struct->deathmatch && !host_client->privileged)
+    if (pr_global_struct->deathmatch)
 	return;
 
     if (sv_player->v.movetype != MOVETYPE_NOCLIP) {
@@ -195,7 +195,7 @@
 	return;
     }
 
-    if (pr_global_struct->deathmatch && !host_client->privileged)
+    if (pr_global_struct->deathmatch)
 	return;
 
     if (sv_player->v.movetype != MOVETYPE_FLY) {
@@ -720,54 +720,6 @@
     Con_Printf("Exe: " __TIME__ " " __DATE__ "\n");
 }
 
-#ifdef IDGODS
-void
-Host_Please_f(void)
-{
-    client_t *cl;
-    int j;
-
-    if (cmd_source != src_command)
-	return;
-
-    if ((Cmd_Argc() == 3) && strcmp(Cmd_Argv(1), "#") == 0) {
-	j = Q_atof(Cmd_Argv(2)) - 1;
-	if (j < 0 || j >= svs.maxclients)
-	    return;
-	if (!svs.clients[j].active)
-	    return;
-	cl = &svs.clients[j];
-	if (cl->privileged) {
-	    cl->privileged = false;
-	    cl->edict->v.flags =
-		(int)cl->edict->v.flags & ~(FL_GODMODE | FL_NOTARGET);
-	    cl->edict->v.movetype = MOVETYPE_WALK;
-	    noclip_anglehack = false;
-	} else
-	    cl->privileged = true;
-    }
-
-    if (Cmd_Argc() != 2)
-	return;
-
-    for (j = 0, cl = svs.clients; j < svs.maxclients; j++, cl++) {
-	if (!cl->active)
-	    continue;
-	if (strcasecmp(cl->name, Cmd_Argv(1)) == 0) {
-	    if (cl->privileged) {
-		cl->privileged = false;
-		cl->edict->v.flags =
-		    (int)cl->edict->v.flags & ~(FL_GODMODE | FL_NOTARGET);
-		cl->edict->v.movetype = MOVETYPE_WALK;
-		noclip_anglehack = false;
-	    } else
-		cl->privileged = true;
-	    break;
-	}
-    }
-}
-#endif
-
 
 void
 Host_Say(qboolean teamonly)
@@ -1182,7 +1134,7 @@
 	    Cmd_ForwardToServer();
 	    return;
 	}
-    } else if (pr_global_struct->deathmatch && !host_client->privileged)
+    } else if (pr_global_struct->deathmatch)
 	return;
 
     save = host_client;
@@ -1264,7 +1216,7 @@
 	return;
     }
 
-    if (pr_global_struct->deathmatch && !host_client->privileged)
+    if (pr_global_struct->deathmatch)
 	return;
 
     t = Cmd_Argv(1);
@@ -1618,9 +1570,7 @@
     Cmd_AddCommand("name", Host_Name_f);
     Cmd_AddCommand("noclip", Host_Noclip_f);
     Cmd_AddCommand("version", Host_Version_f);
-#ifdef IDGODS
-    Cmd_AddCommand("please", Host_Please_f);
-#endif
+
     Cmd_AddCommand("say", Host_Say_f);
     Cmd_AddCommand("say_team", Host_Say_Team_f);
     Cmd_AddCommand("tell", Host_Tell_f);
diff -urN a/NQ/net.h head/NQ/net.h
--- a/NQ/net.h	2004-08-08 18:57:33.000000000 +0930
+++ head/NQ/net.h	2006-03-11 23:13:14.000000000 +1030
@@ -241,10 +241,6 @@
 extern int hostCacheCount;
 extern hostcache_t hostcache[HOSTCACHESIZE];
 
-#ifdef IDGODS
-qboolean IsID(struct qsockaddr *addr);
-#endif
-
 /*
  * ===========================================================================
  *
diff -urN a/NQ/net_dgrm.c head/NQ/net_dgrm.c
--- a/NQ/net_dgrm.c	2006-02-21 20:58:24.000000000 +1030
+++ head/NQ/net_dgrm.c	2006-03-11 23:16:44.000000000 +1030
@@ -109,7 +109,7 @@
 	}
 	print = Con_Printf;
     } else {
-	if (pr_global_struct->deathmatch && !host_client->privileged)
+	if (pr_global_struct->deathmatch)
 	    return;
 	print = SV_ClientPrintf;
     }
diff -urN a/NQ/net_main.c head/NQ/net_main.c
--- a/NQ/net_main.c	2004-08-11 22:35:12.000000000 +0930
+++ head/NQ/net_main.c	2006-03-11 23:13:39.000000000 +1030
@@ -85,10 +85,6 @@
 cvar_t config_modem_init = { "_config_modem_init", "", true };
 cvar_t config_modem_hangup = { "_config_modem_hangup", "AT H", true };
 
-#ifdef IDGODS
-cvar_t idgods = { "idgods", "0" };
-#endif
-
 qboolean recording = false;
 
 net_driver_t *net_driver;
@@ -842,9 +838,6 @@
     Cvar_RegisterVariable(&config_modem_clear);
     Cvar_RegisterVariable(&config_modem_init);
     Cvar_RegisterVariable(&config_modem_hangup);
-#ifdef IDGODS
-    Cvar_RegisterVariable(&idgods);
-#endif
 
     Cmd_AddCommand("slist", NET_Slist_f);
     Cmd_AddCommand("listen", NET_Listen_f);
@@ -964,22 +957,3 @@
     proc->next = pp;
     prev->next = proc;
 }
-
-
-#ifdef IDGODS
-#define IDNET	0xc0f62800
-
-qboolean
-IsID(struct qsockaddr *addr)
-{
-    if (idgods.value == 0.0)
-	return false;
-
-    if (addr->sa_family != 2)
-	return false;
-
-    if ((BigLong(*(int *)&addr->sa_data[2]) & 0xffffff00) == IDNET)
-	return true;
-    return false;
-}
-#endif
diff -urN a/NQ/quakedef.h head/NQ/quakedef.h
--- a/NQ/quakedef.h	2005-01-06 22:47:48.000000000 +1030
+++ head/NQ/quakedef.h	2006-03-11 23:12:03.000000000 +1030
@@ -182,11 +182,6 @@
 
 #define	SOUND_CHANNELS		8
 
-// This makes anyone on id's net privileged
-// Use for multiplayer testing only - VERY dangerous!!!
-// #define IDGODS
-
-
 typedef struct {
     vec3_t origin;
     vec3_t angles;
diff -urN a/NQ/server.h head/NQ/server.h
--- a/NQ/server.h	2004-08-08 17:47:25.000000000 +0930
+++ head/NQ/server.h	2006-03-11 23:15:27.000000000 +1030
@@ -70,7 +70,6 @@
     qboolean active;		// false = client is free
     qboolean spawned;		// false = don't send datagrams
     qboolean dropasap;		// has been told to go to another level
-    qboolean privileged;	// can execute any host command
     qboolean sendsignon;	// only valid before spawned
 
     double last_message;	// reliable messages must be sent
diff -urN a/NQ/sv_main.c head/NQ/sv_main.c
--- a/NQ/sv_main.c	2005-11-27 19:13:02.000000000 +1030
+++ head/NQ/sv_main.c	2006-03-11 23:16:58.000000000 +1030
@@ -287,12 +287,6 @@
     client->message.maxsize = sizeof(client->msgbuf);
     client->message.allowoverflow = true;	// we can catch it
 
-#ifdef IDGODS
-    client->privileged = IsID(&client->netconnection->addr);
-#else
-    client->privileged = false;
-#endif
-
     if (sv.loadgame)
 	memcpy(client->spawn_parms, spawn_parms, sizeof(spawn_parms));
     else {
diff -urN a/NQ/sv_user.c head/NQ/sv_user.c
--- a/NQ/sv_user.c	2004-08-08 18:57:33.000000000 +0930
+++ head/NQ/sv_user.c	2006-03-11 23:18:48.000000000 +1030
@@ -528,10 +528,7 @@
 
 	    case clc_stringcmd:
 		s = MSG_ReadString();
-		if (host_client->privileged)
-		    ret = 2;
-		else
-		    ret = 0;
+		ret = 0;
 		if (strncasecmp(s, "status", 6) == 0)
 		    ret = 1;
 		else if (strncasecmp(s, "god", 3) == 0)
@@ -573,8 +570,6 @@
 
 		if (ret == 1)
 		    Cmd_ExecuteString(s, src_client);
-		else if (ret == 2)
-		    Cbuf_InsertText(s);
 		else
 		    Con_DPrintf("%s tried to %s\n", host_client->name, s);
 		break;
