Re: [code fix] liblist

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 09/10/97

> hello all.... poped in loadlist and tested it out, great program
> except if you try to do
> Xlist 1 9999 [X being eather O, M or R]
> BOOM, the mud crashes...
> to many items I belive, but here is a little pit to handle that.. it
> will take and make it so you cant list more then 300 items....
        Solves the problem, but what you might want to consider is the
following idea that I used to fix it up so it would work altogether

        Basically set everything to use page_string(). Don't know
off hand if this is in the snippet or not - didn't use the thing.  Then,
since we're already writing out to a buffer before we send it, we can
realize when adding the next item/mob/room to the list will be larger than
the buffer. So, inside the loop which scans through your mob/obj/room
list, just check for something like if (strlen(buf-you're-using-to-save) +
strlen(buf-you're-going-to-add) > MAX_SIZE_OF_THE_BUF-YOU'RE_USING_TO_SAVE)
and if so, then page_string() it out then.  The only problem I have with
it is that after like say, 27 pages, it resets to page 1.  But i'm sure
you could just alter page_string to accept and return page numbers of the
start and finish respectively, if you want it cosmetically perfect.

        Hmm. George - does your buffer system fix this? Haven't had time
to think lately, much less code and test.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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