> ## Documentation Index
> Fetch the complete documentation index at: https://playwave.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 텔레포트 연동

> SubPlace 텔레포트 시 PlayWave 인증을 유지하는 방법

## 배경

로비(Lobby) Place에서 SubPlace로 텔레포트하는 구조의 Experience에서는 `TeleportService`를 통한 이동 시 PlayWave 인증이 끊어집니다. 텔레포트 연동을 적용하면 `TeleportOptions`를 통해 세션 데이터를 전달하여 SubPlace에서도 인증을 유지할 수 있습니다.

<Warning>
  텔레포트 연동을 적용하지 않으면 SubPlace 이동 후 과금이 적용되지 않아 **수익 손실**이 발생할 수 있습니다.
</Warning>

## 사전 준비

<Steps>
  <Step title="최신 플러그인 설치">
    Toolbox에서 최신 버전의 PlayWave 플러그인을 설치합니다.

    <Warning>
      **Install SDK** 클릭 시 기존 콜백 함수 스크립트(`PlayWaveSetup`, `PlayWaveClient`)가 초기화됩니다. 반드시 기존 코드를 백업한 후 진행하세요.
    </Warning>
  </Step>

  <Step title="각 Place에 SDK 설치">
    텔레포트 대상이 되는 **모든 SubPlace**에도 PlayWave SDK를 설치해야 합니다. 각 Place에서 플러그인의 **Install SDK**를 실행하세요.
  </Step>
</Steps>

## 텔레포트 코드 수정

기존 텔레포트 로직에서 `TeleportOptions`를 생성한 뒤, `PlayWaveServer.prepareForTeleport`를 호출하여 세션 데이터를 주입합니다.

```lua theme={null}
-- ServerScriptService/TeleportHandler (Script Example)
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local SUB_PLACE_ID = 130143450994652

local PlayWaveServer = require(
    game:GetService("ServerScriptService")
        :WaitForChild("PlayWaveSetup")
        :WaitForChild("PlayWaveServer")
)

local teleportEvent = Instance.new("RemoteEvent")
teleportEvent.Name = "RequestTeleport"
teleportEvent.Parent = ReplicatedStorage

teleportEvent.OnServerEvent:Connect(function(player)
    local teleportOptions = Instance.new("TeleportOptions")
    PlayWaveServer.prepareForTeleport(player, teleportOptions)
    TeleportService:TeleportAsync(SUB_PLACE_ID, {player}, teleportOptions)
end)
```

### 핵심 포인트

| 항목                   | 설명                                        |
| -------------------- | ----------------------------------------- |
| `prepareForTeleport` | PlayWave 세션 데이터를 `TeleportOptions`에 주입합니다 |
| SubPlace SDK 설치      | 각 SubPlace에서 세션 데이터를 수신하려면 SDK가 필요합니다     |
| 기존 콜백 유지             | SDK 재설치 후 `onPcCafe` 콜백을 다시 작성해야 합니다      |

## 적용 체크리스트

<Checklist>
  * 최신 PlayWave 플러그인 설치 완료
  * 모든 SubPlace에 PlayWave SDK 설치 완료
  * 텔레포트 코드에 `prepareForTeleport` 호출 추가
  * 기존 `onPcCafe` 콜백 코드 복원 완료
  * 런처로 테스트하여 SubPlace 이동 후에도 PC방 혜택 유지 확인
</Checklist>

## 다음 단계

<Columns cols={2}>
  <Card title="빠른 시작" icon="rocket" href="/ko/roblox/quickstart">
    플러그인 설치부터 기본 연동까지 전체 과정을 확인합니다.
  </Card>

  <Card title="세션 라이프사이클" icon="rotate" href="/ko/roblox/session-flow">
    세션, 하트비트, 종료가 어떻게 동작하는지 이해합니다.
  </Card>
</Columns>
