Giter Club home page Giter Club logo

roblox's People

Contributors

1waffle1 avatar 4x8matrix avatar connor-gro avatar darkshepherd avatar howmanysmall avatar idiosyncraticsociopath avatar kampfkarren avatar notphantomx avatar overhash avatar quackbox avatar rodel77 avatar william5553 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roblox's Issues

On startup, data is not there, so players are starting over.

Relevant sections are

Inside ServerScriptingService is this script

player.CharacterAdded:Connect(function(character)
	wait()
	local checkpointStore = DataStore2("checkpoints", player)
	local playerCheckpoint = checkpointStore:Get()
	if playerCheckpoint then
		teleportCharacterToCheckpoint(character,playerCheckpoint)
	end
end)

function teleportCharacterToCheckpoint (character,checkpointNumber)
print("Teleporting to "..tostring(checkpointNumber))
local checkpointPart = CheckpointManager:findCheckpointNumber(checkpointNumber) 
if checkpointPart then
	
	teleportCharacterToCFrame(character,checkpointPart.CFrame)
end
end

everything was working fine until datastore2, which now seems to be losing the initial get...

DataStore2 - OnFail

A .OnFail for DataStor2 so if it fails to save data you can do something such as notifying the client.

Don't save unchanged data

Solves the use case for #47.

When a player leaves and their data isn't set, then data doesn't save. However, if you set their data and save twice, it'll truly save twice.

DataStore2:SaveAll(player)

Would save the data of every data store the player uses.

Currently, it's unintuitive that saving one data store in a combined data store saves all of them. This would be the canonical way to save data when using combined data stores (default in #38).

Split DataStore2 functionality, make current saving process optional

DataStore2 is, at its core, a generic and more easy to use data store API that caches. I'd like everyone to use DataStore2.

However, the saving method of DataStore2 prevents this vision. Furthermore, if Roblox ever does anything to prevent this saving method, developers are at a complete loss.

Thus, a generic internal data store saving API should be added, and offer both the berezaa method and normal data store saving. Berezaa should be the default unless anything changes in the future.

This should NOT break any games, and nobody should have to change anything.

Add a way to disable :Save() on player leave for specific stores

Use case: You want to teleport people to a new reserved server. You want to make sure you can get their data in the other server, so you :Save() before teleporting.

When they teleport away, they leave and their data is redundantly saved.

Alternatively, this could also be solved by correctly not resaving data if it hasn't been changed.

Remove regular saving code

I've never tested it and it doesn't even work, it tries to save the data store even if the player already left.

Introduce Save retrying

:Save() does not pcall, but it seems strange for :Get() to pcall if this isn't the case.

An API like :SetBackup should be introduced for :Save() as well.

Deprecate :SetBackup and introduce a global configuration

:SetBackup is fine right now, but leaves a weird future. Using it with different values on combined data stores will only pick one of them. (An issue when combined data stores will eventually be the default).

#38 will need a global configuration, so might as well put this in there as a key that affects all data stores (like :SetBackup does already with combined data stores) on how many tries it'll take before a backup is used instead. For anyone who will explicitly opt out of combined data stores, :SetBackup should continue to work fine and should not give a deprecation warning.

Figure out better system than os.time

os.time has inconsistency across servers. An incrementing counter would be better, but is a bit difficult to do as it'd need to have context of the old data store?

This is arguably critical?

DataStore3

Okay, I don't expect you to do this as DataStore2 is already awesome. But it would be amazing to see a DataStore3 with berezaa's new system. You can read exactly what he said [here].

Reference image:
(https://twitter.com/berezaagames/status/1122174490882998272)
image

I would love to see you implement this. If you did I would recommend just strictly putting it into DataStore2 but leaving DataStore3 options under a "beta" flag and it will be completely optional and eventually be forced?

Smart automatic saving for DataStore2

This is the main thing PlayerDataStore (or whatever it's called, I just learned it about it today hehe) has over DataStore2. It saves often, and makes sure to be smart and wait 10ish seconds before saving again (the same write key limit). I want this! I have regular save off in every game and only made it for anyone that'd want it, but if I had this it would make my life so much easier (worried about people's data not saving in Battle Hats sooo bad).

Utility Functions

Make it so that you can easily load a backup onto a main datastores or even if the player completely loses data it fully loads the backup and if there isn't a backup it goes through each old key until one of them works and loads that one. In the chance everything is lost how exactly can data be retrieved because it takes a lot about how this can prevent data loss but doesn't say much about giving a user their data back.
Also allowing us to use the MasterKey as a normal DataStore would be a great feature and using it with :OnUpdate() I feel as if OnUpdate should return the key saving as well. Here's an example:

DataStore2.Combine("MyMasterKey", "Coins", "Gems")

local Coins = DataStore2("Coins", Player)
local Gems = DataStore2("Gems", Player)

-- Maybe have it as a variable in DataStore2???
DataStore2.MasterKey:OnUpdate(function(SavingKey, Value)
       print(SavingKey, Value) -- If coins saved with value 100 it'd print Coins, 100
end)

Coins:Increment(100, 0)
-- etc.

-- The idea of using MasterKey as a normal datastore:
local Master = DataStore2("MasterKey", Player)

print(Master:Get().Coins) -- Use it like a table.

What I sent you on DevForum for reference:
image

DataStore2:SetValidator

Would take in a function, and every time you call :Set/:Update/etc, the validator is checked and errors if the data is invalid.

Similar to Roact, would be off by default, but be recommended for development.

Type checking

All too often I don't catch myself doing DataStore2(player, "name") instead of the other way around and DataStore2 doesn't stop me, it just gives a vague error.

:Get(defaultValue) doesn't save the default value unless it's set again.

Say you had the code:

dataStore:Get(10)

If the player had no data, they'd get "10". Say a player leaves after this and :Set is never called. This data won't save. This doesn't really matter until you change the default value, say:

dataStore:Get(20)

Now all players who used to have 10 and whom :Set was never called will now get 20.

This is a niche edge case that probably doesn't matter all too much, but it's surprising.

Continuous Integration

I want to run luacheck on PRs (once I make sure nothing actually has any warnings), Travis, and a code coverage tool.

Deprecate requiring by ID

I want the recommended way to use the module going forward to be to either get the free model (once I can actually update it again, and hopefully also use packages) or to download the releases on GitHub.

People requiring by ID (which judging by the survey is a LOT) prevents me from making any backwards incompatible changes.

Data being reverted to a previous save when shutting down servers

After doing some testing, I think what's happening is when a game server is shutdown, the player's data is reverted back to the data received from the initial :Get() when the player joined the server, ignoring any changes made to the player's data while in the server.

DataStore2.Combine by default in 2.0.0 (with settings for existing users)

This is something that wasn't born until after it was seen to be an issue without, but new developers won't realize how necessary this is and not do it. Perhaps introduce DataStore2.Uncombine for the opposite, or just tell developers that were using DataStore2 before to just disable the settings. Also introduce a setting for a master key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.