다음을 통해 공유


빠른 시작: PlayFab 온라인 하위 시스템(OSS)

이 빠른 시작 가이드는 Unreal Engine 4 또는 Unreal Engine 5를 사용하여 제작된 Xbox, PC, Nintendo Switch, PlayStation®5 및 PlayStation®4 게임용 로비, 매치 메이킹 및 파티와 같은 멀티플레이어 기능을 설정하고 사용하는 데 도움이 됩니다. UE4 또는 UE5에서 지원되는 플랫폼 및 버전의 전체 목록은 지원되는 플랫폼을 참조하세요.

대상 플랫폼에 대해 이 페이지에 설명된 관련 단계를 수행하면 OSS 사용을 시작할 준비가 된 것입니다. 인증, 네트워킹, VOIP, 로비로 그룹화, 매치 메이킹에는 다른 변경 사항이 필요 없으며, 사용자를 대신해 처리됩니다.

PlayFab 온라인 하위 시스템 다운로드 및 설치

PlayFab 온라인 하위 시스템으로 이동하여 PlayFab 온라인 하위 시스템 소스를 다운로드하거나 복제합니다. 다운로드 또는 복제된 리포지토리 이름은 PlayFabMultiplayerUnreal입니다. 리포지토리 이름을 OnlineSubsystemPlayFab으로 변경해야 합니다.

필요한 항목

  • PlayFab 타이틀 ID: PlayFab 파티 및 멀티플레이어 SDK에 대해 구성된 타이틀 ID가 없는 경우 PlayFab 파티 활성화를 참조하세요.

GDK, PC, 스위치, PlayStation®5 및 PlayStation®4

초기 설정

Unreal Engine 코드 베이스

  • OnlineSubsystemPlayFab 폴더와 내용을 Engine\Plugins\Online 아래의 UE 디렉터리에 복사합니다.
  • GenerateProjectFiles.bat를 실행하여 엔진에 대한 프로젝트 파일을 만듭니다.
  • UE5.sln 파일을 두 번 클릭하여 Visual Studio에 프로젝트를 로드합니다.
  • 솔루션 구성을 개발 편집기로 설정하고 솔루션 플랫폼을 Win64로 설정한 다음 UE5 대상을 마우스 오른쪽 단추로 클릭하고 빌드를 선택합니다.

게임 코드 베이스

  • .uproject 파일의 플러그인 섹션에 다음 변경 내용을 적용하여 플러그인 목록에 OnlineSubsystemPlayFab를 추가합니다.
    • 배송하지 않는 플랫폼을 제거할 수 있습니다.
    • UE5는 XboxOneGDK를 더 이상 사용하지 않으므로 UE4를 사용하는 경우 XB1 대신 XboxOneGDK를 사용하세요.
{
 "Name": "OnlineSubsystemPlayFab",
 "Enabled": true,
 "WhitelistPlatforms": [
  "XB1",
  "WinGDK",
  "XSX",
  "Win64",
  "Switch",
  "PS4",
  "PS5"
 ],
 "SupportedTargetPlatforms": [
  "XB1",
  "WinGDK",
  "XSX",
  "Win64",
  "Switch",
  "PS4",
  "PS5"
 ]
}
  • .uproject 파일을 마우스 오른쪽 단추로 클릭하고 위의 Unreal Engine 코드 경로로 'Unreal Engine 버전 전환'을 선택하여 게임 솔루션 파일을 생성합니다.

게임 구성

  • 대상으로 하는 플랫폼에 관계없이 게임은 의도한 플랫폼 대상의 INI 파일([yourGameDirectory]/Platforms/[yourPlatform]/Config에 있음)에서 특정 PlayFab 특정 값을 구성해야 합니다.
    • Xbox Series X GDK: XSXEngine.ini
    • PC GDK: WinGDKEngine.ini
    • Xbox One GDK: XB1Engine.ini(또는 UE4를 사용하는 경우 XboxOneGDKEngine.ini)
    • PC Steam: WindowsEngine.ini(또는 [yourGameDirectory]/Config/Windows에서 찾음)
    • Nintendo Switch SwitchEngine.ini
    • PS4™ PS4Engine.ini
    • PS5™ PS5Engine.ini
  • 구성의 INI 섹션이 이미 존재하는 경우(예: Engine.GameEngine) 다음 섹션에 제시된 섹션으로 교체합니다.
  • 모든 <REPLACE ME> 입력란을 데이터로 교체해야 합니다.
