File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -782,11 +782,20 @@ return function(Vargs, GetEnv)
782782 end ;
783783
784784 DataStoreEncode = function (key )
785- if Core .DS_RESET_SALTS [key ] then
786- key = Core .DS_RESET_SALTS [key ] .. key
787- end
788-
789- return Functions .Base64Encode (Remote .Encrypt (tostring (key ), ("SALT_" .. Settings .DataStoreKey ):sub (1 ,50 )))
785+ if Core .DS_RESET_SALTS [key ] then
786+ key = Core .DS_RESET_SALTS [key ] .. key
787+ end
788+
789+ -- Only consider salting if the key isn't a number (like a player ID) and if the setting isn't true
790+ local IsPlayer = tonumber (key ) ~= nil
791+ local SettingIsTrue = server .Settings .DontSaltDataStoreKey == true
792+ local ShouldSaltKey = not IsPlayer and not SettingIsTrue
793+ local EncryptionKey = Settings .DataStoreKey
794+ if ShouldSaltKey then
795+ EncryptionKey = ("SALT_" .. Settings .DataStoreKey ):sub (1 ,50 )
796+ end
797+
798+ return Functions .Base64Encode (Remote .Encrypt (tostring (key ), EncryptionKey ))
790799 end ;
791800
792801 SaveData = function (... )
You can’t perform that action at this time.
0 commit comments