m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
const struct StatDesc *sd;
m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
const struct StatDesc *sd;
if ((parc < 2) || !(sd = stats_find(parv[1])))
parv[1] = "*", sd = stats_find("*");
if ((parc < 2) || !(sd = stats_find(parv[1])))
parv[1] = "*", sd = stats_find("*");
* not privileged (server or an operator), then the STAT_FLAG_OPERONLY
* flag must not be set, and if the STAT_FLAG_OPERFEAT flag is set,
* then the feature given by sd->sd_control must be off.
* not privileged (server or an operator), then the STAT_FLAG_OPERONLY
* flag must not be set, and if the STAT_FLAG_OPERFEAT flag is set,
* then the feature given by sd->sd_control must be off.
*/
if (!IsPrivileged(cptr) &&
((sd->sd_flags & STAT_FLAG_OPERONLY) ||
((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
*/
if (!IsPrivileged(cptr) &&
((sd->sd_flags & STAT_FLAG_OPERONLY) ||
((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
/* Check for extra parameter */
if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
param = parv[3];
/* Check for extra parameter */
if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
param = parv[3];
/* Ok, track down who's supposed to get this... */
if (hunt_server_cmd(sptr, CMD_STATS, cptr, feature_int(FEAT_HIS_REMOTE),
/* Ok, track down who's supposed to get this... */
if (hunt_server_cmd(sptr, CMD_STATS, cptr, feature_int(FEAT_HIS_REMOTE),
assert(sd->sd_func != 0);
/* Ok, dispatch the stats function */
assert(sd->sd_func != 0);
/* Ok, dispatch the stats function */