npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

com.kylin.di.messagepack

v1.0.5

Published

MessagePack-CSharp formatters for Kylin SubscribableProperty types. Enables binary serialization of SubscribableProperty<T>, SubscribableCollection<T>, and SubscribableDictionary<TKey,TValue>.

Downloads

632

Readme

KDI MessagePack Adapter

KDI의 SubscribableProperty, SubscribableCollection, SubscribableDictionary 타입을 MessagePack-CSharp로 바이너리 직렬화할 수 있게 하는 어댑터 패키지.

com.kylin.di.messagepack | Unity 6000.0+ | MIT License

설치

1. Scoped Registry 추가

Packages/manifest.json에 다음을 추가:

{
  "scopedRegistries": [
    {
      "name": "Kylin",
      "url": "https://www.npmjs.com/~kylin",
      "scopes": ["com.kylin"]
    }
  ],
  "dependencies": {
    "com.kylin.di": "1.0.0",
    "com.kylin.di.messagepack": "1.0.0"
  }
}

2. 전제 조건

프로젝트에 MessagePack-CSharp가 설치되어 있어야 합니다. (NuGetForUnity 또는 직접 DLL 참조)


사용법

자동 등록 (기본)

별도 설정이 필요 없습니다. 패키지 설치만으로 RuntimeInitializeOnLoadMethod를 통해 자동으로 MessagePack 기본 옵션에 KDI 리졸버가 등록됩니다.

// 그냥 평소처럼 직렬화하면 됩니다
var health = new SubscribableProperty<int>(100);
var bytes = MessagePackSerializer.Serialize(health);
var restored = MessagePackSerializer.Deserialize<SubscribableProperty<int>>(bytes);
// restored.Value == 100

데이터 클래스 예시

[MessagePackObject]
public class PlayerSaveData
{
    [Key(0)] public SubscribableProperty<int> Health { get; set; } = new(100);
    [Key(1)] public SubscribableProperty<string> Name { get; set; } = new("Player");
    [Key(2)] public SubscribableCollection<string> Inventory { get; set; } = new();
    [Key(3)] public SubscribableDictionary<string, int> Stats { get; set; } = new();
}

// 직렬화
var data = new PlayerSaveData();
data.Health.Value = 80;
data.Inventory.Add("Sword");
data.Stats["ATK"] = 50;

var bytes = MessagePackSerializer.Serialize(data);

// 역직렬화 - 구독 가능한 프로퍼티로 복원됨
var loaded = MessagePackSerializer.Deserialize<PlayerSaveData>(bytes);
// loaded.Health.Value == 80
// loaded.Inventory[0] == "Sword"
// loaded.Stats["ATK"] == 50

// 복원 후에도 구독이 정상 동작
loaded.Health.Subscribe(hp => Debug.Log($"HP: {hp}"));
loaded.Health.Value = 60; // "HP: 60" 출력

수동 옵션 구성 (선택)

자동 등록 대신 수동으로 옵션을 구성하려면:

var options = KDIMessagePackResolver.GetOptions();
var bytes = MessagePackSerializer.Serialize(data, options);
var loaded = MessagePackSerializer.Deserialize<PlayerSaveData>(bytes, options);

동작 원리

| KDI 타입 | 직렬화 형태 | 설명 | |----------|------------|------| | SubscribableProperty<T> | T 값 그대로 | 내부 .Value만 직렬화. 구독 상태는 직렬화하지 않음 | | SubscribableCollection<T> | MessagePack Array | 내부 아이템 리스트를 배열로 직렬화 | | SubscribableDictionary<K,V> | MessagePack Map | 내부 딕셔너리를 Map으로 직렬화 |

역직렬화 시 새 인스턴스가 생성되며, 구독은 비어 있는 상태로 시작합니다. 이는 의도된 동작으로, 구독은 런타임에 코드로 설정하는 것이 올바른 패턴입니다.


의존성

  • com.kylin.di >= 1.0.0
  • MessagePack-CSharp >= 2.x