Don't know the feasibility of this, but in interpret, there's this:

    /*
     * Dispatch the command.
     */
    (*cmd_table[cmd].do_fun) ( ch, argument );

So maybe we can do something to this.  (again, not sure of the feasibility of 
this, may require
more work than estimated):
merc.h, could add to:

struct pc_data
{
...
    char *last_cmd;
    int cmd_iteration;
...
}

so right above the dispatch, you could add:
    ch->pcdata->last_cmd = cmd_table[cmd].name ? ch->pcdata->cmd_iteration++ :
ch->pcdata->last_cmd = cmd_table[cmd].name;
(maybe strdup instead?)

    and then:
    ch->pcdata->cmd_iteration > cmd_table[cmd].max_iteration ? 
send_to_char("Spam whatever
blah.\n\r", ch) : (*cmd_table[cmd].do_fun) ( ch, argument );

========
Again, not sure if this is even remotely feasible.  Heck, rom's method is 
probably better.

Of course, this wouldn't prevent one from doing n,n,n,n,look,n,n,n,n; but 
that's nothing new.


-- Jeremy

----- Original Message ----- 
From: "Chris "Winston" Litchfield" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, July 25, 2003 10:02 PM
Subject: Spamming


> ROM has spam checking in that it checks for a string repeated X amount of
> time.  This is fine as it can catch some people spamming the mud.  However,
> this does not work for things like "note, note, note ,note" or "n,n,n,n,n,n"
> spamming.
>
> So in order for me to prevent that I have long since added (&&
> !strcmp(...,"note"); statements here.
>
> Does anyone have a better system to avoid performance issues?
>
> Chris
>
>
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to