Re: (Non-code discussion) Auto-auction system

From: Pooge (
Date: 12/26/95

ShadowLord wrote:
> I've implemented an auto-auctioning system for the MUD I work at, now,
> but I have ran into a crash bug; I can probably write the neccessary code
> to fix the problem, however, the big problem is that I can't think of a
> good way to prevent the problem without removing the auctioned items.
> The problem is if the current bidder logs off and the auction system
> tries selling the item to them, it obviously won't work; my first
> sollution was to keep the idnum of the last bidder and what they bid, but
> then I thought it was possible that _they_ would have logged off, and the
> last bidder would _be_ them, therefore, I'd be forced just to remove the
> item from the list.
> Here's what I'm talking about:
> [Auction] A polished longsword for 1000 gold, dmg-dice: 2d8.
> > bid polished 1025
> [Auction] You bid 1025 gold for "a polished longsword."
> >
> [Auction] A polished longsword going once to you.

I think this message got partially cut off, at least for me, but from what you're
saying, it sounds like a stack would be a good solution.  I don't know quite how
you implement the auto-auction, but you could probably implement a simple stack of
pointers to struct char_data (bidders) pretty easily.  Then, if the highest bidder
has logged off, pop him and go to the next bidder.  If all of them have (by a strange
chance) logged off (you see the stack is empty), start the auction over as if nothing
had happened.

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