AGENT SKILL

11-attend-storage

暂无简介

License 许可
MIT
所属仓库
devwinsoft/devian
最近更新
2026-04-12
Stars
★ 0
Forks
0

02 资源文件 10

03 SKILL.md 正文

11-attend-storage

Status: ACTIVE AppliesTo: v10

AttendStorage 저장 모델 규약 문서다.


Ownership

  • AttendManager가 AttendStorage를 소유한다.
  • 저장 정본 접근 경계: AttendManager.Storage

Storage Model

[Serializable]
public sealed class AttendStorage
{
    public int schemaVersion = 2;
    public long cycleStartUtcMs;
    public long lastClaimUtcMs;
    public long lastLoginUtcMs;
    public int nextAttendDay;
    public Dictionary<string, long> claimedAttendUtcMs = new();
}

의미:

  • cycleStartUtcMs: 현재 cycle 시작 서버 시각(UTC ms)
  • lastClaimUtcMs: 마지막 claim 서버 시각(UTC ms)
  • lastLoginUtcMs: 마지막 접속 서버 시각(UTC ms)
  • nextAttendDay: 다음 claim day (1..8)
  • claimedAttendUtcMs: attend_id -> claimUtcMs

규칙:

  • nextAttendDay == 8은 7일차 완료 상태(reset 대기)다.
  • reset 시 nextAttendDay=1, lastClaimUtcMs=0, claimedAttendUtcMs.Clear()
  • Clear()는 schema 기본값 + 모든 상태를 초기화한다.
  • AttendRuntime 리스트는 저장하지 않는다(매 접속 시 서버 시각 기준 재구성).

SaveData Payload

루트 payload에서 Attend 섹션은 attend 키를 사용한다.

{
  "version": 17,
  "attend": {
    "schemaVersion": 2,
    "cycleStartUtcMs": 0,
    "lastClaimUtcMs": 0,
    "lastLoginUtcMs": 0,
    "nextAttendDay": 1,
    "claimedAttendUtcMs": {
      "attend_day_001": 1735689600000
    }
  }
}

Deserialize Rules

  • AttendStorage.Clear() 후 복원한다.
  • schemaVersion 누락 시 1을 기본값으로 사용한다.
  • claimedAttendUtcMs의 key가 empty면 skip한다.
  • value가 음수면 0으로 보정한다.
  • nextAttendDay 누락 시 기본값 1을 사용한다.
  • 스키마 마이그레이션 시 추가 보정 로직은 두지 않는다.

Implementation Location (3-path mirror)

  • UPM (정본):
    • framework-cs/upm/com.devian.foundation/Samples~/MobilePackage/Runtime/Attend/AttendStorage.cs
    • framework-cs/upm/com.devian.foundation/Samples~/MobilePackage/Runtime/SaveData/JsonCodec/SaveDataJsonCodecAttend.cs
  • Packages (sync):
    • framework-cs/apps/UnityExample/Packages/com.devian.foundation/Samples~/MobilePackage/Runtime/...
  • Assets/Samples (import):
    • framework-cs/apps/UnityExample/Assets/Samples/Devian Samples/{version}/MobilePackage/Runtime/...

Related

04 同仓库更多 Skills