Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Bug-58: Cache for Downloads - #128

Merged
SantiSev merged 16 commits into
mainfrom
bug-58/cache-for-downloads
May 31, 2026
Merged

Bug-58: Cache for Downloads#128
SantiSev merged 16 commits into
mainfrom
bug-58/cache-for-downloads

Conversation

@maxogod

@maxogod maxogod commented May 30, 2026

Copy link
Copy Markdown
Member

PR Bundle:

Additions:

  • New CacheManager class: has a GetModel and GetSprite function, if it has them in disk will load from there and if it doesnt have it or the cache was invalidated by the updatedAt then it downloads from CDN.
  • New DiskService class: simple binary file operations
  • Use the cache manager in the SpriteManager
  • New IGltfLoader interface to be able to implement differently in editor and game

@maxogod maxogod self-assigned this May 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds disk-backed caching for downloaded sprites/models in the shared Unity package, plus DTO timestamp fields needed for cache invalidation and an abstraction for GLTF loading.

Changes:

  • Adds CacheManager, DiskService, and IGltfLoader to support cached asset retrieval.
  • Routes SpriteManager through the cache and propagates updated_at fields through sprite/model/world DTOs.
  • Extends model downloading to support persistent cache paths and adds a caching setting flag.

Reviewed changes

Copilot reviewed 12 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Runtime/Core/Cache/CacheManager.cs Implements sprite/model cache lookup, invalidation, persistence, and cleanup APIs.
Runtime/Core/Cache/DiskService.cs Adds binary disk read/write/delete helpers under persistent data.
Runtime/Core/Interfaces/IGltfLoader.cs Defines an interface for loading GLTF model bytes.
Runtime/Core/Utils/DateTimeHelper.cs Adds shared timestamp parsing/formatting helpers.
Runtime/Core/Systems/Characters/SpriteManager/SpriteManager.cs Uses CacheManager for sprite texture downloads.
Runtime/Core/Systems/API/AssetsService.cs Adds world CDN sprite URL handling and propagates sprite updated_at.
Runtime/Core/Systems/API/ModelService.cs Allows model downloads to target temp or persistent cache paths.
Runtime/Core/Systems/API/WorldService.cs Propagates world update timestamp into active world data.
Runtime/Core/Systems/API/DTOs/AssetsDTOs.cs Adds updated_at to sprite responses.
Runtime/Core/Systems/API/DTOs/ModelDTOs.cs Adds updated_at to model info.
Runtime/Core/Systems/API/DTOs/WorldDTOs.cs Adds update timestamp to active world data.
Runtime/Models/Settings/SettingsData.cs Adds an enableCaching setting field.
*.meta files Adds Unity metadata for new folders/files.
Files not reviewed (7)
  • Runtime/Core/Cache.meta: Language not supported
  • Runtime/Core/Cache/CacheManager.cs.meta: Language not supported
  • Runtime/Core/Cache/DiskService.cs.meta: Language not supported
  • Runtime/Core/Interfaces.meta: Language not supported
  • Runtime/Core/Interfaces/IGltfLoader.cs.meta: Language not supported
  • Runtime/Core/Utils.meta: Language not supported
  • Runtime/Core/Utils/DateTimeHelper.cs.meta: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Runtime/Core/Systems/API/ModelService.cs
Comment thread Runtime/Core/Systems/API/AssetsService.cs
Comment thread Runtime/Core/Cache/CacheManager.cs
Comment thread Runtime/Core/Systems/Characters/SpriteManager/SpriteManager.cs Outdated
@SantiSev
SantiSev merged commit 30ab17b into main May 31, 2026
3 checks passed
@SantiSev
SantiSev deleted the bug-58/cache-for-downloads branch May 31, 2026 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants