MemoryStore check when item in a sorted map expires

I’m currently in the process of creating an auction house system and am having trouble determining how to reward the highest bidder after the entry expires, so when the bidding is over.

There’s no inherent way to have something happen when an entry expires, so I need help with maybe a design to follow or a direction to look into.

I’ve tried using MessagingService to send like a start event when the entry first gets listed so all servers can start some counter counting down however that has a problem with what if all the servers go down? The entry keeps expiring and the counters would mess up. Perhaps someone could offer a suggestion that fixes those issues, thank you!

I havent worked all too much with memory stores but maybe cache all the listing’s start times and incrementally across all servers check for expired listings, so if all the servers shut down then the listing will properly expire at the check of the next server?

Maybe do a BindToClose thing that renders all of that server’s auction listings as uncontrolled and another game jobid can take control over it?

Have you found a solution to this?

Was a while ago but I remember I made a custom tracking system that made one server the “host” of the auction and could yield for the duration of the auction then when the yield’s over, the auction’s over and you can go from there. When the server died it chose a random server jobid and used messagingservice to pass over all its auctions to that server.

1 Like