Save your player data with ProfileService! (DataStore Module)

Hi loleris,thank you for providing such a great datastore module to the community :+1:
I have a question. The following is part of the code of the CustomWriteQueueAsync function


why is it not added to the queue at all or removed from the queue before the callback is called? When there are multiple update requests in the queue, if some callbacks take a long time to execute, multiple UpdataAsync operations will be executed at the same time. Is it designed this way because there is a low probability of this happening with a 7 second write interval?

In addition, if the above code is changed to the following, will it bring other problems?


My understanding of ProfileService is still superficial, I hope to get your reply

Sorry, I have found that this modification is incorrect :smile:

Actually the queue is also necessary because Roblox does not guarantee parallel UpdateAsync calls being finished in the order they were called

1 Like

Yes, the queue is necessary. The problem with my modification above is when the last UpdateAsync is executing, calling Profile:Save() will not call SaveProfileAsync because #queue > 0, resulting in the latest Profile may not be saved in the DataStore.

Hello
Is there a place (event) in the ProfileService, where I can put my code which collects data from the workspace, converts it to a suitable format and puts it in the profile.Data object?
I.e. I need to populate the profile.Data with the correct data, each time before the profile is saved.
I see in the basic example that 1 such place is the PlayerRemoving handler, where profile:Release is called. But for sure there are other places - when the server is shutdown or when auto-save is invoked, etc.
What would be the most correct approach?

Thanks in advance

Amazing work. This is a life saver.

One question :

How is it possible to use ZonePlus and make a zone, that gives 2x or 3x the amount of Time when inside of it. Im curious how I can increment the store by double or trip the amount.

1 Like

Quick Question regarding ForceLoad; If I make every server that starts up force load a single profile, which I understand makes it so that only the first server has the profile loaded. If the server that has the profile loaded closes and the profile is released, would one of the other servers that ran force load catch it at random?

Hi, I have a question; if a server loads a profile and then shuts down is that profile automatically released, or should I call profile:Release() in the context of BindToClose?

I’m using/creating profiles that correspond to the server itself rather than individual players, so my system loads the profile as soon as the game starts, and I just need to release the profile as soon as the server ends. My eventual goal is to store the JobId of the server currently loading the profile in the profile itself, and then in any other server that tries to load the same profile, it fails and instead gets the JobId of the server that has locked the profile using ViewProfileAsync(), and teleports the player to that server. Hope that makes sense.

Thanks for your great work

Yeah ProfileService will manually release all profiles on server shutdown

2 Likes

Do you have any idea why this error keeps popping up?
image

Does it result in a loss of player data?

Profileservice lacks the most substantial function of detecting changes in player data, how funny can this be?

Are you changing it from in the script or are you adding the values in-game?

So are you releasing the profile when player has left the game?

Is there any way you can restore player data in the case of a developer screw up? One bug leaking through can cause all the players to lose their data if they join the update before it is patched. I have testers, but sometimes you don’t see these bugs.

		Quests = {
		"Kills0/10";
		"Deliveries0/5";
		};

reconcile doesnt work for tables, when I originally added the Quests table, it has Kills0/10, but after adding deliveries after, it doesnt appear in the table for players, any help?

what happens when I print the quests table (7/40 is supposed to be there):
image

How about you implement messagingservice, cross server messaging, it’d be cool! also that’s a new feature.

why? saving data is global
when you save to a datastore itll update everywhere

While this module is frikin amazing I have encountered on one of the issues which sorta gave me anxiety. I really appreciate your work but sometimes the ListenToHopReady is unreliable, most of the times testers have lost data, while I removed it the the data loss vanished completely at the cost of loading into battle place being longer.

You don’t necessarily need it, just call some function you’d wanna connect to a profile update where you’re updating the data.

What is “Profile Update”? I’ve searched the Profile Service API but couldn’t find the connection function for what you said so if you’re kind enough can you tell me what exactly this is?