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

# Game Saves 활성 디바이스 변경

> PlayFab Game Saves 활성 디바이스 변경을 처리하여 플레이어가 여러 플랫폼에서 세션 도중에 디바이스를 전환할 때 진행 상황이 손실되지 않도록 합니다.

## 활성 디바이스 변경 처리

플레이어가 세션 도중에 디바이스를 전환할 때 여러 디바이스에서 동시에 플레이하여 실수로 진행 상황을 잃지 않도록 방지하는 것이 중요합니다.

### 문제 시나리오

1. **플레이어가 디바이스 A에서 시작**: 플레이를 시작하고 "활성" 디바이스가 됩니다.
2. **플레이어가 디바이스 B로 전환**: 로그인하고 "마지막으로 저장한 데이터 동기화"를 선택합니다.
3. **디바이스 B가 활성 상태가 됨**: 디바이스 A는 더 이상 활성 디바이스가 아니지만 이를 모를 수 있습니다.
4. **진행 상황 손실 위험**: 플레이어가 디바이스 A에서 계속 플레이하여 충돌하는 저장 상태를 만들 수 있습니다.

### 해결책: 활성 디바이스 콜백

활성 디바이스 변경을 수신 대기하고 전환을 정상적으로 처리합니다.

```cpp theme={null}
// Set up the active device changed callback during initialization
hr = PFGameSaveFilesSetActiveDeviceChangedCallback(
    optionalTaskQueue,                    // Use nullptr for immediate callback
    MyActiveDeviceChangedCallback,        // Your callback function
    contextPtr);                          // Optional context for your callback
```

### 콜백 구현 예시

```cpp theme={null}
void MyActiveDeviceChangedCallback(void* context)
{
    // The current device is no longer active for Game Saves
    
    // 1. Pause the game immediately
    
    // 2. Inform the player what happened
    // with a message such as:
    // "Your game progress is being continued on another device."
    // "Returning to main menu to prevent data loss."
    
    // 3. Return to a safe state (main menu)
    
    // 4. Re-initialize Game Saves system when ready to play again
    // (The player will need to sync again from the main menu)
}
```

### XBOX 관련 예외

게임이 XBOX의 **Single Point of Presence(SPOP)** 기능만 사용하여 로그인하는 경우 이 시나리오는 자동으로 방지됩니다. SPOP는 사용자가 한 번에 하나의 XBOX 디바이스에만 로그인할 수 있도록 보장합니다.

### 모범 사례

* 멀티 플랫폼 게임의 경우 **항상 이 콜백을 구현하세요**.
* 콜백이 트리거될 때 **즉시 게임 플레이를 일시 중지**하세요.
* **플레이어에게 왜 메뉴로 돌아가는지 명확하게 설명**하세요.
* 게임을 닫는 대신 메인 메뉴로 돌아가서 **재진입을 쉽게 만드세요**.


## Related topics

- [Game Saves 빠른 시작](/ko/services/playfab/player-progression/game-saves/quickstart.md)
- [Game Saves UI 콜백](/ko/services/playfab/player-progression/game-saves/ui-callbacks.md)
- [XBOX PC Remote Tools FAQ 및 문제 해결 가이드](/ko/tools/tools-pc/xbox-pc-remote-tools/faq.md)
- [Game Saves 오프라인 모드](/ko/services/playfab/player-progression/game-saves/offline.md)
- [Game Saves 충돌](/ko/services/playfab/player-progression/game-saves/conflicts.md)