[OnlineSubsystemPlayFab]
bEnabled=true
PlayFabTitleID=<REPLACE ME with your PlayFab title ID>
MaxDeviceCount=<REPLACE ME with your max player count (note: split screen is still 1 device). In the example of an 8 player game, this would be 8.>
MaxDevicesPerUserCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device) In the example of an 8 player game, this would be 1.>
MaxEndpointsPerDeviceCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device)  In the example of an 8 player game, this would be 1.>
MaxUserCount=<REPLACE ME with your max player count (note: split screen is still 1 device)  In the example of an 8 player game, this would be 8.>
MaxUsersPerDeviceCount=<REPLACE ME with your max player count per box (note: split screen is still 1 device)  In the example of an 8 player game, this would be 1.>
DirectPeerConnectivityOptions=<REPLACE ME with your connectivity options, in the form of an array of strings. The default case corresponds to the following:
+DirectPeerConnectivityOptions=AnyPlatformType
+DirectPeerConnectivityOptions=AnyEntityLoginProvider.
If you want to disable P2P and use cloud relay instead, set DirectPeerConnectivityOptions=None>
bHasPlayFabVoiceEnabled=<REPLACE ME with true/false>

[/Script/OnlineSubsystemPlayFab.PlayFabNetDriver]
NetConnectionClassName="OnlineSubsystemPlayFab.PlayFabNetConnection"
ReplicationDriverClassName="<REPLACE ME with your existing replication driver class name>" . Skip if the game doesn't have a replication driver class (https://docs.unrealengine.com/5.2/en-US/replication-graph-in-unreal-engine/).
ConnectionTimeout=15.0
InitialConnectTimeout=30.0

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemPlayFab.PlayFabNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

플랫폼별 고려 사항

이 모든 작업을 완료하면 거의 완료된 것입니다. 설정해야 하는 몇 가지 주요 플랫폼별 매개 변수만 남아 있습니다.

GDK

GDK를 사용하여 게임을 개발하는 경우 플랫폼 서비스를 정의하세요.

[OnlineSubsystem]
DefaultPlatformService=PlayFab
NativePlatformService=GDK

Steam

Steam을 사용하여 Win64용 게임을 개발하는 경우 플랫폼 서비스를 정의합니다.

[OnlineSubsystem]
DefaultPlatformService=PlayFab
NativePlatformService=Steam

Switch

Switch에 대한 자세한 내용은 Switch PlayFab OSS와 함께 제공되는 ReadMe.md 파일을 참조하세요. 액세스 권한이 없는 경우 비공개 리포지토리에 대한 액세스 권한을 요청할 수 있습니다.

PS5™ 및 PS4™

PS5™ 및 PS4™에 대한 자세한 내용은 PS5™ 및 PS4™ PlayFab OSS와 함께 제공되는 ReadMe.md 파일을 참조하세요. 액세스 권한이 없는 경우 비공개 리포지토리에 대한 액세스 권한을 요청할 수 있습니다.

플랫폼 간

마지막으로 게임에서 PlayFab의 플랫폼 간 네트워킹 지원을 사용하는 경우 연결을 허용하는 플랫폼을 정의합니다.

[/Script/OnlineSubsystemUtils.OnlineEngineInterfaceImpl]
!CompatibleUniqueNetIdTypes=ClearArray
+CompatibleUniqueNetIdTypes=STEAM
+CompatibleUniqueNetIdTypes=GDK
+CompatibleUniqueNetIdTypes=SWITCH
+CompatibleUniqueNetIdTypes=PS4
+CompatibleUniqueNetIdTypes=PS5

모든 플랫폼은 기본적으로 VoIP를 허용합니다. 특정 플랫폼에 대해 VoIP를 비활성화하려면 다음 예와 같이 플랫폼 모델 이름을 UE 구성 파일에 추가하십시오.

[OnlineSubsystemPlayFabVoiceChatDisabledPlatforms]
!Platforms=ClearArray
+Platforms=WIN64
+Platforms=STEAM
+Platforms=SWITCH
+Platforms=PS4
+Platforms=PS5

이 단계는 게임에서 사용하는 데 필요한 OSS 설정을 완료합니다. 행운을 빕니다!

게임 코드에서 사용

참고 항목

PlayFab 온라인 하위 시스템은 NAME_GameSession 형식의 게임 세션 이름만 지원합니다.

다른 온라인 하위 시스템 플러그 인을 사용하는 것과 유사합니다.

Game.Build.csPublicDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils" });을(를) 추가한 다음 다른 게임 플러그 인과 동일한 방식으로 사용합니다.

GameSession.cpp의 예제 코드:

#include "OnlineSubsystem.h"
#include "OnlineSubsystemUtils.h"

...

bool Game::JoinSession(const FUniqueNetIdPtr UserId, FName SessionName, const FOnlineSessionSearchResult& SearchResult)
{

	IOnlineSubsystem* OnlineSub = Online::GetSubsystem(GetWorld()); // Using OnlineSubsystemPlayFab plugin
	if (OnlineSub)
	{
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface(); // Using OnlineSessionInterfacePlayFab.h
		if (Sessions.IsValid() && UserId.IsValid())
		{
			// ...
		}
	}
	// ...
}

GameFriends.cpp의 예제 코드:

#include "OnlineSubsystem.h"
#include "OnlineSubsystemUtils.h"

...

void Game::ViewFriendProfile()
{
	IOnlineSubsystem* OnlineSub = Online::GetSubsystem(GetWorld()); // Using OnlineSubsystemPlayFab plugin
	if (OnlineSub)
	{
		IOnlineIdentityPtr Identity = OnlineSub->GetIdentityInterface(); // Using OnlineIdentityInterfacePlayFab.h
		if (Identity.IsValid() && Friends.IsValidIndex(FriendIndex))
		{
			// ....
		}
	}
}

