Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cross server auction house?

Asked by 7 years ago

So Iv been trying to think of a cross server auction house. Only best way without overwriting / losing data I could think of is use a separate data website with HTTP however it would not be able to handle the about of entry process. How would I go about making this while not having auction house data be overwritten when multiple people are updating the auction house and updating the data store at same time. This could be around 500 people using it same exact time

0
Please use proper grammar as your question is hard to read without it. Async_io 908 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

If you create a custom server, HTTPService can handle 500 requests per minute (per server). Since the maximum server size is 50-100, this is more than sufficient (especially if you use a lower player count) - the trick is to make each request to transmit as much information as possible. This is the best way, though you need to know how to program a custom server and you'll need to rent or purchase one (if you cannot find a free service like Trello to host the data for you).

If you don't have the ability/resources to use a custom server, Data Stores can - with good planning - be of some use. There are some limitations you have to plan around; one undocumented limit is "200 requests per 10 seconds per key".

You will need to study the Data Store guide, which talks about, for instance, UpdateAsync, which is what you need so that you don't overwrite data. Note that I have found UpdateAsync extremely slow if you have numerous servers trying to update the same key all at once; in designing, you should try to avoid this situation.

I have found that using OrderedDataStores can be beneficial in sorting data, so long as you can compress that data into a string of length 50 (for the key). You can store some information in the value as well, though the value must be designed so that the OrderedDataStore will retrieve it if it represents the best deal. Note that you will only ever be able to get the best 100 deals in the first page with a single request.

Note that getting data from OrderedDataStores is expensive; per player, you can only get a page every 30 seconds.

One idea is to put as the value in an OrderedDataStore the current time (based on os.time()). Each key would represent what is being bought/sold and perhaps its best offer; you would occasionally retrieve a page of the most recent deals to show to your players. Each entry could have another OrderedDataStore that contains all the offers for that object and who made that offer. Meanwhile, in a normal data store, a key that belongs to each player could be used to keep track of their current offers, so that you can remove them when appropriate.

This is not a simple project. If you've not scripted much before, you may wish to reconsider your idea until you've become more experienced. For instance, if you have fairly large servers, you might want to allow auctioning within a single server, rather than auctioning between servers.

Ad

Answer this question