GithubHelp home page GithubHelp logo

homy-game-studio / hgs-unity-local-storage Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 243 KB

Gerencie arquivos e cache de forma segura em sua aplicação.

License: MIT License

C# 100.00%
cache cross-platform filesystem persistency scriptable-object unity

hgs-unity-local-storage's Issues

Error on Invalidate empty CacheStorage

Behaviour

cacheStorage.Invlidate(); throws DirectoryNotFoundException when the directory not exists yet.

Expected Behaviour

If the directory is not found, cacheStorage.Invlidate(); shold be ignored.

Error Stack

DirectoryNotFoundException: Could not find a part of the path "C:/Users/Matheus Moura/AppData/LocalLow/Homy Game Studio/Tower Stacker/pictures/b7286587de4425770717ffdac19fa1faa360fdeb5b5cb07676ecf492e2d121d4".
System.IO.File.Delete (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
HGS.LocalStorage.Utils.FileUtility.Delete (System.String path) (at Library/PackageCache/com.hgs.local-storage@1a34572c28/Runtime/Scripts/Utils/FileUtility.cs:34)
HGS.LocalStorage.CacheStorage.InvalidateFile (System.String path) (at Library/PackageCache/com.hgs.local-storage@1a34572c28/Runtime/Scripts/CacheStorage.cs:29)
HGS.LocalStorage.CacheStorage.Invalidate (System.String key) (at Library/PackageCache/com.hgs.local-storage@1a34572c28/Runtime/Scripts/CacheStorage.cs:16)
HGS.LocalStorage.CacheStorage.Exists (System.String key) (at Library/PackageCache/com.hgs.local-storage@1a34572c28/Runtime/Scripts/CacheStorage.cs:41)
HGS.TinyPuzzleToolkit.StateDrawers.SpriteDownloadStateDrawer.Draw () (at C:/Users/Matheus Moura/workspace/hgs/hgs-unity-tiny-puzzle-toolkit/Assets/Package/Runtime/Scripts/StateDrawers/SpriteDownloadStateDrawer.cs:44)
HGS.TinyPuzzleToolkit.StateDrawers.SpriteDownloadStateDrawer.OnEnable () (at C:/Users/Matheus Moura/workspace/hgs/hgs-unity-tiny-puzzle-toolkit/Assets/Package/Runtime/Scripts/StateDrawers/SpriteDownloadStateDrawer.cs:24)
``

Add DeleteKey() Method

Cause

Isn't possible remove single key. Like: storage.Delete("my-key")

Expected

Remove single key with

Storage storage;
storage.Delete("key-name" );

DirectoryNotFound Exception when Invalidate()

Behaviour

When CacheStorage start, Invalidate() throws DirectoryNotFoundException because directory not created yet.

ExpectedBehaviour

Check if directory exists after file invalidation.

Error Stack

DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Matheus Moura\AppData\LocalLow\Homy Game Studio\Kong Climber\pictures'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.GetFiles (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
HGS.LocalStorage.Utils.FileUtility.GetFiles (System.String folder) (at Library/PackageCache/com.hgs.local-storage@ed17f3ba6f/Runtime/Scripts/Utils/FileUtility.cs:29)
HGS.LocalStorage.CacheStorage.OnEnable () (at Library/PackageCache/com.hgs.local-storage@ed17f3ba6f/Runtime/Scripts/CacheStorage.cs:35)

Same problem of #12

Add JsonExtension

Expected:

struct UserData
{
    public string displayName;
    public  int  score;
}
var input = new Userdata
{
    displayName: "Joaquim",
    score: 10
}
storage.WriteObject("user", input);
var user = storage.ReadObject<UserData>("user")

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.