├── .gitignore ├── CSharpGettingStarted.md ├── CSharpJobTemplate.yml ├── CSharpResourceTemplate.yml ├── CSharpStepTemplate.yml ├── Licenses ├── Newtonsoft.Json-License.txt └── uunit-license.txt ├── PlayFabSDK ├── PlayFabSDK+Unit.sln ├── PlayFabSDK.sln ├── Properties │ └── AssemblyInfo.cs ├── UnittestRunner │ ├── App.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UUnitTestRunner.cs │ └── UnittestRunner.csproj ├── WindowsFormsApp1 │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── UnittestFormRunner.csproj ├── images │ └── icon.png └── source │ ├── IPlayFabAddonInstanceAPI.cs │ ├── IPlayFabAdminInstanceAPI.cs │ ├── IPlayFabAuthenticationInstanceAPI.cs │ ├── IPlayFabClientInstanceAPI.cs │ ├── IPlayFabCloudScriptInstanceAPI.cs │ ├── IPlayFabDataInstanceAPI.cs │ ├── IPlayFabEconomyInstanceAPI.cs │ ├── IPlayFabEventsInstanceAPI.cs │ ├── IPlayFabExperimentationInstanceAPI.cs │ ├── IPlayFabGroupsInstanceAPI.cs │ ├── IPlayFabInsightsInstanceAPI.cs │ ├── IPlayFabLocalizationInstanceAPI.cs │ ├── IPlayFabMultiplayerInstanceAPI.cs │ ├── IPlayFabPlugin.cs │ ├── IPlayFabProfilesInstanceAPI.cs │ ├── IPlayFabProgressionInstanceAPI.cs │ ├── IPlayFabServerInstanceAPI.cs │ ├── ISerializerPlugin.cs │ ├── ITransportPlugin.cs │ ├── Json │ ├── ISerializer.cs │ ├── NewtonsoftWrapper.cs │ └── SimpleJson.cs │ ├── LICENSE │ ├── PlayFabAddonAPI.cs │ ├── PlayFabAddonInstanceAPI.cs │ ├── PlayFabAddonModels.cs │ ├── PlayFabAdminAPI.cs │ ├── PlayFabAdminInstanceAPI.cs │ ├── PlayFabAdminModels.cs │ ├── PlayFabApiSettings.cs │ ├── PlayFabAuthenticationAPI.cs │ ├── PlayFabAuthenticationContext.cs │ ├── PlayFabAuthenticationInstanceAPI.cs │ ├── PlayFabAuthenticationModels.cs │ ├── PlayFabClientAPI.cs │ ├── PlayFabClientInstanceAPI.cs │ ├── PlayFabClientModels.cs │ ├── PlayFabCloudScriptAPI.cs │ ├── PlayFabCloudScriptInstanceAPI.cs │ ├── PlayFabCloudScriptModels.cs │ ├── PlayFabDataAPI.cs │ ├── PlayFabDataInstanceAPI.cs │ ├── PlayFabDataModels.cs │ ├── PlayFabEconomyAPI.cs │ ├── PlayFabEconomyInstanceAPI.cs │ ├── PlayFabEconomyModels.cs │ ├── PlayFabErrors.cs │ ├── PlayFabEventsAPI.cs │ ├── PlayFabEventsInstanceAPI.cs │ ├── PlayFabEventsModels.cs │ ├── PlayFabExperimentationAPI.cs │ ├── PlayFabExperimentationInstanceAPI.cs │ ├── PlayFabExperimentationModels.cs │ ├── PlayFabGroupsAPI.cs │ ├── PlayFabGroupsInstanceAPI.cs │ ├── PlayFabGroupsModels.cs │ ├── PlayFabHttp │ ├── HttpTransportWithDecompression.cs │ ├── IPlayFabHttp.cs │ ├── PlayFabHttp.cs │ ├── PlayFabPollyHttp.cs │ └── PlayFabSysHttp.cs │ ├── PlayFabInsightsAPI.cs │ ├── PlayFabInsightsInstanceAPI.cs │ ├── PlayFabInsightsModels.cs │ ├── PlayFabLocalizationAPI.cs │ ├── PlayFabLocalizationInstanceAPI.cs │ ├── PlayFabLocalizationModels.cs │ ├── PlayFabMultiplayerAPI.cs │ ├── PlayFabMultiplayerInstanceAPI.cs │ ├── PlayFabMultiplayerModels.cs │ ├── PlayFabProfilesAPI.cs │ ├── PlayFabProfilesInstanceAPI.cs │ ├── PlayFabProfilesModels.cs │ ├── PlayFabProgressionAPI.cs │ ├── PlayFabProgressionInstanceAPI.cs │ ├── PlayFabProgressionModels.cs │ ├── PlayFabSDK.csproj │ ├── PlayFabServerAPI.cs │ ├── PlayFabServerInstanceAPI.cs │ ├── PlayFabServerModels.cs │ ├── PlayFabSettings.cs │ ├── PlayFabUtil.cs │ ├── PluginContract.cs │ ├── PluginManager.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Qos │ ├── IRegionPinger.cs │ ├── PlayFabQosApi.cs │ ├── QosErrorCode.cs │ ├── QosRegionResult.cs │ ├── QosResult.cs │ └── RegionPinger.cs │ ├── Uunit │ ├── PluginManagerTest.cs │ ├── UUnitAssertException.cs │ ├── UUnitIncrementalTestRunner.cs │ ├── UUnitTestCase.cs │ ├── UUnitTestContext.cs │ ├── UUnitTestReport.cs │ ├── UUnitTestSuite.cs │ └── tests │ │ ├── HttpTests.cs │ │ ├── InstanceAuthTests.cs │ │ ├── PlayFabApiTest.cs │ │ ├── PlayFabQosApiTest.cs │ │ ├── PlayFabServerApiTest.cs │ │ └── Utility │ │ └── JsonUnitTests.cs │ └── WsaReflectionExtensions.cs ├── PluginManager.md ├── Plugins └── CloudScript │ ├── PlayFabCloudScriptPlugin.sln │ └── source │ ├── PlayFabCloudScriptPlugin.csproj │ └── PlayFabFunctionContexts.cs ├── README.md ├── XamarinGettingStarted.md ├── XamarinTestRunner ├── XamarinTestRunner.sln ├── XamarinTestRunner │ ├── PlayFabSDK │ │ ├── IPlayFabAddonInstanceAPI.cs │ │ ├── IPlayFabAdminInstanceAPI.cs │ │ ├── IPlayFabAuthenticationInstanceAPI.cs │ │ ├── IPlayFabClientInstanceAPI.cs │ │ ├── IPlayFabCloudScriptInstanceAPI.cs │ │ ├── IPlayFabDataInstanceAPI.cs │ │ ├── IPlayFabEconomyInstanceAPI.cs │ │ ├── IPlayFabEventsInstanceAPI.cs │ │ ├── IPlayFabExperimentationInstanceAPI.cs │ │ ├── IPlayFabGroupsInstanceAPI.cs │ │ ├── IPlayFabInsightsInstanceAPI.cs │ │ ├── IPlayFabLocalizationInstanceAPI.cs │ │ ├── IPlayFabMultiplayerInstanceAPI.cs │ │ ├── IPlayFabPlugin.cs │ │ ├── IPlayFabProfilesInstanceAPI.cs │ │ ├── IPlayFabProgressionInstanceAPI.cs │ │ ├── IPlayFabServerInstanceAPI.cs │ │ ├── ISerializerPlugin.cs │ │ ├── ITransportPlugin.cs │ │ ├── Json │ │ │ ├── ISerializer.cs │ │ │ ├── NewtonsoftWrapper.cs │ │ │ └── SimpleJson.cs │ │ ├── LICENSE │ │ ├── PlayFabAddonAPI.cs │ │ ├── PlayFabAddonInstanceAPI.cs │ │ ├── PlayFabAddonModels.cs │ │ ├── PlayFabAdminAPI.cs │ │ ├── PlayFabAdminInstanceAPI.cs │ │ ├── PlayFabAdminModels.cs │ │ ├── PlayFabApiSettings.cs │ │ ├── PlayFabAuthenticationAPI.cs │ │ ├── PlayFabAuthenticationContext.cs │ │ ├── PlayFabAuthenticationInstanceAPI.cs │ │ ├── PlayFabAuthenticationModels.cs │ │ ├── PlayFabClientAPI.cs │ │ ├── PlayFabClientInstanceAPI.cs │ │ ├── PlayFabClientModels.cs │ │ ├── PlayFabCloudScriptAPI.cs │ │ ├── PlayFabCloudScriptInstanceAPI.cs │ │ ├── PlayFabCloudScriptModels.cs │ │ ├── PlayFabDataAPI.cs │ │ ├── PlayFabDataInstanceAPI.cs │ │ ├── PlayFabDataModels.cs │ │ ├── PlayFabEconomyAPI.cs │ │ ├── PlayFabEconomyInstanceAPI.cs │ │ ├── PlayFabEconomyModels.cs │ │ ├── PlayFabErrors.cs │ │ ├── PlayFabEventsAPI.cs │ │ ├── PlayFabEventsInstanceAPI.cs │ │ ├── PlayFabEventsModels.cs │ │ ├── PlayFabExperimentationAPI.cs │ │ ├── PlayFabExperimentationInstanceAPI.cs │ │ ├── PlayFabExperimentationModels.cs │ │ ├── PlayFabGroupsAPI.cs │ │ ├── PlayFabGroupsInstanceAPI.cs │ │ ├── PlayFabGroupsModels.cs │ │ ├── PlayFabHttp │ │ │ ├── HttpTransportWithDecompression.cs │ │ │ ├── IPlayFabHttp.cs │ │ │ ├── PlayFabHttp.cs │ │ │ ├── PlayFabPollyHttp.cs │ │ │ └── PlayFabSysHttp.cs │ │ ├── PlayFabInsightsAPI.cs │ │ ├── PlayFabInsightsInstanceAPI.cs │ │ ├── PlayFabInsightsModels.cs │ │ ├── PlayFabLocalizationAPI.cs │ │ ├── PlayFabLocalizationInstanceAPI.cs │ │ ├── PlayFabLocalizationModels.cs │ │ ├── PlayFabMultiplayerAPI.cs │ │ ├── PlayFabMultiplayerInstanceAPI.cs │ │ ├── PlayFabMultiplayerModels.cs │ │ ├── PlayFabProfilesAPI.cs │ │ ├── PlayFabProfilesInstanceAPI.cs │ │ ├── PlayFabProfilesModels.cs │ │ ├── PlayFabProgressionAPI.cs │ │ ├── PlayFabProgressionInstanceAPI.cs │ │ ├── PlayFabProgressionModels.cs │ │ ├── PlayFabSDK.csproj │ │ ├── PlayFabServerAPI.cs │ │ ├── PlayFabServerInstanceAPI.cs │ │ ├── PlayFabServerModels.cs │ │ ├── PlayFabSettings.cs │ │ ├── PlayFabUtil.cs │ │ ├── PluginContract.cs │ │ ├── PluginManager.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Qos │ │ │ ├── IRegionPinger.cs │ │ │ ├── PlayFabQosApi.cs │ │ │ ├── QosErrorCode.cs │ │ │ ├── QosRegionResult.cs │ │ │ ├── QosResult.cs │ │ │ └── RegionPinger.cs │ │ ├── Uunit │ │ │ ├── PluginManagerTest.cs │ │ │ ├── UUnitAssertException.cs │ │ │ ├── UUnitIncrementalTestRunner.cs │ │ │ ├── UUnitTestCase.cs │ │ │ ├── UUnitTestContext.cs │ │ │ ├── UUnitTestReport.cs │ │ │ ├── UUnitTestSuite.cs │ │ │ └── tests │ │ │ │ ├── HttpTests.cs │ │ │ │ ├── InstanceAuthTests.cs │ │ │ │ ├── PlayFabApiTest.cs │ │ │ │ ├── PlayFabConnectionStringApiTest.cs │ │ │ │ ├── PlayFabQosApiTest.cs │ │ │ │ ├── PlayFabServerApiTest.cs │ │ │ │ └── Utility │ │ │ │ └── JsonUnitTests.cs │ │ └── WsaReflectionExtensions.cs │ ├── XamarinTestRunner.Android │ │ ├── MainActivity.cs │ │ ├── Properties │ │ │ ├── AndroidManifest.xml │ │ │ └── AssemblyInfo.cs │ │ ├── Resources │ │ │ ├── AboutResources.txt │ │ │ ├── Resource.designer.cs │ │ │ ├── layout │ │ │ │ ├── Tabbar.axml │ │ │ │ └── Toolbar.axml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── icon.xml │ │ │ │ └── icon_round.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── icon.png │ │ │ │ └── launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── icon.png │ │ │ │ └── launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── icon.png │ │ │ │ └── launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── icon.png │ │ │ │ └── launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── icon.png │ │ │ │ └── launcher_foreground.png │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── XamarinTestRunner.Android.csproj │ ├── XamarinTestRunner.UWP │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── Assets │ │ │ ├── LargeTile.scale-100.png │ │ │ ├── LargeTile.scale-200.png │ │ │ ├── LargeTile.scale-400.png │ │ │ ├── SmallTile.scale-100.png │ │ │ ├── SmallTile.scale-200.png │ │ │ ├── SmallTile.scale-400.png │ │ │ ├── SplashScreen.scale-100.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── SplashScreen.scale-400.png │ │ │ ├── Square150x150Logo.scale-100.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square150x150Logo.scale-400.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ │ ├── Square44x44Logo.scale-100.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-400.png │ │ │ ├── Square44x44Logo.targetsize-16.png │ │ │ ├── Square44x44Logo.targetsize-256.png │ │ │ ├── Square44x44Logo.targetsize-48.png │ │ │ ├── StoreLogo.backup.png │ │ │ ├── StoreLogo.scale-100.png │ │ │ ├── StoreLogo.scale-200.png │ │ │ ├── StoreLogo.scale-400.png │ │ │ ├── Wide310x150Logo.scale-100.png │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ └── Wide310x150Logo.scale-400.png │ │ ├── MainPage.xaml │ │ ├── MainPage.xaml.cs │ │ ├── Package.appxmanifest │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Default.rd.xml │ │ └── XamarinTestRunner.UWP.csproj │ ├── XamarinTestRunner.iOS │ │ ├── AppDelegate.cs │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon1024.png │ │ │ │ ├── Icon120.png │ │ │ │ ├── Icon152.png │ │ │ │ ├── Icon167.png │ │ │ │ ├── Icon180.png │ │ │ │ ├── Icon20.png │ │ │ │ ├── Icon29.png │ │ │ │ ├── Icon40.png │ │ │ │ ├── Icon58.png │ │ │ │ ├── Icon60.png │ │ │ │ ├── Icon76.png │ │ │ │ ├── Icon80.png │ │ │ │ └── Icon87.png │ │ ├── Entitlements.plist │ │ ├── Info.plist │ │ ├── Main.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Resources │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ ├── Default.png │ │ │ ├── Default@2x.png │ │ │ └── LaunchScreen.storyboard │ │ └── XamarinTestRunner.iOS.csproj │ └── XamarinTestRunner │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── MainPage.xaml │ │ ├── MainPage.xaml.cs │ │ └── XamarinTestRunner.csproj ├── build Android.cmd ├── build UWP.cmd ├── build all.cmd ├── build iOS.cmd ├── build_Android.cmd ├── build_UWP.cmd ├── build_all.cmd ├── build_iOS.cmd └── readme.md ├── genConfig.json └── images ├── CSharp ├── NewCsProj.png ├── Nuget1.png ├── Nuget2.png ├── PlayFabSourceFolder1.png ├── PlayFabSourceFolder2.png └── SdkImported.png └── Xamarin ├── BuildSettings.png ├── ImportRename.png ├── NetHttp.png ├── NewProj.png └── UpdateXamarin.png /.gitignore: -------------------------------------------------------------------------------- 1 | **/*[Tt]estTitleData.json* 2 | 3 | # Intermediate files 4 | .vs/ 5 | bin/ 6 | obj/ 7 | 8 | # Deleted test projects 9 | PlayFabClientSDK/ 10 | PlayFabServerSDK/ 11 | 12 | *.suo 13 | *.user 14 | *.nupkg -------------------------------------------------------------------------------- /CSharpJobTemplate.yml: -------------------------------------------------------------------------------- 1 | # JOB LEVEL TEMPLATE: 2 | # Used to build CSharp 3 | # Reusable 4 | # Meant to be run from the single CSharpTemplate pipeline (default), or 5 | # from a multi-pipeline such as publishing (should specify alternate params) 6 | 7 | parameters: 8 | - name: ApiSpecSource 9 | displayName: ApiSpecSource 10 | type: string 11 | default: -apiSpecGitUrl https://raw.githubusercontent.com/PlayFab/API_Specs/master/ 12 | - name: CommitMessage 13 | displayName: CommitMessage 14 | type: string 15 | default: Automated build from ADO Pipeline 16 | - name: GitDestBranch 17 | displayName: GitDestBranch 18 | type: string 19 | default: doNotCommit 20 | - name: GitJSetupBranch 21 | displayName: GitJSetupBranch 22 | type: string 23 | default: master 24 | - name: GitSdkGenBranch 25 | displayName: GitSdkGenBranch 26 | type: string 27 | default: master 28 | - name: isVersioned 29 | displayName: isVersioned 30 | type: boolean 31 | default: false 32 | - name: TestCompile 33 | displayName: TestCompile 34 | type: boolean 35 | default: true 36 | - name: TestWin32NetCore 37 | displayName: TestWin32NetCore 38 | type: boolean 39 | default: true 40 | - name: TestWin32Basic 41 | displayName: TestWin32Basic 42 | type: boolean 43 | default: true 44 | - name: SelfTemplateResource 45 | displayName: SelfTemplateResource 46 | type: string 47 | default: self 48 | 49 | jobs: 50 | - job: CSharpJobTemplate 51 | steps: 52 | - bash: echo CSharpJobTemplate 53 | - job: CSharpTemplate 54 | pool: 55 | vmImage: 'windows-latest' 56 | steps: 57 | - template: CSharpStepTemplate.yml 58 | parameters: 59 | ApiSpecSource: ${{ parameters.ApiSpecSource }} 60 | CommitMessage: ${{ parameters.CommitMessage }} 61 | GitDestBranch: ${{ parameters.GitDestBranch }} 62 | GitJSetupBranch: ${{ parameters.GitJSetupBranch }} 63 | GitSdkGenBranch: ${{ parameters.GitSdkGenBranch }} 64 | isVersioned: ${{ parameters.isVersioned }} 65 | TestCompile: ${{ parameters.TestCompile }} 66 | TestWin32NetCore: ${{ parameters.TestWin32NetCore }} 67 | TestWin32Basic: ${{ parameters.TestWin32Basic }} 68 | SelfTemplateResource: ${{ parameters.SelfTemplateResource }} 69 | -------------------------------------------------------------------------------- /CSharpResourceTemplate.yml: -------------------------------------------------------------------------------- 1 | # TOP LEVEL TEMPLATE: 2 | # Can only be used to run the single CSharpTemplate pipeline. 3 | # Why: Resources can only be defined once. 4 | # This determines the resources available to all "jobs" and "steps" no matter which templates are loaded after this 5 | # If resources is ever defined again, it'll break so badly that the pipeline won't even parse 6 | 7 | resources: 8 | repositories: 9 | - repository: JenkinsSdkSetupScripts 10 | type: github 11 | endpoint: GitHub_PlayFab 12 | name: PlayFab/JenkinsSdkSetupScripts 13 | - repository: API_Specs 14 | type: github 15 | endpoint: GitHub_PlayFab 16 | name: PlayFab/API_Specs 17 | - repository: SdkGenerator 18 | type: github 19 | endpoint: GitHub_PlayFab 20 | name: PlayFab/SdkGenerator 21 | - repository: CSharpSDK 22 | endpoint: GitHub_PlayFab 23 | type: github 24 | name: PlayFab/CSharpSDK 25 | 26 | jobs: 27 | - job: CSharpResourceTemplate 28 | steps: 29 | - bash: echo CSharpResourceTemplate 30 | - template: CSharpJobTemplate.yml 31 | -------------------------------------------------------------------------------- /Licenses/Newtonsoft.Json-License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2007 James Newton-King 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Licenses/uunit-license.txt: -------------------------------------------------------------------------------- 1 | Unity has a custom license and subscription, linked to their editor. 2 | https://unity3d.com/get-unity 3 | 4 | We are not distributing the Unity-editor, or any Unity source. 5 | 6 | Uunit Download location 7 | http://wiki.unity3d.com/index.php?title=UUnit 8 | 9 | License 10 | http://creativecommons.org/licenses/by-sa/3.0/ 11 | 12 | /* 13 | * UUnit system from UnityCommunity 14 | * Heavily modified 15 | * Stripped of all unity-related code 16 | * 0.4 release by pboechat 17 | * http://wiki.unity3d.com/index.php?title=UUnit 18 | * http://creativecommons.org/licenses/by-sa/3.0/ 19 | */ 20 | -------------------------------------------------------------------------------- /PlayFabSDK/PlayFabSDK+Unit.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.902 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlayFabSDK", "source\PlayFabSDK.csproj", "{CCA89497-1426-4F0B-8A11-7E5FB965FB4B}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnittestRunner", "UnittestRunner\UnittestRunner.csproj", "{EE5D7734-02A4-4AFE-B2EF-E38B9C24D2BD}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnittestFormRunner", "WindowsFormsApp1\UnittestFormRunner.csproj", "{172A151B-FD46-478D-B690-0636E8212D39}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {EE5D7734-02A4-4AFE-B2EF-E38B9C24D2BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {EE5D7734-02A4-4AFE-B2EF-E38B9C24D2BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {EE5D7734-02A4-4AFE-B2EF-E38B9C24D2BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {EE5D7734-02A4-4AFE-B2EF-E38B9C24D2BD}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {172A151B-FD46-478D-B690-0636E8212D39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {172A151B-FD46-478D-B690-0636E8212D39}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {172A151B-FD46-478D-B690-0636E8212D39}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {172A151B-FD46-478D-B690-0636E8212D39}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {C7B92AD6-2DDB-4345-9146-C98EA85FBA5F} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /PlayFabSDK/PlayFabSDK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlayFabSDK", "source\PlayFabSDK.csproj", "{CCA89497-1426-4F0B-8A11-7E5FB965FB4B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CCA89497-1426-4F0B-8A11-7E5FB965FB4B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /PlayFabSDK/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | 4 | [assembly: AssemblyTitle("PlayFab CSharp Sdk")] 5 | [assembly: AssemblyDescription("Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services.")] 6 | [assembly: AssemblyCompany("PlayFab")] 7 | [assembly: AssemblyProduct("PlayFabSDK")] 8 | [assembly: AssemblyCopyright("Copyright 2014")] 9 | [assembly: AssemblyTrademark("PlayFab")] 10 | [assembly: NeutralResourcesLanguage("en")] 11 | [assembly: AssemblyVersion("1")] 12 | [assembly: AssemblyFileVersion("1")] 13 | -------------------------------------------------------------------------------- /PlayFabSDK/UnittestRunner/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PlayFabSDK/UnittestRunner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTrademark("")] 9 | [assembly: AssemblyCulture("")] 10 | 11 | // Setting ComVisible to false makes the types in this assembly not visible 12 | // to COM components. If you need to access a type in this assembly from 13 | // COM, set the ComVisible attribute to true on that type. 14 | [assembly: ComVisible(false)] 15 | 16 | // The following GUID is for the ID of the typelib if this project is exposed to COM 17 | [assembly: Guid("d15d2425-303b-4652-b118-5ce36d8b46c8")] 18 | -------------------------------------------------------------------------------- /PlayFabSDK/UnittestRunner/UnittestRunner.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | UnittestRunner 7 | UnittestRunner 8 | 512 9 | 10 | UnittestRunner 11 | 12 | 13 | 14 | UnittestRunner 15 | Copyright © 2015 16 | en 17 | 1.0.0.0 18 | 1.0.0.0 19 | UnittestRunner.UUnitTestRunner 20 | 21 | 22 | 23 | 24 | AnyCPU 25 | true 26 | full 27 | false 28 | TRACE;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 29 | prompt 30 | 4 31 | 32 | 33 | AnyCPU 34 | pdbonly 35 | true 36 | TRACE;DEBUG;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 37 | prompt 38 | 4 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsFormsApp1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button1 = new System.Windows.Forms.Button(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.SuspendLayout(); 34 | // 35 | // button1 36 | // 37 | this.button1.Location = new System.Drawing.Point(707, 12); 38 | this.button1.Name = "button1"; 39 | this.button1.Size = new System.Drawing.Size(81, 41); 40 | this.button1.TabIndex = 0; 41 | this.button1.Text = "button1"; 42 | this.button1.UseVisualStyleBackColor = true; 43 | this.button1.Click += new System.EventHandler(this.button1_Click); 44 | // 45 | // label1 46 | // 47 | this.label1.AutoSize = true; 48 | this.label1.Location = new System.Drawing.Point(12, 9); 49 | this.label1.Name = "label1"; 50 | this.label1.Size = new System.Drawing.Size(35, 13); 51 | this.label1.TabIndex = 1; 52 | this.label1.Text = "label1"; 53 | // 54 | // Form1 55 | // 56 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 57 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 58 | this.ClientSize = new System.Drawing.Size(800, 1010); 59 | this.Controls.Add(this.label1); 60 | this.Controls.Add(this.button1); 61 | this.Name = "Form1"; 62 | this.Text = "Form1"; 63 | this.ResumeLayout(false); 64 | this.PerformLayout(); 65 | 66 | } 67 | 68 | #endregion 69 | 70 | private System.Windows.Forms.Button button1; 71 | private System.Windows.Forms.Label label1; 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace WindowsFormsApp1 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Application.Run(new Form1()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WindowsFormsApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsFormsApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("172a151b-fd46-478d-b690-0636e8212d39")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PlayFabSDK/WindowsFormsApp1/UnittestFormRunner.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net5.0-windows 6 | true 7 | false 8 | WindowsFormsApp1 9 | WindowsFormsApp1 10 | 11 | 12 | 13 | AnyCPU 14 | true 15 | full 16 | false 17 | bin\Debug\ 18 | TRACE;DEBUG;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 19 | prompt 20 | 4 21 | 22 | 23 | 24 | AnyCPU 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | Form1.cs 36 | 37 | 38 | ResXFileCodeGenerator 39 | Resources.Designer.cs 40 | 41 | 42 | True 43 | Resources.resx 44 | True 45 | 46 | 47 | SettingsSingleFileGenerator 48 | Settings.Designer.cs 49 | 50 | 51 | True 52 | Settings.settings 53 | True 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /PlayFabSDK/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/PlayFabSDK/images/icon.png -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabAuthenticationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.AuthenticationModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// The Authentication APIs provide a convenient way to convert classic authentication responses into entity authentication 13 | /// models. These APIs will provide you with the entity authentication token needed for subsequent Entity API calls. The 14 | /// game_server API is designed to create uniquely identifiable game_server entities. The game_server Entity token can be 15 | /// used to call Matchmaking Lobby and Pubsub for server scenarios. 16 | /// 17 | public interface IPlayFabAuthenticationInstanceAPI 18 | { 19 | /// 20 | /// Create a game_server entity token and return a new or existing game_server entity. 21 | /// 22 | Task> AuthenticateGameServerWithCustomIdAsync( 23 | AuthenticateCustomIdRequest request, 24 | object customData = null, 25 | Dictionary extraHeaders = null); 26 | 27 | /// 28 | /// Delete a game_server entity. 29 | /// 30 | Task> DeleteAsync( 31 | DeleteRequest request, 32 | object customData = null, 33 | Dictionary extraHeaders = null); 34 | 35 | /// 36 | /// Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid 37 | /// Entity Token. 38 | /// 39 | Task> GetEntityTokenAsync( 40 | GetEntityTokenRequest request, 41 | object customData = null, 42 | Dictionary extraHeaders = null); 43 | 44 | /// 45 | /// Method for a server to validate a client provided EntityToken. Only callable by the title entity. 46 | /// 47 | Task> ValidateEntityTokenAsync( 48 | ValidateEntityTokenRequest request, 49 | object customData = null, 50 | Dictionary extraHeaders = null); 51 | } 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabDataInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.DataModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// Store arbitrary data associated with an entity. Objects are small (~1KB) JSON-compatible objects which are stored 13 | /// directly on the entity profile. Objects are made available for use in other PlayFab contexts, such as PlayStream events 14 | /// and CloudScript functions. Files can efficiently store data of any size or format. Both objects and files support a 15 | /// flexible permissions system to control read and write access by other entities. 16 | /// 17 | public interface IPlayFabDataInstanceAPI 18 | { 19 | /// 20 | /// Abort pending file uploads to an entity's profile. 21 | /// 22 | Task> AbortFileUploadsAsync( 23 | AbortFileUploadsRequest request, 24 | object customData = null, 25 | Dictionary extraHeaders = null); 26 | 27 | /// 28 | /// Delete files on an entity's profile. 29 | /// 30 | Task> DeleteFilesAsync( 31 | DeleteFilesRequest request, 32 | object customData = null, 33 | Dictionary extraHeaders = null); 34 | 35 | /// 36 | /// Finalize file uploads to an entity's profile. 37 | /// 38 | Task> FinalizeFileUploadsAsync( 39 | FinalizeFileUploadsRequest request, 40 | object customData = null, 41 | Dictionary extraHeaders = null); 42 | 43 | /// 44 | /// Retrieves file metadata from an entity's profile. 45 | /// 46 | Task> GetFilesAsync( 47 | GetFilesRequest request, 48 | object customData = null, 49 | Dictionary extraHeaders = null); 50 | 51 | /// 52 | /// Retrieves objects from an entity's profile. 53 | /// 54 | Task> GetObjectsAsync( 55 | GetObjectsRequest request, 56 | object customData = null, 57 | Dictionary extraHeaders = null); 58 | 59 | /// 60 | /// Initiates file uploads to an entity's profile. 61 | /// 62 | Task> InitiateFileUploadsAsync( 63 | InitiateFileUploadsRequest request, 64 | object customData = null, 65 | Dictionary extraHeaders = null); 66 | 67 | /// 68 | /// Sets objects on an entity's profile. 69 | /// 70 | Task> SetObjectsAsync( 71 | SetObjectsRequest request, 72 | object customData = null, 73 | Dictionary extraHeaders = null); 74 | } 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabInsightsInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.InsightsModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// Manage the Insights performance level and data storage retention settings. 13 | /// 14 | public interface IPlayFabInsightsInstanceAPI 15 | { 16 | /// 17 | /// Gets the current values for the Insights performance and data storage retention, list of pending operations, and the 18 | /// performance and data storage retention limits. 19 | /// 20 | Task> GetDetailsAsync( 21 | InsightsEmptyRequest request, 22 | object customData = null, 23 | Dictionary extraHeaders = null); 24 | 25 | /// 26 | /// Retrieves the range of allowed values for performance and data storage retention values as well as the submeter details 27 | /// for each performance level. 28 | /// 29 | Task> GetLimitsAsync( 30 | InsightsEmptyRequest request, 31 | object customData = null, 32 | Dictionary extraHeaders = null); 33 | 34 | /// 35 | /// Gets the status of a SetPerformance or SetStorageRetention operation. 36 | /// 37 | Task> GetOperationStatusAsync( 38 | InsightsGetOperationStatusRequest request, 39 | object customData = null, 40 | Dictionary extraHeaders = null); 41 | 42 | /// 43 | /// Gets a list of pending SetPerformance and/or SetStorageRetention operations for the title. 44 | /// 45 | Task> GetPendingOperationsAsync( 46 | InsightsGetPendingOperationsRequest request, 47 | object customData = null, 48 | Dictionary extraHeaders = null); 49 | 50 | /// 51 | /// Sets the Insights performance level value for the title. 52 | /// 53 | Task> SetPerformanceAsync( 54 | InsightsSetPerformanceRequest request, 55 | object customData = null, 56 | Dictionary extraHeaders = null); 57 | 58 | /// 59 | /// Sets the Insights data storage retention days value for the title. 60 | /// 61 | Task> SetStorageRetentionAsync( 62 | InsightsSetStorageRetentionRequest request, 63 | object customData = null, 64 | Dictionary extraHeaders = null); 65 | } 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabLocalizationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// The Localization APIs give you the tools needed to manage language setup in your title. 13 | /// 14 | public interface IPlayFabLocalizationInstanceAPI 15 | { 16 | /// 17 | /// Retrieves the list of allowed languages, only accessible by title entities 18 | /// 19 | Task> GetLanguageListAsync( 20 | GetLanguageListRequest request, 21 | object customData = null, 22 | Dictionary extraHeaders = null); 23 | } 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabPlugin.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | /// 4 | /// Base interface of any PlayFab SDK plugin. 5 | /// 6 | public interface IPlayFabPlugin 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/IPlayFabProfilesInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.ProfilesModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// All PlayFab entities have profiles, which hold top-level properties about the entity. These APIs give you the tools 13 | /// needed to manage entity profiles. 14 | /// 15 | public interface IPlayFabProfilesInstanceAPI 16 | { 17 | /// 18 | /// Gets the global title access policy 19 | /// 20 | Task> GetGlobalPolicyAsync( 21 | GetGlobalPolicyRequest request, 22 | object customData = null, 23 | Dictionary extraHeaders = null); 24 | 25 | /// 26 | /// Retrieves the entity's profile. 27 | /// 28 | Task> GetProfileAsync( 29 | GetEntityProfileRequest request, 30 | object customData = null, 31 | Dictionary extraHeaders = null); 32 | 33 | /// 34 | /// Retrieves the entity's profile. 35 | /// 36 | Task> GetProfilesAsync( 37 | GetEntityProfilesRequest request, 38 | object customData = null, 39 | Dictionary extraHeaders = null); 40 | 41 | /// 42 | /// Retrieves the title player accounts associated with the given master player account. 43 | /// 44 | Task> GetTitlePlayersFromMasterPlayerAccountIdsAsync( 45 | GetTitlePlayersFromMasterPlayerAccountIdsRequest request, 46 | object customData = null, 47 | Dictionary extraHeaders = null); 48 | 49 | /// 50 | /// Retrieves the title player accounts associated with the given XUIDs. 51 | /// 52 | Task> GetTitlePlayersFromXboxLiveIDsAsync( 53 | GetTitlePlayersFromXboxLiveIDsRequest request, 54 | object customData = null, 55 | Dictionary extraHeaders = null); 56 | 57 | /// 58 | /// Update the display name of the entity 59 | /// 60 | Task> SetDisplayNameAsync( 61 | SetDisplayNameRequest request, 62 | object customData = null, 63 | Dictionary extraHeaders = null); 64 | 65 | /// 66 | /// Sets the global title access policy 67 | /// 68 | Task> SetGlobalPolicyAsync( 69 | SetGlobalPolicyRequest request, 70 | object customData = null, 71 | Dictionary extraHeaders = null); 72 | 73 | /// 74 | /// Updates the entity's language. The precedence hierarchy for communication to the player is Title Player Account 75 | /// language, Master Player Account language, and then title default language if the first two aren't set or supported. 76 | /// 77 | Task> SetProfileLanguageAsync( 78 | SetProfileLanguageRequest request, 79 | object customData = null, 80 | Dictionary extraHeaders = null); 81 | 82 | /// 83 | /// Sets the profiles access policy 84 | /// 85 | Task> SetProfilePolicyAsync( 86 | SetEntityProfilePolicyRequest request, 87 | object customData = null, 88 | Dictionary extraHeaders = null); 89 | } 90 | } 91 | #endif 92 | -------------------------------------------------------------------------------- /PlayFabSDK/source/ISerializerPlugin.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | /// 4 | /// Interface of any data serializer SDK plugin. 5 | /// 6 | public interface ISerializerPlugin : IPlayFabPlugin 7 | { 8 | T DeserializeObject(string serialized); 9 | T DeserializeObject(string serialized, object serializerStrategy); 10 | object DeserializeObject(string serialized); 11 | 12 | string SerializeObject(object obj); 13 | string SerializeObject(object obj, object serializerStrategy); 14 | } 15 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/ITransportPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab 5 | { 6 | /// 7 | /// Interface of any transport SDK plugin. 8 | /// 9 | public interface ITransportPlugin : IPlayFabPlugin 10 | { 11 | Task DoPost(string fullPath, object request, Dictionary headers); 12 | } 13 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/Json/NewtonsoftWrapper.cs: -------------------------------------------------------------------------------- 1 | #if USING_NEWTONSOFT 2 | using System; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Converters; 5 | using System.IO; 6 | 7 | namespace PlayFab.Json 8 | { 9 | public class NewtonsofJsonInstance : ISerializer 10 | { 11 | public static JsonSerializerSettings JsonSettings = new JsonSerializerSettings 12 | { 13 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 14 | Converters = { new StringEnumConverter(), new TimeSpanFloatSeconds(), new IsoDateTimeConverter { DateTimeFormat = PlayFabUtil.DefaultDateTimeFormats[0] } }, 15 | }; 16 | private static Formatting JsonFormatting = Formatting.None; 17 | 18 | private readonly JsonSerializer _serializer = JsonSerializer.Create(JsonSettings); 19 | 20 | public T DeserializeObject(string json) 21 | { 22 | return _serializer.Deserialize(new JsonTextReader(new StringReader(json))); 23 | } 24 | 25 | public T DeserializeObject(string json, object jsonSerializerStrategy) 26 | { 27 | var customSerializer = JsonSerializer.Create((JsonSerializerSettings)jsonSerializerStrategy); 28 | return customSerializer.Deserialize(new JsonTextReader(new StringReader(json))); 29 | } 30 | 31 | public object DeserializeObject(string json) 32 | { 33 | return _serializer.Deserialize(new JsonTextReader(new StringReader(json))); 34 | } 35 | 36 | public string SerializeObject(object json) 37 | { 38 | var jsonString = new StringWriter(); 39 | var writer = new JsonTextWriter(jsonString) { Formatting = JsonFormatting }; 40 | _serializer.Serialize(writer, json); 41 | return jsonString.ToString(); 42 | } 43 | 44 | public string SerializeObject(object json, object jsonSerializerStrategy) 45 | { 46 | var customSerializer = JsonSerializer.Create((JsonSerializerSettings)jsonSerializerStrategy); 47 | var jsonString = new StringWriter(); 48 | var writer = new JsonTextWriter(jsonString) { Formatting = JsonFormatting }; 49 | customSerializer.Serialize(writer, json); 50 | return jsonString.ToString(); 51 | } 52 | } 53 | 54 | public class TimeSpanFloatSeconds : JsonConverter 55 | { 56 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 57 | { 58 | var timeSpan = (TimeSpan)value; 59 | serializer.Serialize(writer, timeSpan.TotalSeconds); 60 | } 61 | 62 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 63 | { 64 | return TimeSpan.FromSeconds(serializer.Deserialize(reader)); 65 | } 66 | 67 | public override bool CanConvert(Type objectType) 68 | { 69 | return objectType == typeof(TimeSpan); 70 | } 71 | } 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabApiSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | 4 | namespace PlayFab 5 | { 6 | public class PlayFabApiSettings 7 | { 8 | public readonly Dictionary RequestGetParams = new Dictionary { 9 | { "sdk", PlayFabSettings.SdkVersionString } 10 | }; 11 | /// This is only for customers running a private cluster. Generally you shouldn't touch this 12 | public string ProductionEnvironmentUrl = PlayFabSettings.DefaultProductionEnvironmentUrl; 13 | /// The name of a customer vertical. This is only for customers running a private cluster. Generally you shouldn't touch this 14 | public string VerticalName = null; 15 | 16 | #if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFAB_SECRETKEY 17 | /// You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 18 | public string DeveloperSecretKey = null; 19 | #endif 20 | 21 | /// You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 22 | public string TitleId; 23 | 24 | /// Set to enable Gzip compression on all responses. Defaults to false. 25 | public bool CompressResponses = false; 26 | 27 | 28 | public virtual string GetFullUrl(string apiCall) 29 | { 30 | return PlayFabSettings.GetFullUrl(apiCall, RequestGetParams, this); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabAuthenticationContext.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | public sealed class PlayFabAuthenticationContext 4 | { 5 | public PlayFabAuthenticationContext() 6 | { 7 | } 8 | 9 | public PlayFabAuthenticationContext(string clientSessionTicket, string entityToken, string playFabId, string entityId, string entityType) : this() 10 | { 11 | #if !DISABLE_PLAYFABCLIENT_API 12 | ClientSessionTicket = clientSessionTicket; 13 | PlayFabId = playFabId; 14 | #endif 15 | #if !DISABLE_PLAYFABENTITY_API 16 | EntityToken = entityToken; 17 | EntityId = entityId; 18 | EntityType = entityType; 19 | #endif 20 | } 21 | 22 | public void CopyFrom(PlayFabAuthenticationContext other) 23 | { 24 | #if !DISABLE_PLAYFABCLIENT_API 25 | ClientSessionTicket = other.ClientSessionTicket; 26 | PlayFabId = other.PlayFabId; 27 | #endif 28 | #if !DISABLE_PLAYFABENTITY_API 29 | EntityToken = other.EntityToken; 30 | EntityId = other.EntityId; 31 | EntityType = other.EntityType; 32 | #endif 33 | } 34 | 35 | #if !DISABLE_PLAYFABCLIENT_API 36 | /// Allows access to the ClientAPI 37 | public string ClientSessionTicket; 38 | /// The master player entity Id 39 | public string PlayFabId; 40 | public bool IsClientLoggedIn() 41 | { 42 | return !string.IsNullOrEmpty(ClientSessionTicket); 43 | } 44 | #endif 45 | 46 | #if !DISABLE_PLAYFABENTITY_API 47 | /// Allows access to most Entity APIs 48 | public string EntityToken; 49 | /// 50 | /// Clients: The title player entity Id (unless replaced with a related entity) 51 | /// Servers: The title id (unless replaced with a related entity) 52 | /// 53 | public string EntityId; 54 | /// 55 | /// Describes the type of entity identified by EntityId 56 | /// 57 | public string EntityType; 58 | public bool IsEntityLoggedIn() 59 | { 60 | return !string.IsNullOrEmpty(EntityToken); 61 | } 62 | #endif 63 | 64 | public void ForgetAllCredentials() 65 | { 66 | #if !DISABLE_PLAYFABCLIENT_API 67 | PlayFabId = null; 68 | ClientSessionTicket = null; 69 | #endif 70 | #if !DISABLE_PLAYFABENTITY_API 71 | EntityToken = null; 72 | EntityId = null; 73 | EntityType = null; 74 | #endif 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabHttp/HttpTransportWithDecompression.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | 4 | namespace PlayFab.Internal 5 | { 6 | internal class HttpTransportWithDecompression : PlayFabSysHttp 7 | { 8 | public HttpTransportWithDecompression() 9 | { 10 | var handler = new HttpClientHandler 11 | { 12 | AutomaticDecompression = DecompressionMethods.GZip, 13 | }; 14 | _client = new HttpClient(handler); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabHttp/IPlayFabHttp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PlayFab.Internal 4 | { 5 | [Obsolete("This interface is deprecated, please use PlayFab.ITransportPlugin instead.", false)] 6 | public interface IPlayFabHttp: ITransportPlugin 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabHttp/PlayFabHttp.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab.Internal 5 | { 6 | /// 7 | /// This is a base-class for all Api-request objects. 8 | /// It is currently unfinished, but we will add result-specific properties, 9 | /// and add template where-conditions to make some code easier to follow 10 | /// 11 | public class PlayFabRequestCommon 12 | { 13 | public PlayFabAuthenticationContext AuthenticationContext; 14 | } 15 | 16 | /// 17 | /// This is a base-class for all Api-result objects. 18 | /// It is currently unfinished, but we will add result-specific properties, 19 | /// and add template where-conditions to make some code easier to follow 20 | /// 21 | public class PlayFabResultCommon 22 | { 23 | } 24 | 25 | public class PlayFabLoginResultCommon : PlayFabResultCommon 26 | { 27 | public PlayFabAuthenticationContext AuthenticationContext; 28 | } 29 | 30 | public class PlayFabJsonError 31 | { 32 | public int code; 33 | public string status; 34 | public string error; 35 | public int errorCode; 36 | public string errorMessage; 37 | public Dictionary errorDetails = null; 38 | public uint? retryAfterSeconds = null; 39 | } 40 | 41 | public class PlayFabJsonSuccess where TResult : PlayFabResultCommon 42 | { 43 | public int code; 44 | public string status; 45 | public TResult data; 46 | } 47 | 48 | public static class PlayFabHttp 49 | { 50 | public static async Task DoPost(string urlPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 51 | { 52 | await new PlayFabUtil.SynchronizationContextRemover(); 53 | 54 | var settings = instanceSettings ?? PlayFabSettings.staticSettings; 55 | var fullPath = settings.GetFullUrl(urlPath); 56 | return await _DoPost(fullPath, request, authType, authKey, extraHeaders, instanceSettings); 57 | } 58 | 59 | public static async Task DoPostWithFullUri(string fullUriPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 60 | { 61 | await new PlayFabUtil.SynchronizationContextRemover(); 62 | 63 | return await _DoPost(fullUriPath, request, authType, authKey, extraHeaders, instanceSettings); 64 | } 65 | 66 | private static async Task _DoPost(string fullPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 67 | { 68 | var settings = instanceSettings ?? PlayFabSettings.staticSettings; 69 | var titleId = settings.TitleId; 70 | if (titleId == null) 71 | throw new PlayFabException(PlayFabExceptionCode.TitleNotSet, "You must set your titleId before making an api call"); 72 | var transport = settings.CompressResponses ? 73 | PluginManager.GetPlugin(PluginContract.PlayFab_Transport_Decompress) : 74 | PluginManager.GetPlugin(PluginContract.PlayFab_Transport); 75 | 76 | var headers = new Dictionary(); 77 | if (authType != null && authKey != null) 78 | { 79 | headers[authType] = authKey; 80 | } 81 | if (extraHeaders != null) 82 | { 83 | foreach (var extraHeader in extraHeaders) 84 | { 85 | headers.Add(extraHeader.Key, extraHeader.Value); 86 | } 87 | } 88 | 89 | return await transport.DoPost(fullPath, request, headers); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabHttp/PlayFabPollyHttp.cs: -------------------------------------------------------------------------------- 1 | using Polly; 2 | using Polly.CircuitBreaker; 3 | using Polly.Retry; 4 | using Polly.Timeout; 5 | using Polly.Wrap; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Net; 10 | using System.Net.Http; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab.Internal 14 | { 15 | /// 16 | /// A Polly wrapped version of PlayFab Transport plug in which used 17 | /// when making http requests to PlayFab Main Server. 18 | /// 19 | public class PlayFabPollyHttp : PlayFabSysHttp, ITransportPlugin 20 | { 21 | /// 22 | /// Http requests worth retrying 23 | /// 24 | public HashSet HttpStatusCodesWorthRetrying = new HashSet { 25 | 408, //HttpStatusCode.RequestTimeout 26 | 409, //HttpStatusCode.Conflict 27 | 429, //HttpStatusCode.TooManyRequests 28 | 500, //HttpStatusCode.InternalServerError 29 | 502, //HttpStatusCode.BadGateway 30 | 503, //HttpStatusCode.ServiceUnavailable 31 | 504 //HttpStatusCode.GatewayTimeout 32 | }; 33 | 34 | /// 35 | /// Gets or set the name of the plug in. Used by the PluginManager when looking up 36 | /// plugins upon request. 37 | /// 38 | public string Name; 39 | 40 | /// 41 | /// Gets the PlayFab retry policies 42 | /// 43 | public AsyncRetryPolicy RetryPolicy { get; private set; } 44 | 45 | /// 46 | /// Constructor for objects of type PollyTransportPlug. 47 | /// 48 | /// Sets a default resilience policy with the following common settings 49 | /// 1) Sets the retry to 3 times and has an embedded backoff. 50 | /// 51 | /// 52 | public PlayFabPollyHttp() 53 | { 54 | var jitterer = new Random(); 55 | var retryPolicy = Policy 56 | .Handle() 57 | .OrResult(r => r != null && (r as PlayFabError) != null && HttpStatusCodesWorthRetrying.Contains((r as PlayFabError).HttpCode)) 58 | .WaitAndRetryAsync(1, 59 | retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)) // exponential back-off: 2, 4, 8 etc 60 | + TimeSpan.FromMilliseconds(jitterer.Next(0, 1000))); // plus some jitter: up to 1 61 | RetryPolicy = retryPolicy; 62 | 63 | Name = "PlayFabWithPolly"; 64 | } 65 | 66 | /// 67 | public new async Task DoPost(string fullPath, object request, Dictionary headers) 68 | { 69 | object doPostResult = await RetryPolicy 70 | .ExecuteAsync(async () => 71 | { 72 | return await base.DoPost(fullPath, request, headers); 73 | }); 74 | 75 | return doPostResult; 76 | } 77 | 78 | /// 79 | /// Overrides the Polly Policies to enforce. 80 | /// 81 | public void OverridePolicies(AsyncRetryPolicy policy) 82 | { 83 | RetryPolicy = policy; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabLocalizationAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | #pragma warning disable 0649 6 | using System; 7 | // This is required for the Obsolete Attribute flag 8 | // which is not always present in all API's 9 | #pragma warning restore 0649 10 | using System.Collections.Generic; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab 14 | { 15 | /// 16 | /// The Localization APIs give you the tools needed to manage language setup in your title. 17 | /// 18 | public static class PlayFabLocalizationAPI 19 | { 20 | /// 21 | /// Verify entity login. 22 | /// 23 | public static bool IsEntityLoggedIn() 24 | { 25 | return PlayFabSettings.staticPlayer.IsEntityLoggedIn(); 26 | } 27 | 28 | /// 29 | /// Clear the Client SessionToken which allows this Client to call API calls requiring login. 30 | /// A new/fresh login will be required after calling this. 31 | /// 32 | public static void ForgetAllCredentials() 33 | { 34 | PlayFabSettings.staticPlayer.ForgetAllCredentials(); 35 | } 36 | 37 | /// 38 | /// Retrieves the list of allowed languages, only accessible by title entities 39 | /// 40 | public static async Task> GetLanguageListAsync(GetLanguageListRequest request, object customData = null, Dictionary extraHeaders = null) 41 | { 42 | await new PlayFabUtil.SynchronizationContextRemover(); 43 | 44 | var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer; 45 | var requestSettings = PlayFabSettings.staticSettings; 46 | if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method"); 47 | 48 | 49 | var httpResult = await PlayFabHttp.DoPost("/Locale/GetLanguageList", request, "X-EntityToken", requestContext.EntityToken, extraHeaders); 50 | if (httpResult is PlayFabError) 51 | { 52 | var error = (PlayFabError)httpResult; 53 | PlayFabSettings.GlobalErrorHandler?.Invoke(error); 54 | return new PlayFabResult { Error = error, CustomData = customData }; 55 | } 56 | 57 | var resultRawJson = (string)httpResult; 58 | var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson); 59 | var result = resultData.data; 60 | 61 | return new PlayFabResult { Result = result, CustomData = customData }; 62 | } 63 | } 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabLocalizationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | #pragma warning disable 0649 6 | using System; 7 | // This is required for the Obsolete Attribute flag 8 | // which is not always present in all API's 9 | #pragma warning restore 0649 10 | using System.Collections.Generic; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab 14 | { 15 | /// 16 | /// The Localization APIs give you the tools needed to manage language setup in your title. 17 | /// 18 | public class PlayFabLocalizationInstanceAPI : IPlayFabLocalizationInstanceAPI 19 | { 20 | public readonly PlayFabApiSettings apiSettings = null; 21 | public readonly PlayFabAuthenticationContext authenticationContext = null; 22 | 23 | public PlayFabLocalizationInstanceAPI(PlayFabAuthenticationContext context) 24 | { 25 | if (context == null) 26 | throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); 27 | authenticationContext = context; 28 | } 29 | 30 | public PlayFabLocalizationInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context) 31 | { 32 | if (context == null) 33 | throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); 34 | apiSettings = settings; 35 | authenticationContext = context; 36 | } 37 | 38 | /// 39 | /// Verify entity login. 40 | /// 41 | public bool IsEntityLoggedIn() 42 | { 43 | return authenticationContext == null ? false : authenticationContext.IsEntityLoggedIn(); 44 | } 45 | 46 | /// 47 | /// Clear the Client SessionToken which allows this Client to call API calls requiring login. 48 | /// A new/fresh login will be required after calling this. 49 | /// 50 | public void ForgetAllCredentials() 51 | { 52 | authenticationContext?.ForgetAllCredentials(); 53 | } 54 | 55 | /// 56 | /// Retrieves the list of allowed languages, only accessible by title entities 57 | /// 58 | public async Task> GetLanguageListAsync(GetLanguageListRequest request, object customData = null, Dictionary extraHeaders = null) 59 | { 60 | await new PlayFabUtil.SynchronizationContextRemover(); 61 | 62 | var requestContext = request?.AuthenticationContext ?? authenticationContext; 63 | var requestSettings = apiSettings ?? PlayFabSettings.staticSettings; 64 | if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method"); 65 | 66 | var httpResult = await PlayFabHttp.DoPost("/Locale/GetLanguageList", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings); 67 | if (httpResult is PlayFabError) 68 | { 69 | var error = (PlayFabError)httpResult; 70 | PlayFabSettings.GlobalErrorHandler?.Invoke(error); 71 | return new PlayFabResult { Error = error, CustomData = customData }; 72 | } 73 | 74 | var resultRawJson = (string)httpResult; 75 | var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson); 76 | var result = resultData.data; 77 | 78 | return new PlayFabResult { Result = result, CustomData = customData }; 79 | } 80 | 81 | } 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabLocalizationModels.cs: -------------------------------------------------------------------------------- 1 | using PlayFab.Internal; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace PlayFab.LocalizationModels 6 | { 7 | public class GetLanguageListRequest : PlayFabRequestCommon 8 | { 9 | /// 10 | /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). 11 | /// 12 | public Dictionary CustomTags ; 13 | 14 | } 15 | 16 | public class GetLanguageListResponse : PlayFabResultCommon 17 | { 18 | /// 19 | /// The list of allowed languages, in BCP47 two-letter format 20 | /// 21 | public List LanguageList ; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabSDK.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | PlayFabAllSDK 6 | PlayFabAllSDK 7 | en-US 8 | 512 9 | 10 | PlayFabAllSDK 11 | 1.210.251010 12 | PlayFab CSharp Sdk 13 | Microsoft 14 | Microsoft 15 | © Microsoft Corporation. All rights reserved. 16 | LICENSE 17 | https://github.com/PlayFab/CSharpSDK 18 | icon.png 19 | false 20 | Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services. 21 | PlayFab 22 | PlayFabSDK 23 | PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native 24 | https://docs.microsoft.com/gaming/playfab/release-notes#251010 25 | en 26 | 1 27 | 1 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | TRACE;DEBUG;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 35 | prompt 36 | 4 37 | 38 | 39 | 40 | pdbonly 41 | true 42 | TRACE;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 43 | prompt 44 | 4 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PlayFabSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace PlayFab 6 | { 7 | public class PlayFabSettings 8 | { 9 | public const string SdkVersion = "1.210.251010"; 10 | public const string BuildIdentifier = "adobuild_csharpsdk_117"; 11 | public const string SdkVersionString = "CSharpSDK-1.210.251010"; 12 | /// This is only for customers running a private cluster. Generally you shouldn't touch this 13 | public static string DefaultProductionEnvironmentUrl = "playfabapi.com"; 14 | 15 | public static ErrorCallback GlobalErrorHandler; 16 | 17 | public readonly static PlayFabApiSettings staticSettings = new PlayFabApiSettings(); 18 | // This field will likely be removed someday 19 | internal readonly static PlayFabAuthenticationContext staticPlayer = new PlayFabAuthenticationContext(); 20 | 21 | #region Deprecated staticSettings redirect properties 22 | [Obsolete("Moved to PlayFabSettings.staticSettings.RequestGetParams")] 23 | public static Dictionary RequestGetParams { get { return staticSettings.RequestGetParams; } } 24 | 25 | [Obsolete("Moved to PlayFabSettings.staticSettings.ProductionEnvironmentUrl")] 26 | public static string ProductionEnvironmentUrl { get { return staticSettings.ProductionEnvironmentUrl; } set { staticSettings.ProductionEnvironmentUrl = value; } } 27 | 28 | [Obsolete("Moved to PlayFabSettings.staticSettings.VerticalName")] 29 | public static string VerticalName { get { return staticSettings.VerticalName; } set { staticSettings.VerticalName = value; } } 30 | 31 | #if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFAB_SECRETKEY 32 | [Obsolete("Moved to PlayFabSettings.staticSettings.DeveloperSecretKey")] 33 | public static string DeveloperSecretKey { get { return staticSettings.DeveloperSecretKey; } set { staticSettings.DeveloperSecretKey = value; } } 34 | #endif 35 | 36 | [Obsolete("Moved to PlayFabSettings.staticSettings.TitleId")] 37 | public static string TitleId { get { return staticSettings.TitleId; } set { staticSettings.TitleId = value; } } 38 | #endregion Deprecated staticSettingsredirect properties 39 | 40 | #if !NET45 && !NETSTANDARD2_0 && !UNITY_EDITOR && !UNITY_STANDALONE 41 | private static string _localApiServer; 42 | #endif 43 | 44 | public static string LocalApiServer 45 | { 46 | get 47 | { 48 | #if NET45 || NETSTANDARD2_0 || UNITY_EDITOR || UNITY_STANDALONE 49 | return PlayFabUtil.GetLocalSettingsFile().LocalApiServer; 50 | #else 51 | return _localApiServer; 52 | #endif 53 | } 54 | #if !NET45 && !NETSTANDARD2_0 && !UNITY_EDITOR && !UNITY_STANDALONE 55 | set 56 | { 57 | _localApiServer = value; 58 | } 59 | #endif 60 | } 61 | 62 | public static string GetFullUrl(string apiCall, Dictionary getParams, PlayFabApiSettings instanceSettings = null) 63 | { 64 | StringBuilder sb = new StringBuilder(1000); 65 | 66 | var apiSettings = instanceSettings ?? staticSettings; 67 | var baseUrl = apiSettings?.ProductionEnvironmentUrl; 68 | 69 | 70 | if (!baseUrl.StartsWith("http")) 71 | { 72 | sb.Append("https://"); 73 | if (!string.IsNullOrEmpty(apiSettings?.TitleId)) 74 | { 75 | sb.Append(apiSettings.TitleId).Append("."); 76 | } 77 | if (!string.IsNullOrEmpty(apiSettings?.VerticalName)) 78 | { 79 | sb.Append(apiSettings?.VerticalName).Append("."); 80 | } 81 | } 82 | 83 | 84 | sb.Append(baseUrl).Append(apiCall); 85 | 86 | if (getParams != null) 87 | { 88 | bool firstParam = true; 89 | foreach (var paramPair in getParams) 90 | { 91 | if (firstParam) 92 | { 93 | sb.Append("?"); 94 | firstParam = false; 95 | } 96 | else 97 | { 98 | sb.Append("&"); 99 | } 100 | sb.Append(paramPair.Key).Append("=").Append(paramPair.Value); 101 | } 102 | } 103 | 104 | return sb.ToString(); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /PlayFabSDK/source/PluginContract.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | public enum PluginContract 4 | { 5 | PlayFab_Serializer, 6 | PlayFab_Transport, 7 | PlayFab_Transport_Decompress 8 | } 9 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/PluginManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using PlayFab.Internal; 4 | 5 | namespace PlayFab 6 | { 7 | public class PluginManager 8 | { 9 | private ConcurrentDictionary, IPlayFabPlugin> plugins = new ConcurrentDictionary, IPlayFabPlugin>(); 10 | 11 | /// 12 | /// The singleton instance of plugin manager. 13 | /// 14 | private static readonly PluginManager Instance = new PluginManager(); 15 | 16 | private PluginManager() 17 | { 18 | } 19 | 20 | /// 21 | /// Gets a plugin. 22 | /// If a plugin with specified contract and optional instance name does not exist, it will create a new one. 23 | /// 24 | /// The plugin contract. 25 | /// The optional plugin instance name. Instance names allow to have mulptiple plugins with the same contract. 26 | /// The plugin instance. 27 | public static T GetPlugin(PluginContract contract, string instanceName = "") where T : IPlayFabPlugin 28 | { 29 | return (T)Instance.GetPluginInternal(contract, instanceName); 30 | } 31 | 32 | /// 33 | /// Sets a custom plugin. 34 | /// If a plugin with specified contract and optional instance name already exists, it will be replaced with specified instance. 35 | /// 36 | /// The plugin instance. 37 | /// The app contract of plugin. 38 | /// The optional plugin instance name. Instance names allow to have mulptiple plugins with the same contract. 39 | public static void SetPlugin(IPlayFabPlugin plugin, PluginContract contract, string instanceName = "") 40 | { 41 | Instance.SetPluginInternal(plugin, contract, instanceName); 42 | } 43 | 44 | private IPlayFabPlugin GetPluginInternal(PluginContract contract, string instanceName) 45 | { 46 | var key = new Tuple(contract, instanceName); 47 | IPlayFabPlugin plugin; 48 | if (!this.plugins.TryGetValue(key, out plugin)) 49 | { 50 | // Requested plugin is not in the cache, create the default one 51 | switch (contract) 52 | { 53 | case PluginContract.PlayFab_Serializer: 54 | plugin = this.CreatePlugin(); 55 | break; 56 | case PluginContract.PlayFab_Transport: 57 | plugin = this.CreatePlugin(); 58 | break; 59 | case PluginContract.PlayFab_Transport_Decompress: 60 | plugin = this.CreatePlugin(); 61 | break; 62 | default: 63 | throw new ArgumentException("This contract is not supported", nameof(contract)); 64 | } 65 | 66 | this.plugins[key] = plugin; 67 | } 68 | 69 | return plugin; 70 | } 71 | 72 | private void SetPluginInternal(IPlayFabPlugin plugin, PluginContract contract, string instanceName) 73 | { 74 | if (plugin == null) 75 | { 76 | throw new ArgumentNullException(nameof(plugin), "Plugin instance cannot be null"); 77 | } 78 | 79 | var key = new Tuple(contract, instanceName); 80 | this.plugins[key] = plugin; 81 | } 82 | 83 | private IPlayFabPlugin CreatePlugin() where T : IPlayFabPlugin, new() 84 | { 85 | return (IPlayFabPlugin)Activator.CreateInstance(typeof(T).AsType()); 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /PlayFabSDK/source/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | 4 | [assembly: AssemblyTrademark("PlayFab")] 5 | -------------------------------------------------------------------------------- /PlayFabSDK/source/Qos/IRegionPinger.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab.QoS 5 | { 6 | public interface IRegionPinger 7 | { 8 | Task PingAsync(); 9 | QosRegionResult GetResult(); 10 | } 11 | } 12 | #endif -------------------------------------------------------------------------------- /PlayFabSDK/source/Qos/QosErrorCode.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | namespace PlayFab.QoS 3 | { 4 | public enum QosErrorCode 5 | { 6 | Success = 0, 7 | NotLoggedIn = 1, 8 | FailedToRetrieveServerList = 2, 9 | FailedToUploadQosResult = 3, 10 | Timeout = 4, 11 | NoResult = 5, 12 | } 13 | } 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /PlayFabSDK/source/Qos/QosRegionResult.cs: -------------------------------------------------------------------------------- 1 |  2 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 3 | namespace PlayFab.QoS 4 | { 5 | using System.Collections.Generic; 6 | 7 | public class QosRegionResult 8 | { 9 | public string Region; 10 | 11 | public int LatencyMs; 12 | 13 | public IReadOnlyList RawMeasurements; 14 | 15 | public int NumTimeouts; 16 | 17 | public int ErrorCode; 18 | } 19 | 20 | internal class QosRegionResultSummary 21 | { 22 | public static QosRegionResultSummary CreateFrom(QosRegionResult result) 23 | { 24 | return new QosRegionResultSummary 25 | { 26 | Region = result.Region, 27 | LatencyMs = result.LatencyMs, 28 | ErrorCode = result.ErrorCode, 29 | NumTimeouts = result.NumTimeouts 30 | }; 31 | } 32 | 33 | public string Region; 34 | 35 | public int NumTimeouts; 36 | 37 | public int LatencyMs; 38 | 39 | public int ErrorCode; 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /PlayFabSDK/source/Qos/QosResult.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | namespace PlayFab.QoS 3 | { 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public class QosResult 8 | { 9 | public List RegionResults; 10 | 11 | public int ErrorCode; 12 | 13 | public string ErrorMessage; 14 | } 15 | 16 | /// 17 | /// This class is used to json serialize the content to send to PlayFab without the ErrorMessage 18 | /// 19 | internal class QosResultPlayFabEvent 20 | { 21 | public static QosResultPlayFabEvent CreateFrom(QosResult result) 22 | { 23 | #if (NETSTANDARD && !NETSTANDARD1_1) || NETFRAMEWORK || NETCOREAPP 24 | return new QosResultPlayFabEvent 25 | { 26 | RegionResults = result.RegionResults.ConvertAll(x => new QosRegionResultSummary() 27 | { 28 | Region = x.Region, 29 | ErrorCode = x.ErrorCode, 30 | LatencyMs = x.LatencyMs 31 | }), 32 | ErrorCode = result.ErrorCode 33 | }; 34 | #else 35 | throw new NotSupportedException("QoS ping library is only supported on .net standard 2.0 and newer, .net core or full .net framework"); 36 | #endif 37 | } 38 | 39 | public List RegionResults; 40 | 41 | public int ErrorCode; 42 | } 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /PlayFabSDK/source/Uunit/UUnitAssertException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * UUnit system from UnityCommunity 3 | * Heavily modified 4 | * 0.4 release by pboechat 5 | * http://wiki.unity3d.com/index.php?title=UUnit 6 | * http://creativecommons.org/licenses/by-sa/3.0/ 7 | */ 8 | 9 | using System; 10 | 11 | namespace PlayFab.UUnit 12 | { 13 | /// 14 | /// The internal uunit exception base class, which you can use to capture all UUnit exceptions 15 | /// 16 | public class UUnitException : Exception 17 | { 18 | public UUnitException(string message) : base(message) { } 19 | } 20 | 21 | /// 22 | /// Throw this exception, via UUnitAssert utility function, in order to define when a test has been skipped. 23 | /// The only information shown will be the "skipped" notification 24 | /// 25 | public class UUnitSkipException : UUnitException 26 | { 27 | public UUnitSkipException(string message) : base(message) { } 28 | } 29 | 30 | /// 31 | /// Throw this exception, via UUnitAssert utility functions, in order to define when a test has failed. 32 | /// The traceback and Message will automatically be displayed as a failure 33 | /// 34 | public class UUnitAssertException : UUnitException 35 | { 36 | public UUnitAssertException(string message) : base(message) { } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /PlayFabSDK/source/Uunit/tests/PlayFabQosApiTest.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | 3 | namespace PlayFab.UUnit 4 | { 5 | using System; 6 | using ClientModels; 7 | using QoS; 8 | 9 | public class PlayFabQosApiTest : UUnitTestCase 10 | { 11 | private static TestTitleData testTitleData; 12 | 13 | // Functional 14 | private static bool TITLE_INFO_SET = false; 15 | 16 | private readonly PlayFabClientInstanceAPI clientApi = new PlayFabClientInstanceAPI(PlayFabSettings.staticPlayer); 17 | 18 | /// 19 | /// PlayFab Title cannot be created from SDK tests, so you must provide your titleId to run unit tests. 20 | /// (Also, we don't want lots of excess unused titles) 21 | /// 22 | public static void SetTitleInfo(TestTitleData testInputs) 23 | { 24 | TITLE_INFO_SET = true; 25 | testTitleData = testInputs; 26 | } 27 | 28 | public override void SetUp(UUnitTestContext testContext) 29 | { 30 | if (!TITLE_INFO_SET) 31 | testContext.Skip(); // We cannot do client tests if the titleId is not given 32 | } 33 | 34 | public override void Tick(UUnitTestContext testContext) 35 | { 36 | // No work needed, async tests will end themselves 37 | } 38 | 39 | /// 40 | /// SERVER API 41 | /// Each API instance can be used to login a player separately from any other API instances, 42 | /// and that player’s authentication context is stored in the API instance 43 | /// 44 | [UUnitTest] 45 | public void QosTest(UUnitTestContext testContext) 46 | { 47 | var loginWithCustomIdRequest = new LoginWithCustomIDRequest() 48 | { 49 | CreateAccount = true, 50 | CustomId = "test_Instance1" 51 | }; 52 | 53 | try 54 | { 55 | clientApi.LoginWithCustomIDAsync(loginWithCustomIdRequest, null, testTitleData.extraHeaders).Wait(); 56 | } 57 | catch (AggregateException aggregateException) when (aggregateException.InnerException != null) 58 | { 59 | throw aggregateException.InnerException; 60 | } 61 | 62 | PlayFabQosApi playFabQosApi = new PlayFabQosApi(); 63 | QosResult qoSResult = playFabQosApi.GetQosResultAsync().Result; 64 | 65 | testContext.IntEquals(0, qoSResult.ErrorCode, $"Qos ErrorMessage: {qoSResult.ErrorMessage}"); 66 | testContext.EndTest(UUnitFinishState.PASSED, null); 67 | } 68 | } 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /PlayFabSDK/source/WsaReflectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace PlayFab 6 | { 7 | #if NETFX_CORE 8 | /// Specifies flags that control binding and the way in which the search for members and types is conducted by reflection. 9 | [Flags] 10 | public enum BindingFlags 11 | { 12 | IgnoreCase = 1, 13 | DeclaredOnly = 2, 14 | Instance = 4, 15 | Static = 8, 16 | Public = 16, 17 | NonPublic = 32, 18 | FlattenHierarchy = 64, 19 | } 20 | #endif 21 | 22 | public static class WsaReflectionExtensions 23 | { 24 | public static Type AsType(this Type type) 25 | { 26 | return type; 27 | } 28 | #if !NETFX_CORE 29 | public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object instance) 30 | { 31 | return Delegate.CreateDelegate(delegateType, instance, methodInfo); 32 | } 33 | public static Assembly GetAssembly(this Type type) 34 | { 35 | return type.Assembly; 36 | } 37 | public static Type GetTypeInfo(this Type type) 38 | { 39 | return type; 40 | } 41 | public static string GetDelegateName(this Delegate delegateInstance) 42 | { 43 | return delegateInstance.Method.Name; 44 | } 45 | #else 46 | public static bool IsAssignableFrom(this Type type, Type other) 47 | { 48 | return type.GetTypeInfo().IsAssignableFrom(other.GetTypeInfo()); 49 | } 50 | public static bool IsAssignableFrom(this Type type, TypeInfo other) 51 | { 52 | return type.GetTypeInfo().IsAssignableFrom(other); 53 | } 54 | public static Assembly GetAssembly(this Type type) 55 | { 56 | return type.GetTypeInfo().Assembly; 57 | } 58 | public static bool IsInstanceOfType(this Type type, object obj) 59 | { 60 | return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); 61 | } 62 | public static string GetDelegateName(this Delegate delegateInstance) 63 | { 64 | return delegateInstance.ToString(); 65 | } 66 | public static MethodInfo GetMethod(this Type type, string methodName) 67 | { 68 | return type.GetTypeInfo().GetDeclaredMethod(methodName); 69 | } 70 | public static IEnumerable GetFields(this TypeInfo typeInfo) 71 | { 72 | return typeInfo.DeclaredFields; 73 | } 74 | public static TypeInfo GetTypeInfo(this TypeInfo typeInfo) 75 | { 76 | return typeInfo; 77 | } 78 | public static IEnumerable GetConstructors(this TypeInfo typeInfo) 79 | { 80 | return typeInfo.DeclaredConstructors; 81 | } 82 | public static IEnumerable GetMethods(this TypeInfo typeInfo, BindingFlags ignored) 83 | { 84 | return typeInfo.DeclaredMethods; 85 | } 86 | public static IEnumerable GetTypes(this Assembly assembly) 87 | { 88 | return assembly.DefinedTypes; 89 | } 90 | #endif 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /PluginManager.md: -------------------------------------------------------------------------------- 1 | # PluginManager API 2 | ## 1. Overview: 3 | The SDK provides a set of plugin interfaces and uses PluginManager class to support custom implementation of some SDK components. Currently the following plugin interfaces are supported: 4 | 5 | ```csharp 6 | PlayFab.ISerializerPlugin // - allows to provide a custom JSON serializer 7 | PlayFab.ITransportPlugin // - allows to provide a custom network HTTP client 8 | ``` 9 | 10 | ## 2. Prerequisites: 11 | The SDK is downloaded and set up (see [README.md](README.md) and [CSharpGettingStarted.md](CSharpGettingStarted.md)). Some initialization code is added that sets PlayFab Title ID (e.g. Program.cs as in the Getting Started guide). 12 | 13 | ## 3. Usage sample: 14 | User can optionally add one or more plugins (custom implementations of interfaces listed above): 15 | ```csharp 16 | public class MyJsonSerializer : ISerializerPlugin 17 | { 18 | public T DeserializeObject(string serialized) 19 | { 20 | // custom implementation 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public T DeserializeObject(string serialized, object serializerStrategy) 25 | { 26 | // custom implementation 27 | throw new NotImplementedException(); 28 | } 29 | 30 | public object DeserializeObject(string serialized) 31 | { 32 | // custom implementation 33 | throw new NotImplementedException(); 34 | } 35 | 36 | public string SerializeObject(object obj) 37 | { 38 | // custom implementation 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public string SerializeObject(object obj, object serializerStrategy) 43 | { 44 | // custom implementation 45 | throw new NotImplementedException(); 46 | } 47 | } 48 | 49 | public class MyNetworkTransportClient : ITransportPlugin 50 | { 51 | public Task DoPost(string urlPath, object request, Dictionary headers) 52 | { 53 | // custom implementation 54 | throw new NotImplementedException(); 55 | } 56 | } 57 | ``` 58 | 59 | Then use PluginManager class to set custom plugins before using any other PlayFab API, for example, in the initialization portion of the code, e.g. where PlayFab Title ID is set: 60 | ```csharp 61 | static void Main(string[] args) 62 | { 63 | PlayFabSettings.TitleId = "144"; // Please change this value to your own titleId from PlayFab Game Manager 64 | 65 | // We recommend using the Polly wrapped transport client as this 66 | // will help your services follow better fault tolerance practices 67 | // and proper retrying logic against the PlayFab services. For more 68 | // information, see the PlayFabPollyHttp class summary. 69 | PluginManager.SetPlugin(new PlayFabPollyHttp(), PluginContract.PlayFab_Transport); 70 | 71 | // Optionally set your own custom JSON serializer 72 | PluginManager.SetPlugin(new MyJsonSerializer(), PluginContract.PlayFab_Serializer); 73 | 74 | // Optionally set your own custom HTTP network client 75 | PluginManager.SetPlugin(new MyNetworkTransportClient(), PluginContract.PlayFab_Transport); 76 | 77 | // ... 78 | } 79 | ``` 80 | The SDK will be using these custom plugins instead of the built-in ones. A currently set plugin for any "contract" supported by PlayFab SDK can be obtained from PluginManager class, for example: 81 | 82 | ```csharp 83 | var currentTransportClient = PluginManager.GetPlugin(PluginContract.PlayFab_Transport); 84 | ``` 85 | -------------------------------------------------------------------------------- /Plugins/CloudScript/PlayFabCloudScriptPlugin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.572 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlayFabCloudScriptPlugin", "source\PlayFabCloudScriptPlugin.csproj", "{980236AC-6037-49DA-BF94-9510733632C7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {980236AC-6037-49DA-BF94-9510733632C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {980236AC-6037-49DA-BF94-9510733632C7}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {980236AC-6037-49DA-BF94-9510733632C7}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {980236AC-6037-49DA-BF94-9510733632C7}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | PlayFabCloudScriptPlugin 6 | PlayFabCloudScriptPlugin 7 | en-US 8 | 512 9 | 10 | PlayFabCloudScriptPlugin 11 | 1.210.251010-alpha 12 | PlayFab CSharp CloudScript Plugin 13 | Microsoft 14 | Microsoft 15 | https://raw.githubusercontent.com/PlayFab/CSharpSDK/master/LICENSE 16 | https://github.com/PlayFab/CSharpSDK 17 | https://playfab.com/assets/img/playfab-mark.png 18 | false 19 | Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services. 20 | PlayFab 21 | PlayFabCloudScriptPlugin 22 | Copyright 2025 23 | PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native 24 | https://docs.microsoft.com/gaming/playfab/release-notes#251010 25 | en 26 | 1 27 | 1 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | TRACE;DEBUG;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 35 | prompt 36 | 4 37 | 38 | 39 | 40 | pdbonly 41 | true 42 | TRACE;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 43 | prompt 44 | 4 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSharpSDK README 2 | 3 | 4 | ## 1. Overview: 5 | 6 | SDK for C#/.net environments other than Unity, including Microsoft CLR environments, Mono and Xamarin. 7 | 8 | 9 | ## 2. Prerequisites: 10 | 11 | * Users should be very familiar with the topics covered in our [getting started guide](https://api.playfab.com/docs/general-getting-started). 12 | 13 | To connect to the PlayFab service, your machine must be running TLS v1.2 or better. 14 | * For Windows, this means Windows 7 and above 15 | * [Official Microsoft Documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380516%28v=vs.85%29.aspx) 16 | * [Support for SSL/TLS protocols on Windows](http://blogs.msdn.com/b/kaushal/archive/2011/10/02/support-for-ssl-tls-protocols-on-windows.aspx) 17 | 18 | ## 3. Source Code & Key Repository Components: 19 | 20 | This package contains three different versions of the PlayFab SDK. 21 | 22 | * PlayFabClientSDK - This version contains only client libraries and is designed for integration with your game client 23 | * PlayFabServerSDK - Contains server and admin APIs designed to be called from your custom logic server or build process 24 | * PlayFabSDK - Contains all APIs in one SDK, as well as a unit-test project 25 | 26 | 27 | ## 4. Usage Instructions: 28 | 29 | 1. Most users will want to use our [NuGet SDK](https://www.nuget.org/packages/PlayFabAllSDK/) 30 | 1. You can search "PlayFab" in Visual Studio 2017, NuGet package manager, and find "PlayFabAllSDK", which is our CSharp SDK. 31 | 1. Advanced users can download the latest SDK source: https://github.com/PlayFab/CSharpSDK/releases 32 | 1. Follow the steps in our [Getting Started Guide](https://api.playfab.com/docs/getting-started/csharp-getting-started) from there 33 | 34 | 35 | ## 5. A testTitleData.json file required for example UnitTestRunner project 36 | 37 | This sdk includes an optional example project that is used by PlayFab to verify sdk features are fully functional. 38 | 39 | Please read about the testTitleData.json format, and purpose here: 40 | * https://github.com/PlayFab/SDKGenerator/blob/master/JenkinsConsoleUtility/testTitleData.md 41 | When running the UnitTestRunner example/testing project, provide the command line inputs " -testInputsFile ". This will read the json file at that location, and attempt to interpret it as the testTitleData.json format. 42 | 43 | 44 | ## 6. Troubleshooting: 45 | 46 | For a complete list of available APIs, check out the [online documentation](http://api.playfab.com/Documentation/). 47 | 48 | #### Contact Us 49 | We love to hear from our developer community! 50 | Do you have ideas on how we can make our products and services better? 51 | 52 | Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services. 53 | 54 | [Forums, Support and Knowledge Base](https://community.playfab.com/index.html) 55 | 56 | 57 | ## 7. Copyright and Licensing Information: 58 | 59 | Apache License -- 60 | Version 2.0, January 2004 61 | http://www.apache.org/licenses/ 62 | 63 | Full details available within the LICENSE file. 64 | 65 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabAuthenticationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.AuthenticationModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// The Authentication APIs provide a convenient way to convert classic authentication responses into entity authentication 13 | /// models. These APIs will provide you with the entity authentication token needed for subsequent Entity API calls. The 14 | /// game_server API is designed to create uniquely identifiable game_server entities. The game_server Entity token can be 15 | /// used to call Matchmaking Lobby and Pubsub for server scenarios. 16 | /// 17 | public interface IPlayFabAuthenticationInstanceAPI 18 | { 19 | /// 20 | /// Create a game_server entity token and return a new or existing game_server entity. 21 | /// 22 | Task> AuthenticateGameServerWithCustomIdAsync( 23 | AuthenticateCustomIdRequest request, 24 | object customData = null, 25 | Dictionary extraHeaders = null); 26 | 27 | /// 28 | /// Delete a game_server entity. 29 | /// 30 | Task> DeleteAsync( 31 | DeleteRequest request, 32 | object customData = null, 33 | Dictionary extraHeaders = null); 34 | 35 | /// 36 | /// Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid 37 | /// Entity Token. 38 | /// 39 | Task> GetEntityTokenAsync( 40 | GetEntityTokenRequest request, 41 | object customData = null, 42 | Dictionary extraHeaders = null); 43 | 44 | /// 45 | /// Method for a server to validate a client provided EntityToken. Only callable by the title entity. 46 | /// 47 | Task> ValidateEntityTokenAsync( 48 | ValidateEntityTokenRequest request, 49 | object customData = null, 50 | Dictionary extraHeaders = null); 51 | } 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabDataInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.DataModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// Store arbitrary data associated with an entity. Objects are small (~1KB) JSON-compatible objects which are stored 13 | /// directly on the entity profile. Objects are made available for use in other PlayFab contexts, such as PlayStream events 14 | /// and CloudScript functions. Files can efficiently store data of any size or format. Both objects and files support a 15 | /// flexible permissions system to control read and write access by other entities. 16 | /// 17 | public interface IPlayFabDataInstanceAPI 18 | { 19 | /// 20 | /// Abort pending file uploads to an entity's profile. 21 | /// 22 | Task> AbortFileUploadsAsync( 23 | AbortFileUploadsRequest request, 24 | object customData = null, 25 | Dictionary extraHeaders = null); 26 | 27 | /// 28 | /// Delete files on an entity's profile. 29 | /// 30 | Task> DeleteFilesAsync( 31 | DeleteFilesRequest request, 32 | object customData = null, 33 | Dictionary extraHeaders = null); 34 | 35 | /// 36 | /// Finalize file uploads to an entity's profile. 37 | /// 38 | Task> FinalizeFileUploadsAsync( 39 | FinalizeFileUploadsRequest request, 40 | object customData = null, 41 | Dictionary extraHeaders = null); 42 | 43 | /// 44 | /// Retrieves file metadata from an entity's profile. 45 | /// 46 | Task> GetFilesAsync( 47 | GetFilesRequest request, 48 | object customData = null, 49 | Dictionary extraHeaders = null); 50 | 51 | /// 52 | /// Retrieves objects from an entity's profile. 53 | /// 54 | Task> GetObjectsAsync( 55 | GetObjectsRequest request, 56 | object customData = null, 57 | Dictionary extraHeaders = null); 58 | 59 | /// 60 | /// Initiates file uploads to an entity's profile. 61 | /// 62 | Task> InitiateFileUploadsAsync( 63 | InitiateFileUploadsRequest request, 64 | object customData = null, 65 | Dictionary extraHeaders = null); 66 | 67 | /// 68 | /// Sets objects on an entity's profile. 69 | /// 70 | Task> SetObjectsAsync( 71 | SetObjectsRequest request, 72 | object customData = null, 73 | Dictionary extraHeaders = null); 74 | } 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabInsightsInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.InsightsModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// Manage the Insights performance level and data storage retention settings. 13 | /// 14 | public interface IPlayFabInsightsInstanceAPI 15 | { 16 | /// 17 | /// Gets the current values for the Insights performance and data storage retention, list of pending operations, and the 18 | /// performance and data storage retention limits. 19 | /// 20 | Task> GetDetailsAsync( 21 | InsightsEmptyRequest request, 22 | object customData = null, 23 | Dictionary extraHeaders = null); 24 | 25 | /// 26 | /// Retrieves the range of allowed values for performance and data storage retention values as well as the submeter details 27 | /// for each performance level. 28 | /// 29 | Task> GetLimitsAsync( 30 | InsightsEmptyRequest request, 31 | object customData = null, 32 | Dictionary extraHeaders = null); 33 | 34 | /// 35 | /// Gets the status of a SetPerformance or SetStorageRetention operation. 36 | /// 37 | Task> GetOperationStatusAsync( 38 | InsightsGetOperationStatusRequest request, 39 | object customData = null, 40 | Dictionary extraHeaders = null); 41 | 42 | /// 43 | /// Gets a list of pending SetPerformance and/or SetStorageRetention operations for the title. 44 | /// 45 | Task> GetPendingOperationsAsync( 46 | InsightsGetPendingOperationsRequest request, 47 | object customData = null, 48 | Dictionary extraHeaders = null); 49 | 50 | /// 51 | /// Sets the Insights performance level value for the title. 52 | /// 53 | Task> SetPerformanceAsync( 54 | InsightsSetPerformanceRequest request, 55 | object customData = null, 56 | Dictionary extraHeaders = null); 57 | 58 | /// 59 | /// Sets the Insights data storage retention days value for the title. 60 | /// 61 | Task> SetStorageRetentionAsync( 62 | InsightsSetStorageRetentionRequest request, 63 | object customData = null, 64 | Dictionary extraHeaders = null); 65 | } 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabLocalizationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// The Localization APIs give you the tools needed to manage language setup in your title. 13 | /// 14 | public interface IPlayFabLocalizationInstanceAPI 15 | { 16 | /// 17 | /// Retrieves the list of allowed languages, only accessible by title entities 18 | /// 19 | Task> GetLanguageListAsync( 20 | GetLanguageListRequest request, 21 | object customData = null, 22 | Dictionary extraHeaders = null); 23 | } 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabPlugin.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | /// 4 | /// Base interface of any PlayFab SDK plugin. 5 | /// 6 | public interface IPlayFabPlugin 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/IPlayFabProfilesInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.ProfilesModels; 4 | using PlayFab.Internal; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlayFab 10 | { 11 | /// 12 | /// All PlayFab entities have profiles, which hold top-level properties about the entity. These APIs give you the tools 13 | /// needed to manage entity profiles. 14 | /// 15 | public interface IPlayFabProfilesInstanceAPI 16 | { 17 | /// 18 | /// Gets the global title access policy 19 | /// 20 | Task> GetGlobalPolicyAsync( 21 | GetGlobalPolicyRequest request, 22 | object customData = null, 23 | Dictionary extraHeaders = null); 24 | 25 | /// 26 | /// Retrieves the entity's profile. 27 | /// 28 | Task> GetProfileAsync( 29 | GetEntityProfileRequest request, 30 | object customData = null, 31 | Dictionary extraHeaders = null); 32 | 33 | /// 34 | /// Retrieves the entity's profile. 35 | /// 36 | Task> GetProfilesAsync( 37 | GetEntityProfilesRequest request, 38 | object customData = null, 39 | Dictionary extraHeaders = null); 40 | 41 | /// 42 | /// Retrieves the title player accounts associated with the given master player account. 43 | /// 44 | Task> GetTitlePlayersFromMasterPlayerAccountIdsAsync( 45 | GetTitlePlayersFromMasterPlayerAccountIdsRequest request, 46 | object customData = null, 47 | Dictionary extraHeaders = null); 48 | 49 | /// 50 | /// Retrieves the title player accounts associated with the given XUIDs. 51 | /// 52 | Task> GetTitlePlayersFromXboxLiveIDsAsync( 53 | GetTitlePlayersFromXboxLiveIDsRequest request, 54 | object customData = null, 55 | Dictionary extraHeaders = null); 56 | 57 | /// 58 | /// Update the display name of the entity 59 | /// 60 | Task> SetDisplayNameAsync( 61 | SetDisplayNameRequest request, 62 | object customData = null, 63 | Dictionary extraHeaders = null); 64 | 65 | /// 66 | /// Sets the global title access policy 67 | /// 68 | Task> SetGlobalPolicyAsync( 69 | SetGlobalPolicyRequest request, 70 | object customData = null, 71 | Dictionary extraHeaders = null); 72 | 73 | /// 74 | /// Updates the entity's language. The precedence hierarchy for communication to the player is Title Player Account 75 | /// language, Master Player Account language, and then title default language if the first two aren't set or supported. 76 | /// 77 | Task> SetProfileLanguageAsync( 78 | SetProfileLanguageRequest request, 79 | object customData = null, 80 | Dictionary extraHeaders = null); 81 | 82 | /// 83 | /// Sets the profiles access policy 84 | /// 85 | Task> SetProfilePolicyAsync( 86 | SetEntityProfilePolicyRequest request, 87 | object customData = null, 88 | Dictionary extraHeaders = null); 89 | } 90 | } 91 | #endif 92 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/ISerializerPlugin.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | /// 4 | /// Interface of any data serializer SDK plugin. 5 | /// 6 | public interface ISerializerPlugin : IPlayFabPlugin 7 | { 8 | T DeserializeObject(string serialized); 9 | T DeserializeObject(string serialized, object serializerStrategy); 10 | object DeserializeObject(string serialized); 11 | 12 | string SerializeObject(object obj); 13 | string SerializeObject(object obj, object serializerStrategy); 14 | } 15 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/ITransportPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab 5 | { 6 | /// 7 | /// Interface of any transport SDK plugin. 8 | /// 9 | public interface ITransportPlugin : IPlayFabPlugin 10 | { 11 | Task DoPost(string fullPath, object request, Dictionary headers); 12 | } 13 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Json/NewtonsoftWrapper.cs: -------------------------------------------------------------------------------- 1 | #if USING_NEWTONSOFT 2 | using System; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Converters; 5 | using System.IO; 6 | 7 | namespace PlayFab.Json 8 | { 9 | public class NewtonsofJsonInstance : ISerializer 10 | { 11 | public static JsonSerializerSettings JsonSettings = new JsonSerializerSettings 12 | { 13 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 14 | Converters = { new StringEnumConverter(), new TimeSpanFloatSeconds(), new IsoDateTimeConverter { DateTimeFormat = PlayFabUtil.DefaultDateTimeFormats[0] } }, 15 | }; 16 | private static Formatting JsonFormatting = Formatting.None; 17 | 18 | private readonly JsonSerializer _serializer = JsonSerializer.Create(JsonSettings); 19 | 20 | public T DeserializeObject(string json) 21 | { 22 | return _serializer.Deserialize(new JsonTextReader(new StringReader(json))); 23 | } 24 | 25 | public T DeserializeObject(string json, object jsonSerializerStrategy) 26 | { 27 | var customSerializer = JsonSerializer.Create((JsonSerializerSettings)jsonSerializerStrategy); 28 | return customSerializer.Deserialize(new JsonTextReader(new StringReader(json))); 29 | } 30 | 31 | public object DeserializeObject(string json) 32 | { 33 | return _serializer.Deserialize(new JsonTextReader(new StringReader(json))); 34 | } 35 | 36 | public string SerializeObject(object json) 37 | { 38 | var jsonString = new StringWriter(); 39 | var writer = new JsonTextWriter(jsonString) { Formatting = JsonFormatting }; 40 | _serializer.Serialize(writer, json); 41 | return jsonString.ToString(); 42 | } 43 | 44 | public string SerializeObject(object json, object jsonSerializerStrategy) 45 | { 46 | var customSerializer = JsonSerializer.Create((JsonSerializerSettings)jsonSerializerStrategy); 47 | var jsonString = new StringWriter(); 48 | var writer = new JsonTextWriter(jsonString) { Formatting = JsonFormatting }; 49 | customSerializer.Serialize(writer, json); 50 | return jsonString.ToString(); 51 | } 52 | } 53 | 54 | public class TimeSpanFloatSeconds : JsonConverter 55 | { 56 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 57 | { 58 | var timeSpan = (TimeSpan)value; 59 | serializer.Serialize(writer, timeSpan.TotalSeconds); 60 | } 61 | 62 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 63 | { 64 | return TimeSpan.FromSeconds(serializer.Deserialize(reader)); 65 | } 66 | 67 | public override bool CanConvert(Type objectType) 68 | { 69 | return objectType == typeof(TimeSpan); 70 | } 71 | } 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabApiSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | 4 | namespace PlayFab 5 | { 6 | public class PlayFabApiSettings 7 | { 8 | public readonly Dictionary RequestGetParams = new Dictionary { 9 | { "sdk", PlayFabSettings.SdkVersionString } 10 | }; 11 | /// This is only for customers running a private cluster. Generally you shouldn't touch this 12 | public string ProductionEnvironmentUrl = PlayFabSettings.DefaultProductionEnvironmentUrl; 13 | /// The name of a customer vertical. This is only for customers running a private cluster. Generally you shouldn't touch this 14 | public string VerticalName = null; 15 | 16 | #if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API || ENABLE_PLAYFAB_SECRETKEY 17 | /// You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 18 | public string DeveloperSecretKey = null; 19 | #endif 20 | 21 | /// You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) 22 | public string TitleId; 23 | 24 | /// Set to enable Gzip compression on all responses. Defaults to false. 25 | public bool CompressResponses = false; 26 | 27 | 28 | public virtual string GetFullUrl(string apiCall) 29 | { 30 | return PlayFabSettings.GetFullUrl(apiCall, RequestGetParams, this); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAuthenticationContext.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | public sealed class PlayFabAuthenticationContext 4 | { 5 | public PlayFabAuthenticationContext() 6 | { 7 | } 8 | 9 | public PlayFabAuthenticationContext(string clientSessionTicket, string entityToken, string playFabId, string entityId, string entityType) : this() 10 | { 11 | #if !DISABLE_PLAYFABCLIENT_API 12 | ClientSessionTicket = clientSessionTicket; 13 | PlayFabId = playFabId; 14 | #endif 15 | #if !DISABLE_PLAYFABENTITY_API 16 | EntityToken = entityToken; 17 | EntityId = entityId; 18 | EntityType = entityType; 19 | #endif 20 | } 21 | 22 | public void CopyFrom(PlayFabAuthenticationContext other) 23 | { 24 | #if !DISABLE_PLAYFABCLIENT_API 25 | ClientSessionTicket = other.ClientSessionTicket; 26 | PlayFabId = other.PlayFabId; 27 | #endif 28 | #if !DISABLE_PLAYFABENTITY_API 29 | EntityToken = other.EntityToken; 30 | EntityId = other.EntityId; 31 | EntityType = other.EntityType; 32 | #endif 33 | } 34 | 35 | #if !DISABLE_PLAYFABCLIENT_API 36 | /// Allows access to the ClientAPI 37 | public string ClientSessionTicket; 38 | /// The master player entity Id 39 | public string PlayFabId; 40 | public bool IsClientLoggedIn() 41 | { 42 | return !string.IsNullOrEmpty(ClientSessionTicket); 43 | } 44 | #endif 45 | 46 | #if !DISABLE_PLAYFABENTITY_API 47 | /// Allows access to most Entity APIs 48 | public string EntityToken; 49 | /// 50 | /// Clients: The title player entity Id (unless replaced with a related entity) 51 | /// Servers: The title id (unless replaced with a related entity) 52 | /// 53 | public string EntityId; 54 | /// 55 | /// Describes the type of entity identified by EntityId 56 | /// 57 | public string EntityType; 58 | public bool IsEntityLoggedIn() 59 | { 60 | return !string.IsNullOrEmpty(EntityToken); 61 | } 62 | #endif 63 | 64 | public void ForgetAllCredentials() 65 | { 66 | #if !DISABLE_PLAYFABCLIENT_API 67 | PlayFabId = null; 68 | ClientSessionTicket = null; 69 | #endif 70 | #if !DISABLE_PLAYFABENTITY_API 71 | EntityToken = null; 72 | EntityId = null; 73 | EntityType = null; 74 | #endif 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabHttp/HttpTransportWithDecompression.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | 4 | namespace PlayFab.Internal 5 | { 6 | internal class HttpTransportWithDecompression : PlayFabSysHttp 7 | { 8 | public HttpTransportWithDecompression() 9 | { 10 | var handler = new HttpClientHandler 11 | { 12 | AutomaticDecompression = DecompressionMethods.GZip, 13 | }; 14 | _client = new HttpClient(handler); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabHttp/IPlayFabHttp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PlayFab.Internal 4 | { 5 | [Obsolete("This interface is deprecated, please use PlayFab.ITransportPlugin instead.", false)] 6 | public interface IPlayFabHttp: ITransportPlugin 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabHttp/PlayFabHttp.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab.Internal 5 | { 6 | /// 7 | /// This is a base-class for all Api-request objects. 8 | /// It is currently unfinished, but we will add result-specific properties, 9 | /// and add template where-conditions to make some code easier to follow 10 | /// 11 | public class PlayFabRequestCommon 12 | { 13 | public PlayFabAuthenticationContext AuthenticationContext; 14 | } 15 | 16 | /// 17 | /// This is a base-class for all Api-result objects. 18 | /// It is currently unfinished, but we will add result-specific properties, 19 | /// and add template where-conditions to make some code easier to follow 20 | /// 21 | public class PlayFabResultCommon 22 | { 23 | } 24 | 25 | public class PlayFabLoginResultCommon : PlayFabResultCommon 26 | { 27 | public PlayFabAuthenticationContext AuthenticationContext; 28 | } 29 | 30 | public class PlayFabJsonError 31 | { 32 | public int code; 33 | public string status; 34 | public string error; 35 | public int errorCode; 36 | public string errorMessage; 37 | public Dictionary errorDetails = null; 38 | public uint? retryAfterSeconds = null; 39 | } 40 | 41 | public class PlayFabJsonSuccess where TResult : PlayFabResultCommon 42 | { 43 | public int code; 44 | public string status; 45 | public TResult data; 46 | } 47 | 48 | public static class PlayFabHttp 49 | { 50 | public static async Task DoPost(string urlPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 51 | { 52 | await new PlayFabUtil.SynchronizationContextRemover(); 53 | 54 | var settings = instanceSettings ?? PlayFabSettings.staticSettings; 55 | var fullPath = settings.GetFullUrl(urlPath); 56 | return await _DoPost(fullPath, request, authType, authKey, extraHeaders, instanceSettings); 57 | } 58 | 59 | public static async Task DoPostWithFullUri(string fullUriPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 60 | { 61 | await new PlayFabUtil.SynchronizationContextRemover(); 62 | 63 | return await _DoPost(fullUriPath, request, authType, authKey, extraHeaders, instanceSettings); 64 | } 65 | 66 | private static async Task _DoPost(string fullPath, PlayFabRequestCommon request, string authType, string authKey, Dictionary extraHeaders, PlayFabApiSettings instanceSettings = null) 67 | { 68 | var settings = instanceSettings ?? PlayFabSettings.staticSettings; 69 | var titleId = settings.TitleId; 70 | if (titleId == null) 71 | throw new PlayFabException(PlayFabExceptionCode.TitleNotSet, "You must set your titleId before making an api call"); 72 | var transport = settings.CompressResponses ? 73 | PluginManager.GetPlugin(PluginContract.PlayFab_Transport_Decompress) : 74 | PluginManager.GetPlugin(PluginContract.PlayFab_Transport); 75 | 76 | var headers = new Dictionary(); 77 | if (authType != null && authKey != null) 78 | { 79 | headers[authType] = authKey; 80 | } 81 | if (extraHeaders != null) 82 | { 83 | foreach (var extraHeader in extraHeaders) 84 | { 85 | headers.Add(extraHeader.Key, extraHeader.Value); 86 | } 87 | } 88 | 89 | return await transport.DoPost(fullPath, request, headers); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabHttp/PlayFabPollyHttp.cs: -------------------------------------------------------------------------------- 1 | using Polly; 2 | using Polly.CircuitBreaker; 3 | using Polly.Retry; 4 | using Polly.Timeout; 5 | using Polly.Wrap; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Net; 10 | using System.Net.Http; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab.Internal 14 | { 15 | /// 16 | /// A Polly wrapped version of PlayFab Transport plug in which used 17 | /// when making http requests to PlayFab Main Server. 18 | /// 19 | public class PlayFabPollyHttp : PlayFabSysHttp, ITransportPlugin 20 | { 21 | /// 22 | /// Http requests worth retrying 23 | /// 24 | public HashSet HttpStatusCodesWorthRetrying = new HashSet { 25 | 408, //HttpStatusCode.RequestTimeout 26 | 409, //HttpStatusCode.Conflict 27 | 429, //HttpStatusCode.TooManyRequests 28 | 500, //HttpStatusCode.InternalServerError 29 | 502, //HttpStatusCode.BadGateway 30 | 503, //HttpStatusCode.ServiceUnavailable 31 | 504 //HttpStatusCode.GatewayTimeout 32 | }; 33 | 34 | /// 35 | /// Gets or set the name of the plug in. Used by the PluginManager when looking up 36 | /// plugins upon request. 37 | /// 38 | public string Name; 39 | 40 | /// 41 | /// Gets the PlayFab retry policies 42 | /// 43 | public AsyncRetryPolicy RetryPolicy { get; private set; } 44 | 45 | /// 46 | /// Constructor for objects of type PollyTransportPlug. 47 | /// 48 | /// Sets a default resilience policy with the following common settings 49 | /// 1) Sets the retry to 3 times and has an embedded backoff. 50 | /// 51 | /// 52 | public PlayFabPollyHttp() 53 | { 54 | var jitterer = new Random(); 55 | var retryPolicy = Policy 56 | .Handle() 57 | .OrResult(r => r != null && (r as PlayFabError) != null && HttpStatusCodesWorthRetrying.Contains((r as PlayFabError).HttpCode)) 58 | .WaitAndRetryAsync(1, 59 | retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)) // exponential back-off: 2, 4, 8 etc 60 | + TimeSpan.FromMilliseconds(jitterer.Next(0, 1000))); // plus some jitter: up to 1 61 | RetryPolicy = retryPolicy; 62 | 63 | Name = "PlayFabWithPolly"; 64 | } 65 | 66 | /// 67 | public new async Task DoPost(string fullPath, object request, Dictionary headers) 68 | { 69 | object doPostResult = await RetryPolicy 70 | .ExecuteAsync(async () => 71 | { 72 | return await base.DoPost(fullPath, request, headers); 73 | }); 74 | 75 | return doPostResult; 76 | } 77 | 78 | /// 79 | /// Overrides the Polly Policies to enforce. 80 | /// 81 | public void OverridePolicies(AsyncRetryPolicy policy) 82 | { 83 | RetryPolicy = policy; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLocalizationAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | #pragma warning disable 0649 6 | using System; 7 | // This is required for the Obsolete Attribute flag 8 | // which is not always present in all API's 9 | #pragma warning restore 0649 10 | using System.Collections.Generic; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab 14 | { 15 | /// 16 | /// The Localization APIs give you the tools needed to manage language setup in your title. 17 | /// 18 | public static class PlayFabLocalizationAPI 19 | { 20 | /// 21 | /// Verify entity login. 22 | /// 23 | public static bool IsEntityLoggedIn() 24 | { 25 | return PlayFabSettings.staticPlayer.IsEntityLoggedIn(); 26 | } 27 | 28 | /// 29 | /// Clear the Client SessionToken which allows this Client to call API calls requiring login. 30 | /// A new/fresh login will be required after calling this. 31 | /// 32 | public static void ForgetAllCredentials() 33 | { 34 | PlayFabSettings.staticPlayer.ForgetAllCredentials(); 35 | } 36 | 37 | /// 38 | /// Retrieves the list of allowed languages, only accessible by title entities 39 | /// 40 | public static async Task> GetLanguageListAsync(GetLanguageListRequest request, object customData = null, Dictionary extraHeaders = null) 41 | { 42 | await new PlayFabUtil.SynchronizationContextRemover(); 43 | 44 | var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer; 45 | var requestSettings = PlayFabSettings.staticSettings; 46 | if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method"); 47 | 48 | 49 | var httpResult = await PlayFabHttp.DoPost("/Locale/GetLanguageList", request, "X-EntityToken", requestContext.EntityToken, extraHeaders); 50 | if (httpResult is PlayFabError) 51 | { 52 | var error = (PlayFabError)httpResult; 53 | PlayFabSettings.GlobalErrorHandler?.Invoke(error); 54 | return new PlayFabResult { Error = error, CustomData = customData }; 55 | } 56 | 57 | var resultRawJson = (string)httpResult; 58 | var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson); 59 | var result = resultData.data; 60 | 61 | return new PlayFabResult { Result = result, CustomData = customData }; 62 | } 63 | } 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLocalizationInstanceAPI.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABENTITY_API 2 | 3 | using PlayFab.LocalizationModels; 4 | using PlayFab.Internal; 5 | #pragma warning disable 0649 6 | using System; 7 | // This is required for the Obsolete Attribute flag 8 | // which is not always present in all API's 9 | #pragma warning restore 0649 10 | using System.Collections.Generic; 11 | using System.Threading.Tasks; 12 | 13 | namespace PlayFab 14 | { 15 | /// 16 | /// The Localization APIs give you the tools needed to manage language setup in your title. 17 | /// 18 | public class PlayFabLocalizationInstanceAPI : IPlayFabLocalizationInstanceAPI 19 | { 20 | public readonly PlayFabApiSettings apiSettings = null; 21 | public readonly PlayFabAuthenticationContext authenticationContext = null; 22 | 23 | public PlayFabLocalizationInstanceAPI(PlayFabAuthenticationContext context) 24 | { 25 | if (context == null) 26 | throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); 27 | authenticationContext = context; 28 | } 29 | 30 | public PlayFabLocalizationInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context) 31 | { 32 | if (context == null) 33 | throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext"); 34 | apiSettings = settings; 35 | authenticationContext = context; 36 | } 37 | 38 | /// 39 | /// Verify entity login. 40 | /// 41 | public bool IsEntityLoggedIn() 42 | { 43 | return authenticationContext == null ? false : authenticationContext.IsEntityLoggedIn(); 44 | } 45 | 46 | /// 47 | /// Clear the Client SessionToken which allows this Client to call API calls requiring login. 48 | /// A new/fresh login will be required after calling this. 49 | /// 50 | public void ForgetAllCredentials() 51 | { 52 | authenticationContext?.ForgetAllCredentials(); 53 | } 54 | 55 | /// 56 | /// Retrieves the list of allowed languages, only accessible by title entities 57 | /// 58 | public async Task> GetLanguageListAsync(GetLanguageListRequest request, object customData = null, Dictionary extraHeaders = null) 59 | { 60 | await new PlayFabUtil.SynchronizationContextRemover(); 61 | 62 | var requestContext = request?.AuthenticationContext ?? authenticationContext; 63 | var requestSettings = apiSettings ?? PlayFabSettings.staticSettings; 64 | if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method"); 65 | 66 | var httpResult = await PlayFabHttp.DoPost("/Locale/GetLanguageList", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings); 67 | if (httpResult is PlayFabError) 68 | { 69 | var error = (PlayFabError)httpResult; 70 | PlayFabSettings.GlobalErrorHandler?.Invoke(error); 71 | return new PlayFabResult { Error = error, CustomData = customData }; 72 | } 73 | 74 | var resultRawJson = (string)httpResult; 75 | var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson); 76 | var result = resultData.data; 77 | 78 | return new PlayFabResult { Result = result, CustomData = customData }; 79 | } 80 | 81 | } 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLocalizationModels.cs: -------------------------------------------------------------------------------- 1 | using PlayFab.Internal; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace PlayFab.LocalizationModels 6 | { 7 | public class GetLanguageListRequest : PlayFabRequestCommon 8 | { 9 | /// 10 | /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). 11 | /// 12 | public Dictionary CustomTags ; 13 | 14 | } 15 | 16 | public class GetLanguageListResponse : PlayFabResultCommon 17 | { 18 | /// 19 | /// The list of allowed languages, in BCP47 two-letter format 20 | /// 21 | public List LanguageList ; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSDK.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | PlayFabAllSDK 6 | PlayFabAllSDK 7 | en-US 8 | 512 9 | 10 | PlayFabAllSDK 11 | 1.210.251010 12 | PlayFab CSharp Sdk 13 | Microsoft 14 | Microsoft 15 | © Microsoft Corporation. All rights reserved. 16 | LICENSE 17 | https://github.com/PlayFab/CSharpSDK 18 | icon.png 19 | false 20 | Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services. 21 | PlayFab 22 | PlayFabSDK 23 | PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native 24 | https://docs.microsoft.com/gaming/playfab/release-notes#251010 25 | en 26 | 1 27 | 1 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | TRACE;DEBUG;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 35 | prompt 36 | 4 37 | 38 | 39 | 40 | pdbonly 41 | true 42 | TRACE;NETFX_CORE;SIMPLE_JSON_TYPEINFO;ENABLE_PLAYFABADMIN_API;ENABLE_PLAYFABSERVER_API 43 | prompt 44 | 4 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PluginContract.cs: -------------------------------------------------------------------------------- 1 | namespace PlayFab 2 | { 3 | public enum PluginContract 4 | { 5 | PlayFab_Serializer, 6 | PlayFab_Transport, 7 | PlayFab_Transport_Decompress 8 | } 9 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PluginManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using PlayFab.Internal; 4 | 5 | namespace PlayFab 6 | { 7 | public class PluginManager 8 | { 9 | private ConcurrentDictionary, IPlayFabPlugin> plugins = new ConcurrentDictionary, IPlayFabPlugin>(); 10 | 11 | /// 12 | /// The singleton instance of plugin manager. 13 | /// 14 | private static readonly PluginManager Instance = new PluginManager(); 15 | 16 | private PluginManager() 17 | { 18 | } 19 | 20 | /// 21 | /// Gets a plugin. 22 | /// If a plugin with specified contract and optional instance name does not exist, it will create a new one. 23 | /// 24 | /// The plugin contract. 25 | /// The optional plugin instance name. Instance names allow to have mulptiple plugins with the same contract. 26 | /// The plugin instance. 27 | public static T GetPlugin(PluginContract contract, string instanceName = "") where T : IPlayFabPlugin 28 | { 29 | return (T)Instance.GetPluginInternal(contract, instanceName); 30 | } 31 | 32 | /// 33 | /// Sets a custom plugin. 34 | /// If a plugin with specified contract and optional instance name already exists, it will be replaced with specified instance. 35 | /// 36 | /// The plugin instance. 37 | /// The app contract of plugin. 38 | /// The optional plugin instance name. Instance names allow to have mulptiple plugins with the same contract. 39 | public static void SetPlugin(IPlayFabPlugin plugin, PluginContract contract, string instanceName = "") 40 | { 41 | Instance.SetPluginInternal(plugin, contract, instanceName); 42 | } 43 | 44 | private IPlayFabPlugin GetPluginInternal(PluginContract contract, string instanceName) 45 | { 46 | var key = new Tuple(contract, instanceName); 47 | IPlayFabPlugin plugin; 48 | if (!this.plugins.TryGetValue(key, out plugin)) 49 | { 50 | // Requested plugin is not in the cache, create the default one 51 | switch (contract) 52 | { 53 | case PluginContract.PlayFab_Serializer: 54 | plugin = this.CreatePlugin(); 55 | break; 56 | case PluginContract.PlayFab_Transport: 57 | plugin = this.CreatePlugin(); 58 | break; 59 | case PluginContract.PlayFab_Transport_Decompress: 60 | plugin = this.CreatePlugin(); 61 | break; 62 | default: 63 | throw new ArgumentException("This contract is not supported", nameof(contract)); 64 | } 65 | 66 | this.plugins[key] = plugin; 67 | } 68 | 69 | return plugin; 70 | } 71 | 72 | private void SetPluginInternal(IPlayFabPlugin plugin, PluginContract contract, string instanceName) 73 | { 74 | if (plugin == null) 75 | { 76 | throw new ArgumentNullException(nameof(plugin), "Plugin instance cannot be null"); 77 | } 78 | 79 | var key = new Tuple(contract, instanceName); 80 | this.plugins[key] = plugin; 81 | } 82 | 83 | private IPlayFabPlugin CreatePlugin() where T : IPlayFabPlugin, new() 84 | { 85 | return (IPlayFabPlugin)Activator.CreateInstance(typeof(T).AsType()); 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | 4 | [assembly: AssemblyTrademark("PlayFab")] 5 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Qos/IRegionPinger.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | using System.Threading.Tasks; 3 | 4 | namespace PlayFab.QoS 5 | { 6 | public interface IRegionPinger 7 | { 8 | Task PingAsync(); 9 | QosRegionResult GetResult(); 10 | } 11 | } 12 | #endif -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Qos/QosErrorCode.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | namespace PlayFab.QoS 3 | { 4 | public enum QosErrorCode 5 | { 6 | Success = 0, 7 | NotLoggedIn = 1, 8 | FailedToRetrieveServerList = 2, 9 | FailedToUploadQosResult = 3, 10 | Timeout = 4, 11 | NoResult = 5, 12 | } 13 | } 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Qos/QosRegionResult.cs: -------------------------------------------------------------------------------- 1 |  2 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 3 | namespace PlayFab.QoS 4 | { 5 | using System.Collections.Generic; 6 | 7 | public class QosRegionResult 8 | { 9 | public string Region; 10 | 11 | public int LatencyMs; 12 | 13 | public IReadOnlyList RawMeasurements; 14 | 15 | public int NumTimeouts; 16 | 17 | public int ErrorCode; 18 | } 19 | 20 | internal class QosRegionResultSummary 21 | { 22 | public static QosRegionResultSummary CreateFrom(QosRegionResult result) 23 | { 24 | return new QosRegionResultSummary 25 | { 26 | Region = result.Region, 27 | LatencyMs = result.LatencyMs, 28 | ErrorCode = result.ErrorCode, 29 | NumTimeouts = result.NumTimeouts 30 | }; 31 | } 32 | 33 | public string Region; 34 | 35 | public int NumTimeouts; 36 | 37 | public int LatencyMs; 38 | 39 | public int ErrorCode; 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Qos/QosResult.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | namespace PlayFab.QoS 3 | { 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public class QosResult 8 | { 9 | public List RegionResults; 10 | 11 | public int ErrorCode; 12 | 13 | public string ErrorMessage; 14 | } 15 | 16 | /// 17 | /// This class is used to json serialize the content to send to PlayFab without the ErrorMessage 18 | /// 19 | internal class QosResultPlayFabEvent 20 | { 21 | public static QosResultPlayFabEvent CreateFrom(QosResult result) 22 | { 23 | #if (NETSTANDARD && !NETSTANDARD1_1) || NETFRAMEWORK || NETCOREAPP 24 | return new QosResultPlayFabEvent 25 | { 26 | RegionResults = result.RegionResults.ConvertAll(x => new QosRegionResultSummary() 27 | { 28 | Region = x.Region, 29 | ErrorCode = x.ErrorCode, 30 | LatencyMs = x.LatencyMs 31 | }), 32 | ErrorCode = result.ErrorCode 33 | }; 34 | #else 35 | throw new NotSupportedException("QoS ping library is only supported on .net standard 2.0 and newer, .net core or full .net framework"); 36 | #endif 37 | } 38 | 39 | public List RegionResults; 40 | 41 | public int ErrorCode; 42 | } 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Uunit/UUnitAssertException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * UUnit system from UnityCommunity 3 | * Heavily modified 4 | * 0.4 release by pboechat 5 | * http://wiki.unity3d.com/index.php?title=UUnit 6 | * http://creativecommons.org/licenses/by-sa/3.0/ 7 | */ 8 | 9 | using System; 10 | 11 | namespace PlayFab.UUnit 12 | { 13 | /// 14 | /// The internal uunit exception base class, which you can use to capture all UUnit exceptions 15 | /// 16 | public class UUnitException : Exception 17 | { 18 | public UUnitException(string message) : base(message) { } 19 | } 20 | 21 | /// 22 | /// Throw this exception, via UUnitAssert utility function, in order to define when a test has been skipped. 23 | /// The only information shown will be the "skipped" notification 24 | /// 25 | public class UUnitSkipException : UUnitException 26 | { 27 | public UUnitSkipException(string message) : base(message) { } 28 | } 29 | 30 | /// 31 | /// Throw this exception, via UUnitAssert utility functions, in order to define when a test has failed. 32 | /// The traceback and Message will automatically be displayed as a failure 33 | /// 34 | public class UUnitAssertException : UUnitException 35 | { 36 | public UUnitAssertException(string message) : base(message) { } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/Uunit/tests/PlayFabQosApiTest.cs: -------------------------------------------------------------------------------- 1 | #if !DISABLE_PLAYFABCLIENT_API && !DISABLE_PLAYFABENTITY_API 2 | 3 | namespace PlayFab.UUnit 4 | { 5 | using System; 6 | using ClientModels; 7 | using QoS; 8 | 9 | public class PlayFabQosApiTest : UUnitTestCase 10 | { 11 | private static TestTitleData testTitleData; 12 | 13 | // Functional 14 | private static bool TITLE_INFO_SET = false; 15 | 16 | private readonly PlayFabClientInstanceAPI clientApi = new PlayFabClientInstanceAPI(PlayFabSettings.staticPlayer); 17 | 18 | /// 19 | /// PlayFab Title cannot be created from SDK tests, so you must provide your titleId to run unit tests. 20 | /// (Also, we don't want lots of excess unused titles) 21 | /// 22 | public static void SetTitleInfo(TestTitleData testInputs) 23 | { 24 | TITLE_INFO_SET = true; 25 | testTitleData = testInputs; 26 | } 27 | 28 | public override void SetUp(UUnitTestContext testContext) 29 | { 30 | if (!TITLE_INFO_SET) 31 | testContext.Skip(); // We cannot do client tests if the titleId is not given 32 | } 33 | 34 | public override void Tick(UUnitTestContext testContext) 35 | { 36 | // No work needed, async tests will end themselves 37 | } 38 | 39 | /// 40 | /// SERVER API 41 | /// Each API instance can be used to login a player separately from any other API instances, 42 | /// and that player’s authentication context is stored in the API instance 43 | /// 44 | [UUnitTest] 45 | public void QosTest(UUnitTestContext testContext) 46 | { 47 | var loginWithCustomIdRequest = new LoginWithCustomIDRequest() 48 | { 49 | CreateAccount = true, 50 | CustomId = "test_Instance1" 51 | }; 52 | 53 | try 54 | { 55 | clientApi.LoginWithCustomIDAsync(loginWithCustomIdRequest, null, testTitleData.extraHeaders).Wait(); 56 | } 57 | catch (AggregateException aggregateException) when (aggregateException.InnerException != null) 58 | { 59 | throw aggregateException.InnerException; 60 | } 61 | 62 | PlayFabQosApi playFabQosApi = new PlayFabQosApi(); 63 | QosResult qoSResult = playFabQosApi.GetQosResultAsync().Result; 64 | 65 | testContext.IntEquals(0, qoSResult.ErrorCode, $"Qos ErrorMessage: {qoSResult.ErrorMessage}"); 66 | testContext.EndTest(UUnitFinishState.PASSED, null); 67 | } 68 | } 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/PlayFabSDK/WsaReflectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace PlayFab 6 | { 7 | #if NETFX_CORE 8 | /// Specifies flags that control binding and the way in which the search for members and types is conducted by reflection. 9 | [Flags] 10 | public enum BindingFlags 11 | { 12 | IgnoreCase = 1, 13 | DeclaredOnly = 2, 14 | Instance = 4, 15 | Static = 8, 16 | Public = 16, 17 | NonPublic = 32, 18 | FlattenHierarchy = 64, 19 | } 20 | #endif 21 | 22 | public static class WsaReflectionExtensions 23 | { 24 | public static Type AsType(this Type type) 25 | { 26 | return type; 27 | } 28 | #if !NETFX_CORE 29 | public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType, object instance) 30 | { 31 | return Delegate.CreateDelegate(delegateType, instance, methodInfo); 32 | } 33 | public static Assembly GetAssembly(this Type type) 34 | { 35 | return type.Assembly; 36 | } 37 | public static Type GetTypeInfo(this Type type) 38 | { 39 | return type; 40 | } 41 | public static string GetDelegateName(this Delegate delegateInstance) 42 | { 43 | return delegateInstance.Method.Name; 44 | } 45 | #else 46 | public static bool IsAssignableFrom(this Type type, Type other) 47 | { 48 | return type.GetTypeInfo().IsAssignableFrom(other.GetTypeInfo()); 49 | } 50 | public static bool IsAssignableFrom(this Type type, TypeInfo other) 51 | { 52 | return type.GetTypeInfo().IsAssignableFrom(other); 53 | } 54 | public static Assembly GetAssembly(this Type type) 55 | { 56 | return type.GetTypeInfo().Assembly; 57 | } 58 | public static bool IsInstanceOfType(this Type type, object obj) 59 | { 60 | return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); 61 | } 62 | public static string GetDelegateName(this Delegate delegateInstance) 63 | { 64 | return delegateInstance.ToString(); 65 | } 66 | public static MethodInfo GetMethod(this Type type, string methodName) 67 | { 68 | return type.GetTypeInfo().GetDeclaredMethod(methodName); 69 | } 70 | public static IEnumerable GetFields(this TypeInfo typeInfo) 71 | { 72 | return typeInfo.DeclaredFields; 73 | } 74 | public static TypeInfo GetTypeInfo(this TypeInfo typeInfo) 75 | { 76 | return typeInfo; 77 | } 78 | public static IEnumerable GetConstructors(this TypeInfo typeInfo) 79 | { 80 | return typeInfo.DeclaredConstructors; 81 | } 82 | public static IEnumerable GetMethods(this TypeInfo typeInfo, BindingFlags ignored) 83 | { 84 | return typeInfo.DeclaredMethods; 85 | } 86 | public static IEnumerable GetTypes(this Assembly assembly) 87 | { 88 | return assembly.DefinedTypes; 89 | } 90 | #endif 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace XamarinTestRunner.Droid 11 | { 12 | [Activity(Label = "XamarinTestRunner", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 14 | { 15 | protected override void OnCreate(Bundle savedInstanceState) 16 | { 17 | TabLayoutResource = Resource.Layout.Tabbar; 18 | ToolbarResource = Resource.Layout.Toolbar; 19 | 20 | base.OnCreate(savedInstanceState); 21 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState); 22 | LoadApplication(new App()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("XamarinTestRunner.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Microsoft")] 13 | [assembly: AssemblyProduct("XamarinTestRunner.Android")] 14 | [assembly: AssemblyCopyright("Copyright Microsoft © 2019")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-anydpi-v26/icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-anydpi-v26/icon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-hdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-hdpi/launcher_foreground.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-mdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-mdpi/launcher_foreground.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #3F51B5 5 | #303F9F 6 | #FF4081 7 | 8 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace XamarinTestRunner.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | 44 | Frame rootFrame = Window.Current.Content as Frame; 45 | 46 | // Do not repeat app initialization when the Window already has content, 47 | // just ensure that the window is active 48 | if (rootFrame == null) 49 | { 50 | // Create a Frame to act as the navigation context and navigate to the first page 51 | rootFrame = new Frame(); 52 | 53 | rootFrame.NavigationFailed += OnNavigationFailed; 54 | 55 | Xamarin.Forms.Forms.Init(e); 56 | 57 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 58 | { 59 | //TODO: Load state from previously suspended application 60 | } 61 | 62 | // Place the frame in the current Window 63 | Window.Current.Content = rootFrame; 64 | } 65 | 66 | if (rootFrame.Content == null) 67 | { 68 | // When the navigation stack isn't restored navigate to the first page, 69 | // configuring the new page by passing required information as a navigation 70 | // parameter 71 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 72 | } 73 | // Ensure the current window is active 74 | Window.Current.Activate(); 75 | } 76 | 77 | /// 78 | /// Invoked when Navigation to a certain page fails 79 | /// 80 | /// The Frame which failed navigation 81 | /// Details about the navigation failure 82 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 83 | { 84 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 85 | } 86 | 87 | /// 88 | /// Invoked when application execution is being suspended. Application state is saved 89 | /// without knowing whether the application will be terminated or resumed with the contents 90 | /// of memory still intact. 91 | /// 92 | /// The source of the suspend request. 93 | /// Details about the suspend request. 94 | private void OnSuspending(object sender, SuspendingEventArgs e) 95 | { 96 | var deferral = e.SuspendingOperation.GetDeferral(); 97 | //TODO: Save application state and stop any background activity 98 | deferral.Complete(); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.backup.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace XamarinTestRunner.UWP 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new XamarinTestRunner.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | XamarinTestRunner.UWP 18 | 82054aab-dead-4862-89be-45bf6fde0115 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamarinTestRunner.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("XamarinTestRunner.UWP")] 13 | [assembly: AssemblyCopyright("Copyright Microsoft © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace XamarinTestRunner.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | Xamarin.Calabash.Start(); 26 | 27 | global::Xamarin.Forms.Forms.Init(); 28 | LoadApplication(new App()); 29 | 30 | return base.FinishedLaunching(app, options); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "scale": "2x", 5 | "size": "20x20", 6 | "idiom": "iphone", 7 | "filename": "Icon40.png" 8 | }, 9 | { 10 | "scale": "3x", 11 | "size": "20x20", 12 | "idiom": "iphone", 13 | "filename": "Icon60.png" 14 | }, 15 | { 16 | "scale": "2x", 17 | "size": "29x29", 18 | "idiom": "iphone", 19 | "filename": "Icon58.png" 20 | }, 21 | { 22 | "scale": "3x", 23 | "size": "29x29", 24 | "idiom": "iphone", 25 | "filename": "Icon87.png" 26 | }, 27 | { 28 | "scale": "2x", 29 | "size": "40x40", 30 | "idiom": "iphone", 31 | "filename": "Icon80.png" 32 | }, 33 | { 34 | "scale": "3x", 35 | "size": "40x40", 36 | "idiom": "iphone", 37 | "filename": "Icon120.png" 38 | }, 39 | { 40 | "scale": "2x", 41 | "size": "60x60", 42 | "idiom": "iphone", 43 | "filename": "Icon120.png" 44 | }, 45 | { 46 | "scale": "3x", 47 | "size": "60x60", 48 | "idiom": "iphone", 49 | "filename": "Icon180.png" 50 | }, 51 | { 52 | "scale": "1x", 53 | "size": "20x20", 54 | "idiom": "ipad", 55 | "filename": "Icon20.png" 56 | }, 57 | { 58 | "scale": "2x", 59 | "size": "20x20", 60 | "idiom": "ipad", 61 | "filename": "Icon40.png" 62 | }, 63 | { 64 | "scale": "1x", 65 | "size": "29x29", 66 | "idiom": "ipad", 67 | "filename": "Icon29.png" 68 | }, 69 | { 70 | "scale": "2x", 71 | "size": "29x29", 72 | "idiom": "ipad", 73 | "filename": "Icon58.png" 74 | }, 75 | { 76 | "scale": "1x", 77 | "size": "40x40", 78 | "idiom": "ipad", 79 | "filename": "Icon40.png" 80 | }, 81 | { 82 | "scale": "2x", 83 | "size": "40x40", 84 | "idiom": "ipad", 85 | "filename": "Icon80.png" 86 | }, 87 | { 88 | "scale": "1x", 89 | "size": "76x76", 90 | "idiom": "ipad", 91 | "filename": "Icon76.png" 92 | }, 93 | { 94 | "scale": "2x", 95 | "size": "76x76", 96 | "idiom": "ipad", 97 | "filename": "Icon152.png" 98 | }, 99 | { 100 | "scale": "2x", 101 | "size": "83.5x83.5", 102 | "idiom": "ipad", 103 | "filename": "Icon167.png" 104 | }, 105 | { 106 | "scale": "1x", 107 | "size": "1024x1024", 108 | "idiom": "ios-marketing", 109 | "filename": "Icon1024.png" 110 | } 111 | ], 112 | "properties": {}, 113 | "info": { 114 | "version": 1, 115 | "author": "xcode" 116 | } 117 | } -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | XamarinTestRunner 27 | CFBundleIdentifier 28 | com.microsoft.playfab.sdktest 29 | CFBundleVersion 30 | 1.0 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | CFBundleName 34 | PlayFab Test Service App 35 | XSAppIconAssets 36 | Assets.xcassets/AppIcon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace XamarinTestRunner.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamarinTestRunner.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("XamarinTestRunner.iOS")] 13 | [assembly: AssemblyCopyright("Copyright Microsoft © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlayFab/CSharpSDK/d2a4e1ced24d426815776603064a8f528f3c7e6c/XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 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 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | using Xamarin.Forms.Xaml; 4 | using PlayFab; 5 | 6 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)] 7 | namespace XamarinTestRunner 8 | { 9 | public partial class App : Application 10 | { 11 | public App() 12 | { 13 | InitializeComponent(); 14 | 15 | MainPage = new MainPage(); 16 | } 17 | 18 | protected override void OnStart() 19 | { 20 | // Handle when your app starts 21 | } 22 | 23 | protected override void OnSleep() 24 | { 25 | // Handle when your app sleeps 26 | } 27 | 28 | protected override void OnResume() 29 | { 30 | // Handle when your app resumes 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /XamarinTestRunner/XamarinTestRunner/XamarinTestRunner/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 |