온라인 서비스(Online Services) 플러그인을 사용하면 에픽, Steam, Xbox Live, PSN, NLPN 같은 다양한 백엔드 온라인 서비스를 언리얼 엔진(UE) 프로젝트에 연결할 수 있습니다. 이 문서에서는 다음을 수행하는 방법을 안내합니다.
온라인 서비스 플러그인 구성
이 길잡이에서는 설명 목적으로 Online Services Null 구현을 사용합니다. 이 구현은 어떠한 백엔드 온라인 서비스에도 연결되지 않으며 테스트 목적으로 사용됩니다. Online Services Null 플러그인은 언리얼 엔진과 함께 사용하기 위해 환경설정하거나 외부에서 등록할 필요가 없으므로 시작하면서 사용하기에 좋습니다. 온라인 서비스 플러그인이 지원하는 전체 서비스 목록은 온라인 서비스 개요 문서를 참조하세요.
온라인 서비스 플러그인 활성화
다양한 온라인 서비스 플러그인을 프로젝트에서 사용할 수 있습니다. 온라인 서비스 베이스 플러그인은 기본적으로 활성화되어 있습니다.
추기 필수 기능을 활성화하는 단계는 다음과 같습니다.
- 언리얼 엔진 C++ 프로젝트를 생성하거나 엽니다.
- 메뉴 바에서 편집(Edit) > 플러그인(Plugins) 으로 이동합니다. 그러면 Plugins 라는 이름의 새 창이나 탭이 열립니다.
- 이 새 창에서 'Online Services'를 검색하거나 왼쪽의 내비게이션 바에서 온라인 플랫폼(Online Platform) 카테고리를 선택합니다.
- 그러면 여러 개의 플러그인이 표시되고, 그중에 Online Services Null 이 있을 것입니다. 박스에 체크하여 Online Services Null 플러그인을 활성화합니다.
(w:800)
백엔드 온라인 서비스로 에픽 온라인 서비스를 사용하려면 Online Services Null 대신 Online Services EOS 를 선택합니다. 그러려면 에픽 온라인 서비스에 제품을 등록하고 온라인 서비스 플러그인이 예상대로 작동하도록 백엔드를 적절하게 구성해야 할 수도 있습니다.
- '변경사항을 적용하려면 언리얼 에디터를 재시작해야 합니다.'라는 메시지가 표시됩니다. 지금 재시작(Restart Now) 을 클릭하여 언리얼 에디터(Unreal Editor) 를 재시작합니다.
- 이제 프로젝트에서 Online Services Null 플러그인이 활성화되었습니다.
프로젝트 종속성에 온라인 서비스 플러그인 추가
To use the Online Services plugins in your project’s C++ code, you mustadd the plugins to your project module as public dependencies. To use the Online Services plugins in your project's C++ code, you mustadd the plugins to your project module as public dependencies. 프로젝트의 C++ 코드에서 온라인 서비스 플러그인을 사용하려면, 프로젝트 모듈에 퍼블릭 종속성으로 해당 플러그인을 추가해야 합니다.
To add the plugins to your project module’s public dependencies, follow these steps: To add the plugins to your project module's public dependencies, follow these steps: 프로젝트 모듈의 퍼블릭 종속성에 플러그인을 추가하는 단계는 다음과 같습니다.
- Open your Unreal Engine C++ Project in the Unreal Editor.
- Open Visual Studio by selecting Tools > Open Visual Studio. This opens your project’s C++ source files in Visual Studio.
- To use the C++ code provided by the Online Services plugins, you must add the
OnlineServicesInterface
module as public dependencies to your project’s .Build.cs file. - Open your project’s .Build.cs file from the Solution Explorer by navigating to Games > [YOUR_GAME] > Source > [YOUR_GAME] > [YOUR_GAME].Build.cs.
- Add
OnlineServicesInterface
andCoreOnline
to your.Build.cs
public dependencies. Your.Build.cs
file should look like this: - Open your Unreal Engine C++ Project in the Unreal Editor.
- Open Visual Studio by selecting Tools > Open Visual Studio. This opens your project's C++ source files in Visual Studio.
- To use the C++ code provided by the Online Services plugins, you must add the
OnlineServicesInterface
module as public dependencies to your project's .Build.cs file. - Open your project's .Build.cs file from the Solution Explorer by navigating to Games > [YOUR_GAME] > Source > [YOUR_GAME] > [YOUR_GAME].Build.cs.
- Add
OnlineServicesInterface
andCoreOnline
to your.Build.cs
public dependencies. Your.Build.cs
file should look like this: - 언리얼 에디터 에서 언리얼 엔진 C++ 프로젝트를 엽니다.
- 툴(Tools) > Visual Studio 열기(Open Visual Studio) 를 선택하여 Visual Studio를 엽니다. 그러면 Visual Studio에서 프로젝트의 C++ 소스 파일이 열립니다.
- 온라인 서비스 플러그인에서 제공된 C++ 코드를 사용하려면
OnlineServicesInterface
모듈을 프로젝트의 .Build.cs 파일에 퍼블릭 종속성으로 추가해야 합니다. - 솔루션 탐색기(Solution Explorer) 에서 Games > [YOUR_GAME] > Source > [YOUR_GAME] > [YOUR_GAME].Build.cs 로 이동하여 프로젝트의 .Build.cs 파일을 엽니다.
-
OnlineServicesInterface
및CoreOnline
을.Build.cs
퍼블릭 종속성에 추가합니다..Build.cs
파일은 다음과 같은 모습일 것입니다.// Copyright Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; public class MyProject : ModuleRules { public MyProject(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "OnlineServicesInterface", "CoreOnline" }); } }
- Visual Studio에서 변경사항을 저장합니다.
프로젝트 파일 생성
Since you made a change to your project’s .Build.cs file, you need to refresh your Visual Studio project files. This ensures that the changes you made are reflected in Visual Studio Intellisense and lets you use the functionality in the plugins that you just added. Since you made a change to your project's .Build.cs file, you need to refresh your Visual Studio project files. This ensures that the changes you made are reflected in Visual Studio Intellisense and lets you use the functionality in the plugins that you just added. 프로젝트의 .Build.cs 파일을 변경했으니 Visual Studio 프로젝트 파일을 새로 고쳐야 합니다. 그러면 변경사항이 Visual Studio Intellisense에 반영되어, 방금 추가한 플러그인의 해당 기능을 사용할 수 있게 됩니다.
프로젝트 파일 생성 단계는 다음과 같습니다.
- Visual Studio를 닫습니다.
- 언리얼 에디터의 열린 프로젝트로 돌아갑니다.
- 툴 > Visual Studio 프로젝트 새로고침(Refresh Visual Studio Project) 을 선택하여 Visual Studio 프로젝트 파일을 재생성합니다.
코드 프로젝트 업데이트 상태를 표시하는 진행률 표시줄이 나타나고, 프로세스가 완료되면 사라집니다.
디폴트 플랫폼 서비스 환경설정
마지막 단계는 온라인 서비스 플러그인에 대한 디폴트 플랫폼 서비스를 지정하는 것입니다. 디폴트 플랫폼 서비스는 UE::Online::GetServices
호출에 의해 반환되는 백엔드 플랫폼 서비스를 지정합니다. 사용할 수 있는 플랫폼 식별자 목록은 온라인 서비스 개요 문서 페이지에서 확인할 수 있습니다.
To specify Online Services Null as the default platform services, follow these steps:
- Open your project in Visual Studio. You can do this by navigating to Tools > Open Visual Studio from within the Unreal Editor.
- Open your project’s DefaultEngine.ini file in the Visual Studio Solution Explorer by navigating to Games > [YOUR_GAME] > Config > DefaultEngine.ini.
- Add the following to your project’s DefaultEngine.ini file: To specify Online Services Null as the default platform services, follow these steps:
- Open your project in Visual Studio. You can do this by navigating to Tools > Open Visual Studio from within the Unreal Editor.
- Open your project's DefaultEngine.ini file in the Visual Studio Solution Explorer by navigating to Games > [YOUR_GAME] > Config > DefaultEngine.ini.
- Add the following to your project's DefaultEngine.ini file: Online Services Null을 디폴트 플랫폼 서비스로 지정하려면 다음 단계를 따릅니다.
- Visual Studio에서 프로젝트를 엽니다. 언리얼 에디터 내에서 툴 > Visual Studio 열기 로 이동하면 열 수 있습니다.
- Visual Studio 솔루션 탐색기에서 Games > [YOUR_GAME] > Config > DefaultEngine.ini로 이동하여 프로젝트의 DefaultEngine.ini 파일을 엽니다.
-
프로젝트의 DefaultEngine.ini 파일에 다음 내용을 추가합니다.
[OnlineServices] DefaultServices=Null
Online Services Null is an online services implementation that does not use any backend online services. This is used for testing and debugging your online services implementation without a backend service. If you want to use a different backend online service as your project’s default online services, you can choose one from the list provided in the Configuration section of the Online Services Overview. Online Services Null is an online services implementation that does not use any backend online services. This is used for testing and debugging your online services implementation without a backend service. If you want to use a different backend online service as your project's default online services, you can choose one from the list provided in the Configuration section of the Online Services Overview. Online Services Null은 어떠한 백엔드 온라인 서비스도 사용하지 않는 온라인 서비스 구현입니다. 백엔드 서비스 없이 온라인 서비스 구현을 테스트하고 디버깅하는 데 사용됩니다. 다른 백엔드 온라인 서비스를 프로젝트의 디폴트 온라인 서비스로 사용하려는 경우, 온라인 서비스 개요의 환경설정 섹션에서 제공된 목록에서 원하는 서비스를 선택하면 됩니다.
프로젝트에서 온라인 서비스 액세스
이제 온라인 서비스 플러그인이 활성화되고 프로젝트에서 사용할 수 있도록 환경설정되었습니다. 온라인 서비스 플러그인과 플러그인의 다양한 인터페이스에 액세스하려면 다음 단계를 따릅니다.
#include "Online/OnlineServices.h"
를 온라인 서비스 플러그인에 액세스하려는 파일에 추가합니다.IOnlineServicesPtr OnlineServicesPtr = UE::Online::GetServices();
를 사용하여 디폴트 플랫폼 서비스에 대한 포인터를 얻습니다.
이제 다른 온라인 서비스 플러그인 인터페이스 기능에 액세스할 수 있습니다. 예를 들어, 인증 인터페이스에 액세스하는 단계는 다음과 같습니다.
- 먼저 디폴트 플랫폼 서비스에 대한 포인터를 얻었는지 확인합니다.
#include "Online/Auth.h"
를 인증 인터페이스에 액세스하려는 파일에 추가합니다.IAuthPtr AuthPtr = OnlineServicesPtr->GetAuthInterface();
를 사용하여 인증 인터페이스에 대한 포인터를 얻습니다.
이제 인증 인터페이스 포인터를 통해 인증 인터페이스의 기능에 액세스할 수 있습니다. 모든 다른 온라인 서비스 인터페이스에도 동일한 로직이 적용됩니다.