문제 해결:

문제를 해결하는 데 도움이 되는 방법입니다.

Unreal Engine 설치 빌드

GDK 빌드 플레이버에서 OnlineSubsystemPlayFab으로 Unreal 엔진 설치 빌드를 만들려고 할 때 사용자가 문제에 직면할 수 있습니다. 보다 완벽한 솔루션이 나올 때까지 이 문제를 성공적으로 극복하기 위해 다음 지침을 제공합니다.

UE4.27+를 사용하는 경우

  • 컴퓨터에서 Unreal Engine이 설치된 디렉터리를 찾습니다.

  • Engine\Platforms\GDK\Plugins\Online\PlayFabParty로 이동합니다.

  • PlayFabParty.uplugin 열기

  • WhitelistPlatforms 키를 BlacklistPlatforms로 교체합니다.

  • 설치된 빌드에 이러한 플랫폼이 필요한 경우 XboxOneGDK(PlayFabParty_XboxOneGDK.uplugin) 및 XSX(PlayFabParty_XSX.uplugin)에 대해 프로세스를 반복합니다. Win64가 설치된 빌드에 필요한 플랫폼이기도 한 경우 BlacklistPlatforms 배열에 Win64를 추가합니다.

    UE4.27+에 대한 PlayFabParty.uplugin의 모듈 구성 예제:

	"Modules": [
		{
			"Name": "PlayFabParty",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"BlacklistPlatforms": ["WinGDK", "Win64"]
		}
	],

UE5.0 - 5.2를 사용하는 경우:

  • 컴퓨터에서 Unreal Engine이 설치된 디렉터리를 찾습니다.
  • Engine\Platforms\GDK\Plugins\Online\PlayFabParty로 이동합니다.
  • PlayFabParty.uplugin을 열고 PlatformDenyList를 사용하여 모듈 구성을 업데이트합니다.
    "Modules": [
            {
                "Name": "PlayFabParty",
                "Type": "Runtime",
                "LoadingPhase": "Default",
                "HasExplicitPlatforms": true,
                "PlatformDenyList": [ "WinGDK", "Win64" ]
            }
        ],
    
  • 설치된 빌드에 이러한 플랫폼이 필요한 경우 XB1(PlayFabParty_XB1.uplugin) 및 XSX(PlayFabParty_XSX.uplugin)에 대해 위의 프로세스를 반복합니다. Win64도 설치된 빌드에 필요한 플랫폼인 경우 PlatformDenyList의 배열에 Win64를 추가합니다.

Steam의 핸드셰이크 오류

핸드셰이크 오류(예: LogHandshake: IncomingConnectionless: Error reading handshake packet)가 표시되는 경우 이 UE 포럼 게시물을 참조하여 설정을 확인하세요.

OnlineSubsystemPlayFab에 대한 워크플로

플랫폼별 고려 사항 섹션에 설명된 단계는 다음을 포함하도록 요청합니다.

[OnlineSubsystem]
DefaultPlatformService=PlayFab

UE OnlineSubsystemModule은 PlayFab에 대한 온라인 하위 시스템 인스턴스를 만들고 PlayFabSingleton을 만들기 시작합니다. 이 시점에서 SDK는 FOnlineSubsystemPlayFab::Init()에서 초기화되며, 여기서 PlayFab TitleID를 사용하여 파티 및 멀티 플레이어 SDK를 모두 초기화합니다(이 titleID는 게임 구성 파일 내에서 정의됨). 초기화하는 동안 기본 온라인 하위 시스템으로 ⁠CreatePlayFabSocketSubsystem()을(를) 만듭니다.

멀티 플레이어 SDK의 워크플로: FOnlineSubsystemPlayFab::Init()은(는) 타이틀에 대한 InitializeMultiplayer() 멀티 플레이어 SDK 싱글톤을 초기화합니다. PlayFabLobby.cpp에서 FPlayFabLobby::DoWork()은(는) 멀티플레이어 API에 의해 트리거된 상태 변경을 처리합니다(API의 경우 Platforms/GDK/Include/PFLobby.h 보기).

멀티 파티 SDK의 워크플로: FOnlineSubsystemPlayFab::Init()은(는) 타이틀에 대한 InitializeParty() 멀티 플레이어 SDK 싱글톤을 초기화합니다. OnlineSubsystemPlayFab.cpp에서 FOnlineSubsystemPlayFab::DoWork()은(는) 파티 API에 의해 트리거된 상태 변경을 처리합니다(API의 경우 Platforms/GDK/Include/Party.h 보기).

"PlayStation"은 Interactive Entertainment Inc.의 등록 상표 또는 상표입니다.

"PS4"는 Sony Interactive Entertainment Inc.의 등록 상표 또는 상표입니다.

"PS5"는 Sony Interactive Entertainment Inc.의 등록 상표 또는 상표입니다.