> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-ko/communications/messages.md).

# 메시지

comms의 메시지는 이진 데이터입니다 *패킷*, protocol buffers를 사용해 직렬화된 [프로토콜 버퍼](https://github.com/protocolbuffers/protobuf). 이들은 텍스트 및 음성 채팅, 위치 업데이트, 프로필 변경 및 기타 실시간 상호작용을 전달합니다.

{% hint style="info" %}
오픈소스 [Comms Station](https://decentraland.github.io/comms-station/).
{% endhint %}

모든 메시지 정의는 다음에서 확인할 수 있습니다 [프로토콜 저장소](https://github.com/decentraland/protocol), 그리고 아래의 각 메시지 유형에는 해당 선언으로 연결되는 링크가 있습니다.

**`패킷`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L8)

이 `패킷` 구조는 모든 메시지의 컨테이너입니다.

| 필드        | 유형    | 값                                                                                                                                                            |
| --------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `message` | `열거형` | <p>다음 중 하나입니다 <code>채팅</code>, <code>음성</code>, <code>위치</code>, <code>프로필 버전 알림</code>,<br><code>프로필 요청</code>, <code>프로필 응답</code>, 또는 <code>씬</code>.</p> |

### 텍스트 및 음성 채팅

클라이언트는 텍스트 메시지와 오디오 클립을 연결된 모든 피어(보통 같은 섬의 플레이어)에게 브로드캐스트하여 채팅합니다.

두 개만 `패킷` 유형이 관련되며, 사용 사례마다 하나씩 있습니다. 일반적으로 클라이언트는 이러한 메시지를 섬의 다른 모든 클라이언트에게 브로드캐스트하며, 섬은 상호작용할 수 있는 인근 플레이어들의 그룹입니다.

***

**`채팅`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L56)

다른 클라이언트에게 텍스트 채팅 메시지를 보냅니다.

| 필드        | 유형       | 값              |
| --------- | -------- | -------------- |
| `message` | `string` | 메시지의 텍스트       |
| `타임스탬프`   | `double` | 발신자의 UTC 타임스탬프 |

***

**`음성`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L66)

인코딩된 음성 샘플을 다른 클라이언트에게 보냅니다.

| 필드                | 유형       | 값                                   |
| ----------------- | -------- | ----------------------------------- |
| `encoded_samples` | `bytes`  | 인코딩된 오디오 데이터                        |
| `코덱`              | `열거형`    | 오직 `VC_OPUS` (현재는 다른 코덱은 지원되지 않습니다) |
| `인덱스`             | `uint32` | 발신자가 설정하는 증가 카운터                    |

이 `코덱` 필드는 `열거형` 값입니다. 사용자 정의 코덱은 지원되지 않습니다.

### 이동

아바타를 제어하는 클라이언트는 플레이어 간의 이동과 자세를 동기화하기 위해 섬 내에서 위치 업데이트를 송수신합니다.

***

**`위치`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L20)

아바타의 위치와 방향을 다른 클라이언트에 업데이트합니다.

| 필드                                                                                                                  | 유형       | 값                |
| ------------------------------------------------------------------------------------------------------------------- | -------- | ---------------- |
| <p><code>position\_x</code><br><code>position\_y</code><br><code>position\_z</code></p>                             | `float`  | 월드 맵에서의 아바타 위치   |
| <p><code>rotation\_x</code><br><code>rotation\_y</code><br><code>rotation\_z</code><br><code>rotation\_w</code></p> | `float`  | 아바타 회전 쿼터니언      |
| `인덱스`                                                                                                               | `uint32` | 발신자가 설정하는 증가 카운터 |

클라이언트는 일반적으로 `위치` 업데이트를 낮은 빈도로 전송하다가(예: 1\~2초마다 한 번), 이동하거나 상호작용할 때는 높은 빈도(초당 여러 번)로 전환합니다.

