|
| 10 Feb 2015 10:59 PM |
Studio's glitchy right now
how many seconds
I'm asking because of game.OnClose |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:01 PM |
game.OnClose will delay the closure of a server if there's a yeild in the function so there's no need to worry
game.OnClose = function() wait'5'; end -->waits 5 seconds before server closes. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:03 PM |
| If a lot of people are in your game and you save on close and you need to shutdown all for an update it would cause problems of so many attempted saves at once |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:04 PM |
@Goulstem
I know that, but I'm going to save emergency data there and it has a max limit of 30 seconds.
@128GB
that's why i'm asking this
most data is saved in a loop but this is for very important stuff |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:06 PM |
| Well I doubt your saving would take 30+ seconds. |
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:09 PM |
| Seeing as how generic for loops are close to instantaneous without a yeild, and that DataStores update in no time at all, I hightly doubt you'd exceed 30 seconds unless you're being silly and putting in waits for no reason. But also be careful to not go over the DS request limit or else you will be screwed lol |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:10 PM |
| could you save a request in 1 second or less |
|
|
| Report Abuse |
|
|
Ruinable
|
  |
| Joined: 14 Sep 2014 |
| Total Posts: 8903 |
|
|
| 10 Feb 2015 11:13 PM |
Try doing
Now = tick() -datasave Later =tick() print(Later-Now)
|
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:13 PM |
| ID 17 errors I can't test anything in a live game |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:14 PM |
| Mhmm.. but then again if you have a system where people can save at their own will then if a bunch of people save right before the server closes then you could exceed the DS request limit per minute(hehe, rhymes). So it's a gamble. I would just find an alternative, what are you trying to accomplish here? |
|
|
| Report Abuse |
|
|
Ruinable
|
  |
| Joined: 14 Sep 2014 |
| Total Posts: 8903 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:16 PM |
@Goul If he saves 20 people on close it could exceed the limit too, thats what we were talking about |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:17 PM |
My datastore system:
-Loop every 60 seconds, save 3 values with 3 different calls to SetAsync(). -Save dev product purchases immediately (gambling here that it won't get over the limit, but hey if it does I just got a ton of robux right?)
-Save important data that needs to be saved (likely a single call) in game.OnClose, part of a login bonus system or possibly something else. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:19 PM |
Limit for Setting async is (60 + numPlayers * 10) So 60 + (20) * 10 ~ 60 + 200 ~ 260. 260 limit per minute.. I doubt you'll exceed the limit with a game.onclose solely |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:21 PM |
| That would easily go over if a couple of servers are opened and then closed |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:21 PM |
But it's about how long it would take.
The max amount of time game.OnClose can yield is 30 seconds, and if we're talking about 20 players (maybe even up to 25), that could be a problem if a datastore call on average takes say 1.5 seconds. |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:22 PM |
"That would easily go over if a couple of servers are opened and then closed"
Datastore limits are per server. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:25 PM |
I'm pretty sure theres a limit thats not per server too though
|
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:27 PM |
| Oh, well then 30 seconds would be plenty of time for it to save, it would take almost no time at all to save it |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 11:30 PM |
ok I'll take your word for it
but let me tell you if this ends up NOT being the case and this hits the front page and there a bad problem, I WILL hack you. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:37 PM |
h4x0r
You spawn() each save so it doesn't wait for it to finish saving before saving the next one
Like
for _, player in next, game.Players:GetPlayers() do spawn(function() --[[Save player]] end) end |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:38 PM |
| You could spawn() each save so it doesn't wait for it to finish saving before saving the next one* |
|
|
| Report Abuse |
|
|