# 게임에서 Moderation SDK 사용

> 게임에서 Moderation SDK를 사용하는 방법을 알아봅니다.

## 플레이어 신고##report-a-player

설정이 완료되면 UAS ID를 사용하고 리포트에 사유를 작성하여 플레이어를 신고할 수 있습니다.

플레이어가 신고되면 Unity Dashboard로 이동하여 인시던트와 첨부된 리포트 정보를 검토할 수 있습니다.

Vivox v16.0.0 패키지 이상을 사용하는 경우 신고자와 신고당한 플레이어가 있던 채널의 마지막 15분의 대화가 리포트에 첨부됩니다.

다음은 리포트 제출 예시입니다.

```cs
using Unity.Services.Moderation;
using Unity.Services.Moderation.Models;
using Unity.Services.Moderation.Exceptions;

public async void Report(string userId)
{
    // userId should be the UAS id of the reported player
    // eg: the currently logged in user id is accessible with
    // var MyUserId = AuthenticationService.Instance.PlayerId

    try {
        var report = Moderation.Instance.NewReport(userId,
            new ReportReason(ReportReason.Threat));
        await Moderation.Instance.ReportPlayer(report);
        Debug.Log("Report submitted!");
    } catch (ModerationServiceException e){
        if (e.Reason == ModerationServiceExceptionReason.SelfReportError) {
            Debug.Log("Error: you can’t report yourself");
        } else {
            Debug.Log($"Error: {e.Reason}");
        }
    }
}
```

## 신고 사유##report-reason

사유는 Unity에서 정의하며, 게임 내에 배열로 표시됩니다.

```cs
using Unity.Services.Moderation.Models;

public ListReasons()
{
  foreach (var reason in ReportReason.PossibleReasons)
  {
      Debug.Log(reason);
  }
}
```

각 사유의 상수는 **Moderation > Runtime > Models > ReportReasons.cs**에 있습니다.

| 상수                                          | 사유                           |
| ------------------------------------------- | ---------------------------- |
| public const string AimSnapping             | = "aim snapping";            |
| public const string Boosting                | = "boosting";                |
| public const string Exploiting              | = "exploiting";              |
| public const string Hacking                 | = "hacking";                 |
| public const string Smurfing                | = "smurfing";                |
| public const string UnrealisticMovement     | = "unrealistic movement";    |
| public const string CollusionWithOpponent   | = "collusion with opponent"; |
| public const string LeftMatch               | = "left the match";          |
| public const string Inactive                | = "inactive";                |
| public const string Sabotage                | = "sabotage";                |
| public const string Spamming                | = "spamming";                |
| public const string HateSpeech              | = "hate speech";             |
| public const string PredatoryBehavior       | = "predatory behavior";      |
| public const string NoiseDisruption         | = "noise disruption";        |
| public const string Scamming                | = "scamming";                |
| public const string Ads                     | = "ads";                     |
| public const string Threat                  | = "threat";                  |
| public const string VerbalAbuse             | = "verbal abuse";            |
| public const string InappropriatePlayerName | = "player name";             |

## 조치##actions

조치는 인시던트를 검토할 때 대시보드를 통해 적용됩니다.

조치가 적용되어 있고 조치 대상인 사용자가 로그인하면 Moderation 서비스와 연동된 다양한 UGS 패키지에서 다양한 오류 메시지를 받게 됩니다. 오류는 [오류 응답](/services/access-control.md#error-responses)에 설명된 액세스 제어 규칙을 따릅니다. 이는 예상되는 동작입니다.

일부 SDK는 이러한 오류를 자체 예외로 래핑하는 메커니즘을 제공합니다. 예를 들어 Vivox SDK는 정책이 사용자가 커뮤니케이션에 액세스하는 것을 막을 경우 `MintException`을 방출합니다.

다음은 지원되는 제재 오류 목록입니다.

| 패키지 이름                            | 예외                     | 사용 사례                                                              |
| --------------------------------- | ---------------------- | ------------------------------------------------------------------ |
| com.unity.services.authentication | RequestFailedException | 플레이어가 차단되면 innerException에 ACCOUNT\_DISABLED 메시지가 포함된 이 예외가 전달됩니다. |
| com.unity.services.vivox          | MintException          | 플레이어가 커뮤니케이션 채널에 액세스하지 못하도록 차단되면 403 상태 코드와 함께 이 예외가 전달됩니다.        |

## 증거 관리##evidence-management

프로젝트에서 Vivox 16.0.0 이상 버전을 사용하는 경우, SDK는 신고자와 신고당한 플레이어가 속해 있는 채널 목록을 자동으로 포함합니다. 해당 채널에 있던 추가 플레이어 목록도 포함됩니다.

이 정보를 사용하여 리포트의 [증거](./evidence.md)에 세부 정보가 추가됩니다.

리포트 컨텍스트를 더 잘 제어하려면 리포트에 포함된 채널과 플레이어 목록을 변경한 후 전송하시기 바랍니다.

```cs
 var report = Moderation.Instance.NewReport(userId, new ReportReason(ReportReason.Threat));

report.Players = new List<PlayerContext>(); // The list of extra players you want to include in screenings.
report.VivoxChannels = new List<VivoxChannel>(); // The list of channels to be screened.
```
