Suphi's DataStore Module

is it possible to manage as an Administrator this database to give via a software?

Sure anything is possible

I think the global updates approach would most like be the best way

Using the cloud service add a list of commands to a separate datastore using updatesync

Then in game every so often use updateasync to read and clean out the list of commands

Then run them commands and a command can do almost anything you want

thank you very much there is a software to do this manipulation

Question is it intentional for roblox studio to not count towards session locking? I am able to save data from both ingame and roblox studio at the same time. And is it required to do Save() before destroying the datastore because sometimes people say they experience a bit of data loss when they leave the game if they performed actions just before leaving.

When in studio the memorystore is saved locally and restarting studio also resets the memorystore so no session locking wont replicate to the real game from studio

no its not required to call Save()

there is 2 cases where data could be lost

  1. Roblox servers failed
  2. You never checked the datastore.State == true before updating the value
1 Like

If your getting MemoryStoreService requests throttling I think Roblox is having some under the hood problems at this current time

2 Likes

Is this still maintanance? I’ll using this for my new project game

If you find a problem tell me and ill fix it

1 Like

Hey, nice module - works really well however one issue I have is that you mention that this module reconciles missing data, but does this handle deep copying tables?
From my testing, data reconciles if it is at the first level but going deeper into a table it no longer does. Would make a massive improvement if you could implement this natively.
Thanks for making this!

Hi Suphi, I am having this problem where (just out of the blue after updating), where whenever I open my Data Script and your Data Module, my studio crashes. It doesn’t crash with any other datastores. I double checked, no circular dependencies, no unlimited loops without any exits - which shouldn’t matter anyways because I am still in edit, not play test. Any idea whats going on?

it is a deep reconcile here are the functions

Clone = function(original)
	if type(original) ~= "table" then return original end
	local clone = {}
	for index, value in original do clone[index] = Clone(value) end
	return clone
end

Reconcile = function(target, template)	
	for index, value in template do
		if type(index) == "number" then continue end
		if target[index] == nil then
			target[index] = Clone(value)
		elseif type(target[index]) == "table" and type(value) == "table" then
			Reconcile(target[index], value)
		end
	end
end

are you using a mac or windows?

Does studio crash when you run the game or just by simply opening the module while the game is not running?

if studio is crashing outside of game then its most likely related to this bug

I did some testing and I think the issue arises when trying to reconcile a list of items where the index is a number.

An example of something that does not reconcile would be

[1] = {
   outfit = {
      hat = 1,
      shirt = 1,
      pants = 1,
   },
}

Where I want to add a new coins = 0 field after outfit - so the new template would be

[1] = {
   outfit = {
      hat = 1,
      shirt = 1,
      pants = 1,
   },
   coins = 0,
}

This does not reconcile correctly because the Reconcile function continues without recursively calling itself back to go deeper into the table if the key is a number.
Currently, I iterate over each individual list item and reconcile them individually but it would be nice if you could implement support for this.

I know that other data reconciling functions only reconcile data behind string keys, but perhaps adding an option to reconcile integer keys could be useful.

in the reconcile function simply comment out or remove the number type check line

Reconcile = function(target, template)	
	for index, value in template do
		if type(index) == "number" then continue end -- comment or remove this line out
		if target[index] == nil then
			target[index] = Clone(value)
		elseif type(target[index]) == "table" and type(value) == "table" then
			Reconcile(target[index], value)
		end
	end
end
1 Like


Why is this occuring? I’m using the datastore module with save slot scopes. When I shut down, some players only get 1 and then this bug happens.

These are internal Roblox errors as long as a player does not get 15 of these errors in a row you don’t normally have to worry about it even if they do get 15 memorystore errors in a row they wont lose any data all that will happen is the session will change state to closed/false

I believe your slot problem is related to something else

Any fix??? Maybe I have to continue calling the new() method to get the data???

Players get that error more than 15 sometimes… It kinda started after I did soft shutdowns and players in new servers sometimes don’t see their slots. Overall the bug is gamebreaking. I loaded three datastores of the same player (but in diff scopes) in a for loop with no interval waits. Could that be why? Do I need to add a wait interval?

It kinda only happens in private servers…

My first impressions of this module are great, awesome upsides to ProfileService. However, I do have a few questions.

  1. With regard to local caching, if a player is on another server and they are using a local cache of their data. Does it become available if you force :Save() against their data?

  2. As for queues, I just want to ensure I understand correctly. For the built-in system, it can only store info for up to 45 days before it will automatically clear, correct? Curious what the reasoning for this is.

  3. The final thing I am curious about is whether or not it will be known that a user’s data is loaded on another server? I don’t believe so by looking over the code, however I am unsure.

For background, I am working for an RP game with arrest and economy functions. Currently, I am working on the ability for people to receive payment while they are either not in the same server, or issue arrests by the courts to players not in the game.