# Moderation SDK 연동

> Moderation 대시보드에 액세스하고 이를 사용하는 방법을 알아봅니다.

> **Warning:**
>
> DSA(디지털서비스법)는 유니티가 DSA에 따라 고객의 최종 사용자에게 영향을 미치는 조치를 취할 경우 최종 사용자에게 알릴 것을 요구합니다. 이 요구 사항을 준수하기 위해, Unity Authentication 서비스를 이용하는 UGS(Unity Gaming Services) 제품을 사용할 경우, 알림 API를 연동해야 합니다.
>
> DSA에 대한 자세한 내용은 [디지털서비스법 - 규정 준수 업데이트](https://unity.com/legal/digital-services-act)를 참조하십시오.
>
> 게임이 DSA를 준수하도록 하려면 [DSA 알림](/authentication/dsa-notifications.md.md)을 참조하십시오.

Unity Moderation을 시작하기 전에 모든 [요구 사항](./requirements.md)이 충족되어야 합니다.

프로젝트에서 Safe Text가 활성화되어 있으면 Unity Dashboard 내에서 Moderation 대시보드에 액세스할 수 있습니다.

[Safe Text](/safe-text/get-started.md) 기술 자료의 단계에 따라 프로젝트에서 제품을 활성화할 수 있습니다.

프로젝트에 Safe Text가 추가되면 다음 단계를 따릅니다.

1. [Moderation 엔드포인트가 allowlist에 있는지 확인](#ensure-moderation-endpoints-on-the-allowlist)합니다.
2. [Moderation SDK를 추가](#import-the-moderation-sdk)합니다.
3. [Unity 서비스를 초기화](#initialize-unity-services)합니다.

Moderation이 프로젝트에 적용되면 프로젝트의 다른 구성원에게 안전 관리자(Safety Admin)와 안전 중재자(Safety Moderator)라는 [사용자 역할을 할당](./user-roles.md)하여 리포트 검토를 시작합니다.

## Moderation 엔드포인트가 allowlist에 있는지 확인##ensure-moderation-endpoints-on-the-allowlist

프로젝트에서 [액세스 제어](/services/access-control.md)를 사용하는 경우 [기본값으로 거부(Deny by Default)](/services/access-control.md#deny-by-default)가 적용되어 있을 수도 있습니다.

이 경우, Moderation SDK가 Moderation 서비스로 리포트를 전송할 수 있도록 플레이어에게 리포트 전송 권한을 부여해야 합니다.

프로젝트에 다음 정책을 추가하여 플레이어가 리포트를 보낼 수 있는 권한을 부여합니다.

```json
{
  "Sid": "allow-moderation-report",
  "Action": ["*"],
  "Effect": "Allow",
  "Principal": "Player",
  "Resource": "urn:ugs:moderation-report:/*"
}
```

## Moderation SDK 임포트##import-the-moderation-sdk

Unity Dashboard에 프로젝트를 연결한 후, 최신 버전의 Moderation 패키지를 설치할 수 있습니다.

[Unity 패키지 관리자](https://docs.unity3d.com/Manual/upm-ui.html)를 사용하여 Unity 에디터에 Moderation 패키지를 임포트합니다.

> **Note:**
>
> Moderation SDK는 패키지 관리자에서 다음 버전의 Unity에 대해 사용 가능합니다.
>
> * 2021.3.32f1
> * 2022.3.12f1
> * 2023.1.17f1
> * 2023.2.0b15
> * 2023.3.0a11

## Unity 서비스 초기화##initialize-unity-services

Moderation SDK는 플레이어를 신고할 수 있는 클래스의 싱글톤 인스턴스를 표시합니다. 이를 사용하려면 Unity 서비스를 초기화하고 UAS(Unity Authentication 서비스)로 플레이어를 인증합니다.

다음은 UAS를 사용하여 사용자를 인증하는 방법의 예제를 보여 주는 코드입니다.

```cs
using Unity.Services.Core;
using Unity.Services.Authentication;
async void Start()
{
    await UnityServices.InitializeAsync();
    await AuthenticationService.Instance.SignInAnonymouslyAsync();
    if (AuthenticationService.Instance.IsSignedIn)
    {
        // game code.
    }
    else
    {
        Debug.Log("Player was not signed in successfully?");
    }
}
```
