if(sv_status_privacy.integer && cmd->source != src_command)
strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
else
- strlcpy(ip, (client->netconnection && client->netconnection->address) ? client->netconnection->address : "botclient", 48);
+ strlcpy(ip, (client->netconnection && *client->netconnection->address) ? client->netconnection->address : "botclient", 48);
frags = client->frags;
}
}
+// Disable cheats if sv_cheats is turned off
+static void Host_DisableCheats_c(char *value)
+{
+ prvm_prog_t *prog = SVVM_prog;
+ int i = 0;
+
+ if (value[0] == '0' && !value[1])
+ {
+ while (svs.clients[i].edict)
+ {
+ if (((int)PRVM_serveredictfloat(svs.clients[i].edict, flags) & FL_GODMODE))
+ PRVM_serveredictfloat(svs.clients[i].edict, flags) = (int)PRVM_serveredictfloat(svs.clients[i].edict, flags) ^ FL_GODMODE;
+ if (((int)PRVM_serveredictfloat(svs.clients[i].edict, flags) & FL_NOTARGET))
+ PRVM_serveredictfloat(svs.clients[i].edict, flags) = (int)PRVM_serveredictfloat(svs.clients[i].edict, flags) ^ FL_NOTARGET;
+ if (PRVM_serveredictfloat(svs.clients[i].edict, movetype) == MOVETYPE_NOCLIP ||
+ PRVM_serveredictfloat(svs.clients[i].edict, movetype) == MOVETYPE_FLY)
+ {
+ noclip_anglehack = false;
+ PRVM_serveredictfloat(svs.clients[i].edict, movetype) = MOVETYPE_WALK;
+ }
+ i++;
+ }
+ }
+}
+
/*
===============================================================================
PRVM_ED_ParseEdict (prog, start, ent);
// link it into the bsp tree
- if (!ent->priv.server->free)
+ if (!ent->priv.server->free && !VectorCompare(PRVM_serveredictvector(ent, absmin), PRVM_serveredictvector(ent, absmax)))
SV_LinkEdict(ent);
}
Send back ping and packet loss update for all current players to this player
====================
*/
-void Host_Pings_f(cmd_state_t *cmd)
+static void Host_Pings_f(cmd_state_t *cmd)
{
int i, j, ping, packetloss, movementloss;
char temp[128];
Cvar_RegisterVariable(&skin);
Cvar_RegisterVariable(&noaim);
Cvar_RegisterVariable(&sv_cheats);
+ Cvar_RegisterCallback(&sv_cheats, Host_DisableCheats_c);
Cvar_RegisterVariable(&sv_adminnick);
Cvar_RegisterVariable(&sv_status_privacy);
Cvar_RegisterVariable(&sv_status_show_qcstatus);
Cmd_AddCommand(&cmd_client, "packet", Host_Packet_f, "send a packet to the specified address:port containing a text string");
Cmd_AddCommand(&cmd_clientfromserver, "packet", Host_Packet_f, "send a packet to the specified address:port containing a text string");
Cmd_AddCommand(&cmd_client, "topcolor", Host_TopColor_f, "QW command to set top color without changing bottom color");
+ Cmd_AddCommand(&cmd_clientfromserver, "topcolor", Host_TopColor_f, "QW command to set top color without changing bottom color");
Cmd_AddCommand(&cmd_client, "bottomcolor", Host_BottomColor_f, "QW command to set bottom color without changing top color");
Cmd_AddCommand(&cmd_client, "fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)");