{"id":"franydev/profilestore","name":"profilestore","scope":"franydev","platform":"roblox","description":"Periodic DataStore saving solution with session locking","version":"1.0.2","latest":"1.0.2","versions":["1.0.0","1.0.1","1.0.2"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved.","License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"b94b333df9482462e51ad805d53a6545a5c2c2a02f30efab55a54bf88ed9bad4","likes":0,"downloads":0,"install":"forest install franydev/profilestore","url":"https://forest.dev/p/roblox/franydev/profilestore","files":"https://api.forest.dev/ai/package/roblox/franydev/profilestore/files","readme":"# MAD STUDIO - ProfileStore\r\n\r\nProfileStore is a Roblox DataStore wrapper that streamlines auto-saving, session locking\r\nand a few other features for the game developer. ProfileStore's source code runs on a single\r\nModuleScript.\r\n\r\nIf you want to save time writing code for player data caching or want to prevent item\r\n\"duping\" in a game with trading - this can be a helpful resource!\r\n\r\n💲💲💲 *Consider [donating R$ to the creator of ProfileStore (Click here)](https://www.roblox.com/games/103946622805308/MAD-STUDIO-Open-Source-Donations) if you find this resource helpful!*\r\n\r\n## How does it work?\r\n\r\nProfileStore loads and caches data from a DataStore key on a single Roblox game server and\r\nprevents other game servers from accessing this data too soon by establishing a session lock\r\nand handling session lock conflicts between servers swiftly all while not using too many\r\nDataStore and MessagingService API calls.\r\n\r\nData units saved by ProfileStore are called **\"profiles\"** which can be accessed in-game by\r\nstarting a **\"session\"**. During an active session you gain access to a table ([`Profile.Data`](/ProfileStore/api/#data))\r\nwhich will either be saved to the DataStore on the next auto-save or when you manually end\r\nthe session.\r\n\r\nProfileStore is primarily **player-data-oriented** and, by design, tweaked for a common use\r\ncase where each game player would have a single profile dedicated to storing their game\r\nprogress. Session locking addresses the issue of data access from more than one game server\r\n(which can cause item \"dupes\" in games with trading) by keeping track of which game server\r\nis currently caching data and gracefully switches ownership from one server to the other\r\nwithout failing new session requests. ProfileStore can still be used for non-player data\r\nstorage, although ProfileStore's session locking is not ideal for quick writing from several\r\ngame servers.\r\n\r\nProfileStore's module functions try to resemble the Roblox API for a sense of familiarity\r\nto Roblox developers. Methods with the `Async` keyword yield until a result is ready\r\n(e.g. `:StartSessionAsync()`), while others do not.\r\n\r\n**ProfileStore is not designed (and never will be) for in-game leaderboards or any kind of global state.**\r\n\r\n---\r\n\r\n*Developed by [loleris](https://x.com/lolerismad)*\r\n\r\n***See documentation:***\r\n**[ProfileStore wiki](https://madstudioroblox.github.io/ProfileStore/)**\r\n\r\n***Get it now on:***\r\n[Roblox library](https://create.roblox.com/store/asset/109379033046155/ProfileStore)","readmeTruncated":false}