TWO_X Patch/Snippet

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 01/19/98


WARNING: Non-Newbie Ranting about a small "problem" (?) in
    the TWOX snippet of George's doing.

Ok, this probably should be directed at George,
but after I installed the TWO_X patch,
I've had to make a few changes to the is_evil_char() function.

Now, I realize that strstr() is faster for the TWOX
patch, but it also allows for weird things to happen.
I don't know if maybe I should print everything to a buffer, and then
send it out or what, but it's pretty freaky.

take this for example.
I have his history snippet added, and I wrote a simple
do_history command, so it would show which command was about
to be overwritten, and which was the last few commands done.

    1. HISTORY
    2. history
    3. HISTORY
    4. history
    5. HISTORY
    6. history
    7. HISTORY
    8. history
->  9. HISTORY
   10. history
that above is WITHOUT it,
below is with.
    1. (5*)HISTORY
    2. (5*)history
    3.     4.     5.     6.      7.     8. ->  9.    10.
I was wondering if it could be changed just to start with
BEGINNINGS of lines?  eh?  mainly because the strstr() call sorts
through the entire string looking for that string, and you add 4 bytes
to the first occurrence of it. and remove it from the rest.
maybe, find a way to have it check the lines sent?
like maybe on deeper, in the  process_output() function
or maybe even  write_to_descriptor??

I figured i'd ask this, because in write_to_output,
you are only able to check the currently sent in text, and
you check it everytime.  Whereas process_output()
you'd go through it looking for similarities in lines,
and then go from there (b/c that's the reason of a
(2*) stacking patch is to go line-by-line)

I realize, that I'm probably the only one who is having this problem,
but I feel it shouldn't be necessary to add EVERY letter to the
is_evil_char() function just to because someone spams
the command that begins with that letter
(lower/upper b/c strstr is case sensitive).
(ask, beg, command, drink, eat, force,
 get, hit, inventory, junk, kill,
 look, mail, north, open, put, quaff,
 rest, sit, tell, up, visible, wear, (no stock 'X' command)
 yawn, zreset)
 These are all stock commands, and i'd be required to add
 every letter of the alphabet along with !, and ^ into
 is_evil_char() not to mention both case versions, AND
 the numbers 0-9 (if i had his goto without goto snippet)
 and that would completely take away from the point of the snippet.

 I realize I've been ranting and raving, and if you've gotten
 this far in the mail, I appreciate it.
 (By-the-by, just in case you did read it, and you feel like
  flaming, please quote this to prove you read it: 2+2=5 )

 Anyway, don't get me wrong, the snippet is great and I love
 all the work George has put into CircleMUD and his snippets, but if
 I must get rid of the history command to make use of this snippet,
 I'd rather fix it to how it possibly (IMHO) should be done.

 So, any ideas/comments/suggestions on how/if this could/will be done?

 thanks.

 Code On
 Akuma the Raging Coder


  +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |
  +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST