Intro
GameLift Server SDK๋ฅผ ํ์ฉํ์ฌ Unreal Dedicate Server๋ฅผ ํ ์คํธํ๊ธฐ ์ํด
GameLift SDK๋ฅผ Unreal ํ๋ก์ ํธ์ ์ถ๊ฐํด ๋ณด์!
์ด ๊ธ์ ์์ ํ๊ฒฝ์ Win64์ด๋ฉฐ,
๋ค์ ํ์ด์ง๋ฅผ ์ฐธ๊ณ ํ์ฌ ์งํํ๋ค.
https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-setup-unreal.html
Integrate Amazon GameLift Servers into an Unreal Engine project - Amazon GameLift Servers
You don't need to rebuild the solution. Instead, build just the project under the Games folder that matches the name of your app. Otherwise Visual Studio rebuilds the entire UE5 project, which might take up to an hour.
docs.aws.amazon.com
์ค๋น
โ Visual Studio 2019 ์ด์
โ CMake 3.1 ์ด์
โ Python 3.6 ์ด์
โ Git PATH์ค์ ์๋ฃ
โ Unreal Engine Source Build
ํ๋ก์ ํธ์ Server Target ์ถ๊ฐํ๊ธฐ
1. {ProjectName}Server.Target.cs ํ์ผ ์ถ๊ฐ
2. ๋ค๋ฅธ Target.cs์ ๋ด์ฉ์ ๋ณต์ฌํด ์ TargetType๋ง Server๋ก ์์ ํด ์ค๋ค.
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class FPSTemplateServerTarget : TargetRules
{
public FPSTemplateServerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Server;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
ExtraModuleNames.Add("FPSTemplate");
}
}
Unreal์ ์ํ ServerSDK ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋น๋ํ๊ธฐ
์ด ๊ณผ์ ์์ ์ฐ๋ฆฌ๊ฐ ์ต์ข ์ ์ผ๋ก ์ป์ด์ผ ํ๋ ๊ฑด ๋ค์๊ณผ ๊ฐ๋ค.
1. OpenSSL์ dll ํ์ผ!
2. aws-cpp-sdk-gamelift-server์ dllํ์ผ๊ณผ lib ํ์ผ์ด ๋ด๊ธด GameLiftPlugin ํด๋!
Open SSL ๋น๋ํ๊ธฐ
๐คOpenSSL์ด ํ์ํ ์ด์
Open SSL์ ์คํ์์ค ์ํธํ (Cryptography) ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค. ๋คํธ์ํฌ ์์์ ์ปดํจํฐ ๊ฐ ์ปค๋ฎค๋์ผ์ด์ ๋ณด์์ ์ฌ์ฉ๋๋ค. ๋ฐ์ดํฐ์ ๋ณด์๊ณผ ๋ฌด๊ฒฐ์ฑ(Integrity)์ ๋ณด์ฅํ๋๋ฐ ๋์์ ์ฃผ๋ SSL(Secure Socket Layer)๊ณผ TLS(Transport Layer Security) ํ๋กํ ์ฝ์ ์ฌ์ฉํ๋ค.
GameLift๋ฅผ ์ฌ์ฉํ์ฌ ์จ๋ผ์ธ ๊ฒ์์ ์ ์ํ ๋ AWS์ ํด๋ผ์ฐ๋ ์๋น์ค์ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ด๊ณ ๋ฐ๊ฒ ๋๋๋ฐ ์ด AWS๊ฐ Open SSL์ ์ฌ์ฉํ๋ค. ๊ทธ๋ฆฌ๊ณ Amazon Game Lift SDK๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ํ๋ก์ ํธ๋ฅผ ํจํค์ง ํ๊ธฐ ์ํด ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ํ์ํ๋ค.
1. OpenSSL ๋ค์ด๋ก๋ ๋ฐ ์ค์น
์ฐธ๊ณ ๋ฌธ์ => https://github.com/openssl/openssl/blob/master/NOTES-WINDOWS.md
openssl/NOTES-WINDOWS.md at master · openssl/openssl
TLS/SSL and crypto library. Contribute to openssl/openssl development by creating an account on GitHub.
github.com
OpenSSL ๋น๋๋ฅผ ์ํด์ ๋ช ๊ฐ์ง ์ฌ์ ์์ ์ด ํ์ํ๋ค.
์ฌ์ ์์ 1. Perl ์ค์น : https://strawberryperl.com/
Strawberry Perl for Windows
Perl is a programming language suitable for writing simple scripts as well as complex applications — see https://www.perl.org. Strawberry Perl is a perl environment for MS Windows containing all you need to run and develop perl applications. It is design
strawberryperl.com
โ๐์ค์น ๋ฐฉ๋ฒ (๋ ๋ณด๊ธฐ)
์ต์ ๋ฒ์ ์ MSI ํ์ผ์ ๋ค์ดํ์ฌ ์ค์นํ๋ค.

CMD ์ฐฝ์์ " perl --version "์ ์ ๋ ฅํ์ ๋, ๋ค์๊ณผ ๊ฐ์ด ๋ฒ์ ์ ๋ณด๊ฐ ๋ฌ๋ค๋ฉด ์ฑ๊ณต์ ์ผ๋ก ์ค์น๊ฐ ์๋ฃ๋ ๊ฒ์ด๋ค.

์ฌ์ ์์ 2. NASM ์ค์น : https://www.nasm.us/
NASM
Latest version Stable 2.16.03 History Builds List Snapshots Latest, List For users of RPM-based Linux distributions (e.g. Fedora, Red Hat, SUSE, ...), you can download the official NASM builds using dnf or yum by installing nasm.repo in your /etc/yum/yum.r
www.nasm.us
NASM์ Netwide Assembler๋ก ์ธํ x86 ์ํคํ ์ฒ์ฉ ์ด์ ๋ธ๋ฌ์ด์ ์ญ์ด์ ๋ธ๋ฌ์ด๋ค. ํ๋ก๊ทธ๋จ์ ์์ฑํ๋ ๋ฐ ์ฌ์ฉ๋๊ณ OpenSSL์ ์ฌ์ฉํ๊ธฐ ์ํด ํ์ํ๋ค.
โ๐์ค์น ๋ฐฉ๋ฒ (๋ ๋ณด๊ธฐ)
NASM ์ฌ์ดํธ๋ก ๋ค์ด๊ฐ ์ต์ ๋ฒ์ ์ installer๋ฅผ ๋ค์ด๋ฐ์ ์ค๋ค.



- ์คํ ํ์ผ์ ๊ด๋ฆฌ์๊ถํ์ผ๋ก ์คํ ํ, ์ค์น๋ฅผ ์งํํ๋ค.
- ์ค์น ํ, CMD ์ฐฝ์ ์ผ์ nasm --version ์ ์ ๋ ฅํ์ฌ ์ต์ ๋ฒ์ ์ผ๋ก ์ ์ค์น๊ฐ ๋์๋์ง ํ์ธํ๋ค. ์ด๋, where nasm ์ ์ ๋ ฅํ์๋, Strawberry ํ์์ ์๋ nasm.exe ๊ฒฝ๋ก๊ฐ ๋์จ๋ค๋ฉด ํ๊ฒฝ ๋ณ์ ์ค์ ์ ํด์ค์ผํ๋ค.

- ํ๊ฒฝ๋ณ์ ์ค์ ์ฐฝ์์ ์์คํ ํธ์ > Path๋ฅผ ํธ์งํ์ฌ, NASM์ ๊ฒฝ๋ก๊ฐ Strawberry ๊ฒฝ๋ก๋ณด๋ค ์์ ์ฌ ์ ์๋๋ก ํ๋ค.


- ๊ทธ๋ฆฌ๊ณ ๋ค์ where nasm ์ ์ ๋ ฅํ์๋, ๋ค์๊ณผ ๊ฐ์ด ๋์ค๋ฉด ์ฑ๊ณต์ ์ผ๋ก ์ค์น๊ฐ ๋ ๊ฒ์ด๋ค.

์ฌ์ ์์ ์ด ๋๋ฌ์ผ๋ฉด ์ด์ด์ ์๋ ๊ณผ์ ์ ๋ฐ๋ผ๊ฐ๋ค.
1. ๊ธฐ๋ณธ ๊ฐ๋ฐ์ ๋ช ๋ น ํ๋กฌํํธ ๋ช ๋ น ํ์ผ VsDevCmd.bat ์คํํ๊ธฐ
์ด ๊ณผ์ ์ nmake.exe์ cl.exe ํ๊ฒฝ ๋ณ์ ์ค์ ์ ์ํด ํ์ํ ๊ณผ์ ์ด๋ค.
- ๐C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools ์์ VsDevCmd.bat์ ์ฐพ๋๋ค.
- ์ฐพ์๋ค๋ฉด cmd๋ฅผ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํํ๋ค.
- cmd ์ฐฝ์ ๋ค์๊ณผ ๊ฐ์ด ์ ๋ ฅํ๋ค (window 64bit์ ๊ฒฝ์ฐ)
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat" -arch=amd64
2. OpenSSL Configuration
- ์ ๋นํ ์์น์ OpenSSL repository ๋ฅผ Cloneํ๋ค.https://github.com/openssl/openssl.git
GitHub - openssl/openssl: TLS/SSL and crypto library
TLS/SSL and crypto library. Contribute to openssl/openssl development by creating an account on GitHub.
github.com
- ํด๋น ์์น์์ cmd๋ฅผ ์คํ ์ํจ ํ ๋ค์๊ณผ ๊ฐ์ด ์ ๋ ฅํ๋ค.
perl Configure VC-WIN64A
- ์๋์ ๊ฐ์ด ๋จ๋ฉด OpenSSL Configuration์ ์ฑ๊ณตํ ๊ฒ์ด๋ค.
3. NMake ์คํํ๊ธฐ
- x64 Native Tools Command Prompt for VS2022๋ฅผ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํํ๋ค.
- OpenSSL ๊ฒฝ๋ก๋ก ์ด๋ ํ nmake๋ฅผ ์คํํ๋ค. ๊ฝค ์ค๋ ์๊ฐ์ด ๊ฑธ๋ฆฐ๋ค.
์ด ๋ชจ๋ ๊ณผ์ ์ด ๋๋ฌ์ผ๋ฉด openssl ๊ฒฝ๋ก์์ ๋ค์ ๋ ํ์ผ์ ๋ณต์ฌํด๋๋ค.
๐ libcrypto-3-x64.dll
๐ libssl-3-x64.dll
Game Lift Server SDK ๋น๋ํ๊ธฐ
- ์๋ ํ์ด์ง์์ ์ต์ Release๋ฒ์ ์ .zipํ์ผ์ ๋ค์ด ๋ฐ๋๋ค.
https://github.com/amazon-gamelift/amazon-gamelift-plugin-unreal/releases
Releases · amazon-gamelift/amazon-gamelift-plugin-unreal
The Amazon GameLift Plugin for Unreal contains libraries and native UI that makes it easier to access GameLift resources and integrate GameLift into your Unreal game. You can use the GameLift Unrea...
github.com
- ์์ถ์ ํผ๋ค.
๋ค์ด๋ฐ์ ํ์ผ์ ์์ถ์ ํ๋ฉด, ๋ ์์ถํ์ผ amazon-gamelift-plugin-unreal๊ณผ GameLift-Cpp-ServerSDK์ ํ์ธํ ์ ์๋๋ฐ, ์ด ๋ ์์ถ ํ์ผ์ download๊ฐ ์๋ C๋๋ผ์ด๋ธ์ ์์ถ์ ํผ๋ค.
- Server SDK ๋น๋๋ฅผ ์ํด ์์คํ ํ๊ฒฝ๋ณ์์ ์ด์ ์ ๋ค์ด๋ฐ์๋ OPENSSL์ ๊ฒฝ๋ก๋ฅผ ๋ฐํ์ผ๋ก "OPENSSL_ROOT_DIR" ๊ณผ "OPENSSL_INCLUDE_DIR" ์ถ๊ฐํ๋ค.
- Developer Command Prompt for VS 2022๋ฅผ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํํ๋ค.
- ๋ค์ ๋ช ๋ น์ด๋ฅผ ์์ฐจ์ ์ผ๋ก ์ ๋ ฅํ์ฌ ๋น๋๋ฅผ ์งํํ๋ค.
cd C:\GameLift-Cpp-ServerSDK-5.2.0
mkdir out
cd out
cmake -G "Visual Studio 17 2022" -DBUILD_FOR_UNREAL=1 ..
msbuild ALL_BUILD.vcxproj /p:Configuration=Release
- ์์ฑ๋ ๋ค์ ๋ ํ์ผ์ ๋ณต์ฌํ๋ค.
๐ \out\prefix\lib\aws-cpp-sdk-gamelift-server.lib
๐ \out\prefix\bin\aws-cpp-sdk-gamelift-server.dll - ๋ณต์ฌํ ํ์ผ์ ์๊น ์์ถ์ ํ์๋ amazon-gamelift-plugin-unreal์ ๋ค์ ๊ฒฝ๋ก์ Unreal plugin ํด๋์ ๋ถ์ฌ๋ฃ๋๋ค.
๐ C:\amazon-gamelift-plugin-unreal\GameLiftPlugin\Source\GameLiftServer\ThirdParty\GameLiftServerSDK\Win64
Import the Game Lift Server SDK
- amazon-gamelift-plugin-unreal์ ๐ GameLiftPlugin ํด๋๋ฅผ ๋ณต์ฌํ๋ค.
- ์ธ๋ฆฌ์ผ ํ๋ก์ ํธ ๊ฒฝ๋ก๋ก ์ด๋ํด์ ๐Plugins ํด๋๋ฅผ ์๋ก ์์ฑํ๋ค.
- ์ด Plugin ํด๋์ ๋ณต์ฌํด๋ GameLiftPlugin๋ฅผ ๋ถ์ฌ๋ฃ๋๋ค.
๋ง์ฝ git์ ์ฌ์ฉ์ค์ด๋ผ๋ฉด ํ๋ก์ ํธ์์ ์ฌ์ฉ๋๋ ๐.gitignore ํ์ผ์ ๋ณต์ฌํด ๐Plugins ํด๋์๋ ์ถ๊ฐํด์ค์ผํ๋ค.
- ํ๋ก์ ํธ์ .uproject์ ํ๋ฌ๊ทธ ์ธ์ ์ถ๊ฐํ๋ค.
"Plugins": [
{
"Name": "GameLiftPlugin",
"Enabled": true
}
]
- ํ๋ก์ ํธ์ .Build.cs ํ์ผ์ PublicDependencyModuleNames ๋์ "GameLiftServerSDK”๋ฅผ ์ถ๊ฐํ๋ค.
using UnrealBuildTool;
using System.Collections.Generic;
public class FPSTemplate: ModuleRules
{
public FPSTemplate(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "GameLiftServerSDK" });
bEnableExceptions = true;
}
}
- ๐Binaries ์ ๐Intermediate ํด๋๋ฅผ ์ญ์ ํ๊ณ .uproject ์ฐํด๋ฆญ ํ “Generate Visual Studio project file” ์ ์ ํํ๋ค.
- ์๋ฃจ์ ์ ์ด๊ณ ํ๋ฌ๊ทธ์ธ์ด ์ฑ๊ณต์ ์ผ๋ก ์ถ๊ฐ๋์๋์ง ํ์ธํ๋ค.
- ํ๋ก์ ํธ๋ฅผ ๋น๋ํ๋ค.
- ๋ง์ฝ ๋น๋์ ์คํจํ๋ค๋ฉด,
- ํ๋ก์ ํธ์์ ์ฌ์ฉ๋๋ ๐.gitignore ํ์ผ์ ๋ณต์ฌํด ๐Plugins ํด๋์๋ ์ถ๊ฐ๊ฐ ๋์๋์ง ํ์ธํ๋ค.
- ํ๋ก์ ํธ .Target.cs ์ IncludeOrderVersion ์ ๋ค์๊ณผ ๊ฐ์ด ์์ ํด๋ณด์.
IncludeOrderVersion = EngineIncludeOrderVersion.Latest; โ
- ๋ง์ฝ ๋น๋์ ์คํจํ๋ค๋ฉด,
- Development Server ๋น๋๋ฅผ ์งํํ๋ค.
๋ง๋ฌด๋ฆฌ
๋น๋๊น์ง ๋ง์ณค๋ค๋ฉด ์ฑ๊ณต์ ์ผ๋ก GameLift SDK ํ๋ฌ๊ทธ์ธ์ ํ๋ก์ ํธ์ ์ถ๊ฐ ์๋ฃ๋ ๊ฒ์ด๋ค!!
OPENSSL์ ๋ dll ์ Server ํจํค์ง ํ์ ํ์ํ๋ ์ ๋ณด๊ดํด๋์.
๐ libcrypto-3-x64.dll
๐ libssl-3-x64.dll