On Mon, 19 Jan 1998, Akuma/Chris Baggett/DOOMer wrote:
>I've had to make a few changes to the is_evil_char() function.
That's why it's there.
>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.
Every line should be sent at a time, not pieces of a line.
> 1. HISTORY
> 2. history
> 3. HISTORY
> 4. history
> 5. HISTORY
> 6. history
> 7. HISTORY
> 8. history
>-> 9. HISTORY
> 10. history
You must be doing:
sprintf(buf, "%2d. ", i);
send_to_char(buf, ch);
send_to_char(variable, ch);
Use:
sprintf(buf, "%3d. %s", i, variable);
send_to_char(buf, ch);
>I was wondering if it could be changed just to start with
>BEGINNINGS of lines? eh? mainly because the strstr() call sorts
How would it know what it the beginning of a line? I suppose you could
check for a \r\n to only stack lines which appear to be at the end but I
don't know how effective that would be.
>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??
Harder.
>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)
It's a lot easier to check the incoming line for a duplicate than it is to
look though an existing string for two pieces which *may* be similiar.
>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
The is_evil_char() is meant for control characters to prevent color
bleeding. If you have other problems, fix your printing. The one I know
of that I don't have fixed and would be 'interesting' to fix is the
equipment list problem. (wear two of the same ring for example.)
>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.
Why do you add those to the function?
> (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 )
2+2 != 5, even for large values of 2.
>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.
I think I already mentioned to send one line at a time. A suggestion on
the 'eq' problem would be nice as it's not a pressing matter I'm looking
into at the moment. I do think searching the existing string for possible
matches is the wrong way to go about it though.
You could give the "\r\n required to stack" idea a try and see how it goes.
I doubt it'll do much though. (It will help the 'eq' problem though.)
--
George Greer - Me@Null.net | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard
+------------------------------------------------------------+
| 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