Set Up the Unreal SDK #
Create a new project (optional) #
Set up PragmaSDK for Unreal #
Create a
Plugins
folder in the root of your Unreal project.Copy
pragma-engine/sdk/unreal4/update-pragma-sdk.sh
to thePlugins
folder you just created.Modify the
update-pragma-sdk.sh
script as follows:
Uncomment
SOURCE_ENGINE_RELATIVE_FOLDER
and change the value to point to yourpragma-engine
repo.Uncomment
TARGET_PRAGMA_SDK_DIR
and change the value toPragmaSDK
. This creates a PragmaSDK folder under the current directory (Plugins
).
- Run
update-pragma-sdk.sh
in Git Bash from the directory where you copied the script. Confirm that thePragmaSDK
folder now exists in yourPlugins
directory.
Update PragmaSDK for Unreal #
Whenever you make changes to Pragma Engine or update the code, you’ll want to update the PragmaSDK Unreal plugin folder. Re-run the update script command from your Unreal Plugins
directory:
update-pragma-sdk.sh
Configure the Pragma SDK #
From your Unreal project base folder, open
Source/[Project Name]/[Project Name].Build.cs
and addPragmaSDK
andPragmaSDKAux
to thePublicDependencyModuleNames
array:PublicDependencyModuleNames.AddRange(new string[] { ..., "PragmaSDK", "PragmaSDKAux" });
From your Unreal project base folder, open
Config/DefaultGame.ini
and add the following configuration information to the bottom:
[/Script/PragmaSDK.PragmaSdkConfig]
BackendAddress="http://127.0.0.1:10000"
ProtocolType="WebSocket"
GameClientVersion="GameServerVersion1"
When configuring the SDK for a game server, you should use the PartnerBackendAddress config and port 10100 (partner port).
(Optional) Add the following to Config/DefaultEngine.ini
to enable logs for every inbound and outbound RPC with payloads.
[Core.Log]
LogPragma=Verbose