├── java ├── version.txt ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── README.md ├── gameserverSDK │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── gaming │ │ │ ├── GSDKInfo.java │ │ │ ├── GameHostHealth.java │ │ │ ├── SessionHostStatus.java │ │ │ ├── ConnectedPlayer.java │ │ │ ├── MaintenanceSchedule.java │ │ │ ├── GameserverSDKInitializationException.java │ │ │ ├── ConfigurationBase.java │ │ │ ├── Configuration.java │ │ │ ├── Operation.java │ │ │ ├── SessionConfig.java │ │ │ └── MaintenanceEvent.java │ └── build.gradle ├── javaTestRunnerGame │ ├── Dockerfile │ └── build.gradle ├── build.gradle ├── gameserverSDKConsoleApp │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── azure │ │ └── gaming │ │ └── gsdkConsoleApp │ │ └── Main.java └── gradlew.bat ├── .gitattributes ├── cpp ├── cppsdk │ ├── version.txt │ ├── gsdkWindowsPch.h │ ├── gsdkWindowsPch.cpp │ ├── gsdkSampleConfigLinux.json │ ├── gsdkLinuxPch.h │ ├── gsdkSampleConfigWindows.json │ ├── gsdkInfo.h │ ├── gsdkCommonPch.h │ ├── gsdkLog.h │ ├── gsdkLog.cpp │ ├── ManualResetEvent.cpp │ ├── ManualResetEvent.h │ ├── gsdkUtils.h │ ├── include │ │ └── playfab │ │ │ ├── PlayFabMatchmakerApi.h │ │ │ ├── PlayFabSettings.h │ │ │ └── PlayFabHttp.h │ ├── source │ │ └── playfab │ │ │ ├── PlayFabSettings.cpp │ │ │ └── PlayFabError.cpp │ ├── gsdkUtils.cpp │ └── GSDK_CPP_Windows.vcxproj.filters ├── testapps │ ├── cppWindowsRunnerGame │ │ ├── testassetfile.txt │ │ └── cppWindowsRunnerGame.vcxproj.filters │ ├── cppWindowsTestApp │ │ ├── cppWindowsTestApp.cpp │ │ ├── cppWindowsTestAppPch.cpp │ │ ├── cppWindowsTestAppPch.h │ │ └── cppWindowsTestApp.vcxproj.filters │ └── cppLinuxRunnerGame │ │ └── Dockerfile ├── testbuild.sh ├── testbuild.bat ├── dependencies │ ├── openssl │ │ ├── libssl-1_1-x64.dll │ │ └── libcrypto-1_1-x64.dll │ ├── DockerSystemDlls │ │ └── Windows │ │ │ └── System32 │ │ │ ├── concrt140.dll │ │ │ ├── concrt140d.dll │ │ │ ├── msvcp140.dll │ │ │ ├── msvcp140d.dll │ │ │ ├── msvcr110.dll │ │ │ ├── msvcr110d.dll │ │ │ ├── rasadhlp.dll │ │ │ ├── ucrtbased.dll │ │ │ ├── vcruntime140.dll │ │ │ ├── vcruntime140d.dll │ │ │ └── OnDemandConnRouteHelper.dll │ ├── libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi │ │ ├── bin │ │ │ ├── curl.exe │ │ │ └── libcurl_debug.dll │ │ ├── lib │ │ │ ├── libcurl_debug.exp │ │ │ ├── libcurl_debug.lib │ │ │ └── libcurl_debug.pdb │ │ └── include │ │ │ └── curl │ │ │ ├── stdcheaders.h │ │ │ ├── mprintf.h │ │ │ └── curlver.h │ └── libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi │ │ ├── bin │ │ ├── curl.exe │ │ └── libcurl.dll │ │ ├── lib │ │ ├── libcurl.exp │ │ └── libcurl.lib │ │ └── include │ │ └── curl │ │ ├── stdcheaders.h │ │ ├── mprintf.h │ │ └── curlver.h ├── README.md ├── unittests │ ├── stdafx.cpp │ ├── targetver.h │ ├── stdafx.h │ ├── GSDK_CPP_UnitTests.vcxproj.filters │ └── TestConfig.h └── CMakeLists.txt ├── csharp ├── GSDK_CSharp_Standard │ ├── version.txt │ ├── assets │ │ └── playfab-mark.png │ ├── InternalsVisibleTo.cs │ ├── Model │ │ ├── GSDKInfo.cs │ │ ├── HeartbeatRequest.cs │ │ ├── SessionConfig.cs │ │ ├── HeartbeatResponse.cs │ │ ├── MaintenanceSchedule.cs │ │ └── GSDKConfiguration.cs │ ├── ConnectedPlayer.cs │ ├── LoggerFactory.cs │ ├── GSDKInitializationException.cs │ ├── CollectionUtils.cs │ ├── HttpClientFactory.cs │ ├── ISystemOperations.cs │ ├── GameServerConnectionInfo.cs │ ├── FilesystemLogger.cs │ ├── GSDK_CSharp_Standard.csproj │ └── HttpClientWrapper.cs ├── WinTestRunnerGame │ ├── testassetfile.txt │ ├── App.config │ └── WinTestRunnerGame.csproj ├── README.md ├── WindowsTestAppCSharp │ ├── WindowsTestAppCSharp.csproj │ └── Program.cs └── Tests │ ├── Tests.csproj │ └── GSDKConfigurationTests.cs ├── UnityGsdk ├── Assets │ ├── Resources │ │ ├── BillingMode.json │ │ └── BillingMode.json.meta │ ├── PlayFabSdk │ │ ├── PlayFabSDKAssembly.asmdef │ │ ├── MultiplayerAgent │ │ │ ├── Model │ │ │ │ ├── GSDKInfo.cs │ │ │ │ ├── GameOperation.cs │ │ │ │ ├── GSDKInfo.cs.meta │ │ │ │ ├── GameState.cs.meta │ │ │ │ ├── ConnectedPlayer.cs.meta │ │ │ │ ├── ErrorStates.cs.meta │ │ │ │ ├── GameOperation.cs.meta │ │ │ │ ├── SessionConfig.cs.meta │ │ │ │ ├── GsdkConfiguration.cs.meta │ │ │ │ ├── HeartbeatRequest.cs.meta │ │ │ │ ├── HeartbeatResponse.cs.meta │ │ │ │ ├── MaintenanceSchedule.cs.meta │ │ │ │ ├── GameServerConnectionInfo.cs.meta │ │ │ │ ├── ErrorStates.cs │ │ │ │ ├── GameState.cs │ │ │ │ ├── HeartbeatRequest.cs │ │ │ │ ├── ConnectedPlayer.cs │ │ │ │ ├── HeartbeatResponse.cs │ │ │ │ ├── MaintenanceSchedule.cs │ │ │ │ ├── GameServerConnectionInfo.cs │ │ │ │ ├── GsdkConfiguration.cs │ │ │ │ └── SessionConfig.cs │ │ │ ├── Helpers.meta │ │ │ ├── Model.meta │ │ │ ├── Helpers │ │ │ │ ├── SimpleJson.cs.meta │ │ │ │ └── SimpleJsonInstance.cs.meta │ │ │ ├── PlayFabMultiplayerAgentView.cs.meta │ │ │ └── PlayFabMultiplayerAgentAPI.cs.meta │ │ ├── PlayFabSDKAssembly.asmdef.meta │ │ ├── link.xml.meta │ │ ├── MultiplayerAgent.meta │ │ └── link.xml │ ├── Scene.unity.meta │ ├── Tests.meta │ ├── BuildUtils.meta │ ├── PlayFabSdk.meta │ ├── Resources.meta │ ├── Tests │ │ ├── TestAssembly.asmdef.meta │ │ ├── GSDKTests.cs.meta │ │ └── TestAssembly.asmdef │ ├── BuildUtils │ │ ├── EditorAssembly.asmdef.meta │ │ ├── Builder.cs.meta │ │ ├── EditorAssembly.asmdef │ │ └── Builder.cs │ ├── TestServerInstance.cs.meta │ └── TestServerInstance.cs ├── MpsGsdk.unitypackage ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── VersionControlSettings.asset │ ├── TimeManager.asset │ ├── EditorBuildSettings.asset │ ├── AudioManager.asset │ ├── VFXManager.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── PackageManagerSettings.asset │ ├── MemorySettings.asset │ ├── DynamicsManager.asset │ ├── EditorSettings.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ └── GraphicsSettings.asset ├── .vsconfig ├── Packages │ ├── manifest.json │ └── packages-lock.json ├── UserSettings │ ├── Search.index │ ├── EditorUserSettings.asset │ └── Search.settings ├── README.md └── .gitignore ├── UnrealPlugin ├── Resources │ └── Icon128.png ├── Documentation │ ├── MyGameInstanceH.png │ ├── BlueprintFullGraph.png │ ├── DependencyModules.png │ ├── DevelopmentEditor.png │ ├── GSDKBlueprintNodes.png │ ├── MyGameInstanceCPP.png │ ├── SelectUnrealEngineVersion.png │ ├── BlueprintGSDKHealthCheckFunction.png │ ├── BlueprintRegisterHealthCheckDelegate.png │ └── BlueprintAddRegisterHealthCheckDelegate.png ├── TestingProject │ ├── Config │ │ └── DefaultGame.ini │ ├── Content │ │ └── NewWorld.umap │ ├── Source │ │ ├── SlateUGS │ │ │ ├── SlateUGS.h │ │ │ ├── Private │ │ │ │ ├── Tests │ │ │ │ │ ├── GsdkTests.h │ │ │ │ │ └── TestConfiguration.h │ │ │ │ └── TestGameInstance.cpp │ │ │ ├── SlateUGS.cpp │ │ │ ├── Public │ │ │ │ └── TestGameInstance.h │ │ │ └── SlateUGS.Build.cs │ │ ├── SlateUGSServer.Target.cs │ │ ├── SlateUGS.Target.cs │ │ └── SlateUGSEditor.Target.cs │ ├── Plugins │ │ └── PlayFabGSDK │ │ │ ├── Source │ │ │ └── PlayFabGSDK │ │ │ │ ├── Private │ │ │ │ ├── GSDKInfo.h │ │ │ │ ├── GSDKInternalUtils.h │ │ │ │ └── GSDKInternalUtils.cpp │ │ │ │ ├── Public │ │ │ │ ├── ConnectedPlayer.h │ │ │ │ ├── MaintenanceSchedule.h │ │ │ │ └── GameServerConnectionInfo.h │ │ │ │ └── PlayFabGSDK.Build.cs │ │ │ └── PlayFabGSDK.uplugin │ ├── .vsconfig │ └── .gitignore ├── Source │ └── PlayFabGSDK │ │ ├── Private │ │ ├── GSDKInfo.h │ │ ├── GSDKInternalUtils.h │ │ └── GSDKInternalUtils.cpp │ │ ├── Public │ │ ├── ConnectedPlayer.h │ │ ├── MaintenanceSchedule.h │ │ └── GameServerConnectionInfo.h │ │ └── PlayFabGSDK.Build.cs ├── PlayFabGSDK.uplugin └── ThirdPersonMPSetup.md ├── experimental └── go │ ├── go.mod │ ├── logger.go │ ├── go.sum │ └── README.md ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── pull_request_template.md ├── updateVersion.js ├── README.md └── upgradeguide200219.md /java/version.txt: -------------------------------------------------------------------------------- 1 | 0.4.201215 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /cpp/cppsdk/version.txt: -------------------------------------------------------------------------------- 1 | 0.6.190103 -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/version.txt: -------------------------------------------------------------------------------- 1 | 0.11.210519 -------------------------------------------------------------------------------- /csharp/WinTestRunnerGame/testassetfile.txt: -------------------------------------------------------------------------------- 1 | pikachu -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsRunnerGame/testassetfile.txt: -------------------------------------------------------------------------------- 1 | pikachu -------------------------------------------------------------------------------- /UnityGsdk/Assets/Resources/BillingMode.json: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /cpp/testbuild.sh: -------------------------------------------------------------------------------- 1 | rm -rf out 2 | mkdir out 3 | pushd out 4 | cmake .. 5 | make 6 | popd 7 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/PlayFabSDKAssembly.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PlayFabSDKAssembly" 3 | } 4 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkWindowsPch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/cppsdk/gsdkWindowsPch.h -------------------------------------------------------------------------------- /java/settings.gradle: -------------------------------------------------------------------------------- 1 | include "gameserverSDK", "gameserverSDKConsoleApp", "javaTestRunnerGame" 2 | 3 | -------------------------------------------------------------------------------- /UnityGsdk/MpsGsdk.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnityGsdk/MpsGsdk.unitypackage -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkWindowsPch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/cppsdk/gsdkWindowsPch.cpp -------------------------------------------------------------------------------- /cpp/testbuild.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rmdir /s /q out 3 | mkdir out 4 | pushd out 5 | cmake .. 6 | cmake --build . 7 | -------------------------------------------------------------------------------- /UnrealPlugin/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Resources/Icon128.png -------------------------------------------------------------------------------- /java/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/java/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.12f1 2 | m_EditorVersionWithRevision: 2022.3.12f1 (4fe6e059c7ef) 3 | -------------------------------------------------------------------------------- /cpp/dependencies/openssl/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/openssl/libssl-1_1-x64.dll -------------------------------------------------------------------------------- /UnityGsdk/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/MyGameInstanceH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/MyGameInstanceH.png -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | [/Script/UnrealEd.ProjectPackagingSettings] 2 | IncludeAppLocalPrerequisites=True 3 | 4 | -------------------------------------------------------------------------------- /cpp/dependencies/openssl/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/openssl/libcrypto-1_1-x64.dll -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/BlueprintFullGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/BlueprintFullGraph.png -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/DependencyModules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/DependencyModules.png -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/DevelopmentEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/DevelopmentEditor.png -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/GSDKBlueprintNodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/GSDKBlueprintNodes.png -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/MyGameInstanceCPP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/MyGameInstanceCPP.png -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Content/NewWorld.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/TestingProject/Content/NewWorld.umap -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsTestApp/cppWindowsTestApp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/testapps/cppWindowsTestApp/cppWindowsTestApp.cpp -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/assets/playfab-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/csharp/GSDK_CSharp_Standard/assets/playfab-mark.png -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsTestApp/cppWindowsTestAppPch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/testapps/cppWindowsTestApp/cppWindowsTestAppPch.cpp -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsTestApp/cppWindowsTestAppPch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/testapps/cppWindowsTestApp/cppWindowsTestAppPch.h -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/SelectUnrealEngineVersion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/SelectUnrealEngineVersion.png -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkSampleConfigLinux.json: -------------------------------------------------------------------------------- 1 | { 2 | "heartbeatEndpoint": "localhost:56001", 3 | "sessionHostId": "123-456-789-AAA", 4 | "logFolder": "/~/gsdkLogs" 5 | } -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/BlueprintGSDKHealthCheckFunction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/BlueprintGSDKHealthCheckFunction.png -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkLinuxPch.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include "json/json.h" 7 | #include "curl/curl.h" 8 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkSampleConfigWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "heartbeatEndpoint": "localhost:56001", 3 | "sessionHostId": "123-456-789-AAA", 4 | "logFolder": "D:\\GSDK\\Logs\\" 5 | } -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/concrt140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/concrt140.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/concrt140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/concrt140d.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/msvcp140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/msvcp140.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/msvcp140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/msvcp140d.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/msvcr110.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/msvcr110.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/msvcr110d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/msvcr110d.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/rasadhlp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/rasadhlp.dll -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/ucrtbased.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/ucrtbased.dll -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/BlueprintRegisterHealthCheckDelegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/BlueprintRegisterHealthCheckDelegate.png -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/vcruntime140.dll -------------------------------------------------------------------------------- /UnrealPlugin/Documentation/BlueprintAddRegisterHealthCheckDelegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/UnrealPlugin/Documentation/BlueprintAddRegisterHealthCheckDelegate.png -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/vcruntime140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/vcruntime140d.dll -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/InternalsVisibleTo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | [assembly:InternalsVisibleTo("Tests")] 3 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/SlateUGS.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/bin/curl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/bin/curl.exe -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define GSDK_INFO_FLAVOR "C++" 4 | #define GSDK_INFO_VERSION "2.0.0" 5 | 6 | #define GSDK_INFO_FLAVOR_KEY "Flavor" 7 | #define GSDK_INFO_VERSION_KEY "Version" -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/bin/curl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/bin/curl.exe -------------------------------------------------------------------------------- /cpp/README.md: -------------------------------------------------------------------------------- 1 | # C++ Multiplayer Server Game Server SDK 2 | 3 | This folder contains the C++ GSDK. Please open an [issue](https://github.com/PlayFab/gsdk/issues) for any feedback or questions you may have. -------------------------------------------------------------------------------- /cpp/dependencies/DockerSystemDlls/Windows/System32/OnDemandConnRouteHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/DockerSystemDlls/Windows/System32/OnDemandConnRouteHelper.dll -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/bin/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/bin/libcurl.dll -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/lib/libcurl.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/lib/libcurl.exp -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/lib/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/lib/libcurl.lib -------------------------------------------------------------------------------- /java/README.md: -------------------------------------------------------------------------------- 1 | # Java Multiplayer Server Game Server SDK 2 | 3 | This folder contains the Java GSDK. Please open an [issue](https://github.com/PlayFab/gsdk/issues) for any feedback or questions you may have. -------------------------------------------------------------------------------- /UnityGsdk/Assets/Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d378995b5aeb28f40bb2017078460c17 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/bin/libcurl_debug.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/bin/libcurl_debug.dll -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.exp -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.lib -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/gsdk/HEAD/cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/lib/libcurl_debug.pdb -------------------------------------------------------------------------------- /UnityGsdk/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.22", 4 | "com.unity.test-framework": "1.1.33", 5 | "com.unity.modules.unitywebrequest": "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6e2bf2cd205d4e418aadb8f5996efe0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/BuildUtils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9181a179d5fd5004db8c9758c6c8b8ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de94d12ee4a7c5c49870631f30c4c478 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4b0b14cf00202b42a296e3735ceac43 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Resources/BillingMode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 444b0eb293fe9cb4186f4919e97d379d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/GSDKInfo.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | class GSDKInfo { 4 | private String Flavor = "Java"; 5 | 6 | private String Version = "2.0.0"; 7 | } 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GSDKInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [Serializable] 4 | internal class GSDKInfo 5 | { 6 | public string Flavor { get; } = "Unity"; 7 | public string Version { get; } = "2.0.0"; 8 | } 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Tests/TestAssembly.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4086a11a438ff154bb46483fc03b4faf 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Private/GSDKInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define GSDK_INFO_FLAVOR "Unreal" 4 | #define GSDK_INFO_VERSION "2.0.0" 5 | 6 | #define GSDK_INFO_FLAVOR_KEY "Flavor" 7 | #define GSDK_INFO_VERSION_KEY "Version" 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/BuildUtils/EditorAssembly.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 573096486a7bc0944a55f1f893b61991 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/PlayFabSDKAssembly.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c8f5ad5cf706344b807e9306f37d673 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc2c3070dc174cc45a4aaf1a5e38263d 3 | timeCreated: 1468524880 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/Private/Tests/GsdkTests.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #if (WITH_DEV_AUTOMATION_TESTS && WITH_EDITOR) 4 | #pragma once 5 | 6 | #include "CoreMinimal.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2d610d70252dc24eb69e5a67e163dda 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe478e9f2477f8478f2f4ae3cf6eb7f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Private/GSDKInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define GSDK_INFO_FLAVOR "Unreal" 4 | #define GSDK_INFO_VERSION "2.0.0" 5 | 6 | #define GSDK_INFO_FLAVOR_KEY "Flavor" 7 | #define GSDK_INFO_VERSION_KEY "Version" 8 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/GameHostHealth.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | /** 4 | * Whether a game server is healthy or unhealthy. 5 | */ 6 | public enum GameHostHealth { 7 | Healthy, 8 | Unhealthy; 9 | } 10 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/GSDKInfo.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 3 | { 4 | internal class GSDKInfo 5 | { 6 | public string Flavor { get; } = "C#"; 7 | public string Version { get; } = "2.0.0"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/SlateUGS.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "SlateUGS.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, SlateUGS, "SlateUGS" ); 7 | -------------------------------------------------------------------------------- /java/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 11 16:34:09 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip 7 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6cdc6fe4a2823643b6a053a5f5cb513 3 | folderAsset: yes 4 | timeCreated: 1524063088 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /java/javaTestRunnerGame/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use OpenJDK as a base image 2 | FROM openjdk:8 3 | 4 | # Copy the executable 5 | COPY *.jar /app/ 6 | 7 | # Set the working directory to /app 8 | WORKDIR /app 9 | 10 | # Run our game when the container launches 11 | CMD ["java", "-jar", "javaTestRunnerGame.jar"] -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameOperation.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | 5 | [Serializable] 6 | public enum GameOperation 7 | { 8 | Invalid, 9 | Continue, 10 | Active, 11 | Terminate 12 | } 13 | } -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Private/GSDKInternalUtils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | class UGSDKInternalUtils 8 | { 9 | public: 10 | static FString GetEnvironmentVariable(const FString& EnvironmentVariableName); 11 | }; 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/BuildUtils/Builder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14aa2ff642f2ed349af245c5aea02fd3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/TestServerInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a8c2a24fbb9b2041b133cb8fc0cc496 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Tests/GSDKTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ec8dcda7946a8342be960f412fb584a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/UserSettings/Search.index: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Assets", 3 | "roots": ["Assets"], 4 | "includes": [], 5 | "excludes": [], 6 | "options": { 7 | "types": true, 8 | "properties": true, 9 | "extended": false, 10 | "dependencies": false 11 | }, 12 | "baseScore": 999 13 | } -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scene.unity 10 | guid: d378995b5aeb28f40bb2017078460c17 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /cpp/unittests/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // GSDK_CPP_UnitTests.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /cpp/unittests/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GSDKInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f9cdee3fd2d23f44b9b6770de949330 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 116b9b8a6a366774688856c867d70af0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Helpers/SimpleJson.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee78dcd93c9825f4b86e6839f1eab468 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/ConnectedPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a10c2cf110590c4b9fdf0dcc5883fb6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/ErrorStates.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1163b07dea965f48b7e0ce774137d38 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameOperation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df9f47c523e88c0419a291fd44949903 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/SessionConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 846e010d76778c2488d3ff31e7c30188 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Private/GSDKInternalUtils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | class UGSDKInternalUtils 8 | { 9 | public: 10 | static FString GetEnvironmentVariable(const FString& EnvironmentVariableName); 11 | }; 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Helpers/SimpleJsonInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c294bcad4061f8448edbc339e3d7039 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GsdkConfiguration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39811e32b068d22478dc8a490039996c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/HeartbeatRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efc19f05b9964be43ac6bb5cfba02b61 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/HeartbeatResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4d1cfa9b6467814991d1e1d4411a9d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/MaintenanceSchedule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad9b1b567032202408e7a91ca1d07aff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /java/gameserverSDK/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'idea' 3 | 4 | sourceCompatibility = 1.8 5 | repositories { 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | compile 'com.google.code.gson:gson:2.8.0' 11 | compile 'org.apache.httpcomponents:fluent-hc:4.5.3' 12 | compile "com.github.rholder:guava-retrying:2.0.0" 13 | } 14 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameServerConnectionInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2b17765c54968a40a804052b511f39b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/PlayFabMultiplayerAgentView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77b96b385c9a9044a93afc57d9cac3bc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/ConnectedPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 4 | { 5 | public class ConnectedPlayer 6 | { 7 | public string PlayerId { get; set; } 8 | 9 | public ConnectedPlayer(string playerid) 10 | { 11 | this.PlayerId = playerid; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /csharp/README.md: -------------------------------------------------------------------------------- 1 | # C# Multiplayer Server Game Server SDK 2 | 3 | This folder contains the C# GSDK. 4 | 5 | ## C# Nuget package 6 | 7 | We do have a Nuget package here: https://www.nuget.org/packages/com.playfab.csharpgsdk 8 | 9 | ### Release Notes 10 | 11 | - 0.10.200325: No API differences from 0.9.200218, only minor changes on the text displayed at the Nuget page. -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/ErrorStates.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | 5 | [Serializable] 6 | public enum ErrorStates 7 | { 8 | Ok = 0, 9 | Retry30S = 30, 10 | Retry5M = 300, 11 | Retry10M = 600, 12 | Retry15M = 900, 13 | Cancelled = -1 14 | } 15 | } -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameState.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | 5 | [Serializable] 6 | public enum GameState 7 | { 8 | Invalid, 9 | Initializing, 10 | StandingBy, 11 | Active, 12 | Terminating, 13 | Terminated, 14 | Quarantined 15 | } 16 | } -------------------------------------------------------------------------------- /csharp/WindowsTestAppCSharp/WindowsTestAppCSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Private/GSDKInternalUtils.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #include "GSDKInternalUtils.h" 4 | 5 | #include "HAL/PlatformMisc.h" 6 | 7 | FString UGSDKInternalUtils::GetEnvironmentVariable(const FString& EnvironmentVariableName) 8 | { 9 | return FPlatformMisc::GetEnvironmentVariable(*EnvironmentVariableName); 10 | } 11 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Public/ConnectedPlayer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "ConnectedPlayer.generated.h" 8 | 9 | USTRUCT(BlueprintType) 10 | struct FConnectedPlayer 11 | { 12 | GENERATED_BODY() 13 | public: 14 | UPROPERTY(BlueprintReadWrite) 15 | FString PlayerId; 16 | }; 17 | -------------------------------------------------------------------------------- /csharp/WinTestRunnerGame/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /java/build.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | apply plugin: 'java' 3 | apply plugin: 'eclipse-wtp' 4 | 5 | sourceCompatibility = 1.8 6 | repositories { 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | testCompile 'junit:junit:4.12' 12 | } 13 | 14 | version = '1.0' 15 | 16 | jar { 17 | manifest.attributes provider: 'gradle' 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /experimental/go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/playfab/gsdk/experimental/go 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/sirupsen/logrus v1.9.3 7 | github.com/stretchr/testify v1.9.0 8 | ) 9 | 10 | require ( 11 | github.com/davecgh/go-spew v1.1.1 // indirect 12 | github.com/pmezard/go-difflib v1.0.0 // indirect 13 | golang.org/x/sys v0.21.0 // indirect 14 | gopkg.in/yaml.v3 v3.0.1 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/PlayFabMultiplayerAgentAPI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 974b235893cccfb4d8fd15330a1e0d9b 3 | timeCreated: 1524063105 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Private/GSDKInternalUtils.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #include "GSDKInternalUtils.h" 4 | 5 | #include "HAL/PlatformMisc.h" 6 | 7 | FString UGSDKInternalUtils::GetEnvironmentVariable(const FString& EnvironmentVariableName) 8 | { 9 | return FPlatformMisc::GetEnvironmentVariable(*EnvironmentVariableName); 10 | } 11 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Public/ConnectedPlayer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "ConnectedPlayer.generated.h" 8 | 9 | USTRUCT(BlueprintType) 10 | struct FConnectedPlayer 11 | { 12 | GENERATED_BODY() 13 | public: 14 | UPROPERTY(BlueprintReadWrite) 15 | FString PlayerId; 16 | }; 17 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | public interface ILogger 4 | { 5 | void Start(); 6 | void Log(string message); 7 | } 8 | 9 | public static class LoggerFactory 10 | { 11 | public static ILogger CreateInstance(string logFolder) 12 | { 13 | return new FileSystemLogger(logFolder); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /java/gameserverSDKConsoleApp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'idea' 3 | 4 | dependencies { 5 | compile project(':gameserverSDK') 6 | } 7 | 8 | jar { 9 | from { 10 | (configurations.runtime).collect { 11 | it.isDirectory() ? it : zipTree(it) 12 | } 13 | } 14 | manifest { 15 | attributes( 16 | 'Main-Class': 'com.microsoft.azure.gaming.gsdkConsoleApp.Main' 17 | ) 18 | } 19 | } -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/HeartbeatRequest.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | [Serializable] 7 | public class HeartbeatRequest 8 | { 9 | public GameState CurrentGameState { get; set; } 10 | 11 | public string CurrentGameHealth { get; set; } 12 | 13 | public IList CurrentPlayers { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/SessionHostStatus.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | /** 4 | * The series of game states we support. 5 | * Note: This needs to match the VM Agent and C++/C# GSDK 6 | */ 7 | enum SessionHostStatus { 8 | Invalid, 9 | Initializing, 10 | StandingBy, 11 | Active, 12 | Terminating, 13 | Terminated, 14 | Quarantined, // TODO: Remove when CP no longer has Quarantine 15 | } 16 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/BuildUtils/EditorAssembly.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EditorAssembly", 3 | "rootNamespace": "", 4 | "references": [], 5 | "includePlatforms": [ 6 | "Editor" 7 | ], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": false, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGSServer.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | using System; 6 | 7 | public class SlateUGSServerTarget : TargetRules 8 | { 9 | public SlateUGSServerTarget(TargetInfo Target) : base(Target) 10 | { 11 | Type = TargetType.Server; 12 | DefaultBuildSettings = BuildSettingsVersion.Latest; 13 | 14 | ExtraModuleNames.Add("SlateUGS"); 15 | } 16 | } -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class SlateUGSTarget : TargetRules 7 | { 8 | public SlateUGSTarget(TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Game; 11 | DefaultBuildSettings = BuildSettingsVersion.Latest; 12 | 13 | ExtraModuleNames.AddRange( new string[] { "SlateUGS" } ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cpp/unittests/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | // Headers for CppUnitTest 11 | #include "CppUnitTest.h" 12 | 13 | // TODO: reference additional headers your program requires here 14 | #define WIN32_LEAN_AND_MEAN 15 | #include "windows.h" 16 | #include "curl/curl.h" 17 | #include "json/json.h" -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/HeartbeatRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 2 | { 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Converters; 5 | 6 | internal class HeartbeatRequest 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public GameState CurrentGameState { get; set; } 10 | 11 | public string CurrentGameHealth { get; set; } 12 | 13 | public ConnectedPlayer[] CurrentPlayers { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /cpp/testapps/cppLinuxRunnerGame/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | # Copy the executable to /app 4 | COPY cppLinuxRunnerGame.out /app/ 5 | 6 | # Set the working directory to /app 7 | WORKDIR /app 8 | 9 | # Expose the port the game listens to 10 | EXPOSE 3600 11 | 12 | # Install dependencies 13 | RUN apt-get update && apt-get install -y \ 14 | curl \ 15 | libcurl3 \ 16 | libjsoncpp1 \ 17 | libssl1.0.0 18 | 19 | # Run game when the container launches 20 | CMD ./cppLinuxRunnerGame.out -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGSEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class SlateUGSEditorTarget : TargetRules 7 | { 8 | public SlateUGSEditorTarget(TargetInfo Target) : base(Target) 9 | { 10 | Type = TargetType.Editor; 11 | DefaultBuildSettings = BuildSettingsVersion.Latest; 12 | 13 | ExtraModuleNames.AddRange( new string[] { "SlateUGS" } ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/GSDKInitializationException.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | using System; 4 | 5 | public class GSDKInitializationException : Exception 6 | { 7 | public GSDKInitializationException(string message) 8 | : base(message) 9 | { 10 | } 11 | 12 | public GSDKInitializationException(string message, Exception innerException) 13 | : base(message, innerException) 14 | { 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/CollectionUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 6 | { 7 | static class CollectionUtils 8 | { 9 | public static void AddIfNotNullOrEmpty(this IDictionary dictionary, string key, string value) 10 | { 11 | if (!string.IsNullOrEmpty(value)) 12 | { 13 | dictionary[key] = value; 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/ConnectedPlayer.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | using Helpers; 5 | 6 | [Serializable] 7 | public class ConnectedPlayer 8 | { 9 | public ConnectedPlayer() 10 | { 11 | 12 | } 13 | 14 | public ConnectedPlayer(string playerid) 15 | { 16 | PlayerId = playerid; 17 | } 18 | 19 | [JsonProperty(PropertyName = "playerId")] 20 | public string PlayerId { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_EnableOutputSuspension: 1 16 | m_SpatializerPlugin: 17 | m_AmbisonicDecoderPlugin: 18 | m_DisableAudio: 0 19 | m_VirtualizeEffects: 1 20 | m_RequestedDSPBufferSize: 0 21 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_EmptyShader: {fileID: 0} 11 | m_RenderPipeSettingsPath: 12 | m_FixedTimeStep: 0.016666668 13 | m_MaxDeltaTime: 0.05 14 | m_MaxScrubTime: 30 15 | m_CompiledVersion: 0 16 | m_RuntimeVersion: 0 17 | m_RuntimeResources: {fileID: 0} 18 | m_BatchEmptyLifetime: 300 19 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/ConnectedPlayer.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | /** 4 | * Describes a player that is connected to the game server. 5 | */ 6 | public class ConnectedPlayer { 7 | private String playerId; 8 | 9 | public ConnectedPlayer(String newPlayerId){ 10 | this.setPlayerId(newPlayerId); 11 | } 12 | 13 | public String getPlayerId() { 14 | return playerId; 15 | } 16 | 17 | public void setPlayerId(String playerId) { 18 | this.playerId = playerId; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkCommonPch.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #ifdef GSDK_LINUX 23 | #include "gsdkLinuxPch.h" 24 | #else 25 | #endif 26 | 27 | #ifdef GSDK_WINDOWS 28 | #include "gsdkWindowsPch.h" 29 | #endif 30 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/MaintenanceSchedule.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | import java.util.List; 4 | import com.google.gson.annotations.SerializedName; 5 | 6 | public class MaintenanceSchedule { 7 | 8 | private String documentIncarnation; 9 | 10 | @SerializedName(value = "Events") 11 | private List events; 12 | 13 | public String getDocumentIncarnation() { 14 | return documentIncarnation; 15 | } 16 | 17 | public List getMaintenanceEvents() { 18 | return events; 19 | } 20 | } -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /UnrealPlugin/PlayFabGSDK.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "PlayFabGSDK", 6 | "Description": "Unreal Integration of the PlayFab GSDK", 7 | "Category": "PlayFab", 8 | "CreatedBy": "PlayFab", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": false, 14 | "IsBetaVersion": true, 15 | "IsExperimentalVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "PlayFabGSDK", 20 | "Type": "Runtime", 21 | "LoadingPhase": "EarliestPossible" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/HttpClientFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | internal interface IHttpClientFactory 4 | { 5 | IHttpClient CreateInstance(string baseUrl); 6 | } 7 | 8 | internal class HttpClientFactory : IHttpClientFactory 9 | { 10 | public static HttpClientFactory Instance { get; } = new HttpClientFactory(); 11 | 12 | private HttpClientFactory() 13 | { 14 | } 15 | 16 | public IHttpClient CreateInstance(string baseUrl) 17 | { 18 | return new HttpClientWrapper(baseUrl); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/PlayFabGSDK.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "PlayFabGSDK", 6 | "Description": "Unreal Integration of the PlayFab GSDK", 7 | "Category": "PlayFab", 8 | "CreatedBy": "PlayFab", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": false, 14 | "IsBetaVersion": true, 15 | "IsExperimentalVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "PlayFabGSDK", 20 | "Type": "Runtime", 21 | "LoadingPhase": "EarliestPossible" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /java/javaTestRunnerGame/build.gradle: -------------------------------------------------------------------------------- 1 | version 'unspecified' 2 | 3 | apply plugin: 'java' 4 | 5 | sourceCompatibility = 1.8 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | compile project(':gameserverSDK') 13 | } 14 | 15 | task copyTask(type: Copy) { 16 | from 'Dockerfile' 17 | into 'build/libs' 18 | } 19 | 20 | jar { 21 | from { 22 | (configurations.runtime).collect { 23 | it.isDirectory() ? it : zipTree(it) 24 | } 25 | } 26 | 27 | manifest { 28 | attributes( 29 | 'Main-Class': 'com.microsoft.azure.gaming.testRunnerGame.Main' 30 | ) 31 | } 32 | } 33 | 34 | build.finalizedBy(copyTask) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/GameserverSDKInitializationException.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | /** 4 | * Exception thrown when there was an issue initializing the GSDK. 5 | * Since it derives from RuntimeException, this is an unchecked exception, 6 | * because if the GSDK fails to initialize, that is a non-recoverable error. 7 | */ 8 | public class GameserverSDKInitializationException extends RuntimeException { 9 | public GameserverSDKInitializationException(String message){ 10 | super(message); 11 | } 12 | 13 | public GameserverSDKInitializationException(String message, Throwable cause){ 14 | super(message, cause); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.Net.Component.4.6.2.TargetingPack", 5 | "Microsoft.VisualStudio.Component.VC.14.34.17.4.ARM64", 6 | "Microsoft.VisualStudio.Component.VC.14.34.17.4.x86.x64", 7 | "Microsoft.VisualStudio.Component.VC.Tools.ARM64", 8 | "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", 9 | "Microsoft.VisualStudio.Component.Windows10SDK", 10 | "Microsoft.VisualStudio.Workload.CoreEditor", 11 | "Microsoft.VisualStudio.Workload.ManagedDesktop", 12 | "Microsoft.VisualStudio.Workload.NativeDesktop", 13 | "Microsoft.VisualStudio.Workload.NativeGame", 14 | "Microsoft.VisualStudio.Workload.Universal" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /csharp/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/SessionConfig.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using Newtonsoft.Json; 6 | 7 | internal class SessionConfig 8 | { 9 | [JsonProperty(PropertyName = "sessionId")] 10 | public Guid SessionId { get; set; } 11 | 12 | [JsonProperty(PropertyName = "sessionCookie")] 13 | public string SessionCookie { get; set; } 14 | 15 | [JsonProperty(PropertyName = "initialPlayers")] 16 | public List InitialPlayers { get; set; } 17 | 18 | [JsonProperty(PropertyName = "metadata")] 19 | public Dictionary Metadata { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /experimental/go/logger.go: -------------------------------------------------------------------------------- 1 | package gsdk 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | "time" 8 | 9 | log "github.com/sirupsen/logrus" 10 | ) 11 | 12 | func initializeLogger(directory string) { 13 | utctime := time.Now().UTC().Unix() 14 | filename := fmt.Sprintf("%s/GSDK_output_%d.txt", directory, utctime) 15 | f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) 16 | if err != nil { 17 | panic(err) 18 | } 19 | mw := io.MultiWriter(os.Stdout, f) 20 | log.SetOutput(mw) 21 | } 22 | 23 | func logInfo(s string) { 24 | log.Info(s) 25 | } 26 | 27 | func logDebug(s string) { 28 | log.Debug(s) 29 | } 30 | 31 | func logWarn(s string) { 32 | log.Warn(s) 33 | } 34 | 35 | func logError(s string) { 36 | log.Error(s) 37 | } 38 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/HeartbeatResponse.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using Helpers; 4 | using System; 5 | 6 | [Serializable] 7 | public class HeartbeatResponse 8 | { 9 | [JsonProperty(PropertyName = "sessionConfig")] 10 | public SessionConfig SessionConfig { get; set; } 11 | 12 | [JsonProperty(PropertyName = "nextScheduledMaintenanceUtc")] 13 | public string NextScheduledMaintenanceUtc { get; set; } 14 | 15 | [JsonProperty(PropertyName = "maintenanceSchedule")] 16 | public MaintenanceSchedule MaintenanceSchedule { get; set; } 17 | 18 | [JsonProperty(PropertyName = "operation")] 19 | public GameOperation Operation { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Version [e.g. 22] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/Tests/TestAssembly.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tests", 3 | "rootNamespace": "", 4 | "references": [ 5 | "UnityEngine.TestRunner", 6 | "UnityEditor.TestRunner", 7 | "PlayFabSDKAssembly" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": true, 13 | "precompiledReferences": [ 14 | "nunit.framework.dll" 15 | ], 16 | "autoReferenced": false, 17 | "defineConstraints": [ 18 | "UNITY_INCLUDE_TESTS" 19 | ], 20 | "versionDefines": [ 21 | { 22 | "name": "Unity", 23 | "expression": "2015", 24 | "define": "ENABLE_PLAYFABSERVER_API" 25 | } 26 | ], 27 | "noEngineReferences": false 28 | } -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/HeartbeatResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 2 | { 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Converters; 5 | 6 | internal class HeartbeatResponse 7 | { 8 | [JsonProperty(PropertyName = "sessionConfig")] 9 | public SessionConfig SessionConfig { get; set; } 10 | 11 | [JsonProperty(PropertyName = "nextScheduledMaintenanceUtc")] 12 | public string NextScheduledMaintenanceUtc { get; set; } 13 | 14 | [JsonProperty(PropertyName = "maintenanceSchedule")] 15 | public MaintenanceSchedule MaintenanceSchedule { get; set; } 16 | 17 | [JsonProperty(PropertyName = "operation", ItemConverterType = typeof(StringEnumConverter))] 18 | public GameOperation Operation { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkLog.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include "gsdkUtils.h" 9 | 10 | namespace Microsoft 11 | { 12 | namespace Azure 13 | { 14 | namespace Gaming 15 | { 16 | 17 | class GSDKLogMethod 18 | { 19 | public: 20 | GSDKLogMethod(const char *methodName); 21 | ~GSDKLogMethod(); 22 | 23 | void setExceptionInformation(const std::exception &ex); 24 | HRESULT setHResult(HRESULT hr); 25 | 26 | private: 27 | std::string m_methodName; 28 | std::string m_exception_message; 29 | HRESULT m_hr; 30 | }; 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Public/MaintenanceSchedule.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "MaintenanceSchedule.generated.h" 8 | 9 | USTRUCT(BlueprintType) 10 | struct FMaintenanceEvent 11 | { 12 | GENERATED_BODY() 13 | public: 14 | UPROPERTY(BlueprintReadWrite) 15 | FString EventId; 16 | FString EventType; 17 | FString ResourceType; 18 | TArray Resources; 19 | FString EventStatus; 20 | FDateTime NotBefore; 21 | FString Description; 22 | FString EventSource; 23 | uint32_t DurationInSeconds; 24 | }; 25 | 26 | USTRUCT(BlueprintType) 27 | struct FMaintenanceSchedule 28 | { 29 | GENERATED_BODY() 30 | public: 31 | UPROPERTY(BlueprintReadWrite) 32 | FString DocumentIncarnation; 33 | TArray Events; 34 | }; 35 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Public/MaintenanceSchedule.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "MaintenanceSchedule.generated.h" 8 | 9 | USTRUCT(BlueprintType) 10 | struct FMaintenanceEvent 11 | { 12 | GENERATED_BODY() 13 | public: 14 | UPROPERTY(BlueprintReadWrite) 15 | FString EventId; 16 | FString EventType; 17 | FString ResourceType; 18 | TArray Resources; 19 | FString EventStatus; 20 | FDateTime NotBefore; 21 | FString Description; 22 | FString EventSource; 23 | uint32_t DurationInSeconds; 24 | }; 25 | 26 | USTRUCT(BlueprintType) 27 | struct FMaintenanceSchedule 28 | { 29 | GENERATED_BODY() 30 | public: 31 | UPROPERTY(BlueprintReadWrite) 32 | FString DocumentIncarnation; 33 | TArray Events; 34 | }; 35 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/PlayFabGSDK.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class PlayFabGSDK : ModuleRules 6 | { 7 | public PlayFabGSDK(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange( 12 | new string[] 13 | { 14 | "CoreUObject", 15 | "Engine", 16 | "Core", 17 | "Json", 18 | "HTTP" 19 | // ... add other public dependencies that you statically link with here ... 20 | } 21 | ); 22 | 23 | if (Target.Type == TargetType.Server) 24 | { 25 | if (Target.Platform == UnrealTargetPlatform.Win64) 26 | { 27 | RuntimeDependencies.Add("$(TargetOutputDir)/D3DCompiler_43.dll", "C:/Windows/System32/D3DCompiler_43.dll", StagedFileType.SystemNonUFS); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | **What this PR does / why we need it**: 11 | 12 | **Special notes for your reviewer**: 13 | 14 | **If applicable**: 15 | - [ ] this PR contains documentation 16 | - [ ] this PR contains unit tests 17 | - [ ] this PR has been tested for backwards compatibility -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/MaintenanceSchedule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 5 | { 6 | public class MaintenanceSchedule 7 | { 8 | public string DocumentIncarnation { get; set; } 9 | 10 | public IList Events { get; set; } 11 | } 12 | 13 | public class MaintenanceEvent 14 | { 15 | public string EventId { get; set; } 16 | 17 | public string EventType { get; set; } 18 | 19 | public string ResourceType { get; set; } 20 | 21 | public IList Resources { get; set; } 22 | 23 | public string EventStatus { get; set; } 24 | 25 | public DateTime? NotBefore { get; set; } 26 | 27 | public string Description { get; set; } 28 | 29 | public string EventSource { get; set; } 30 | 31 | public int DurationInSeconds { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/PlayFabGSDK.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class PlayFabGSDK : ModuleRules 6 | { 7 | public PlayFabGSDK(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange( 12 | new string[] 13 | { 14 | "CoreUObject", 15 | "Engine", 16 | "Core", 17 | "Json", 18 | "HTTP" 19 | // ... add other public dependencies that you statically link with here ... 20 | } 21 | ); 22 | 23 | if (Target.Type == TargetType.Server) 24 | { 25 | if (Target.Platform == UnrealTargetPlatform.Win64) 26 | { 27 | RuntimeDependencies.Add("$(TargetOutputDir)/D3DCompiler_43.dll", "C:/Windows/System32/D3DCompiler_43.dll", StagedFileType.SystemNonUFS); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/Public/TestGameInstance.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Engine/GameInstance.h" 7 | #include "GSDKUtils.h" 8 | #include "TestGameInstance.generated.h" 9 | 10 | DECLARE_LOG_CATEGORY_EXTERN(LogPlayFabGSDKGameInstance, Log, All); 11 | 12 | /** 13 | * 14 | */ 15 | UCLASS() 16 | class SLATEUGS_API UTestGameInstance : public UGameInstance 17 | { 18 | GENERATED_BODY() 19 | 20 | public: 21 | virtual void Init() override; 22 | virtual void OnStart() override; 23 | 24 | protected: 25 | UFUNCTION() 26 | void OnGSDKShutdown(); 27 | 28 | UFUNCTION() 29 | bool OnGSDKHealthCheck(); 30 | 31 | UFUNCTION() 32 | void OnGSDKServerActive(); 33 | 34 | UFUNCTION() 35 | void OnGSDKReadyForPlayers(); 36 | 37 | UFUNCTION() 38 | void OnGSDKMaintenanceV2(const FMaintenanceSchedule& schedule); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/ConfigurationBase.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | /** 4 | * Contains shared code between JsonFileConfiguration and EnvironmentConfiguration 5 | */ 6 | abstract class ConfigurationBase implements Configuration { 7 | private final String titleId; 8 | private final String buildId; 9 | private final String region; 10 | 11 | protected ConfigurationBase() 12 | { 13 | // These are always set as environment variables, even with the new gsdk config json file 14 | this.titleId = System.getenv(TITLE_ID_VARIABLE_NAME); 15 | this.buildId = System.getenv(BUILD_ID_VARIABLE_NAME); 16 | this.region = System.getenv(REGION_VARIABLE_NAME); 17 | } 18 | 19 | @Override 20 | public String getTitleId() { return this.titleId; } 21 | 22 | @Override 23 | public String getBuildId() { return this.buildId; } 24 | 25 | @Override 26 | public String getRegion() { return this.region; } 27 | } 28 | -------------------------------------------------------------------------------- /UnityGsdk/UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedSceneGuid-0: 9 | value: 065756575450085a0808097b40200644424e1e297e2923607b7d4d31b5b26d3b 10 | flags: 0 11 | RecentlyUsedSceneGuid-1: 12 | value: 0702035e5c0c5c59580f0920427b594446151a787c7971607a714965b2e3656f 13 | flags: 0 14 | vcSharedLogLevel: 15 | value: 0d5e400f0650 16 | flags: 0 17 | m_VCAutomaticAdd: 1 18 | m_VCDebugCom: 0 19 | m_VCDebugCmd: 0 20 | m_VCDebugOut: 0 21 | m_SemanticMergeMode: 2 22 | m_DesiredImportWorkerCount: 2 23 | m_StandbyImportWorkerCount: 2 24 | m_IdleImportWorkerShutdownDelay: 60000 25 | m_VCShowFailedCheckout: 1 26 | m_VCOverwriteFailedCheckoutAssets: 1 27 | m_VCProjectOverlayIcons: 1 28 | m_VCHierarchyOverlayIcons: 1 29 | m_VCOtherOverlayIcons: 1 30 | m_VCAllowAsyncUpdate: 1 31 | m_ArtifactGarbageCollection: 1 32 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/SlateUGS.Build.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class SlateUGS : ModuleRules 6 | { 7 | public SlateUGS(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Json", "PlayFabGSDK" }); 12 | 13 | PrivateDependencyModuleNames.AddRange(new string[] { }); 14 | 15 | PrivateIncludePaths.AddRange(new string[] { }); 16 | 17 | // Uncomment if you are using Slate UI 18 | // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 19 | 20 | // Uncomment if you are using online features 21 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 22 | 23 | // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/Configuration.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * Various properties that can be configured for the GSDK. 7 | * As long as it implements this interface, the GSDK can accept configurations 8 | * from various sources, such as environment variables, json files, etc. 9 | */ 10 | interface Configuration { 11 | String getHeartbeatEndpoint(); 12 | String getServerId(); 13 | String getLogFolder(); 14 | String getSharedContentFolder(); 15 | String getCertificateFolder(); 16 | String getVmId(); 17 | String getTitleId(); 18 | String getBuildId(); 19 | String getRegion(); 20 | Map getBuildMetadata(); 21 | Map getGamePorts(); 22 | void validate() throws GameserverSDKInitializationException; 23 | 24 | 25 | final String TITLE_ID_VARIABLE_NAME = "PF_TITLE_ID"; 26 | final String BUILD_ID_VARIABLE_NAME = "PF_BUILD_ID"; 27 | final String REGION_VARIABLE_NAME = "PF_REGION"; 28 | } 29 | -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsRunnerGame/cppWindowsRunnerGame.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/ISystemOperations.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | using System; 4 | using System.IO; 5 | 6 | public interface ISystemOperations 7 | { 8 | string FileReadAllText(string filename); 9 | 10 | bool FileExists(string filename); 11 | 12 | string GetEnvironmentVariableValue(string variable); 13 | } 14 | 15 | public class SystemOperations : ISystemOperations 16 | { 17 | public static SystemOperations Instance { get; } = new SystemOperations(); 18 | 19 | private SystemOperations() 20 | { 21 | } 22 | 23 | public string FileReadAllText(string filename) 24 | { 25 | return File.ReadAllText(filename); 26 | } 27 | 28 | public bool FileExists(string filename) 29 | { 30 | return File.Exists(filename); 31 | } 32 | 33 | public string GetEnvironmentVariableValue(string variable) 34 | { 35 | return Environment.GetEnvironmentVariable(variable); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /updateVersion.js: -------------------------------------------------------------------------------- 1 | var fileName = process.argv[2]; 2 | console.log("Begin updating version"); 3 | 4 | var versionRe = new RegExp("([0-9]+)\.([0-9]+)\.([0-9][0-9][0-9][0-9][0-9][0-9])([a-zA-Z0-9-_]*)"); 5 | var now = new Date(); 6 | var todaysDate = (now.getUTCFullYear()%100).toString().padStart(2, "0") + (now.getMonth()+1).toString().padStart(2, "0") + (now.getUTCDate()).toString().padStart(2, "0"); 7 | 8 | fs = require('fs') 9 | fs.readFile(fileName, 'utf8', function (err,data) { 10 | if (err) { 11 | return console.log(err); 12 | } 13 | 14 | var reMatch = data.match(versionRe); 15 | if (!reMatch) process.exit(); 16 | 17 | var majorVer = parseInt(reMatch[1]); 18 | var minorVer = parseInt(reMatch[2]); 19 | minorVer++; // Increment the minor version here 20 | 21 | var newVersion = majorVer.toString() + "." + minorVer.toString() + "." + todaysDate + reMatch[4]; 22 | 23 | fs.writeFile (fileName, newVersion, function(err) { 24 | if (err) throw err; 25 | console.log(`Finished! New version is ${newVersion}`); 26 | }); 27 | }); 28 | 29 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 1 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_ConfigSource: 0 29 | m_UserSelectedRegistryName: 30 | m_UserAddingNewScopedRegistry: 0 31 | m_RegistryInfoDraft: 32 | m_Modified: 0 33 | m_ErrorMessage: 34 | m_UserModificationsInstanceId: -874 35 | m_OriginalInstanceId: -876 36 | m_LoadAssets: 0 37 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/Operation.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Operations that the agent asks the GSDK to perform. 7 | * 8 | * Note: The order needs to match the VM Agent and C++/C# GSDK. 9 | * Also make sure to keep these Uppercase, since Java string to 10 | * enum parsing is case-sensitive 11 | */ 12 | enum Operation { 13 | @SerializedName(value = "invalid", alternate = {"Invalid", "INVALID"}) 14 | INVALID, 15 | 16 | @SerializedName(value = "continue", alternate = {"Continue", "CONTINUE"}) 17 | CONTINUE, 18 | 19 | @SerializedName(value = "getmanifest", alternate = {"GetManifest", "GETMANIFEST"}) 20 | GETMANIFEST, 21 | 22 | // TODO: Remove when CP no longer has Quarantine 23 | @SerializedName(value = "quarantine", alternate = {"Quarantine", "QUARANTINE"}) 24 | QUARANTINE, 25 | 26 | @SerializedName(value = "active", alternate = {"Active", "ACTIVE"}) 27 | ACTIVE, 28 | 29 | @SerializedName(value = "terminate", alternate = {"Terminate", "TERMINATE"}) 30 | TERMINATE 31 | } 32 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/Private/Tests/TestConfiguration.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #if (WITH_DEV_AUTOMATION_TESTS && WITH_EDITOR) 4 | #pragma once 5 | 6 | #include "CoreMinimal.h" 7 | #include "PlayFabGSDK/Private/GSDKConfiguration.h" 8 | 9 | class TestConfiguration : public FJsonFileConfiguration 10 | { 11 | public: 12 | TestConfiguration() = default; 13 | ~TestConfiguration() = default; 14 | 15 | void SetHeartbeatEndpoint(FString heartbeatEndpoint); 16 | void SetServerId(FString serverId); 17 | void SetLogFolder(FString logFolder); 18 | void SetCertificateFolder(FString certFolder); 19 | void SetSharedContentFolder(FString sharedContentFolder); 20 | void SetGameCertificates(TMap gameCerts); 21 | void SetBuildMetadata(TMap metadata); 22 | void SetGamePorts(TMap ports); 23 | void SetPublicIpV4Address(FString ipv4Address); 24 | void SetFullyQualifiedDomainName(FString domainName); 25 | void SetVmId(FString vmId); 26 | void SetGameServerConnectionInfo(FGameServerConnectionInfo connectionInfo); 27 | 28 | bool SerializeToFile(const FString& fileName); 29 | }; 30 | #endif 31 | -------------------------------------------------------------------------------- /csharp/WinTestRunnerGame/WinTestRunnerGame.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net8.0 5 | WinTestRunnerGame 6 | WinTestRunnerGame 7 | true 8 | 9 | 10 | 11 | {970425EE-E9B1-4AE2-876E-CA663EC6F486} 12 | GSDK_CSharp_Standard 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | PreserveNewest 25 | 26 | 27 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkLog.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #include "gsdkCommonPch.h" 5 | #include "gsdkInternal.h" 6 | 7 | namespace Microsoft 8 | { 9 | namespace Azure 10 | { 11 | namespace Gaming 12 | { 13 | 14 | GSDKLogMethod::GSDKLogMethod(const char *methodName) 15 | { 16 | m_hr = S_OK; 17 | m_methodName = methodName; 18 | GSDK::logMessage(" - GSDKMethodEntry: " + m_methodName); 19 | } 20 | 21 | GSDKLogMethod::~GSDKLogMethod() 22 | { 23 | std::string msg = " - GSDKMethodEntry: " + m_methodName + " Result: " + std::to_string(m_hr); 24 | if (!m_exception_message.empty()) 25 | msg += " Exception: " + m_exception_message; 26 | GSDK::logMessage(msg); 27 | } 28 | 29 | void GSDKLogMethod::setExceptionInformation(const std::exception &ex) 30 | { 31 | m_exception_message = ex.what(); 32 | } 33 | 34 | HRESULT GSDKLogMethod::setHResult(HRESULT hr) 35 | { 36 | m_hr = hr; 37 | return hr; 38 | } 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /cpp/testapps/cppWindowsTestApp/cppWindowsTestApp.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015 user specific files 2 | .vs/ 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | 22 | # Compiled Static libraries 23 | *.lai 24 | *.la 25 | *.a 26 | *.lib 27 | 28 | # Executables 29 | *.exe 30 | *.out 31 | *.app 32 | *.ipa 33 | 34 | # These project files can be generated by the engine 35 | *.xcodeproj 36 | *.xcworkspace 37 | *.sln 38 | *.suo 39 | *.opensdf 40 | *.sdf 41 | *.VC.db 42 | *.VC.opendb 43 | 44 | # Precompiled Assets 45 | SourceArt/**/*.png 46 | SourceArt/**/*.tga 47 | 48 | # Binary Files 49 | Binaries/* 50 | Plugins/*/Binaries/* 51 | 52 | # Builds 53 | Build/* 54 | 55 | # Whitelist PakBlacklist-.txt files 56 | !Build/*/ 57 | Build/*/** 58 | !Build/*/PakBlacklist*.txt 59 | 60 | # Don't ignore icon files in Build 61 | !Build/**/*.ico 62 | 63 | # Built data for maps 64 | *_BuiltData.uasset 65 | 66 | # Configuration files generated by the Editor 67 | Saved/* 68 | 69 | # Compiled source files for the engine to use 70 | Intermediate/* 71 | Plugins/*/Intermediate/* 72 | 73 | # Cache files for the editor to use 74 | DerivedDataCache/* 75 | 76 | # Config from unit testing 77 | *testConfig.json -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /UnityGsdk/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ext.nunit": { 4 | "version": "1.0.6", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ide.visualstudio": { 11 | "version": "2.0.22", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.test-framework": "1.1.9" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.test-framework": { 20 | "version": "1.1.33", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.ext.nunit": "1.0.6", 25 | "com.unity.modules.imgui": "1.0.0", 26 | "com.unity.modules.jsonserialize": "1.0.0" 27 | }, 28 | "url": "https://packages.unity.com" 29 | }, 30 | "com.unity.modules.imgui": { 31 | "version": "1.0.0", 32 | "depth": 1, 33 | "source": "builtin", 34 | "dependencies": {} 35 | }, 36 | "com.unity.modules.jsonserialize": { 37 | "version": "1.0.0", 38 | "depth": 1, 39 | "source": "builtin", 40 | "dependencies": {} 41 | }, 42 | "com.unity.modules.unitywebrequest": { 43 | "version": "1.0.0", 44 | "depth": 0, 45 | "source": "builtin", 46 | "dependencies": {} 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /UnityGsdk/README.md: -------------------------------------------------------------------------------- 1 | # GSDK for the Unity game engine 2 | 3 | This folder contains the Game Server SDK for the Unity game engine. The GSDK files are in the `PlayFabSdk/MultiplayerAgent` folder. The entire GSDK is usable via class `PlayFabMultiplayerAgentAPI`. There is a sample scene in the `MultiplayerServerSample` folder that is meant to be used as a guidance when starting up a new project. For a more robust sample, check our `gsdksamples` repository [here](https://github.com/PlayFab/MpsSamples/tree/main/UnityMirror). 4 | 5 | ### Can I use PlayFab SDK along the GSDK? 6 | 7 | Yup, PlayFab SDK and GSDK would reside in different folders in your Unity project, thus having no conflict. 8 | 9 | ### What do I need to do in order to use the Unity GSDK in a new project? 10 | 11 | You can drag the `PlayFabSDK` folder to your Unity project. After that, you need to enable the scripring directive `ENABLE_PLAYFABSERVER_API` on your Build settings, like in [this screenshot](https://user-images.githubusercontent.com/8256138/81462605-a6d7ac80-9168-11ea-9748-110ed01095c2.png) 12 | 13 | ### Heartbeats are failing when I run in container mode (no heartbeat error), what should I do? 14 | 15 | GSDK sends game server heartbeats to the PlayFab VmAgent process (which is in the same VM as the game server) using plain HTTP calls. Unity disallows that by default, but you can enable it in "project settings > player > other settings > allow downloads over http". 16 | -------------------------------------------------------------------------------- /cpp/cppsdk/ManualResetEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "gsdkCommonPch.h" 2 | #include "ManualResetEvent.h" 3 | 4 | namespace Microsoft 5 | { 6 | namespace Azure 7 | { 8 | namespace Gaming 9 | { 10 | ManualResetEvent::ManualResetEvent() : m_isGateOpen(false) 11 | { 12 | } 13 | 14 | 15 | ManualResetEvent::~ManualResetEvent() 16 | { 17 | } 18 | 19 | void ManualResetEvent::Wait() 20 | { 21 | std::unique_lock lock(m_mutex); 22 | m_condition.wait(lock, [&]() -> bool { return m_isGateOpen; }); 23 | } 24 | 25 | bool ManualResetEvent::Wait(unsigned long milliseconds) 26 | { 27 | std::unique_lock lock(m_mutex); 28 | return m_condition.wait_for(lock, std::chrono::milliseconds(milliseconds), [&]() -> bool { return m_isGateOpen; }); 29 | } 30 | 31 | void ManualResetEvent::Signal() 32 | { 33 | m_mutex.lock(); 34 | m_isGateOpen = true; 35 | m_mutex.unlock(); 36 | m_condition.notify_all(); 37 | } 38 | 39 | void ManualResetEvent::Reset() 40 | { 41 | m_mutex.lock(); 42 | m_isGateOpen = false; 43 | m_mutex.unlock(); 44 | } 45 | 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /cpp/cppsdk/ManualResetEvent.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Microsoft 10 | { 11 | namespace Azure 12 | { 13 | namespace Gaming 14 | { 15 | class ManualResetEvent 16 | { 17 | private: 18 | bool m_isGateOpen; 19 | std::mutex m_mutex; 20 | std::condition_variable m_condition; 21 | 22 | public: 23 | ManualResetEvent(); 24 | ~ManualResetEvent(); 25 | 26 | // If the gate is closed, this blocks until signal is called, without a timeout. 27 | // If the gate is open, then no blocking occurs. 28 | void Wait(); 29 | 30 | // If the gate is closed, this blocks until either a signal is called or we timeout. 31 | // Returns false if there was a timeout, true if the event was signaled. 32 | // If the gate is open, then no blocking occurs and we return true. 33 | bool Wait(unsigned long milliseconds); 34 | 35 | // Unblocks any waits and sets the gate to open 36 | void Signal(); 37 | 38 | // Closes the gate so new waits get blocked again 39 | void Reset(); 40 | }; 41 | 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/SessionConfig.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | import java.util.UUID; 7 | 8 | /** 9 | * Configuration for a game session 10 | */ 11 | class SessionConfig { 12 | private UUID sessionId; 13 | 14 | private String sessionCookie; 15 | 16 | private List initialPlayers; 17 | 18 | protected UUID getSessionId() { 19 | return sessionId; 20 | } 21 | 22 | public void setSessionId(UUID sessionId) { 23 | this.sessionId = sessionId; 24 | } 25 | 26 | 27 | protected String getSessionCookie() { 28 | return sessionCookie; 29 | } 30 | 31 | public void setSessionCookie(String sessionCookie) { 32 | this.sessionCookie = sessionCookie; 33 | } 34 | 35 | 36 | protected List getInitialPlayers() { 37 | return initialPlayers; 38 | } 39 | 40 | public void setInitialPlayers(List initialPlayers) { 41 | this.initialPlayers = initialPlayers; 42 | } 43 | 44 | protected Map ToMapAllStrings() 45 | { 46 | HashMap properties = new HashMap(); 47 | properties.put(GameserverSDK.SESSION_ID_KEY, this.getSessionId().toString()); 48 | properties.put(GameserverSDK.SESSION_COOKIE_KEY, this.getSessionCookie()); 49 | return properties; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /UnrealPlugin/Source/PlayFabGSDK/Public/GameServerConnectionInfo.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "GameServerConnectionInfo.generated.h" 8 | 9 | 10 | USTRUCT(BlueprintType) 11 | struct FGamePort 12 | { 13 | GENERATED_BODY() 14 | public: 15 | /// 16 | /// The friendly name / identifier for the port, specified by the game developer in the Build configuration. 17 | /// 18 | UPROPERTY(BlueprintReadOnly) 19 | FString Name; 20 | 21 | /// 22 | /// The port at which the game server should listen on (maps externally to ). 23 | /// For process based servers, this is determined by Control Plane, based on the ports available on the VM. 24 | /// For containers, this is specified by the game developer in the Build configuration. 25 | /// 26 | UPROPERTY(BlueprintReadOnly) 27 | int32 ServerListeningPort = 0; 28 | 29 | /// 30 | /// The public port to which clients should connect (maps internally to ). 31 | /// 32 | UPROPERTY(BlueprintReadOnly) 33 | int32 ClientConnectionPort = 0; 34 | }; 35 | 36 | USTRUCT(BlueprintType) 37 | struct FGameServerConnectionInfo 38 | { 39 | GENERATED_BODY() 40 | public: 41 | UPROPERTY(BlueprintReadOnly) 42 | FString PublicIpV4Address; 43 | 44 | UPROPERTY(BlueprintReadOnly) 45 | TArray GamePortsConfiguration; 46 | }; 47 | -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Plugins/PlayFabGSDK/Source/PlayFabGSDK/Public/GameServerConnectionInfo.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) Microsoft Corporation. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "GameServerConnectionInfo.generated.h" 8 | 9 | 10 | USTRUCT(BlueprintType) 11 | struct FGamePort 12 | { 13 | GENERATED_BODY() 14 | public: 15 | /// 16 | /// The friendly name / identifier for the port, specified by the game developer in the Build configuration. 17 | /// 18 | UPROPERTY(BlueprintReadOnly) 19 | FString Name; 20 | 21 | /// 22 | /// The port at which the game server should listen on (maps externally to ). 23 | /// For process based servers, this is determined by Control Plane, based on the ports available on the VM. 24 | /// For containers, this is specified by the game developer in the Build configuration. 25 | /// 26 | UPROPERTY(BlueprintReadOnly) 27 | int32 ServerListeningPort = 0; 28 | 29 | /// 30 | /// The public port to which clients should connect (maps internally to ). 31 | /// 32 | UPROPERTY(BlueprintReadOnly) 33 | int32 ClientConnectionPort = 0; 34 | }; 35 | 36 | USTRUCT(BlueprintType) 37 | struct FGameServerConnectionInfo 38 | { 39 | GENERATED_BODY() 40 | public: 41 | UPROPERTY(BlueprintReadOnly) 42 | FString PublicIpV4Address; 43 | 44 | UPROPERTY(BlueprintReadOnly) 45 | TArray GamePortsConfiguration; 46 | }; 47 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread(void *, size_t, size_t, FILE *); 28 | size_t fwrite(const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread(void *, size_t, size_t, FILE *); 28 | size_t fwrite(const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 14 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0.1 19 | m_ClothInterCollisionStiffness: 0.2 20 | m_ContactsGeneration: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | m_SimulationMode: 0 23 | m_AutoSyncTransforms: 0 24 | m_ReuseCollisionCallbacks: 0 25 | m_InvokeCollisionCallbacks: 1 26 | m_ClothInterCollisionSettingsToggle: 0 27 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 28 | m_ContactPairsMode: 0 29 | m_BroadphaseType: 0 30 | m_WorldBounds: 31 | m_Center: {x: 0, y: 0, z: 0} 32 | m_Extent: {x: 250, y: 250, z: 250} 33 | m_WorldSubdivisions: 8 34 | m_FrictionType: 0 35 | m_EnableEnhancedDeterminism: 0 36 | m_EnableUnifiedHeightmaps: 1 37 | m_ImprovedPatchFriction: 0 38 | m_SolverType: 0 39 | m_DefaultMaxAngularSpeed: 50 40 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/GameServerConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class GameServerConnectionInfo 6 | { 7 | public GameServerConnectionInfo() 8 | { 9 | } 10 | 11 | public string PublicIpV4Adress { get; set; } 12 | 13 | public IEnumerable GamePortsConfiguration { get; set; } 14 | } 15 | 16 | /// 17 | /// A class that captures details about a game server port. 18 | /// 19 | public class GamePort 20 | { 21 | public GamePort() 22 | { 23 | } 24 | 25 | /// 26 | /// The friendly name / identifier for the port, specified by the game developer in the Build configuration. 27 | /// 28 | public string Name { get; set; } 29 | 30 | /// 31 | /// The port at which the game server should listen on (maps externally to ). 32 | /// For process based servers, this is determined by Control Plane, based on the ports available on the VM. 33 | /// For containers, this is specified by the game developer in the Build configuration. 34 | /// 35 | public int ServerListeningPort { get; set; } 36 | 37 | /// 38 | /// The public port to which clients should connect (maps internally to ). 39 | /// 40 | public int ClientConnectionPort { get; set; } 41 | } 42 | } -------------------------------------------------------------------------------- /UnityGsdk/UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | trackSelection = true 2 | refreshSearchWindowsInPlayMode = false 3 | fetchPreview = true 4 | defaultFlags = 0 5 | keepOpen = false 6 | queryFolder = "Assets" 7 | onBoardingDoNotAskAgain = true 8 | showPackageIndexes = false 9 | showStatusBar = false 10 | scopes = { 11 | } 12 | providers = { 13 | packages = { 14 | active = true 15 | priority = 90 16 | defaultAction = null 17 | } 18 | adb = { 19 | active = false 20 | priority = 2500 21 | defaultAction = null 22 | } 23 | asset = { 24 | active = true 25 | priority = 25 26 | defaultAction = null 27 | } 28 | find = { 29 | active = true 30 | priority = 25 31 | defaultAction = null 32 | } 33 | log = { 34 | active = false 35 | priority = 210 36 | defaultAction = null 37 | } 38 | profilermarkers = { 39 | active = false 40 | priority = 100 41 | defaultAction = null 42 | } 43 | performance = { 44 | active = false 45 | priority = 100 46 | defaultAction = null 47 | } 48 | store = { 49 | active = true 50 | priority = 100 51 | defaultAction = null 52 | } 53 | scene = { 54 | active = true 55 | priority = 50 56 | defaultAction = null 57 | } 58 | } 59 | objectSelectors = { 60 | } 61 | recentSearches = [ 62 | ] 63 | searchItemFavorites = [ 64 | ] 65 | savedSearchesSortOrder = 0 66 | showSavedSearchPanel = false 67 | hideTabs = false 68 | expandedQueries = [ 69 | ] 70 | queryBuilder = false 71 | ignoredProperties = "id;name;classname;imagecontentshash" 72 | helperWidgetCurrentArea = "all" 73 | disabledIndexers = "" 74 | minIndexVariations = 2 75 | findProviderIndexHelper = true -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/MaintenanceSchedule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using PlayFab.MultiplayerAgent.Helpers; 4 | 5 | namespace PlayFab.MultiplayerAgent.Model 6 | { 7 | [Serializable] 8 | public class MaintenanceSchedule 9 | { 10 | [JsonProperty(PropertyName = "documentIncarnation")] 11 | public string DocumentIncarnation { get; set; } 12 | 13 | public List Events { get; set; } 14 | } 15 | 16 | [Serializable] 17 | public class MaintenanceEvent 18 | { 19 | [JsonProperty(PropertyName = "eventId")] 20 | public string EventId { get; set; } 21 | 22 | [JsonProperty(PropertyName = "eventType")] 23 | public string EventType { get; set; } 24 | 25 | [JsonProperty(PropertyName = "resourceType")] 26 | public string ResourceType { get; set; } 27 | 28 | public List Resources { get; set; } 29 | 30 | [JsonProperty(PropertyName = "eventStatus")] 31 | public string EventStatus { get; set; } 32 | 33 | [JsonProperty(PropertyName = "notBefore")] 34 | public DateTime? NotBefore { get; set; } 35 | 36 | [JsonProperty(PropertyName = "description")] 37 | public string Description { get; set; } 38 | 39 | [JsonProperty(PropertyName = "eventSource")] 40 | public string EventSource { get; set; } 41 | 42 | [JsonProperty(PropertyName = "durationInSeconds")] 43 | public int DurationInSeconds { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /java/gameserverSDK/src/main/java/com/microsoft/azure/gaming/MaintenanceEvent.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming; 2 | 3 | import java.time.ZonedDateTime; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | import java.util.UUID; 8 | import com.google.gson.annotations.SerializedName; 9 | 10 | public class MaintenanceEvent { 11 | 12 | private String eventId; 13 | 14 | private String eventType; 15 | 16 | private String resourceType; 17 | 18 | @SerializedName(value = "Resources") 19 | private List resources; 20 | 21 | private String eventStatus; 22 | 23 | private ZonedDateTime notBefore; 24 | 25 | private String description; 26 | 27 | private String eventSource; 28 | 29 | private int durationInSeconds; 30 | 31 | public String getEventId() { 32 | return eventId; 33 | } 34 | 35 | public String getEventType() { 36 | return eventType; 37 | } 38 | 39 | public String getResourceType() { 40 | return resourceType; 41 | } 42 | 43 | public List getResources() { 44 | return resources; 45 | } 46 | 47 | public String getEventStatus() { 48 | return eventStatus; 49 | } 50 | 51 | public ZonedDateTime getNotBefore() { 52 | return notBefore; 53 | } 54 | 55 | public String getDescription() { 56 | return description; 57 | } 58 | 59 | public String getEventSource() { 60 | return eventSource; 61 | } 62 | 63 | public int getDurationInSeconds() { 64 | return durationInSeconds; 65 | } 66 | } -------------------------------------------------------------------------------- /cpp/unittests/GSDK_CPP_UnitTests.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /UnityGsdk/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* 73 | 74 | !/[Pp]ackages/ -------------------------------------------------------------------------------- /cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(GSDK_CPP) 3 | 4 | # if no build type specified, default to Debug 5 | if(NOT CMAKE_BUILD_TYPE) 6 | set(CMAKE_BUILD_TYPE Debug) 7 | endif() 8 | 9 | # if we're building for Windows, use the included CURL lib 10 | if(WIN32) 11 | # TODO: handle something that isn't Debug/Release when pathing this out 12 | set(CURL_LIBRARY "dependencies/libcurl-vc15-x64-${CMAKE_BUILD_TYPE}-dll-ssl-dll-ipv6-sspi/lib/") 13 | set(CURL_INCLUDE_DIR "dependencies/libcurl-vc15-x64-${CMAKE_BUILD_TYPE}-dll-ssl-dll-ipv6-sspi/include/") 14 | endif() 15 | 16 | # if we're Windows, the above handles the requirement 17 | # if we're Linux, install libcurl via package manager or vcpkg 18 | find_package(CURL REQUIRED) 19 | 20 | add_library(GSDK_CPP 21 | "cppsdk/gsdk.cpp" 22 | "cppsdk/gsdkConfig.cpp" 23 | "cppsdk/gsdkLog.cpp" 24 | "cppsdk/gsdkUtils.cpp" 25 | "cppsdk/jsoncpp.cpp" 26 | "cppsdk/ManualResetEvent.cpp" 27 | ) 28 | 29 | target_include_directories(GSDK_CPP PRIVATE 30 | cppsdk 31 | cppsdk/include) 32 | 33 | set_target_properties(GSDK_CPP PROPERTIES CXX_STANDARD 14) 34 | 35 | # set output names and other flags 36 | if(UNIX) 37 | set_target_properties(GSDK_CPP PROPERTIES OUTPUT_NAME "GSDK_CPP_Linux") 38 | target_compile_options(GSDK_CPP PRIVATE -DGSDK_LINUX) 39 | elseif(WIN32) 40 | set_target_properties(GSDK_CPP PROPERTIES OUTPUT_NAME "GSDK_CPP_Windows") 41 | target_include_directories(GSDK_CPP PRIVATE "dependencies/libcurl-vc15-x64-${CMAKE_BUILD_TYPE}-dll-ssl-dll-ipv6-sspi/include/") 42 | target_compile_options(GSDK_CPP PRIVATE -DGSDK_WINDOWS) 43 | endif() 44 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/TestServerInstance.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using PlayFab; 3 | using PlayFab.MultiplayerAgent.Model; 4 | 5 | public class TestServerInstance : MonoBehaviour 6 | { 7 | private void Awake() 8 | { 9 | Debug.LogWarning("TestServerInstance.Awake() called"); 10 | PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnShutdown; 11 | PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; 12 | PlayFabMultiplayerAgentAPI.OnMaintenanceV2Callback += OnMaintenanceV2; 13 | 14 | PlayFabMultiplayerAgentAPI.Start(); 15 | } 16 | 17 | private void Start() 18 | { 19 | Debug.LogWarning("TestServerInstance.Start() called"); 20 | PlayFabMultiplayerAgentAPI.ReadyForPlayers(); 21 | } 22 | 23 | private void OnShutdown() 24 | { 25 | Debug.LogWarning("TestServerInstance.OnShutdown() called - exiting"); 26 | Application.Quit(); 27 | } 28 | 29 | // Unused in this sdk right now 30 | private bool OnHealthCheck() 31 | { 32 | Debug.LogWarning("TestServerInstance.OnHealthCheck() called - returning healthy"); 33 | return true; 34 | } 35 | 36 | private void OnServerActive() 37 | { 38 | Debug.LogWarning("TestServerInstance.OnServerActive() called"); 39 | } 40 | 41 | private void OnMaintenanceV2(MaintenanceSchedule schedule) 42 | { 43 | Debug.LogWarning($"TestServerInstance.OnMaintenanceV2() called with {schedule.Events[0].EventType}, {schedule.Events[0].EventStatus}, {schedule.Events[0].EventSource}, " + 44 | $"{schedule.Events[0].Resources[0]}, {schedule.Events[0].NotBefore}"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 2 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;java;cpp;c;mm;m;h 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 0 28 | m_EnterPlayModeOptions: 3 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_AssetPipelineMode: 1 37 | m_RefreshImportMode: 0 38 | m_CacheServerMode: 0 39 | m_CacheServerEndpoint: 40 | m_CacheServerNamespacePrefix: default 41 | m_CacheServerEnableDownload: 1 42 | m_CacheServerEnableUpload: 1 43 | m_CacheServerEnableAuth: 0 44 | m_CacheServerEnableTls: 0 45 | m_CacheServerValidationMode: 2 46 | m_CacheServerDownloadBatchSize: 128 47 | m_EnableEnlightenBakedGI: 0 48 | -------------------------------------------------------------------------------- /experimental/go/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 5 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 6 | github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= 7 | github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 8 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 9 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 10 | github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 11 | github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 12 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 13 | golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= 14 | golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 15 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 16 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 17 | gopkg.in/yaml.v3 v3.0.0-20220521103104-8f96da9f5d5e/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 18 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 19 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 20 | -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 3 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | buildHeightMesh: 0 88 | maxJobWorkers: 0 89 | preserveTilesOutsideBounds: 0 90 | debug: 91 | m_Flags: 0 92 | m_SettingNames: 93 | - Humanoid 94 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/FilesystemLogger.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | using System; 4 | using System.IO; 5 | 6 | public class FileSystemLogger : ILogger 7 | { 8 | private string _logFolder; 9 | private StreamWriter _logWriter; 10 | 11 | public FileSystemLogger(string logFolder) 12 | { 13 | _logFolder = logFolder; 14 | } 15 | 16 | public void Log(string message) 17 | { 18 | if (_logWriter == null) 19 | { 20 | return; // Logging is disabled 21 | } 22 | 23 | _logWriter.WriteLine($"{DateTime.UtcNow:o}\t{message}"); 24 | _logWriter.Flush(); 25 | } 26 | 27 | public void Start() 28 | { 29 | if (_logWriter != null) 30 | { 31 | return; 32 | } 33 | 34 | string currentDirectory = Directory.GetCurrentDirectory(); 35 | if (string.IsNullOrWhiteSpace(_logFolder)) 36 | { 37 | _logFolder = currentDirectory; 38 | } 39 | 40 | try 41 | { 42 | if (!Directory.Exists(_logFolder)) 43 | { 44 | Directory.CreateDirectory(_logFolder); 45 | } 46 | } 47 | catch (Exception ex) 48 | { 49 | _logFolder = currentDirectory; 50 | throw ex; 51 | } 52 | 53 | long datePart = DateTime.UtcNow.ToFileTime(); 54 | string fileName = Path.Combine(_logFolder, $"GSDK_output_{datePart}.txt"); 55 | FileStream fileStream = File.Open(fileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read); 56 | _logWriter = new StreamWriter(fileStream); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 6 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_GizmoOptions: 10 48 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PlayFab Game Server SDK 2 | [![C++](https://img.shields.io/nuget/v/com.playfab.cppgsdk.v140?style=flat-square&label=C%2B%2B)](https://www.nuget.org/packages/com.playfab.cppgsdk.v140) 3 | [![C#](https://img.shields.io/nuget/v/com.playfab.csharpgsdk?style=flat-square&label=C%23)](https://www.nuget.org/packages/com.playfab.csharpgsdk) 4 | [![Java](https://img.shields.io/maven-central/v/com.playfab/gameserverSDK?style=flat-square&label=Java)](https://mvnrepository.com/artifact/com.playfab/gameserverSDK) 5 | 6 | ## Overview 7 | 8 | PlayFab Game Server SDK for C#, C++, and Java environments. The GSDK is used to integrate with PlayFab Multiplayer Servers and modify the game server lifecycle (check [here](https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/multiplayer-game-server-lifecycle) for more info). 9 | 10 | ## Prerequisites 11 | 12 | [getting started guide](https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/integrating-game-servers-with-gsdk) 13 | 14 | ## Samples 15 | 16 | Check the [gsdkSamples](https://github.com/PlayFab/gsdkSamples) repo. 17 | 18 | ## Contact Us 19 | 20 | We love to hear from our developer community! 21 | Do you have ideas on how we can make our products and services better? 22 | 23 | Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services. 24 | 25 | [Forums, Support and Knowledge Base](https://community.playfab.com/index.html) 26 | 27 | ## Contributing 28 | 29 | We are more than happy to accept external contributions! If you want to propose a small code change, feel free to open a Pull Request directly. If you plan to do a bigger change, it would be better if you open an issue describing your proposed design in order to get feedback from project maintainers. 30 | 31 | ## Release Notes 32 | 33 | Please navigate into the respective language folders. 34 | 35 | ## Copyright and Licensing Information 36 | 37 | Apache License -- 38 | Version 2.0, January 2004 39 | http://www.apache.org/licenses/ 40 | 41 | Full details available within the LICENSE file. 42 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkUtils.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef GSDK_WINDOWS 17 | #include "windows.h" 18 | #define CURL_GLOBAL_GSDK_INIT_FLAGS CURL_GLOBAL_WIN32 19 | #endif 20 | 21 | #ifdef GSDK_LINUX 22 | typedef unsigned int HRESULT; 23 | #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) 24 | #define FAILED(hr) (((HRESULT)(hr)) < 0) 25 | #define S_OK ((HRESULT)0L) 26 | #define CURL_GLOBAL_GSDK_INIT_FLAGS CURL_GLOBAL_NOTHING 27 | #endif 28 | 29 | #define WIDE2(x) L##x 30 | #define WIDECHAR(x) WIDE2(x) 31 | #ifndef __WFUNCTION__ 32 | #define __WFUNCTION__ WIDECHAR(__func__) 33 | #endif 34 | 35 | inline std::string WSTR2STR(const std::wstring &wstr) { return std::string(wstr.begin(), wstr.end()); } 36 | inline std::string WCHAR2STR(const wchar_t *wcharPtr) { std::wstring wstr(wcharPtr); return std::string(wstr.begin(), wstr.end()); } 37 | inline std::wstring STR2WSTR(const std::string &str) { return std::wstring(str.begin(), str.end()); } 38 | inline std::wstring CHAR2WSTR(const char *charPtr) { std::string str(charPtr); return std::wstring(str.begin(), str.end()); } 39 | #define WSTR2CHAR( wstr ) WSTR2STR( wstr ).c_str() 40 | #define WSTR2WCHAR( wstr ) wstr.c_str() 41 | #define WCHAR2CHAR( wcharPtr ) WCHAR2STR( wcharPtr ).c_str() 42 | #define STR2CHAR( str ) str.c_str() 43 | #define STR2WCHAR( str ) STR2WSTR( str ).c_str() 44 | #define CHAR2WCHAR( charPtr ) CHAR2WSTR( charPtr ).c_str() 45 | 46 | namespace Microsoft 47 | { 48 | namespace Azure 49 | { 50 | namespace Gaming 51 | { 52 | 53 | class cGSDKUtils 54 | { 55 | public: 56 | static std::string getEnvironmentVariable(const char *environmentVariableName); 57 | static std::wstring getEnvironmentVariableW(const wchar_t *environmentVariableName); 58 | static bool createDirectoryIfNotExists(std::string path); 59 | static time_t tm2timet_utc(struct tm *tm); 60 | }; 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /cpp/cppsdk/include/playfab/PlayFabMatchmakerApi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef ENABLE_PLAYFABSERVER_API 4 | 5 | #include 6 | #include 7 | 8 | namespace PlayFab 9 | { 10 | /// 11 | /// Main interface for PlayFab Sdk, specifically all Matchmaker APIs 12 | /// 13 | class PlayFabMatchmakerAPI 14 | { 15 | public: 16 | static size_t Update(); 17 | static void ForgetAllCredentials(); 18 | 19 | 20 | // ------------ Generated API calls 21 | static void AuthUser(MatchmakerModels::AuthUserRequest& request, ProcessApiCallback callback, ErrorCallback errorCallback = nullptr, void* customData = nullptr); 22 | static void PlayerJoined(MatchmakerModels::PlayerJoinedRequest& request, ProcessApiCallback callback, ErrorCallback errorCallback = nullptr, void* customData = nullptr); 23 | static void PlayerLeft(MatchmakerModels::PlayerLeftRequest& request, ProcessApiCallback callback, ErrorCallback errorCallback = nullptr, void* customData = nullptr); 24 | static void StartGame(MatchmakerModels::StartGameRequest& request, ProcessApiCallback callback, ErrorCallback errorCallback = nullptr, void* customData = nullptr); 25 | static void UserInfo(MatchmakerModels::UserInfoRequest& request, ProcessApiCallback callback, ErrorCallback errorCallback = nullptr, void* customData = nullptr); 26 | 27 | private: 28 | PlayFabMatchmakerAPI(); // Private constructor, static class should never have an instance 29 | PlayFabMatchmakerAPI(const PlayFabMatchmakerAPI& other); // Private copy-constructor, static class should never have an instance 30 | 31 | // ------------ Generated result handlers 32 | static void OnAuthUserResult(CallRequestContainer& request); 33 | static void OnPlayerJoinedResult(CallRequestContainer& request); 34 | static void OnPlayerLeftResult(CallRequestContainer& request); 35 | static void OnStartGameResult(CallRequestContainer& request); 36 | static void OnUserInfoResult(CallRequestContainer& request); 37 | 38 | }; 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_MPRINTF_H 2 | #define __CURL_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | #include /* needed for FILE */ 27 | #include "curl.h" /* for CURL_EXTERN */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | CURL_EXTERN int curl_mprintf(const char *format, ...); 34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 37 | const char *format, ...); 38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 42 | const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __CURL_MPRINTF_H */ 51 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_MPRINTF_H 2 | #define __CURL_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | #include /* needed for FILE */ 27 | #include "curl.h" /* for CURL_EXTERN */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | CURL_EXTERN int curl_mprintf(const char *format, ...); 34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 37 | const char *format, ...); 38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 42 | const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __CURL_MPRINTF_H */ 51 | -------------------------------------------------------------------------------- /upgradeguide200219.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Upgrade guide for 0.7.190918 -> 0.7.200220 3 | author: gufabre 4 | description: Description of breaking changes of new cpp nuget release. 5 | ms.author: gufabre 6 | ms.date: 02/19/2020 7 | ms.topic: article 8 | ms.prod: playfab 9 | keywords: playfab, development, release, apis, features 10 | ms.localizationpriority: medium 11 | --- 12 | 13 | # Upgrade guide for 0.7.190918 -> 0.7.200220 14 | 15 | The 0.7.200220 release of the GSDK for C++ contains breaking changes. The primary change in this update is provide thread safety. Previous implementations allowed a thread to alter a dictionary while another thread read it which caused errors and raised exceptions. This topic provides detailed instructions on the steps you must take to update your code when you update to current release. 16 | 17 | The PR contains a detailed explanation of the changes: [c++ change for thread safety #43](https://github.com/PlayFab/gsdk/pull/43/) 18 | 19 | Most customers are only affected by 3 very minor breaking changes in this release. Nearly all customers will need to change 1 or 2 lines of code, but very few customers might need to change more. The upgrade guide below cover all of the possible changes required for even the most obscure breaking changes. 20 | 21 | ## Upgrade instructions - Affects most/all customers 22 | 23 | 24 | The following methods have been updated to return an object instead of a reference: 25 | 1. `GSDK::getConfigSettings()` 26 | 2. `GSDK::getLogsDirectory()` 27 | 3. `GSDK::getSharedContentDirectory()` 28 | 29 | * You must update your code as follows to accept the returned object: 30 | 31 | `GSDK::getConfigSettings()` 32 | * Old: ```const std::unordered_map& config = GSDK::getConfigSettings();``` 33 | * New: ```const std::unordered_map config = GSDK::getConfigSettings();``` 34 | 35 | `GSDK::getLogsDirectory()` 36 | * Old: ```const std::string& logsDirectory = GSDK::getLogsDirectory();``` 37 | * New: ```const std::string logsDirectory = GSDK::getLogsDirectory();``` 38 | 39 | `GSDK::getSharedContentDirectory()` 40 | * Old: ```const std::string& sharedContentDirectory = GSDK::getSharedContentDirectory();``` 41 | * New: ```const std::string sharedContentDirectory = GSDK::getSharedContentDirectory();``` 42 | 43 | We apologize that while trivial, these changes were necessary in order to ensure thread safety. 44 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/GSDK_CSharp_Standard.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PlayFab C# Gameserver SDK 5 | Microsoft 6 | © Microsoft Corporation. All rights reserved. 7 | SDK for making calls against PlayFab Multiplayer Servers Control Plane 8 | Microsoft 9 | 0.0.0.0 10 | $(Version) 11 | GSDK Playfab Multiplayer Servers 12 | https://learn.microsoft.com/gaming/playfab/features/multiplayer/servers/ 13 | Enables PlayFab game servers to interact with PlayFab control systems, accept players and send heartbeats. 14 | Release of the C# Game Server SDK for use with PlayFab Multiplayer Servers. 15 | playfab-mark.png 16 | com.playfab.csharpgsdk 17 | AnyCPU;x64 18 | 19 | 20 | 21 | netstandard2.0 22 | 23 | 24 | Microsoft.Playfab.Gaming.GSDK.CSharp 25 | Microsoft.Playfab.Gaming.GSDK.CSharp 26 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 27 | true 28 | 29 | 30 | Microsoft.Playfab.Gaming.GSDK.CSharp.xml 31 | Apache-2.0 32 | https://github.com/PlayFab/gsdk 33 | git 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | True 42 | \ 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GameServerConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using Helpers; 6 | 7 | /// 8 | /// A class that captures details on how a game server operates. 9 | /// 10 | public class GameServerConnectionInfo 11 | { 12 | public GameServerConnectionInfo() 13 | { 14 | } 15 | 16 | /// 17 | /// The IPv4 address of the game server. 18 | /// 19 | [JsonProperty(PropertyName = "publicIpV4Address")] 20 | public string PublicIPv4Address { get; set; } 21 | 22 | 23 | [Obsolete("Please use PublicIPv4Address instead.")] 24 | [JsonProperty(PropertyName = "publicIpV4Adress")] 25 | public string PublicIpV4Adress { get => PublicIPv4Address; set { if (!string.IsNullOrWhiteSpace(value) && PublicIPv4Address != value) { PublicIPv4Address = value; } } } 26 | 27 | /// 28 | /// The ports configured for the game server. 29 | /// 30 | [JsonProperty(PropertyName = "gamePortsConfiguration")] 31 | public IEnumerable GamePortsConfiguration { get; set; } 32 | } 33 | 34 | /// 35 | /// A class that captures details about a game server port. 36 | /// 37 | public class GamePort 38 | { 39 | public GamePort() 40 | { 41 | } 42 | 43 | /// 44 | /// The friendly name / identifier for the port, specified by the game developer in the Build configuration. 45 | /// 46 | [JsonProperty(PropertyName = "name")] 47 | public string Name { get; set; } 48 | 49 | /// 50 | /// The port at which the game server should listen on (maps externally to ). 51 | /// For process based servers, this is determined by Control Plane, based on the ports available on the VM. 52 | /// For containers, this is specified by the game developer in the Build configuration. 53 | /// 54 | [JsonProperty(PropertyName = "serverListeningPort")] 55 | public int ServerListeningPort { get; set; } 56 | 57 | /// 58 | /// The public port to which clients should connect (maps internally to ). 59 | /// 60 | [JsonProperty(PropertyName = "clientConnectionPort")] 61 | public int ClientConnectionPort { get; set; } 62 | } 63 | } -------------------------------------------------------------------------------- /cpp/cppsdk/source/playfab/PlayFabSettings.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | namespace PlayFab 6 | { 7 | const std::string PlayFabSettings::sdkVersion = "2.0.180420"; 8 | const std::string PlayFabSettings::buildIdentifier = "xplatcppsdk_manual"; 9 | const std::string PlayFabSettings::versionString = "XPlatCppSdk-2.0.180420"; 10 | 11 | bool PlayFabSettings::useDevelopmentEnvironment = false; 12 | std::string PlayFabSettings::serverURL; 13 | std::string PlayFabSettings::developmentEnvironmentURL = ".playfabsandbox.com"; 14 | std::string PlayFabSettings::productionEnvironmentURL = ".playfabapi.com"; 15 | std::string PlayFabSettings::titleId; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 16 | ErrorCallback PlayFabSettings::globalErrorHandler = nullptr; 17 | 18 | // Control whether all callbacks are threaded or whether the user manually controlls callback timing from their main-thread 19 | bool PlayFabSettings::threadedCallbacks = false; 20 | 21 | std::string PlayFabSettings::entityToken; // This is set by entity GetEntityToken method, and is required by all other Entity API methods 22 | #if defined(ENABLE_PLAYFABSERVER_API) || defined(ENABLE_PLAYFABADMIN_API) 23 | std::string PlayFabSettings::developerSecretKey; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 24 | #endif 25 | 26 | #ifndef DISABLE_PLAYFABCLIENT_API 27 | std::string PlayFabSettings::clientSessionTicket; // This is set by any Client Login method, and is required for all other Client API methods 28 | std::string PlayFabSettings::advertisingIdType = ""; // Set this to the appropriate AD_TYPE_X constant below 29 | std::string PlayFabSettings::advertisingIdValue = ""; // Set this to corresponding device value 30 | 31 | bool PlayFabSettings::disableAdvertising = false; 32 | const std::string PlayFabSettings::AD_TYPE_IDFA = "Idfa"; 33 | const std::string PlayFabSettings::AD_TYPE_ANDROID_ID = "Adid"; 34 | #endif 35 | 36 | void PlayFabSettings::ForgetAllCredentials() 37 | { 38 | entityToken.clear(); 39 | clientSessionTicket.clear(); 40 | } 41 | 42 | std::string PlayFabSettings::GetUrl(const std::string& urlPath) 43 | { 44 | if (serverURL.length() == 0) 45 | serverURL = "https://" + titleId + (useDevelopmentEnvironment ? developmentEnvironmentURL : productionEnvironmentURL); 46 | return serverURL + urlPath; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/Model/GSDKConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using Newtonsoft.Json; 6 | 7 | internal class GSDKConfiguration 8 | { 9 | private const string TITLE_ID_ENV_VAR = "PF_TITLE_ID"; 10 | private const string BUILD_ID_ENV_VAR = "PF_BUILD_ID"; 11 | private const string REGION_ENV_VAR = "PF_REGION"; 12 | 13 | public GSDKConfiguration() 14 | { 15 | GameCertificates = new Dictionary(); 16 | BuildMetadata = new Dictionary(); 17 | GamePorts = new Dictionary(); 18 | } 19 | 20 | public string TitleId => Environment.GetEnvironmentVariable(TITLE_ID_ENV_VAR); 21 | public string BuildId => Environment.GetEnvironmentVariable(BUILD_ID_ENV_VAR); 22 | public string Region => Environment.GetEnvironmentVariable(REGION_ENV_VAR); 23 | 24 | [JsonProperty(PropertyName = "heartbeatEndpoint", Required = Required.Always)] 25 | public string HeartbeatEndpoint { get; set; } 26 | 27 | [JsonProperty(PropertyName = "sessionHostId", Required = Required.Always)] 28 | public string SessionHostId { get; set; } 29 | 30 | [JsonProperty(PropertyName = "vmId")] 31 | public string VmId { get; set; } 32 | 33 | [JsonProperty(PropertyName = "logFolder")] 34 | public string LogFolder { get; set; } 35 | 36 | [JsonProperty(PropertyName = "sharedContentFolder")] 37 | public string SharedContentFolder { get; set; } 38 | 39 | [JsonProperty(PropertyName = "certificateFolder")] 40 | public string CertificateFolder { get; set; } 41 | 42 | [JsonProperty(PropertyName = "gameCertificates")] 43 | public IDictionary GameCertificates { get; set; } 44 | 45 | [JsonProperty(PropertyName = "buildMetadata")] 46 | public IDictionary BuildMetadata { get; set; } 47 | 48 | [JsonProperty(PropertyName = "gamePorts")] 49 | public IDictionary GamePorts { get; set; } 50 | 51 | [JsonProperty(PropertyName = "publicIpV4Address")] 52 | public string PublicIpV4Address { get; set; } 53 | 54 | [JsonProperty(PropertyName = "fullyQualifiedDomainName")] 55 | public string FullyQualifiedDomainName { get; set; } 56 | 57 | [JsonProperty(PropertyName = "gameServerConnectionInfo")] 58 | public GameServerConnectionInfo GameServerConnectionInfo { get; set; } 59 | } 60 | } -------------------------------------------------------------------------------- /csharp/GSDK_CSharp_Standard/HttpClientWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp 2 | { 3 | using System; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Model; 8 | using Newtonsoft.Json; 9 | 10 | internal interface IHttpClient 11 | { 12 | Task SendHeartbeatAsync(HeartbeatRequest request); 13 | Task SendInfoAsync(string url); 14 | } 15 | 16 | internal class HttpClientWrapper : IHttpClient 17 | { 18 | private readonly string _baseUrl; 19 | private readonly HttpClient _client; 20 | 21 | public HttpClientWrapper(string baseUrl) 22 | { 23 | _baseUrl = baseUrl; 24 | _client = new HttpClient(); 25 | 26 | _client.DefaultRequestHeaders.Clear(); 27 | _client.DefaultRequestHeaders.Add("Accept", "application/json"); 28 | _client.DefaultRequestHeaders.Add("User-Agent", "Microsoft PlayFab Game SDK"); 29 | } 30 | 31 | public async Task SendHeartbeatAsync(HeartbeatRequest request) 32 | { 33 | string formattedText = JsonConvert.SerializeObject(request, Formatting.Indented); 34 | HttpRequestMessage requestMessage = new HttpRequestMessage 35 | { 36 | Method = new HttpMethod("PATCH"), 37 | RequestUri = new Uri(_baseUrl), 38 | Content = new StringContent(formattedText, Encoding.UTF8, "application/json") 39 | }; 40 | 41 | HttpResponseMessage responseMessage = await _client.SendAsync(requestMessage); 42 | 43 | responseMessage.EnsureSuccessStatusCode(); 44 | 45 | HeartbeatResponse response = JsonConvert.DeserializeObject( 46 | await responseMessage.Content.ReadAsStringAsync()); 47 | 48 | return response; 49 | } 50 | 51 | public async Task SendInfoAsync(string url) 52 | { 53 | string formattedText = JsonConvert.SerializeObject(new GSDKInfo(), Formatting.Indented); 54 | HttpRequestMessage requestMessage = new HttpRequestMessage 55 | { 56 | Method = new HttpMethod("POST"), 57 | RequestUri = new Uri(url), 58 | Content = new StringContent(formattedText, Encoding.UTF8, "application/json") 59 | }; 60 | 61 | HttpResponseMessage responseMessage = await _client.SendAsync(requestMessage); 62 | 63 | responseMessage.EnsureSuccessStatusCode(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /cpp/cppsdk/include/playfab/PlayFabSettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace PlayFab 6 | { 7 | /// 8 | /// All settings and global variables for PlayFab 9 | /// 10 | class PlayFabSettings 11 | { 12 | public: 13 | static const std::string sdkVersion; 14 | static const std::string buildIdentifier; 15 | static const std::string versionString; 16 | 17 | static bool useDevelopmentEnvironment; 18 | static std::string developmentEnvironmentURL; 19 | static std::string productionEnvironmentURL; 20 | static std::string titleId; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 21 | static ErrorCallback globalErrorHandler; 22 | 23 | // Control whether all callbacks are threaded or whether the user manually controlls callback timing from their main-thread 24 | static bool threadedCallbacks; 25 | 26 | static std::string entityToken; // This is set by entity GetEntityToken method, and is required by all other Entity API methods 27 | #if defined(ENABLE_PLAYFABSERVER_API) || defined(ENABLE_PLAYFABADMIN_API) 28 | static std::string developerSecretKey; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 29 | #endif 30 | #ifndef DISABLE_PLAYFABCLIENT_API 31 | static std::string clientSessionTicket; // This is set by any Client Login method, and is required for all other Client API methods 32 | static std::string advertisingIdType; // Set this to the appropriate AD_TYPE_X constant below 33 | static std::string advertisingIdValue; // Set this to corresponding device value 34 | 35 | // DisableAdvertising is provided for completeness, but changing it is not suggested 36 | // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly 37 | static bool disableAdvertising; 38 | static const std::string AD_TYPE_IDFA; 39 | static const std::string AD_TYPE_ANDROID_ID; 40 | 41 | static void ForgetAllCredentials(); 42 | #endif 43 | private: 44 | PlayFabSettings(); // Private constructor, static class should never have an instance 45 | PlayFabSettings(const PlayFabSettings& other); // Private copy-constructor, static class should never have an instance 46 | 47 | friend PlayFabHttp; 48 | static std::string GetUrl(const std::string& urlPath); 49 | 50 | static std::string serverURL; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /experimental/go/README.md: -------------------------------------------------------------------------------- 1 | # Go GSDK 2 | 3 | This is an implementation of the GSDK in Go programming language. It's considered experimental and is not yet ready for production use or supported. Expect bugs and breaking changes :) 4 | 5 | This version of GSDK is pretty similar to the existing ones, apart from the fact that it contains a "MarkAllocated" method which internally sets the game server to active. 6 | 7 | Things to remember: 8 | 9 | - ReadyForPlayers is blocking, it unblocks when the game server is Active. However, it can always be used in a goroutine 10 | - MarkAllocated works only when the game server is on StandingBy, so it should be called after "ReadyForPlayers" is called. For the time being, this method *should not* be used since it requires configuration settings on the Multiplayer Servers backend for each title. 11 | - RequestMultiplayerServer API must *not* be called on a Build that uses "MarkAllocated". It will probably work on the server side, but there is a small chance of concurrency issues if the two operations (RequestMultiplayerServer and MarkAllocated) happen at the same time. 12 | 13 | Here is a sample of calling GSDK: 14 | 15 | ```golang 16 | package main 17 | 18 | import ( 19 | "fmt" 20 | "time" 21 | 22 | gsdk "github.com/playfab/gsdk/experimental/go" 23 | ) 24 | 25 | func main() { 26 | gsdk.RegisterHealthCallback(func() bool { 27 | return true 28 | }) 29 | gsdk.RegisterShutdownCallback(func() { 30 | gsdk.LogMessage("Shutting down") 31 | }) 32 | gsdk.Start() 33 | doMarkAllocatedGSDK() 34 | } 35 | 36 | // doMarkAllocatedGSDK will start a goroutine which will call MarkAllocated after 5 minutes 37 | // this method is highly experimental and should NOT be used since it requires configuration settings on the Multiplayer Servers backend 38 | func doMarkAllocatedGSDK() { 39 | go func() { 40 | gsdk.LogMessage("Sleeping for 300 seconds") 41 | time.Sleep(time.Second * 300) 42 | gsdk.LogMessage("Marking allocated") 43 | if err := gsdk.MarkAllocated(); err != nil { 44 | gsdk.LogMessage(fmt.Sprintf("Error marking allocated: %v", err)) 45 | } 46 | }() 47 | gsdk.LogMessage("Before ReadyForPlayers") 48 | gsdk.ReadyForPlayers() 49 | gsdk.LogMessage("After ReadyForPlayers") 50 | time.Sleep(time.Second * 1200) 51 | gsdk.LogMessage("Exiting") 52 | } 53 | 54 | // doNormalGSDK is the "normal" way to call GSDK, with ReadyForPlayers blocking till the RequestMultiplayerServer API is called 55 | func doNormalGSDK() { 56 | gsdk.LogMessage("Before ReadyForPlayers") 57 | gsdk.ReadyForPlayers() 58 | gsdk.LogMessage("After ReadyForPlayers") 59 | time.Sleep(time.Second * 1200) 60 | gsdk.LogMessage("Exiting") 61 | 62 | } 63 | ``` 64 | -------------------------------------------------------------------------------- /UnrealPlugin/ThirdPersonMPSetup.md: -------------------------------------------------------------------------------- 1 | # ThirdPersonMP Example Project Setup 2 | 3 | This guide covers the construction of an example project which can operate as a game-client and dedicated game-server. This will set up the minimum requirements for an Unreal project, before the GSDK can be integrated. 4 | 5 | This guide is an excellent starting point if you are starting from scratch. 6 | 7 | ## Goals 8 | 9 | The project needs to have the following capabilities and features: 10 | 11 | * Networking 12 | * Multiplayer 13 | * Dedicated Game-Server 14 | 15 | To accomplish this, we will construct a project from scratch using Unreal tutorials. 16 | 17 | ## Requirements 18 | 19 | * Download Visual Studio. The [community version](https://visualstudio.microsoft.com/vs/community/) is free. 20 | * Required workloads: .NET desktop development and Desktop development with C++ 21 | * Download Unreal Engine Source Code. For instructions, see [Downloading Unreal Engine Source code (external)](https://docs.unrealengine.com/5.1/en-US/downloading-unreal-engine-source-code/). 22 | 23 | ## Instructions 24 | 25 | All of the necessary instructions are in the Unreal Tutorials. First, download Unreal Engine Source Build by following [these instructions](https://docs.unrealengine.com/4.26/ProgrammingAndScripting/ProgrammingWithCPP/DownloadingSourceCode/) from the Unreal Engine website. 26 | 27 | Next, you should follow the Unreal [Third Person Template](https://docs.unrealengine.com/4.27/Resources/Templates/ThirdPerson/) tutorial. This covers the creation of a basic project we will use for the rest of this document. 28 | 29 | Then, you should proceed to the Unreal [Multiplayer Programming Quick Start](https://docs.unrealengine.com/4.27/InteractiveExperiences/Networking/QuickStart/) tutorial. Note, the first step of this tutorial is an abbreviated version of the one above. This guide upgrades the ThirdPersonMP template to a multiplayer project. 30 | 31 | Once finished with the above guides, you will have a working multiplayer game client. Next, you need a dedicated server. At this point, you should proceed to the Unreal [Setting Up Dedicated Servers](https://docs.unrealengine.com/4.27/InteractiveExperiences/Networking/HowTo/DedicatedServers/) tutorial. This will set up a dedicated server for your project, and concludes our list of requirements. 32 | 33 | Once finished with all guides, you will have a network-enabled multiplayer project with a dedicated game server. 34 | 35 | ## Navigation 36 | 37 | You are now ready to [install the PlayFab Unreal GSDK](ThirdPersonMPGSDKSetup.md) into this project. 38 | 39 | Alternately, you can return to the main [Unreal GSDK Plugin](README.md#project-gsdk-setup) guide. 40 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/GsdkConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using Helpers; 6 | 7 | public class GSDKConfiguration 8 | { 9 | private const string TITLE_ID_ENV_VAR = "PF_TITLE_ID"; 10 | private const string BUILD_ID_ENV_VAR = "PF_BUILD_ID"; 11 | private const string REGION_ENV_VAR = "PF_REGION"; 12 | 13 | public GSDKConfiguration() 14 | { 15 | TitleId = Environment.GetEnvironmentVariable(TITLE_ID_ENV_VAR); 16 | BuildId = Environment.GetEnvironmentVariable(BUILD_ID_ENV_VAR); 17 | Region = Environment.GetEnvironmentVariable(REGION_ENV_VAR); 18 | GameCertificates = new Dictionary(); 19 | BuildMetadata = new Dictionary(); 20 | GamePorts = new Dictionary(); 21 | } 22 | 23 | public string TitleId { get; private set; } 24 | public string BuildId { get; private set; } 25 | public string Region { get; private set; } 26 | 27 | [JsonProperty(PropertyName = "heartbeatEndpoint")] 28 | public string HeartbeatEndpoint { get; set; } 29 | 30 | [JsonProperty(PropertyName = "sessionHostId")] 31 | public string SessionHostId { get; set; } 32 | 33 | [JsonProperty(PropertyName = "vmId")] 34 | public string VmId { get; set; } 35 | 36 | [JsonProperty(PropertyName = "logFolder")] 37 | public string LogFolder { get; set; } 38 | 39 | [JsonProperty(PropertyName = "sharedContentFolder")] 40 | public string SharedContentFolder { get; set; } 41 | 42 | [JsonProperty(PropertyName = "certificateFolder")] 43 | public string CertificateFolder { get; set; } 44 | 45 | [JsonProperty(PropertyName = "gameCertificates")] 46 | public IDictionary GameCertificates { get; set; } 47 | 48 | [JsonProperty(PropertyName = "buildMetadata")] 49 | public IDictionary BuildMetadata { get; set; } 50 | 51 | [JsonProperty(PropertyName = "gamePorts")] 52 | public IDictionary GamePorts { get; set; } 53 | 54 | [JsonProperty(PropertyName = "publicIpV4Address")] 55 | public string PublicIpV4Address { get; set; } 56 | 57 | [JsonProperty(PropertyName = "fullyQualifiedDomainName")] 58 | public string FullyQualifiedDomainName { get; set; } 59 | 60 | [JsonProperty(PropertyName = "gameServerConnectionInfo")] 61 | public GameServerConnectionInfo GameServerConnectionInfo { get; set; } 62 | } 63 | } -------------------------------------------------------------------------------- /UnityGsdk/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_DepthNormals: 17 | m_Mode: 1 18 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 19 | m_MotionVectors: 20 | m_Mode: 1 21 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 22 | m_LightHalo: 23 | m_Mode: 1 24 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LensFlare: 26 | m_Mode: 1 27 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 28 | m_VideoShadersIncludeMode: 2 29 | m_AlwaysIncludedShaders: 30 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 31 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 32 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 37 | m_PreloadedShaders: [] 38 | m_PreloadShadersBatchTimeLimit: -1 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 40 | m_CustomRenderPipeline: {fileID: 0} 41 | m_TransparencySortMode: 0 42 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 43 | m_DefaultRenderingPath: 1 44 | m_DefaultMobileRenderingPath: 1 45 | m_TierSettings: [] 46 | m_LightmapStripping: 0 47 | m_FogStripping: 0 48 | m_InstancingStripping: 0 49 | m_BrgStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_DefaultRenderingLayerMask: 1 63 | m_LogWhenShaderIsCompiled: 0 64 | m_SRPDefaultSettings: {} 65 | m_LightProbeOutsideHullStrategy: 1 66 | m_CameraRelativeLightCulling: 0 67 | m_CameraRelativeShadowCulling: 0 68 | -------------------------------------------------------------------------------- /cpp/cppsdk/gsdkUtils.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) Microsoft Corporation. All rights reserved. 3 | 4 | #include "gsdkCommonPch.h" 5 | #include "gsdkInternal.h" 6 | 7 | #ifdef GSDK_WINDOWS 8 | #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 9 | #include "experimental/filesystem" 10 | #include "process.h" 11 | #endif 12 | 13 | #ifdef GSDK_LINUX 14 | #include "sys/stat.h" 15 | #include "sys/types.h" 16 | #include "unistd.h" 17 | #endif 18 | 19 | namespace Microsoft 20 | { 21 | namespace Azure 22 | { 23 | namespace Gaming 24 | { 25 | 26 | std::string cGSDKUtils::getEnvironmentVariable(const char *environmentVariableName) 27 | { 28 | #ifdef GSDK_LINUX 29 | char* envVal = ::getenv(environmentVariableName); 30 | if (envVal != nullptr) 31 | { 32 | return envVal; 33 | } 34 | else 35 | { 36 | return ""; 37 | } 38 | #else 39 | size_t logFolderNameLength = 0; 40 | char logFolderBuffer[8192]; // significantly arbitrarily larger than any path we will ever create 41 | if (::getenv_s(&logFolderNameLength, logFolderBuffer, environmentVariableName) == 0) 42 | { 43 | return logFolderBuffer; 44 | } 45 | else 46 | { 47 | return ""; 48 | } 49 | #endif 50 | } 51 | 52 | std::wstring cGSDKUtils::getEnvironmentVariableW(const wchar_t *environmentVariableName) 53 | { 54 | return STR2WSTR(cGSDKUtils::getEnvironmentVariable(WCHAR2CHAR(environmentVariableName))); 55 | } 56 | 57 | bool cGSDKUtils::createDirectoryIfNotExists(std::string path) 58 | { 59 | try 60 | { 61 | #ifdef GSDK_LINUX 62 | return mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH | S_IXOTH); 63 | #else 64 | std::experimental::filesystem::create_directories(std::experimental::filesystem::path(path)); 65 | return true; 66 | #endif 67 | } 68 | catch (...) 69 | { 70 | return false; 71 | } 72 | } 73 | 74 | time_t cGSDKUtils::tm2timet_utc(tm * tm) 75 | { 76 | #ifdef GSDK_LINUX 77 | return timegm(tm); 78 | #else 79 | return _mkgmtime(tm); 80 | #endif 81 | } 82 | 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /cpp/cppsdk/source/playfab/PlayFabError.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | namespace PlayFab 6 | { 7 | void PlayFabError::FromJson(Json::Value& input) 8 | { 9 | const Json::Value HttpCode_member = input["code"]; 10 | if (HttpCode_member != Json::Value::null) HttpCode = HttpCode_member.asInt(); 11 | const Json::Value ErrorCode_member = input["errorCode"]; 12 | if (ErrorCode_member != Json::Value::null) ErrorCode = PlayFabErrorCode(ErrorCode_member.asInt()); 13 | const Json::Value HttpStatus_member = input["status"]; 14 | if (HttpStatus_member != Json::Value::null) HttpStatus = HttpStatus_member.asString(); 15 | const Json::Value ErrorName_member = input["error"]; 16 | if (ErrorName_member != Json::Value::null) ErrorName = ErrorName_member.asString(); 17 | const Json::Value ErrorMessage_member = input["errorMessage"]; 18 | if (ErrorMessage_member != Json::Value::null) ErrorMessage = ErrorMessage_member.asString(); 19 | ErrorDetails = input["errorDetails"]; 20 | Data = input["data"]; 21 | } 22 | 23 | Json::Value PlayFabError::ToJson() const 24 | { 25 | // This is not expected to be used, but implemented for completeness 26 | Json::Value output; 27 | output["code"] = Json::Value(HttpCode); 28 | output["errorCode"] = Json::Value(ErrorCode); 29 | output["status"] = Json::Value(HttpStatus); 30 | output["error"] = Json::Value(ErrorName); 31 | output["errorMessage"] = Json::Value(ErrorMessage); 32 | output["errorDetails"] = ErrorDetails; 33 | output["data"] = Data; 34 | return output; 35 | } 36 | 37 | std::string PlayFabError::GenerateReport() const 38 | { 39 | std::string output; 40 | output.reserve(1024); 41 | output += ErrorMessage; 42 | if (ErrorDetails != Json::Value::null && ErrorDetails.isObject()) 43 | { 44 | for (auto detailIter = ErrorDetails.begin(); detailIter != ErrorDetails.end(); ++detailIter) 45 | { 46 | if (!detailIter->isArray()) continue; 47 | 48 | output += "\n"; 49 | output += detailIter.key().asString(); 50 | output += ": "; 51 | int valueIndex = 0; 52 | for (auto valueIter = detailIter->begin(); valueIter != detailIter->end(); ++valueIter) 53 | { 54 | if (!valueIter->isString()) continue; 55 | if (valueIndex != 0) output += ", "; 56 | output += valueIter->asString(); 57 | valueIndex++; 58 | } 59 | } 60 | } 61 | return output; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /cpp/cppsdk/GSDK_CPP_Windows.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Header Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/BuildUtils/Builder.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEditor.Build.Reporting; 3 | using UnityEngine; 4 | 5 | public class Builder 6 | { 7 | [MenuItem("Test/Build Win64")] 8 | private static int BuildWin64() 9 | { 10 | // Setup build options (e.g. scenes, build output location) 11 | var options = new BuildPlayerOptions 12 | { 13 | // Change to scenes from your project 14 | scenes = new[] 15 | { 16 | "Assets/Scene.unity", 17 | }, 18 | 19 | // Change to location the output should go 20 | locationPathName = "BuildOutputWindows/build.exe", 21 | options = BuildOptions.CleanBuildCache | BuildOptions.BuildScriptsOnly | BuildOptions.StrictMode, 22 | target = BuildTarget.StandaloneWindows64, 23 | }; 24 | 25 | var report = BuildPipeline.BuildPlayer(options); 26 | 27 | int error = 0; 28 | if (report.summary.result == BuildResult.Succeeded) 29 | { 30 | Debug.Log($"Build successful - Build written to {options.locationPathName}"); 31 | } 32 | else if (report.summary.result == BuildResult.Failed) 33 | { 34 | Debug.LogError($"Build failed"); 35 | error = 1; 36 | } 37 | 38 | return error; 39 | } 40 | 41 | [MenuItem("Test/Build Linux64")] 42 | private static int BuildLinux64() 43 | { 44 | // Setup build options (e.g. scenes, build output location) 45 | var options = new BuildPlayerOptions 46 | { 47 | // Change to scenes from your project 48 | scenes = new[] 49 | { 50 | "Assets/Scene.unity", 51 | }, 52 | 53 | // Change to location the output should go 54 | locationPathName = "BuildOutputLinux/build.exe", 55 | options = BuildOptions.CleanBuildCache | BuildOptions.BuildScriptsOnly | BuildOptions.StrictMode, 56 | target = BuildTarget.StandaloneLinux64, 57 | }; 58 | 59 | var report = BuildPipeline.BuildPlayer(options); 60 | 61 | int error = 0; 62 | if (report.summary.result == BuildResult.Succeeded) 63 | { 64 | Debug.Log($"Build successful - Build written to {options.locationPathName}"); 65 | } 66 | else if (report.summary.result == BuildResult.Failed) 67 | { 68 | Debug.LogError($"Build failed"); 69 | error = 2; 70 | } 71 | 72 | return error; 73 | } 74 | 75 | // This function will be called from the build process 76 | public static void Build() 77 | { 78 | int error = 0; 79 | error += BuildWin64(); 80 | error += BuildLinux64(); 81 | 82 | if (error > 0) 83 | { 84 | EditorApplication.Exit(error); 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /csharp/Tests/GSDKConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Playfab.Gaming.GSDK.CSharp.Test 2 | { 3 | using System.Collections.Generic; 4 | using FluentAssertions; 5 | using Model; 6 | using Newtonsoft.Json; 7 | using VisualStudio.TestTools.UnitTesting; 8 | 9 | [TestClass] 10 | public class GSDKConfigurationTests 11 | { 12 | [TestMethod] 13 | public void ReadConfiguration_EmptyGameCertificates_Parsed() 14 | { 15 | var testConfig = new 16 | { 17 | heartbeatEndpoint = "heartbeatendpoint", 18 | sessionHostId = "serverid", 19 | gameCertificates = new 20 | { 21 | } 22 | }; 23 | 24 | GSDKConfiguration c = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(testConfig)); 25 | c.GameCertificates.Should().NotBeNull(); 26 | c.GameCertificates.Should().HaveCount(0); 27 | } 28 | 29 | [TestMethod] 30 | public void ReadConfiguration_MultipleGameCertificates_Parsed() 31 | { 32 | var testConfig = new 33 | { 34 | heartbeatEndpoint = "heartbeatendpoint", 35 | sessionHostId = "serverid", 36 | gameCertificates = new Dictionary 37 | { 38 | {"gameCert", "onetwothree"}, 39 | {"gameCert2", "threefourfive"} 40 | } 41 | }; 42 | GSDKConfiguration c = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(testConfig)); 43 | 44 | c.GameCertificates.Should().NotBeNull(); 45 | c.GameCertificates.Should().HaveCount(2); 46 | } 47 | 48 | 49 | [TestMethod] 50 | public void ReadConfiguration_EmptyGameGamePorts_Parsed() 51 | { 52 | var testConfig = new 53 | { 54 | heartbeatEndpoint = "heartbeatendpoint", 55 | sessionHostId = "serverid", 56 | gamePorts = new 57 | { 58 | } 59 | }; 60 | 61 | GSDKConfiguration c = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(testConfig)); 62 | c.GamePorts.Should().NotBeNull(); 63 | c.GamePorts.Should().HaveCount(0); 64 | } 65 | 66 | [TestMethod] 67 | public void ReadConfiguration_MultipleGamePorts_Parsed() 68 | { 69 | var testConfig = new 70 | { 71 | heartbeatEndpoint = "heartbeatendpoint", 72 | sessionHostId = "serverid", 73 | gamePorts = new Dictionary 74 | { 75 | {"8080", "debug"}, 76 | {"8081", "debug"} 77 | } 78 | }; 79 | 80 | GSDKConfiguration c = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(testConfig)); 81 | 82 | c.GamePorts.Should().NotBeNull(); 83 | c.GamePorts.Should().HaveCount(2); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /UnrealPlugin/TestingProject/Source/SlateUGS/Private/TestGameInstance.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "TestGameInstance.h" 5 | 6 | DEFINE_LOG_CATEGORY(LogPlayFabGSDKGameInstance); 7 | 8 | void UTestGameInstance::Init() 9 | { 10 | FOnGSDKShutdown_Dyn OnGsdkShutdown; 11 | OnGsdkShutdown.BindDynamic(this, &UTestGameInstance::OnGSDKShutdown); 12 | FOnGSDKHealthCheck_Dyn OnGsdkHealthCheck; 13 | OnGsdkHealthCheck.BindDynamic(this, &UTestGameInstance::OnGSDKHealthCheck); 14 | FOnGSDKServerActive_Dyn OnGSDKServerActive; 15 | OnGSDKServerActive.BindDynamic(this, &UTestGameInstance::OnGSDKServerActive); 16 | FOnGSDKReadyForPlayers_Dyn OnGSDKReadyForPlayers; 17 | OnGSDKReadyForPlayers.BindDynamic(this, &UTestGameInstance::OnGSDKReadyForPlayers); 18 | FOnGSDKMaintenanceV2_Dyn OnGSDKMaintenanceV2; 19 | OnGSDKMaintenanceV2.BindDynamic(this, &UTestGameInstance::OnGSDKMaintenanceV2); 20 | 21 | UGSDKUtils::RegisterGSDKShutdownDelegate(OnGsdkShutdown); 22 | UGSDKUtils::RegisterGSDKHealthCheckDelegate(OnGsdkHealthCheck); 23 | UGSDKUtils::RegisterGSDKServerActiveDelegate(OnGSDKServerActive); 24 | UGSDKUtils::RegisterGSDKReadyForPlayers(OnGSDKReadyForPlayers); 25 | UGSDKUtils::RegisterGSDKMaintenanceV2Delegate(OnGSDKMaintenanceV2); 26 | 27 | #if UE_SERVER 28 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Reached Init!")); 29 | UGSDKUtils::SetDefaultServerHostPort(); 30 | #endif 31 | } 32 | 33 | void UTestGameInstance::OnStart() 34 | { 35 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Reached onStart!")); 36 | UGSDKUtils::ReadyForPlayers(); 37 | } 38 | 39 | void UTestGameInstance::OnGSDKShutdown() 40 | { 41 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Shutdown!")); 42 | FPlatformMisc::RequestExit(false); 43 | } 44 | 45 | bool UTestGameInstance::OnGSDKHealthCheck() 46 | { 47 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Healthy!")); 48 | return true; 49 | } 50 | 51 | void UTestGameInstance::OnGSDKServerActive() 52 | { 53 | /** 54 | * Server is transitioning to an active state. 55 | * Optional: Add in the implementation any code that is needed for the game server when 56 | * this transition occurs. 57 | */ 58 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Active!")); 59 | } 60 | 61 | void UTestGameInstance::OnGSDKReadyForPlayers() 62 | { 63 | /** 64 | * Server is transitioning to a StandBy state. Game initialization is complete and the game is ready 65 | * to accept players. 66 | * Optional: Add in the implementation any code that is needed for the game server before 67 | * initialization completes. 68 | */ 69 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Finished Initialization - Moving to StandBy!")); 70 | } 71 | 72 | void UTestGameInstance::OnGSDKMaintenanceV2(const FMaintenanceSchedule& schedule) 73 | { 74 | /** 75 | * Server recieved a maintenance event. 76 | * Optional: Add in the implementation any code that is needed for the game server when 77 | * this transition occurs. 78 | */ 79 | UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Recieved maintenance event: %s, %s, %s"), *schedule.Events[0].EventType, *schedule.Events[0].EventStatus, *schedule.Events[0].EventSource); 80 | } 81 | -------------------------------------------------------------------------------- /UnityGsdk/Assets/PlayFabSdk/MultiplayerAgent/Model/SessionConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab.MultiplayerAgent.Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using Helpers; 7 | 8 | [Serializable] 9 | public class SessionConfig : IEquatable 10 | { 11 | [JsonProperty(PropertyName = "sessionId")] 12 | public string SessionId { get; set; } 13 | 14 | [JsonProperty(PropertyName = "sessionCookie")] 15 | public string SessionCookie { get; set; } 16 | 17 | [JsonProperty(PropertyName = "initialPlayers")] 18 | public List InitialPlayers { get; set; } 19 | 20 | [JsonProperty(PropertyName = "metadata")] 21 | public Dictionary Metadata { get; set; } 22 | 23 | public void CopyNonNullFields(SessionConfig other) 24 | { 25 | if (other == null) 26 | { 27 | return; 28 | } 29 | 30 | if (!string.IsNullOrEmpty(other.SessionId)) 31 | { 32 | SessionId = other.SessionId; 33 | } 34 | 35 | if (!string.IsNullOrEmpty(other.SessionCookie)) 36 | { 37 | SessionCookie = other.SessionCookie; 38 | } 39 | 40 | if (other.InitialPlayers != null && other.InitialPlayers.Any()) 41 | { 42 | InitialPlayers = other.InitialPlayers; 43 | } 44 | 45 | if (other.Metadata != null && other.Metadata.Any()) 46 | { 47 | Metadata = other.Metadata; 48 | } 49 | 50 | } 51 | 52 | public override bool Equals(object obj) 53 | { 54 | return Equals(obj as SessionConfig); 55 | } 56 | 57 | public bool Equals(SessionConfig other) 58 | { 59 | return other != null && 60 | SessionId == other.SessionId && 61 | SessionCookie == other.SessionCookie && 62 | EqualityComparer>.Default.Equals(InitialPlayers, other.InitialPlayers) && 63 | EqualityComparer>.Default.Equals(Metadata, other.Metadata); 64 | } 65 | 66 | public override int GetHashCode() 67 | { 68 | var hashCode = -481859842; 69 | hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(SessionId); 70 | hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(SessionCookie); 71 | hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(InitialPlayers); 72 | hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(Metadata); 73 | 74 | return hashCode; 75 | } 76 | 77 | public static bool operator ==(SessionConfig left, SessionConfig right) 78 | { 79 | return EqualityComparer.Default.Equals(left, right); 80 | } 81 | 82 | public static bool operator !=(SessionConfig left, SessionConfig right) 83 | { 84 | return !(left == right); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-debug-dll-ssl-dll-ipv6-sspi/include/curl/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURLVER_H 2 | #define __CURL_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* This header file contains nothing but libcurl version info, generated by 26 | a script at release-time. This was made its own header file in 7.11.2 */ 27 | 28 | /* This is the global package copyright */ 29 | #define LIBCURL_COPYRIGHT "1996 - 2018 Daniel Stenberg, ." 30 | 31 | /* This is the version number of the libcurl package from which this header 32 | file origins: */ 33 | #define LIBCURL_VERSION "7.63.0-DEV" 34 | 35 | /* The numeric version number is also available "in parts" by using these 36 | defines: */ 37 | #define LIBCURL_VERSION_MAJOR 7 38 | #define LIBCURL_VERSION_MINOR 63 39 | #define LIBCURL_VERSION_PATCH 0 40 | 41 | /* This is the numeric version of the libcurl version number, meant for easier 42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will 43 | always follow this syntax: 44 | 45 | 0xXXYYZZ 46 | 47 | Where XX, YY and ZZ are the main version, release and patch numbers in 48 | hexadecimal (using 8 bits each). All three numbers are always represented 49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 50 | appears as "0x090b07". 51 | 52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 53 | and it is always a greater number in a more recent release. It makes 54 | comparisons with greater than and less than work. 55 | 56 | Note: This define is the full hex number and _does not_ use the 57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it 58 | and needs it to contain the full number. 59 | */ 60 | #define LIBCURL_VERSION_NUM 0x073F00 61 | 62 | /* 63 | * This is the date and time when the full source package was created. The 64 | * timestamp is not stored in git, as the timestamp is properly set in the 65 | * tarballs by the maketgz script. 66 | * 67 | * The format of the date follows this template: 68 | * 69 | * "2007-11-23" 70 | */ 71 | #define LIBCURL_TIMESTAMP "[unreleased]" 72 | 73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) 74 | #define CURL_AT_LEAST_VERSION(x,y,z) \ 75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) 76 | 77 | #endif /* __CURL_CURLVER_H */ 78 | -------------------------------------------------------------------------------- /cpp/dependencies/libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi/include/curl/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURLVER_H 2 | #define __CURL_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* This header file contains nothing but libcurl version info, generated by 26 | a script at release-time. This was made its own header file in 7.11.2 */ 27 | 28 | /* This is the global package copyright */ 29 | #define LIBCURL_COPYRIGHT "1996 - 2018 Daniel Stenberg, ." 30 | 31 | /* This is the version number of the libcurl package from which this header 32 | file origins: */ 33 | #define LIBCURL_VERSION "7.63.0-DEV" 34 | 35 | /* The numeric version number is also available "in parts" by using these 36 | defines: */ 37 | #define LIBCURL_VERSION_MAJOR 7 38 | #define LIBCURL_VERSION_MINOR 63 39 | #define LIBCURL_VERSION_PATCH 0 40 | 41 | /* This is the numeric version of the libcurl version number, meant for easier 42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will 43 | always follow this syntax: 44 | 45 | 0xXXYYZZ 46 | 47 | Where XX, YY and ZZ are the main version, release and patch numbers in 48 | hexadecimal (using 8 bits each). All three numbers are always represented 49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 50 | appears as "0x090b07". 51 | 52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 53 | and it is always a greater number in a more recent release. It makes 54 | comparisons with greater than and less than work. 55 | 56 | Note: This define is the full hex number and _does not_ use the 57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it 58 | and needs it to contain the full number. 59 | */ 60 | #define LIBCURL_VERSION_NUM 0x073F00 61 | 62 | /* 63 | * This is the date and time when the full source package was created. The 64 | * timestamp is not stored in git, as the timestamp is properly set in the 65 | * tarballs by the maketgz script. 66 | * 67 | * The format of the date follows this template: 68 | * 69 | * "2007-11-23" 70 | */ 71 | #define LIBCURL_TIMESTAMP "[unreleased]" 72 | 73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) 74 | #define CURL_AT_LEAST_VERSION(x,y,z) \ 75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) 76 | 77 | #endif /* __CURL_CURLVER_H */ 78 | -------------------------------------------------------------------------------- /cpp/cppsdk/include/playfab/PlayFabHttp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace PlayFab 12 | { 13 | struct CallRequestContainer; 14 | typedef void(*RequestCompleteCallback)(CallRequestContainer& reqContainer); 15 | typedef std::shared_ptr SharedVoidPointer; 16 | 17 | /// 18 | /// Internal PlayFabHttp container for each api call 19 | /// 20 | struct CallRequestContainer 21 | { 22 | // I own these objects, I must always destroy them 23 | CURL* curlHandle; 24 | curl_slist* curlHttpHeaders; 25 | // I never own this, I can never destroy it 26 | void* customData; 27 | 28 | bool finished; 29 | std::string authKey; 30 | std::string authValue; 31 | std::string responseString; 32 | Json::Value responseJson = Json::Value::null; 33 | PlayFabError errorWrapper; 34 | RequestCompleteCallback internalCallback; 35 | SharedVoidPointer successCallback; 36 | ErrorCallback errorCallback; 37 | 38 | CallRequestContainer(); 39 | ~CallRequestContainer(); 40 | }; 41 | 42 | /// 43 | /// Provides an interface and a static instance for https implementations 44 | /// 45 | class IPlayFabHttp 46 | { 47 | public: 48 | static IPlayFabHttp& Get(); 49 | 50 | virtual ~IPlayFabHttp(); 51 | 52 | virtual void AddRequest(const std::string& urlPath, const std::string& authKey, const std::string& authValue, const Json::Value& requestBody, RequestCompleteCallback internalCallback, SharedVoidPointer successCallback, ErrorCallback errorCallback, void* customData) = 0; 53 | virtual size_t Update() = 0; 54 | protected: 55 | static std::unique_ptr httpInstance; 56 | }; 57 | 58 | /// 59 | /// PlayFabHttp is the default https implementation for Win/C++, using cpprestsdk 60 | /// 61 | class PlayFabHttp : public IPlayFabHttp 62 | { 63 | public: 64 | static void MakeInstance(); 65 | ~PlayFabHttp() override; 66 | 67 | void AddRequest(const std::string& urlPath, const std::string& authKey, const std::string& authValue, const Json::Value& requestBody, RequestCompleteCallback internalCallback, SharedVoidPointer successCallback, ErrorCallback errorCallback, void* customData) override; 68 | size_t Update() override; 69 | private: 70 | PlayFabHttp(); // Private constructor, to enforce singleton instance 71 | PlayFabHttp(const PlayFabHttp& other); // Private copy-constructor, to enforce singleton instance 72 | 73 | static size_t CurlReceiveData(char* buffer, size_t blockSize, size_t blockCount, void* userData); 74 | static void ExecuteRequest(CallRequestContainer& reqContainer); 75 | void WorkerThread(); 76 | static void HandleCallback(CallRequestContainer& reqContainer); 77 | static void HandleResults(CallRequestContainer& reqContainer); 78 | 79 | std::thread pfHttpWorkerThread; 80 | std::mutex httpRequestMutex; 81 | bool threadRunning; 82 | std::vector pendingRequests; 83 | std::vector pendingResults; 84 | }; 85 | } 86 | -------------------------------------------------------------------------------- /java/gameserverSDKConsoleApp/src/main/java/com/microsoft/azure/gaming/gsdkConsoleApp/Main.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.azure.gaming.gsdkConsoleApp; 2 | 3 | import com.microsoft.azure.gaming.*; 4 | 5 | import java.time.ZoneId; 6 | import java.util.ArrayList; 7 | import java.util.Map; 8 | 9 | /** 10 | * Simple app that lets us test the various Java GSDK methods 11 | * 12 | * Created by briantre on 6/15/2017. 13 | */ 14 | public class Main { 15 | static int state = 0; 16 | public static void main(String[] args){ 17 | try { 18 | // Startup 19 | // GameserverSDK.start(); 20 | String logsFolder = GameserverSDK.getLogsDirectory(); 21 | System.out.println("The logs folder is: " + logsFolder); 22 | GameserverSDK.registerShutdownCallback(() -> System.out.println("I was just shutdown.")); 23 | GameserverSDK.registerHealthCallback(() -> { 24 | state++; 25 | return state % 2 == 0? GameHostHealth.Healthy : GameHostHealth.Unhealthy; 26 | }); 27 | GameserverSDK.registerMaintenanceCallback((maintenance) -> { 28 | System.out.println("There is a new scheduled maintenance happening at: " 29 | + maintenance.withZoneSameInstant(ZoneId.systemDefault()).toString()); 30 | }); 31 | GameserverSDK.registerMaintenanceV2Callback((schedule) -> { 32 | System.out.println("GSDK maintenanceV2 scheduled with" + schedule.getMaintenanceEvents().get(0).getEventType() + "," + schedule.getMaintenanceEvents().get(0).getEventStatus() + "," + schedule.getMaintenanceEvents().get(0).getEventSource()); 33 | }); 34 | GameserverSDK.readyForPlayers(); 35 | 36 | ArrayList players = new ArrayList(); 37 | players.add(new ConnectedPlayer("gamertag1")); 38 | GameserverSDK.updateConnectedPlayers(players); 39 | 40 | // Grab config 41 | Map settings = GameserverSDK.getConfigSettings(); 42 | System.out.println(settings.toString()); 43 | 44 | // Print a rainbow 45 | int size = 13; 46 | for (int i = 0; i < 5; i++) 47 | { 48 | String edge = new String(new char[size]).replace('\0', ' '); 49 | String middle = new String(new char[2 * i]).replace('\0', ' '); 50 | System.out.println(edge + "====" + middle + "=====" + edge); 51 | size--; 52 | } 53 | 54 | for (int i = 0; i < 4; i++) 55 | { 56 | String edge = new String(new char[size]).replace('\0', ' '); 57 | String middle = new String(new char[10]).replace('\0', ' '); 58 | System.out.println(edge + "====" + middle + "=====" + edge); 59 | } 60 | 61 | players.add(new ConnectedPlayer("gamertag2")); 62 | GameserverSDK.updateConnectedPlayers(players); 63 | 64 | // Keep the game running to test GSDK 65 | for (int i = 0; i < 30; i++) 66 | { 67 | System.out.println("..."); 68 | Thread.sleep(1000); 69 | } 70 | 71 | System.out.println("Ending"); 72 | } 73 | catch(GameserverSDKInitializationException ex) { 74 | System.out.println(ex.toString()); 75 | } 76 | catch (Exception e){ 77 | System.out.println(e.toString()); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /java/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find JDK 20 | if "%JAVA_HOME%" == "" goto findJavaHomeFromRegistry 21 | 22 | @rem Find java.exe 23 | if defined JAVA_HOME goto findJavaFromJavaHome 24 | 25 | set JAVA_EXE=java.exe 26 | %JAVA_EXE% -version >NUL 2>&1 27 | if "%ERRORLEVEL%" == "0" goto init 28 | 29 | echo. 30 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 31 | echo. 32 | echo Please set the JAVA_HOME variable in your environment to match the 33 | echo location of your Java installation. 34 | 35 | goto fail 36 | 37 | :findJavaHomeFromRegistry 38 | ::- Get the Java Version 39 | set KEY="HKLM\SOFTWARE\JavaSoft\Java Development Kit" 40 | set VALUE=CurrentVersion 41 | reg query %KEY% /v %VALUE% 2>nul || ( 42 | echo JDK not installed 43 | exit /b 1 44 | ) 45 | set JDK_VERSION= 46 | for /f "tokens=2,*" %%a in ('reg query %KEY% /v %VALUE% ^| findstr %VALUE%') do ( 47 | set JDK_VERSION=%%b 48 | ) 49 | 50 | echo JDK VERSION: %JDK_VERSION% 51 | 52 | ::- Get the JavaHome 53 | set KEY="HKLM\SOFTWARE\JavaSoft\Java Development Kit\%JDK_VERSION%" 54 | set VALUE=JavaHome 55 | reg query %KEY% /v %VALUE% 2>nul || ( 56 | echo JavaHome not installed 57 | exit /b 1 58 | ) 59 | 60 | set JAVA_HOME= 61 | for /f "tokens=2,*" %%a in ('reg query %KEY% /v %VALUE% ^| findstr %VALUE%') do ( 62 | set JAVA_HOME=%%b 63 | ) 64 | 65 | echo JAVA_HOME: %JAVA_HOME% 66 | goto findJavaFromJavaHome 67 | 68 | :findJavaFromJavaHome 69 | set JAVA_HOME=%JAVA_HOME:"=% 70 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 71 | 72 | if exist "%JAVA_EXE%" goto init 73 | 74 | echo. 75 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 76 | echo. 77 | echo Please set the JAVA_HOME variable in your environment to match the 78 | echo location of your Java installation. 79 | 80 | goto fail 81 | 82 | :init 83 | @rem Get command-line arguments, handling Windows variants 84 | 85 | if not "%OS%" == "Windows_NT" goto win9xME_args 86 | 87 | :win9xME_args 88 | @rem Slurp the command line arguments. 89 | set CMD_LINE_ARGS= 90 | set _SKIP=2 91 | 92 | :win9xME_args_slurp 93 | if "x%~1" == "x" goto execute 94 | 95 | set CMD_LINE_ARGS=%* 96 | 97 | :execute 98 | @rem Setup the command line 99 | 100 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 101 | 102 | @rem Execute Gradle 103 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 104 | 105 | :end 106 | @rem End local scope for the variables with windows NT shell 107 | if "%ERRORLEVEL%"=="0" goto mainEnd 108 | 109 | :fail 110 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 111 | rem the _cmd.exe /c_ return code! 112 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 113 | exit /b 1 114 | 115 | :mainEnd 116 | if "%OS%"=="Windows_NT" endlocal 117 | 118 | :omega 119 | -------------------------------------------------------------------------------- /cpp/unittests/TestConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "..\cppsdk\gsdkConfig.h" 4 | 5 | namespace Microsoft 6 | { 7 | namespace Azure 8 | { 9 | namespace Gaming 10 | { 11 | class TestConfig : public Configuration 12 | { 13 | public: 14 | TestConfig( const std::string & heartbeatEndpoint, 15 | const std::string & serverId, 16 | const std::string & logFolder, 17 | const std::string & sharedContentFolder, 18 | const std::string & certFolder = std::string(), 19 | const std::unordered_map & gameCerts = std::unordered_map(), 20 | const std::string & titleId = std::string(), 21 | const std::string & buildId = std::string(), 22 | const std::string & region = std::string(), 23 | const std::unordered_map & metadata = std::unordered_map(), 24 | const std::unordered_map & ports = std::unordered_map(), 25 | const std::string & ipv4Address = std::string() = std::string(), 26 | const std::string & domainName = std::string() = std::string(), 27 | const std::string & vmId = std::string() = std::string(), 28 | const GameServerConnectionInfo & connectionInfo = GameServerConnectionInfo()); 29 | 30 | const std::string &getHeartbeatEndpoint(); 31 | const std::string &getServerId(); 32 | const std::string &getLogFolder(); 33 | const std::string &getSharedContentFolder(); 34 | const std::string &getCertificateFolder(); 35 | const std::unordered_map &getGameCertificates(); 36 | const std::string &getTitleId(); 37 | const std::string &getBuildId(); 38 | const std::string &getRegion(); 39 | const std::unordered_map &getBuildMetadata(); 40 | const std::unordered_map &getGamePorts(); 41 | const std::string &getPublicIpV4Address(); 42 | const std::string &getFullyQualifiedDomainName(); 43 | const std::string &getVmId(); 44 | const GameServerConnectionInfo &getGameServerConnectionInfo(); 45 | bool shouldLog(); 46 | bool shouldHeartbeat(); 47 | 48 | private: 49 | std::string m_heartbeatEndpoint; 50 | std::string m_serverId; 51 | std::string m_logFolder; 52 | std::string m_sharedContentFolder; 53 | std::string m_certFolder; 54 | std::unordered_map m_gameCerts; 55 | std::unordered_map m_metadata; 56 | std::unordered_map m_ports; 57 | std::string m_titleId; 58 | std::string m_buildId; 59 | std::string m_region; 60 | std::string m_ipv4Address; 61 | std::string m_domainName; 62 | std::string m_vmId; 63 | GameServerConnectionInfo m_connectionInfo; 64 | }; 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /csharp/WindowsTestAppCSharp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Playfab.Gaming.GSDK.CSharp; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace WindowsTestAppCSharp 6 | { 7 | class Program 8 | { 9 | static int healthState = 0; 10 | static bool getIsHealthy() 11 | { 12 | healthState++; 13 | return healthState % 2 == 0; // Flip back and forth so we can test both states 14 | } 15 | 16 | static void maintenanceScheduled(DateTimeOffset time) 17 | { 18 | Console.WriteLine($"Maintenance scheduled for: {time.ToLocalTime():dddd, MMMM d, yyyy HH:mm:ss}, which is this many seconds from now: {(time - DateTimeOffset.Now).TotalSeconds}"); 19 | } 20 | 21 | static void Main(string[] args) 22 | { 23 | // Test startup 24 | GameserverSDK.Start(); 25 | 26 | GameserverSDK.RegisterShutdownCallback(() => Console.WriteLine("Server is shutting me down!!!!!")); 27 | GameserverSDK.RegisterHealthCallback(getIsHealthy); 28 | GameserverSDK.RegisterMaintenanceCallback(maintenanceScheduled); 29 | 30 | // Test grabbing config 31 | Console.WriteLine("Config before Active."); 32 | foreach (var config in GameserverSDK.getConfigSettings()) 33 | { 34 | Console.WriteLine($"{config.Key}: {config.Value}"); 35 | } 36 | 37 | if (GameserverSDK.ReadyForPlayers()) 38 | { 39 | IList initialPlayers = GameserverSDK.GetInitialPlayers(); 40 | Console.WriteLine("Initial Players: " +string.Join(",",initialPlayers)); 41 | 42 | List players = new List() 43 | { 44 | new ConnectedPlayer("player1"), 45 | new ConnectedPlayer("player2") 46 | }; 47 | GameserverSDK.UpdateConnectedPlayers(players); 48 | 49 | Console.WriteLine("Config after Active."); 50 | foreach (var config in GameserverSDK.getConfigSettings()) 51 | { 52 | Console.WriteLine($"{config.Key}: {config.Value}"); 53 | } 54 | 55 | // Print a rainbow 56 | int size = 13; 57 | for (int i = 0; i < 5; i++) 58 | { 59 | String edge = new String(new char[size]).Replace('\0', ' '); 60 | String middle = new String(new char[2 * i]).Replace('\0', ' '); 61 | Console.WriteLine(edge + "====" + middle + "=====" + edge); 62 | size--; 63 | } 64 | 65 | for (int i = 0; i < 4; i++) 66 | { 67 | String edge = new String(new char[size]).Replace('\0', ' '); 68 | String middle = new String(new char[10]).Replace('\0', ' '); 69 | Console.WriteLine(edge + "====" + middle + "=====" + edge); 70 | } 71 | 72 | // Leave running a bit more to see the heartbeats 73 | for (int i = 0; i < 10; i++) 74 | { 75 | Console.WriteLine("..."); 76 | System.Threading.Thread.Sleep(1000); 77 | } 78 | } 79 | else 80 | { 81 | Console.WriteLine("Did not activate, instead shutting down..."); 82 | } 83 | 84 | Console.WriteLine("Press enter to exit."); 85 | Console.ReadKey(); 86 | } 87 | } 88 | } 89 | --------------------------------------------------------------------------------