]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_ccmds.c
model_brush: Set mod_bsp_portalize to 0 by default for now. It hurts performance...
[xonotic/darkplaces.git] / sv_ccmds.c
index 27847ffb3b3948c4bc30cc4051dd4a056c7689b8..613ae309475acb20a3fbe15bf22cb0601a98c9ae 100644 (file)
@@ -416,16 +416,10 @@ static void SV_Pause_f(cmd_state_t *cmd)
        else
                print = SV_ClientPrintf;
 
-       if (!pausable.integer)
+       if (!pausable.integer && cmd->source == src_client && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
        {
-               if (cmd->source == src_client)
-               {
-                       if(cls.state == ca_dedicated || host_client != &svs.clients[0]) // non-admin
-                       {
-                               print("Pause not allowed.\n");
-                               return;
-                       }
-               }
+               print("Pause not allowed.\n");
+               return;
        }
        
        sv.paused ^= 1;
@@ -496,7 +490,7 @@ static void SV_Say(cmd_state_t *cmd, qbool teamonly)
                        SV_ClientPrint(text);
        host_client = save;
 
-       if (cls.state == ca_dedicated)
+       if(!host_isclient.integer)
                Con_Print(&text[1]);
 }
 
@@ -718,68 +712,6 @@ static void SV_Pings_f(cmd_state_t *cmd)
                MSG_WriteString(&host_client->netconnection->message, "\n");
 }
 
-/*
-====================
-SV_User_f
-
-user <name or userid>
-
-Dump userdata / masterdata for a user
-====================
-*/
-static void SV_User_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
-{
-       int             uid;
-       int             i;
-
-       if (Cmd_Argc(cmd) != 2)
-       {
-               Con_Printf ("Usage: user <username / userid>\n");
-               return;
-       }
-
-       uid = atoi(Cmd_Argv(cmd, 1));
-
-       for (i = 0;i < cl.maxclients;i++)
-       {
-               if (!cl.scores[i].name[0])
-                       continue;
-               if (cl.scores[i].qw_userid == uid || !strcasecmp(cl.scores[i].name, Cmd_Argv(cmd, 1)))
-               {
-                       InfoString_Print(cl.scores[i].qw_userinfo);
-                       return;
-               }
-       }
-       Con_Printf ("User not in server.\n");
-}
-
-/*
-====================
-SV_Users_f
-
-Dump userids for all current players
-====================
-*/
-static void SV_Users_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
-{
-       int             i;
-       int             c;
-
-       c = 0;
-       Con_Printf ("userid frags name\n");
-       Con_Printf ("------ ----- ----\n");
-       for (i = 0;i < cl.maxclients;i++)
-       {
-               if (cl.scores[i].name[0])
-               {
-                       Con_Printf ("%6i %4i %s\n", cl.scores[i].qw_userid, cl.scores[i].frags, cl.scores[i].name);
-                       c++;
-               }
-       }
-
-       Con_Printf ("%i total users\n", c);
-}
-
 /*
 ==================
 SV_Status_f
@@ -1137,7 +1069,7 @@ static void SV_Kick_f(cmd_state_t *cmd)
        {
                if (cmd->source == src_local)
                {
-                       if (cls.state == ca_dedicated)
+                       if(!host_isclient.integer)
                                who = "Console";
                        else
                                who = cl_name.string;
@@ -1346,7 +1278,7 @@ static void SV_Viewmodel_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
        prvm_edict_t    *e;
-       dp_model_t      *m;
+       model_t *m;
 
        if (!sv.active)
                return;
@@ -1375,7 +1307,7 @@ static void SV_Viewframe_f(cmd_state_t *cmd)
        prvm_prog_t *prog = SVVM_prog;
        prvm_edict_t    *e;
        int             f;
-       dp_model_t      *m;
+       model_t *m;
 
        if (!sv.active)
                return;
@@ -1393,7 +1325,7 @@ static void SV_Viewframe_f(cmd_state_t *cmd)
        }
 }
 
-static void PrintFrameName (dp_model_t *m, int frame)
+static void PrintFrameName (model_t *m, int frame)
 {
        if (m->animscenes)
                Con_Printf("frame %i: %s\n", frame, m->animscenes[frame].name);
@@ -1410,7 +1342,7 @@ static void SV_Viewnext_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
        prvm_edict_t    *e;
-       dp_model_t      *m;
+       model_t *m;
 
        if (!sv.active)
                return;
@@ -1437,7 +1369,7 @@ static void SV_Viewprev_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
        prvm_edict_t    *e;
-       dp_model_t      *m;
+       model_t *m;
 
        if (!sv.active)
                return;
@@ -1470,7 +1402,7 @@ static void SV_SendCvar_f(cmd_state_t *cmd)
        cvarname = Cmd_Argv(cmd, 1);
 
        old = host_client;
-       if (cls.state != ca_dedicated)
+       if(host_isclient.integer)
                i = 1;
        else
                i = 0;
@@ -1713,8 +1645,6 @@ void SV_InitOperatorCommands(void)
        Cmd_AddCommand(CF_SHARED, "viewnext", SV_Viewnext_f, "change to next animation frame of viewthing entity in current level");
        Cmd_AddCommand(CF_SHARED, "viewprev", SV_Viewprev_f, "change to previous animation frame of viewthing entity in current level");
        Cmd_AddCommand(CF_SHARED, "maxplayers", SV_MaxPlayers_f, "sets limit on how many players (or bots) may be connected to the server at once");
-       Cmd_AddCommand(CF_SHARED, "user", SV_User_f, "prints additional information about a player number or name on the scoreboard");
-       Cmd_AddCommand(CF_SHARED, "users", SV_Users_f, "prints additional information about all players on the scoreboard");
        Cmd_AddCommand(CF_SERVER, "sendcvar", SV_SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
 
        // commands that do not have automatic forwarding from cmd_client, these are internal details of the network protocol and not of interest to users (if they know what they are doing they can still use a generic "cmd prespawn" or similar)