[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.

Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
Tyrann 2006-09-10 19:13:50 +09:30
parent 9308c81030
commit 702ece9076
8 changed files with 9 additions and 106 deletions

View File

@ -128,7 +128,7 @@ Host_God_f(void)
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 @@ Host_Notarget_f(void)
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 @@ Host_Noclip_f(void)
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 @@ Host_Fly_f(void)
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 @@ Host_Version_f(void)
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 @@ Host_Kick_f(void)
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 @@ Host_Give_f(void)
return;
}
if (pr_global_struct->deathmatch && !host_client->privileged)
if (pr_global_struct->deathmatch)
return;
t = Cmd_Argv(1);
@ -1618,9 +1570,7 @@ Host_InitCommands(void)
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);

View File

@ -241,10 +241,6 @@ typedef struct {
extern int hostCacheCount;
extern hostcache_t hostcache[HOSTCACHESIZE];
#ifdef IDGODS
qboolean IsID(struct qsockaddr *addr);
#endif
/*
* ===========================================================================
*

View File

@ -109,7 +109,7 @@ NET_Ban_f(void)
}
print = Con_Printf;
} else {
if (pr_global_struct->deathmatch && !host_client->privileged)
if (pr_global_struct->deathmatch)
return;
print = SV_ClientPrintf;
}

View File

@ -85,10 +85,6 @@ cvar_t config_modem_clear = { "_config_modem_clear", "ATZ", true };
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 @@ NET_Init(void)
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 @@ SchedulePollProcedure(PollProcedure *proc, double timeOffset)
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

View File

@ -182,11 +182,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#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;

View File

@ -70,7 +70,6 @@ typedef struct client_s {
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

View File

@ -287,12 +287,6 @@ SV_ConnectClient(int clientnum)
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 {

View File

@ -528,10 +528,7 @@ SV_ReadClientMessage(void)
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 @@ SV_ReadClientMessage(void)
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;