{% hint style="info" %}
위치 업데이트를 보낼 때는 일반적으로 신뢰성보다 속도가 더 중요합니다. 전송이 더 빠르면, 메시지가 가끔 `위치` 누락되거나 순서가 바뀌더라도 체감 성능은 더 좋습니다. 일부 전송 방식(예: [LiveKit](https://github.com/decentraland/docs/blob/main/contributor/communications/transport-types/livekit/README.md))은 메시지별로 빠른 모드와 신뢰성 모드 사이를 전환할 수 있습니다.
{% endhint %}

낮은 빈도의 브로드캐스트는 잠시 연결이 끊겼거나 섬에 합류하는 동안 메시지를 놓친 클라이언트에게 업데이트를 전달하는 간단한 해결책으로 권장됩니다.

이 `인덱스` 필드는 발신자가 설정하는 증가 카운터로, 수신자가 순서 없이 도착한 업데이트를 정렬할 수 있게 합니다.

### 프로필 공유

섬 안의 클라이언트는 다른 플레이어의 아바타 정보를 요청하여 아바타를 렌더링하고, 이름과 사진 등을 표시할 수 있습니다.

프로필 변경은(예: 위치 업데이트에 비해) 드물기 때문에, 이 시스템은 로컬 프로필 캐시를 유지하는 작업을 단순화하고 필요할 때만 프로필을 가져오도록 설계되었습니다.

세 가지가 있습니다 [`패킷`](#Packet) 유형이 관련됩니다: 한 [`프로필 요청`](#ProfileRequest)/[`프로필 응답`](#ProfileResponse) 쌍은 클라이언트가 필요할 때 프로필을 공유하는 데 사용하며, [`프로필 버전 알림`](#AnnounceProfileVersion) 메시지는 피어에게 최신 버전이 무엇인지 알려주어 요청 여부를 결정하게 합니다.

클라이언트는 일반적으로 `프로필 버전 알림` 메시지를 주기적으로 브로드캐스트하고, 프로필이 변경되면 즉시 브로드캐스트합니다.

{% @mermaid/diagram content="sequenceDiagram
participant Client1 as Client 1
participant Client2 as Client 2
participant Client3 as Client 3

```
Note over Client1: Broadcast profile version
Client1->>Client1: AnnounceProfileVersion(v1)
Client1->>Client1: AnnounceProfileVersion(v1)

Note over Client3: Request profile
Client3->>Client1: ProfileRequest(@client 1)
Client1->>Client3: ProfileResponse(v1)

Client1->>Client1: AnnounceProfileVersion(v1)

Note over Client1: Profile updated
Client1->>Client1: AnnounceProfileVersion(v2)

Note over Client2,Client3: Multiple clients request
Client2->>Client1: ProfileRequest(@client 1)
Client3->>Client1: ProfileRequest(@client 1)
Client1->>Client2: ProfileResponse(v2)
Client1->>Client3: ProfileResponse(v2)" %}
```

***

**`프로필 버전 알림`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L34)

다른 클라이언트에게 다음이 있음을 알립니다 [프로필 엔터티](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/profiles/README.md) 요청할 수 있습니다.

| 필드                | 유형       | 값                      |
| ----------------- | -------- | ---------------------- |
| `profile_version` | `uint32` | 변경될 때마다 증가하는 버전 번호입니다. |

프로필을 캐시하는 수신자는 `profile_version` 숫자를 사용해 로컬 사본이 최신인지, 아니면 다음을 보내야 하는지 판단할 수 있습니다. [`프로필 요청`](#ProfileRequest).

***

**`프로필 요청`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L41)

특정 피어에게 지정된 버전의 프로필을 요청합니다.

| 필드                | 유형       | 값              |
| ----------------- | -------- | -------------- |
| `address`         | string   | 프로필의 식별 주소입니다. |
| `profile_version` | `uint32` | 원하는 프로필 버전입니다. |

수신자는 다음으로 응답할 수 있습니다 [`프로필 응답`](#ProfileResponse) 요청된 프로필을 제공하는 메시지입니다.

***

**`프로필 응답`** [**↗ 소스**](https://github.com/decentraland/protocol/blob/c48ea0aa00d8173084571552463a6a05a7f49636/proto/decentraland/kernel/comms/rfc4/comms.proto#L46)

다음에 대한 응답으로 프로필을 보냅니다 [`프로필 요청`](#ProfileRequest).

| 필드                   | 유형       | 값                                 |
| -------------------- | -------- | --------------------------------- |
| `serialized_profile` | string   | JSON으로 직렬화된 프로필 엔터티입니다.           |
| `base_url`           | `uint32` | 발신자가 권장하는 파일시스템 엔드포인트의 기본 URL입니다. |

이 `serialized_profile` 필드에는 다음의 JSON 직렬화가 포함됩니다 [프로필 엔터티](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/profiles/README.md).

발신자가 프로필에서 참조된 엔터티(예: 착용 아이템)를 다운로드할 콘텐츠 서버를 권장하고 싶다면, 다음을 설정할 수 있습니다 `base_url` 필드를 힌트로 사용할 수 있습니다. 클라이언트는 이 URL을 사용하거나 무시할 수 있습니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/contributor/contributor-ko/communications/messages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
