From b89dd7149ae71a43e9358a4691935606e979c93b Mon Sep 17 00:00:00 2001 From: sezero Date: Mon, 12 Dec 2011 09:50:23 +0000 Subject: [PATCH] removed privileged member from the client structure git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@506 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/host_cmd.c | 12 ++++++------ quakespasm/Quake/net_dgrm.c | 2 +- quakespasm/Quake/server.h | 1 - quakespasm/Quake/sv_main.c | 1 - quakespasm/Quake/sv_user.c | 10 +++------- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/quakespasm/Quake/host_cmd.c b/quakespasm/Quake/host_cmd.c index 4335a00e..76963080 100644 --- a/quakespasm/Quake/host_cmd.c +++ b/quakespasm/Quake/host_cmd.c @@ -564,7 +564,7 @@ void Host_God_f (void) return; } - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; //johnfitz -- allow user to explicitly set god mode to on or off @@ -609,7 +609,7 @@ void Host_Notarget_f (void) return; } - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; //johnfitz -- allow user to explicitly set notarget to on or off @@ -656,7 +656,7 @@ void Host_Noclip_f (void) return; } - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; //johnfitz -- allow user to explicitly set noclip to on or off @@ -712,7 +712,7 @@ void Host_Fly_f (void) return; } - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; //johnfitz -- allow user to explicitly set noclip to on or off @@ -1742,7 +1742,7 @@ void Host_Kick_f (void) return; } } - else if (pr_global_struct->deathmatch && !host_client->privileged) + else if (pr_global_struct->deathmatch) return; save = host_client; @@ -1830,7 +1830,7 @@ void Host_Give_f (void) return; } - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; t = Cmd_Argv(1); diff --git a/quakespasm/Quake/net_dgrm.c b/quakespasm/Quake/net_dgrm.c index 4bbba2ad..edbfecbc 100644 --- a/quakespasm/Quake/net_dgrm.c +++ b/quakespasm/Quake/net_dgrm.c @@ -95,7 +95,7 @@ static void NET_Ban_f (void) } else { - if (pr_global_struct->deathmatch && !host_client->privileged) + if (pr_global_struct->deathmatch) return; print_fn = SV_ClientPrintf; } diff --git a/quakespasm/Quake/server.h b/quakespasm/Quake/server.h index 8c560079..2b72676a 100644 --- a/quakespasm/Quake/server.h +++ b/quakespasm/Quake/server.h @@ -84,7 +84,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 diff --git a/quakespasm/Quake/sv_main.c b/quakespasm/Quake/sv_main.c index a0882a40..e88d7e0a 100644 --- a/quakespasm/Quake/sv_main.c +++ b/quakespasm/Quake/sv_main.c @@ -347,7 +347,6 @@ void SV_ConnectClient (int clientnum) client->message.data = client->msgbuf; client->message.maxsize = sizeof(client->msgbuf); client->message.allowoverflow = true; // we can catch it - client->privileged = false; if (sv.loadgame) memcpy (client->spawn_parms, spawn_parms, sizeof(spawn_parms)); diff --git a/quakespasm/Quake/sv_user.c b/quakespasm/Quake/sv_user.c index 05ea1796..91b85a24 100644 --- a/quakespasm/Quake/sv_user.c +++ b/quakespasm/Quake/sv_user.c @@ -529,10 +529,7 @@ nextmsg: case clc_stringcmd: s = MSG_ReadString (); - if (host_client->privileged) - ret = 2; - else - ret = 0; + ret = 0; if (Q_strncasecmp(s, "status", 6) == 0) ret = 1; else if (Q_strncasecmp(s, "god", 3) == 0) @@ -571,9 +568,8 @@ nextmsg: ret = 1; else if (Q_strncasecmp(s, "ban", 3) == 0) ret = 1; - if (ret == 2) - Cbuf_InsertText (s); - else if (ret == 1) + + if (ret == 1) Cmd_ExecuteString (s, src_client); else Con_DPrintf("%s tried to %s\n", host_client->name, s);