├── plugin └── GameSparks │ ├── Content │ └── gs_icon.uasset │ ├── Resources │ └── Icon128.png │ ├── Source │ ├── GameSparksBaseSDK │ │ ├── src │ │ │ ├── GameSparks │ │ │ │ ├── GSUtil.cpp │ │ │ │ ├── GSMessage.cpp │ │ │ │ ├── GSTypedResponse.cpp │ │ │ │ ├── GSRequest.cpp │ │ │ │ └── GSIosHelper.mm │ │ │ └── mbedtls │ │ │ │ └── version.c │ │ └── include │ │ │ ├── GameSparks │ │ │ ├── GSConfig.h │ │ │ ├── GSTime.h │ │ │ ├── GSUtil.h │ │ │ ├── IGSData.h │ │ │ ├── GSMessage.h │ │ │ ├── GSObject.h │ │ │ ├── GSConnection.h │ │ │ ├── Cocos2dxPlatform.h │ │ │ ├── GSDateTime.h │ │ │ ├── GSLeakDetector.h │ │ │ ├── GSOptional.h │ │ │ ├── MarmaladePlatform.h │ │ │ ├── GSTypedResponse.h │ │ │ ├── gsstl.h │ │ │ └── GSData.h │ │ │ ├── mbedtls │ │ │ ├── havege.h │ │ │ ├── entropy_poll.h │ │ │ ├── arc4.h │ │ │ ├── base64.h │ │ │ ├── pkcs5.h │ │ │ ├── md_internal.h │ │ │ ├── padlock.h │ │ │ ├── ssl_cookie.h │ │ │ ├── error.h │ │ │ ├── cipher_internal.h │ │ │ ├── certs.h │ │ │ └── version.h │ │ │ ├── google │ │ │ └── timesupport.h │ │ │ └── easywsclient │ │ │ └── easywsclient.hpp │ └── GameSparks │ │ ├── Private │ │ ├── GameSparksRequestArray.cpp │ │ ├── GameSparksPrivatePCH.h │ │ ├── GameSparksRequestArray.h │ │ ├── GameSparksLogEventData.cpp │ │ ├── GameSparksComponent.cpp │ │ ├── GameSparksModule.h │ │ ├── 0002GSAmalgamated.cpp │ │ ├── GameSparksComponent.h │ │ ├── GameSparksUnrealPlatform.h │ │ └── GameSparksLogEventData.h │ │ └── Public │ │ └── IGameSparks.h │ └── GameSparks.uplugin ├── GameSparksSample ├── Content │ ├── GameSparksLevel.umap │ ├── GameSparksStuff.uasset │ └── GameSparksGameMode.uasset ├── Build │ └── Windows │ │ └── Application.ico ├── Plugins │ └── GameSparks │ │ ├── Resources │ │ └── Icon128.png │ │ ├── Content │ │ └── gs_icon.uasset │ │ ├── Source │ │ ├── GameSparksBaseSDK │ │ │ ├── src │ │ │ │ ├── GameSparks │ │ │ │ │ ├── GSUtil.cpp │ │ │ │ │ ├── GSMessage.cpp │ │ │ │ │ ├── GSTypedResponse.cpp │ │ │ │ │ ├── GSRequest.cpp │ │ │ │ │ └── GSIosHelper.mm │ │ │ │ └── mbedtls │ │ │ │ │ └── version.c │ │ │ └── include │ │ │ │ ├── GameSparks │ │ │ │ ├── GSConfig.h │ │ │ │ ├── GSTime.h │ │ │ │ ├── GSUtil.h │ │ │ │ ├── IGSData.h │ │ │ │ ├── GSMessage.h │ │ │ │ ├── GSObject.h │ │ │ │ ├── GSConnection.h │ │ │ │ ├── Cocos2dxPlatform.h │ │ │ │ ├── GSDateTime.h │ │ │ │ ├── GSLeakDetector.h │ │ │ │ ├── GSOptional.h │ │ │ │ ├── MarmaladePlatform.h │ │ │ │ ├── GSTypedResponse.h │ │ │ │ ├── gsstl.h │ │ │ │ └── GSData.h │ │ │ │ ├── mbedtls │ │ │ │ ├── havege.h │ │ │ │ ├── entropy_poll.h │ │ │ │ ├── arc4.h │ │ │ │ ├── base64.h │ │ │ │ ├── pkcs5.h │ │ │ │ ├── md_internal.h │ │ │ │ ├── padlock.h │ │ │ │ ├── ssl_cookie.h │ │ │ │ ├── error.h │ │ │ │ ├── cipher_internal.h │ │ │ │ ├── version.h │ │ │ │ └── certs.h │ │ │ │ └── google │ │ │ │ └── timesupport.h │ │ └── GameSparks │ │ │ ├── Private │ │ │ ├── GameSparksRequestArray.cpp │ │ │ ├── GameSparksPrivatePCH.h │ │ │ ├── GameSparksRequestArray.h │ │ │ ├── GameSparksLogEventData.cpp │ │ │ ├── GameSparksComponent.cpp │ │ │ ├── GameSparksModule.h │ │ │ ├── 0002GSAmalgamated.cpp │ │ │ ├── GameSparksComponent.h │ │ │ ├── GameSparksUnrealPlatform.h │ │ │ └── GameSparksLogEventData.h │ │ │ └── Public │ │ │ └── IGameSparks.h │ │ └── GameSparks.uplugin ├── Source │ ├── GameSparksSample │ │ ├── GameSparksSample.h │ │ ├── GameSparksSampleGameMode.cpp │ │ ├── GameSparksSample.cpp │ │ ├── GameSparksSampleGameMode.h │ │ ├── GameSparksSample.Build.cs │ │ └── Resources │ │ │ └── Windows │ │ │ └── GameSparksSample.rc │ ├── GameSparksSample.Target.cs │ └── GameSparksSampleEditor.Target.cs ├── Config │ ├── DefaultEditor.ini │ ├── DefaultInput.ini │ └── DefaultEngine.ini └── GameSparksSample.uproject └── README.md /plugin/GameSparks/Content/gs_icon.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/plugin/GameSparks/Content/gs_icon.uasset -------------------------------------------------------------------------------- /plugin/GameSparks/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/plugin/GameSparks/Resources/Icon128.png -------------------------------------------------------------------------------- /GameSparksSample/Content/GameSparksLevel.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Content/GameSparksLevel.umap -------------------------------------------------------------------------------- /GameSparksSample/Build/Windows/Application.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Build/Windows/Application.ico -------------------------------------------------------------------------------- /GameSparksSample/Content/GameSparksStuff.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Content/GameSparksStuff.uasset -------------------------------------------------------------------------------- /GameSparksSample/Content/GameSparksGameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Content/GameSparksGameMode.uasset -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Plugins/GameSparks/Resources/Icon128.png -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Content/gs_icon.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Plugins/GameSparks/Content/gs_icon.uasset -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/GameSparksSample.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "Engine.h" 6 | 7 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSUtil.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSUtil.cpp -------------------------------------------------------------------------------- /GameSparksSample/Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | [EditoronlyBP] 2 | bAllowClassAndBlueprintPinMatching=true 3 | bReplaceBlueprintWithClass=true 4 | bDontLoadBlueprintOutsideEditor=true 5 | bBlueprintIsNotBlueprintType=true 6 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSUtil.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/englercj/gamesparks-cpp-unreal/master/GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSUtil.cpp -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSConfig_h__ 3 | #define GSConfig_h__ 4 | 5 | #pragma once 6 | #endif // GSConfig_h__ 7 | 8 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/GameSparksSampleGameMode.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "GameSparksSample.h" 4 | #include "GameSparksSampleGameMode.h" 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSConfig_h__ 3 | #define GSConfig_h__ 4 | 5 | #pragma once 6 | #endif // GSConfig_h__ 7 | 8 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/GameSparksSample.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "GameSparksSample.h" 4 | 5 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, GameSparksSample, "GameSparksSample" ); 6 | -------------------------------------------------------------------------------- /GameSparksSample/GameSparksSample.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "4.9", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "GameSparksSample", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksRequestArray.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksRequestArray.h" 6 | 7 | UGameSparksRequestArray::UGameSparksRequestArray(const class FObjectInitializer& PCIP) : Super(PCIP) { 8 | } -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksRequestArray.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksRequestArray.h" 6 | 7 | UGameSparksRequestArray::UGameSparksRequestArray(const class FObjectInitializer& PCIP) : Super(PCIP) { 8 | } -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | 4 | namespace GameSparks 5 | { 6 | namespace Api 7 | { 8 | namespace Messages 9 | { 10 | const gsstl::string GSMessage::MESSAGE_ID_KEY = "messageId"; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSTime.h: -------------------------------------------------------------------------------- 1 | #ifndef __GS_TIME_H__ 2 | #define __GS_TIME_H__ 3 | 4 | #pragma once 5 | 6 | namespace GameSparks 7 | { 8 | /// typedef for the type to use for seconds. While this does not provide type safety, it at least names it properly. 9 | typedef float Seconds; 10 | } 11 | 12 | #endif /* __GS_TIME_H__ */ 13 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | 4 | namespace GameSparks 5 | { 6 | namespace Api 7 | { 8 | namespace Messages 9 | { 10 | const gsstl::string GSMessage::MESSAGE_ID_KEY = "messageId"; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSTime.h: -------------------------------------------------------------------------------- 1 | #ifndef __GS_TIME_H__ 2 | #define __GS_TIME_H__ 3 | 4 | #pragma once 5 | 6 | namespace GameSparks 7 | { 8 | /// typedef for the type to use for seconds. While this does not provide type safety, it at least names it properly. 9 | typedef float Seconds; 10 | } 11 | 12 | #endif /* __GS_TIME_H__ */ 13 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksPrivatePCH.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #define GS_USE_STD_FUNCTION 1 6 | #define GS_COMPILER_HAS_NULLPTR_SUPPORT 1 7 | #define __NUMBERFORMATTING__ //avoid clashed with CarbonCore.framework/Headers/NumberFormatting.h 8 | 9 | //#include "Engine.h" 10 | //#include "GameSparksClasses.h" 11 | 12 | 13 | 14 | //DECLARE_LOG_CATEGORY_EXTERN(Victory, Log, All); 15 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksPrivatePCH.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | 5 | #define GS_USE_STD_FUNCTION 1 6 | #define GS_COMPILER_HAS_NULLPTR_SUPPORT 1 7 | #define __NUMBERFORMATTING__ //avoid clashed with CarbonCore.framework/Headers/NumberFormatting.h 8 | 9 | //#include "Engine.h" 10 | //#include "GameSparksClasses.h" 11 | 12 | 13 | 14 | //DECLARE_LOG_CATEGORY_EXTERN(Victory, Log, All); 15 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/GameSparksSampleGameMode.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "GameFramework/GameMode.h" 6 | #include "GameSparksSampleGameMode.generated.h" 7 | 8 | /** 9 | * 10 | */ 11 | UCLASS() 12 | class GAMESPARKSSAMPLE_API AGameSparksSampleGameMode : public AGameMode 13 | { 14 | GENERATED_BODY() 15 | 16 | 17 | 18 | 19 | }; 20 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSTypedResponse.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | 4 | namespace GameSparks 5 | { 6 | namespace Core 7 | { 8 | const gsstl::string GSTypedResponse::SCRIPT_DATA_KEY = "scriptData"; 9 | const gsstl::string GSTypedResponse::ERROR_KEY = "error"; 10 | const gsstl::string GSTypedResponse::REQUEST_ID_KEY = "requestId"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSTypedResponse.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | 4 | namespace GameSparks 5 | { 6 | namespace Core 7 | { 8 | const gsstl::string GSTypedResponse::SCRIPT_DATA_KEY = "scriptData"; 9 | const gsstl::string GSTypedResponse::ERROR_KEY = "error"; 10 | const gsstl::string GSTypedResponse::REQUEST_ID_KEY = "requestId"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSUtil.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSUtil_h__ 3 | #define GSUtil_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace GameSparks 10 | { 11 | namespace Util 12 | { 13 | gsstl::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); 14 | gsstl::string base64_decode(gsstl::string const& encoded_string); 15 | gsstl::string getHMAC(gsstl::string nonce, gsstl::string appSecret); 16 | 17 | bool shouldConnect(); 18 | } 19 | } 20 | #endif // GSUtil_h__ 21 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/IGSData.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef IGSData_h__ 3 | #define IGSData_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | namespace Core 13 | { 14 | /// base class for GSData objects 15 | class IGSData 16 | { 17 | GS_LEAK_DETECTOR(IGSData) 18 | public: 19 | 20 | /// access the internal cJSON object 21 | virtual const cJSON* GetBaseData() const = 0; 22 | }; 23 | } 24 | 25 | } 26 | #endif // IGSData_h__ 27 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSUtil.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSUtil_h__ 3 | #define GSUtil_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace GameSparks 10 | { 11 | namespace Util 12 | { 13 | gsstl::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); 14 | gsstl::string base64_decode(gsstl::string const& encoded_string); 15 | gsstl::string getHMAC(gsstl::string nonce, gsstl::string appSecret); 16 | 17 | bool shouldConnect(); 18 | } 19 | } 20 | #endif // GSUtil_h__ 21 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/IGSData.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef IGSData_h__ 3 | #define IGSData_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | namespace Core 13 | { 14 | /// base class for GSData objects 15 | class IGSData 16 | { 17 | GS_LEAK_DETECTOR(IGSData) 18 | public: 19 | 20 | /// access the internal cJSON object 21 | virtual const cJSON* GetBaseData() const = 0; 22 | }; 23 | } 24 | 25 | } 26 | #endif // IGSData_h__ 27 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class GameSparksSampleTarget : TargetRules 7 | { 8 | public GameSparksSampleTarget(TargetInfo Target) 9 | { 10 | Type = TargetType.Game; 11 | } 12 | 13 | // 14 | // TargetRules interface. 15 | // 16 | 17 | public override void SetupBinaries( 18 | TargetInfo Target, 19 | ref List OutBuildBinaryConfigurations, 20 | ref List OutExtraModuleNames 21 | ) 22 | { 23 | OutExtraModuleNames.AddRange( new string[] { "GameSparksSample" } ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSampleEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class GameSparksSampleEditorTarget : TargetRules 7 | { 8 | public GameSparksSampleEditorTarget(TargetInfo Target) 9 | { 10 | Type = TargetType.Editor; 11 | } 12 | 13 | // 14 | // TargetRules interface. 15 | // 16 | 17 | public override void SetupBinaries( 18 | TargetInfo Target, 19 | ref List OutBuildBinaryConfigurations, 20 | ref List OutExtraModuleNames 21 | ) 22 | { 23 | OutExtraModuleNames.AddRange( new string[] { "GameSparksSample" } ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksRequestArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameSparksRequestArray.generated.h" 4 | 5 | UCLASS(BlueprintType) 6 | class UGameSparksRequestArray : public UObject 7 | { 8 | GENERATED_UCLASS_BODY() 9 | 10 | public: 11 | 12 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Create GameSparksRequestArray", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "GameSparks|Data") 13 | static UGameSparksRequestArray* CreateGameSparksRequestArray(UObject* WorldContextObject){ 14 | return NewObject(); 15 | } 16 | 17 | 18 | UPROPERTY(BlueprintReadOnly, Category = "GameSparks|Request Params") 19 | TArray StringArray; 20 | }; -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksRequestArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameSparksRequestArray.generated.h" 4 | 5 | UCLASS(BlueprintType) 6 | class UGameSparksRequestArray : public UObject 7 | { 8 | GENERATED_UCLASS_BODY() 9 | 10 | public: 11 | 12 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Create GameSparksRequestArray", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "GameSparks|Data") 13 | static UGameSparksRequestArray* CreateGameSparksRequestArray(UObject* WorldContextObject){ 14 | return NewObject(); 15 | } 16 | 17 | 18 | UPROPERTY(BlueprintReadOnly, Category = "GameSparks|Request Params") 19 | TArray StringArray; 20 | }; -------------------------------------------------------------------------------- /plugin/GameSparks/GameSparks.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion" : 3, 3 | "PluginFileVersion" : 1, 4 | 5 | "FriendlyName" : "GameSparksSDK", 6 | "Version" : 1, 7 | "VersionName" : "0.1", 8 | "CreatedBy" : "GameSparks Ltd, 2015", 9 | "CreatedByURL" : "http://www.gamesparks.com", 10 | "EngineVersion" : "4.6.1", 11 | "Description" : "GameSparks SDK for Unreal Engine 4. This is a beta of the plugin without fully integrated blueprint API.", 12 | "Category" : "GameSparks.GameSparksSDK", 13 | "EnabledByDefault" : true, 14 | "CanContainContent": true, 15 | "MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/offers/0bb7b72905c64c7d86c4c430a42bc9c1", 16 | "Modules" : 17 | [ 18 | { 19 | "Name" : "GameSparks", 20 | "Type" : "Runtime", 21 | "WhitelistPlatforms" : [ "Win32", "Win64", "Mac", "Android", "IOS", "PS4" ], 22 | "LoadingPhase" : "PreDefault" 23 | }, 24 | ] 25 | } -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/GameSparks.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion" : 3, 3 | "PluginFileVersion" : 1, 4 | 5 | "FriendlyName" : "GameSparksSDK", 6 | "Version" : 1, 7 | "VersionName" : "0.1", 8 | "CreatedBy" : "GameSparks Ltd, 2015", 9 | "CreatedByURL" : "http://www.gamesparks.com", 10 | "EngineVersion" : "4.6.1", 11 | "Description" : "GameSparks SDK for Unreal Engine 4. This is a beta of the plugin without fully integrated blueprint API.", 12 | "Category" : "GameSparks.GameSparksSDK", 13 | "EnabledByDefault" : true, 14 | "CanContainContent": true, 15 | "MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/offers/0bb7b72905c64c7d86c4c430a42bc9c1", 16 | "Modules" : 17 | [ 18 | { 19 | "Name" : "GameSparks", 20 | "Type" : "Runtime", 21 | "WhitelistPlatforms" : [ "Win32", "Win64", "Mac", "Android", "IOS", "PS4" ], 22 | "LoadingPhase" : "PreDefault" 23 | }, 24 | ] 25 | } -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/GameSparksSample.Build.cs: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class GameSparksSample : ModuleRules 6 | { 7 | public GameSparksSample(TargetInfo Target) 8 | { 9 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); 10 | 11 | PrivateDependencyModuleNames.AddRange(new string[] { }); 12 | 13 | // Uncomment if you are using Slate UI 14 | // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 15 | 16 | // Uncomment if you are using online features 17 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 18 | // if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64)) 19 | // { 20 | // if (UEBuildConfiguration.bCompileSteamOSS == true) 21 | // { 22 | // DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam"); 23 | // } 24 | // } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /GameSparksSample/Config/DefaultInput.ini: -------------------------------------------------------------------------------- 1 | 2 | [/Script/Engine.InputSettings] 3 | +AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 4 | +AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 5 | +AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 6 | +AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 7 | +AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) 8 | +AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) 9 | bUseMouseForTouch=True 10 | +ActionMappings=(ActionName="FireGameSparksAction",Key=G,bShift=False,bCtrl=False,bAlt=False,bCmd=False) 11 | ConsoleKey=None 12 | +ConsoleKeys=Tilde 13 | 14 | 15 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksLogEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksLogEventData.h" 6 | 7 | UGameSparksLogEventData::UGameSparksLogEventData(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {} 8 | 9 | 10 | UGameSparksLogEventData* UGameSparksLogEventData::CreateGameSparksLogEventAttributes(UObject* WorldContextObject){ 11 | UGameSparksLogEventData* proxy = NewObject(); 12 | return proxy; 13 | }; 14 | 15 | UGameSparksLogEventData* UGameSparksLogEventData::SetString(const FString& name, const FString& value) 16 | { 17 | m_strings.Add(name, value); 18 | return this; 19 | } 20 | 21 | UGameSparksLogEventData* UGameSparksLogEventData::SetNumber(const FString& name, const int32 value) 22 | { 23 | m_numbers.Add(name, value); 24 | return this; 25 | } 26 | 27 | UGameSparksLogEventData* UGameSparksLogEventData::SetObject(const FString& name, UGameSparksScriptData* value) 28 | { 29 | m_objects.Add(name, value); 30 | return this; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Public/IGameSparks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ModuleManager.h" 4 | 5 | 6 | /** 7 | * The public interface to this module. In most cases, this interface is only public to sibling modules 8 | * within this plugin. 9 | */ 10 | class IGameSparks : public IModuleInterface 11 | { 12 | 13 | public: 14 | 15 | /** 16 | * Singleton-like access to this module's interface. This is just for convenience! 17 | * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. 18 | * 19 | * @return Returns singleton instance, loading the module on demand if needed 20 | */ 21 | static inline IGameSparks& Get() 22 | { 23 | return FModuleManager::LoadModuleChecked< IGameSparks >( "IGameSparks" ); 24 | } 25 | 26 | /** 27 | * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. 28 | * 29 | * @return True if the module is loaded and ready to use 30 | */ 31 | static inline bool IsAvailable() 32 | { 33 | return FModuleManager::Get().IsModuleLoaded( "IGameSparks" ); 34 | } 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksLogEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksLogEventData.h" 6 | 7 | UGameSparksLogEventData::UGameSparksLogEventData(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {} 8 | 9 | 10 | UGameSparksLogEventData* UGameSparksLogEventData::CreateGameSparksLogEventAttributes(UObject* WorldContextObject){ 11 | UGameSparksLogEventData* proxy = NewObject(); 12 | return proxy; 13 | }; 14 | 15 | UGameSparksLogEventData* UGameSparksLogEventData::SetString(const FString& name, const FString& value) 16 | { 17 | m_strings.Add(name, value); 18 | return this; 19 | } 20 | 21 | UGameSparksLogEventData* UGameSparksLogEventData::SetNumber(const FString& name, const int32 value) 22 | { 23 | m_numbers.Add(name, value); 24 | return this; 25 | } 26 | 27 | UGameSparksLogEventData* UGameSparksLogEventData::SetObject(const FString& name, UGameSparksScriptData* value) 28 | { 29 | m_objects.Add(name, value); 30 | return this; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Public/IGameSparks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ModuleManager.h" 4 | 5 | 6 | /** 7 | * The public interface to this module. In most cases, this interface is only public to sibling modules 8 | * within this plugin. 9 | */ 10 | class IGameSparks : public IModuleInterface 11 | { 12 | 13 | public: 14 | 15 | /** 16 | * Singleton-like access to this module's interface. This is just for convenience! 17 | * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. 18 | * 19 | * @return Returns singleton instance, loading the module on demand if needed 20 | */ 21 | static inline IGameSparks& Get() 22 | { 23 | return FModuleManager::LoadModuleChecked< IGameSparks >( "IGameSparks" ); 24 | } 25 | 26 | /** 27 | * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. 28 | * 29 | * @return True if the module is loaded and ready to use 30 | */ 31 | static inline bool IsAvailable() 32 | { 33 | return FModuleManager::Get().IsModuleLoaded( "IGameSparks" ); 34 | } 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GameSparks Plugin for Unreal 2 | 3 | # Prerequisites (depending on which platforms you want to support) 4 | 1. [Unreal Engine 4.6+](https://www.unrealengine.com/what-is-unreal-engine-4) 5 | 2. [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html#download) 6 | 3. [XCode](https://developer.apple.com/xcode/downloads/) 7 | 4. [Visual Studio](http://www.visualstudio.com/downloads/download-visual-studio-vs.aspx) 8 | 9 | 10 | ## running the sample 11 | 12 | 1. double click GameSparksSample/GameSparksSample.uproject 13 | 2. open the GameSparks GameMode blueprint and set the API credentials 14 | 3. press play in the Unreal Editor 15 | 16 | 17 | ## Integrating the SDK into your project 18 | 19 | 1. Copy the Plugin located at plugin/GameSparks into the Plugins directory of your project 20 | 2. Copy GameSparksGameMode.uasset into the Content directory of your project 21 | 3. Adapt the blueprint to your needs 22 | 23 | 24 | ## Next Steps 25 | 26 | Explore the [API docs](http://api.gamesparks.net), the [Doxygen documentation](http://gamesparks.bitbucket.org/cpp-sdk/annotated.html) and the [Examples](http://gamesparks.bitbucket.org/cpp-sdk/examples.html). 27 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSMessage_h__ 3 | #define GSMessage_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSTypedResponse.h" 8 | #include "GSObject.h" 9 | #include "./gsstl.h" 10 | #include 11 | 12 | using namespace GameSparks::Core; 13 | using namespace GameSparks::Optional; 14 | 15 | namespace GameSparks 16 | { 17 | namespace Core 18 | { 19 | class GS; 20 | } 21 | 22 | namespace Api 23 | { 24 | namespace Messages 25 | { 26 | /// base class for all messages 27 | class GSMessage : public GSTypedResponse 28 | { 29 | public: 30 | /// construct from GSData 31 | GSMessage(const GSData& message) 32 | : GSTypedResponse(message) 33 | { 34 | 35 | } 36 | 37 | /// get the id of this message 38 | t_StringOptional GetMessageId() const 39 | { 40 | return m_Response.GetString(MESSAGE_ID_KEY); 41 | } 42 | 43 | protected: 44 | /// @internal 45 | const static gsstl::string MESSAGE_ID_KEY; ///< key name to access the message id 46 | private: 47 | }; 48 | } 49 | } 50 | } 51 | #endif // GSMessage_h__ 52 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSMessage_h__ 3 | #define GSMessage_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSTypedResponse.h" 8 | #include "GSObject.h" 9 | #include "./gsstl.h" 10 | #include 11 | 12 | using namespace GameSparks::Core; 13 | using namespace GameSparks::Optional; 14 | 15 | namespace GameSparks 16 | { 17 | namespace Core 18 | { 19 | class GS; 20 | } 21 | 22 | namespace Api 23 | { 24 | namespace Messages 25 | { 26 | /// base class for all messages 27 | class GSMessage : public GSTypedResponse 28 | { 29 | public: 30 | /// construct from GSData 31 | GSMessage(const GSData& message) 32 | : GSTypedResponse(message) 33 | { 34 | 35 | } 36 | 37 | /// get the id of this message 38 | t_StringOptional GetMessageId() const 39 | { 40 | return m_Response.GetString(MESSAGE_ID_KEY); 41 | } 42 | 43 | protected: 44 | /// @internal 45 | const static gsstl::string MESSAGE_ID_KEY; ///< key name to access the message id 46 | private: 47 | }; 48 | } 49 | } 50 | } 51 | #endif // GSMessage_h__ 52 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksComponent.h" 6 | #include "GameSparksModule.h" 7 | 8 | // Sets default values for this component's properties 9 | UGameSparksComponent::UGameSparksComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) 10 | { 11 | bWantsInitializeComponent = true; 12 | PrimaryComponentTick.bCanEverTick = false; 13 | } 14 | 15 | void UGameSparksComponent::Connect(FString apikey, FString secret, bool previewServer, bool clearCachedAuthentication) 16 | { 17 | if (UGameSparksModule::GetModulePtr() != nullptr){ 18 | UGameSparksModule::GetModulePtr()->Initialize(apikey, secret, previewServer, clearCachedAuthentication); 19 | } 20 | } 21 | 22 | void UGameSparksComponent::Disconnect() 23 | { 24 | if (UGameSparksModule::GetModulePtr() != nullptr){ 25 | UGameSparksModule::GetModulePtr()->Shutdown(); 26 | } 27 | 28 | } 29 | 30 | void UGameSparksComponent::Logout() 31 | { 32 | if (UGameSparksModule::GetModulePtr() != nullptr){ 33 | UGameSparksModule::GetModulePtr()->Logout(); 34 | } 35 | } 36 | 37 | 38 | bool UGameSparksComponent::IsAuthenticated(){ 39 | return 40 | UGameSparksModule::GetModulePtr() != nullptr && 41 | UGameSparksModule::GetModulePtr()->GetGSInstance().GetAuthenticated(); 42 | } 43 | 44 | bool UGameSparksComponent::IsAvailable(){ 45 | return 46 | UGameSparksModule::GetModulePtr() != nullptr && 47 | UGameSparksModule::GetModulePtr()->GetGSInstance().GetAvailable(); 48 | } 49 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | #include "Engine.h" 3 | #include "GameSparksClasses.h" 4 | 5 | #include "GameSparksComponent.h" 6 | #include "GameSparksModule.h" 7 | 8 | // Sets default values for this component's properties 9 | UGameSparksComponent::UGameSparksComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) 10 | { 11 | bWantsInitializeComponent = true; 12 | PrimaryComponentTick.bCanEverTick = false; 13 | } 14 | 15 | void UGameSparksComponent::Connect(FString apikey, FString secret, bool previewServer, bool clearCachedAuthentication) 16 | { 17 | if (UGameSparksModule::GetModulePtr() != nullptr){ 18 | UGameSparksModule::GetModulePtr()->Initialize(apikey, secret, previewServer, clearCachedAuthentication); 19 | } 20 | } 21 | 22 | void UGameSparksComponent::Disconnect() 23 | { 24 | if (UGameSparksModule::GetModulePtr() != nullptr){ 25 | UGameSparksModule::GetModulePtr()->Shutdown(); 26 | } 27 | 28 | } 29 | 30 | void UGameSparksComponent::Logout() 31 | { 32 | if (UGameSparksModule::GetModulePtr() != nullptr){ 33 | UGameSparksModule::GetModulePtr()->Logout(); 34 | } 35 | } 36 | 37 | 38 | bool UGameSparksComponent::IsAuthenticated(){ 39 | return 40 | UGameSparksModule::GetModulePtr() != nullptr && 41 | UGameSparksModule::GetModulePtr()->GetGSInstance().GetAuthenticated(); 42 | } 43 | 44 | bool UGameSparksComponent::IsAvailable(){ 45 | return 46 | UGameSparksModule::GetModulePtr() != nullptr && 47 | UGameSparksModule::GetModulePtr()->GetGSInstance().GetAvailable(); 48 | } 49 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSObject.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSObject_h__ 3 | #define GSObject_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSRequestData.h" 8 | #include "GSOptional.h" 9 | #include 10 | #include 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | class GSRequest; 17 | 18 | /// Basically GSData with additional type information 19 | class GSObject : public GSRequestData 20 | { 21 | public: 22 | 23 | typedef GameSparks::Optional::Optional t_Optional; 24 | 25 | GSObject(cJSON* data) 26 | : GSRequestData(data) 27 | { 28 | 29 | } 30 | 31 | GSObject(const GSData& wrapper) 32 | : GSRequestData(wrapper) 33 | { 34 | 35 | } 36 | 37 | GSObject(const GSObject& other) 38 | : GSRequestData(other.m_Data) 39 | { 40 | 41 | } 42 | 43 | 44 | ~GSObject() 45 | { 46 | } 47 | 48 | GSObject(const gsstl::string& type) 49 | { 50 | AddString("@class", type); 51 | } 52 | 53 | /// Create a new instance of the given type ("@class") 54 | Optional::t_StringOptional GetType() const 55 | { 56 | return GetString("@class"); 57 | } 58 | 59 | static GSObject FromJSON(const gsstl::string& json) 60 | { 61 | cJSON* root = cJSON_Parse(json.c_str()); 62 | GSObject result(root); 63 | cJSON_Delete(root); 64 | return result; 65 | } 66 | 67 | protected: 68 | GSObject() 69 | : GSRequestData() 70 | { 71 | 72 | } 73 | 74 | friend class GSRequest; 75 | 76 | GS_LEAK_DETECTOR(GSObject) 77 | }; 78 | } 79 | } 80 | #endif // GSObject_h__ 81 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSObject.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSObject_h__ 3 | #define GSObject_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSRequestData.h" 8 | #include "GSOptional.h" 9 | #include 10 | #include 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | class GSRequest; 17 | 18 | /// Basically GSData with additional type information 19 | class GSObject : public GSRequestData 20 | { 21 | public: 22 | 23 | typedef GameSparks::Optional::Optional t_Optional; 24 | 25 | GSObject(cJSON* data) 26 | : GSRequestData(data) 27 | { 28 | 29 | } 30 | 31 | GSObject(const GSData& wrapper) 32 | : GSRequestData(wrapper) 33 | { 34 | 35 | } 36 | 37 | GSObject(const GSObject& other) 38 | : GSRequestData(other.m_Data) 39 | { 40 | 41 | } 42 | 43 | 44 | ~GSObject() 45 | { 46 | } 47 | 48 | GSObject(const gsstl::string& type) 49 | { 50 | AddString("@class", type); 51 | } 52 | 53 | /// Create a new instance of the given type ("@class") 54 | Optional::t_StringOptional GetType() const 55 | { 56 | return GetString("@class"); 57 | } 58 | 59 | static GSObject FromJSON(const gsstl::string& json) 60 | { 61 | cJSON* root = cJSON_Parse(json.c_str()); 62 | GSObject result(root); 63 | cJSON_Delete(root); 64 | return result; 65 | } 66 | 67 | protected: 68 | GSObject() 69 | : GSRequestData() 70 | { 71 | 72 | } 73 | 74 | friend class GSRequest; 75 | 76 | GS_LEAK_DETECTOR(GSObject) 77 | }; 78 | } 79 | } 80 | #endif // GSObject_h__ 81 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksModule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameSparks/gsstl.h" 4 | #if PLATFORM_WINDOWS 5 | #include "AllowWindowsPlatformTypes.h" 6 | #endif 7 | #include "GameSparks/GS.h" 8 | #if PLATFORM_WINDOWS 9 | #include "HideWindowsPlatformTypes.h" 10 | #endif 11 | #include "GSMessageListeners.h" 12 | #include "IGameSparks.h" 13 | #include "Runtime/Engine/Public/Tickable.h" 14 | #include "GameSparksComponent.h" 15 | 16 | 17 | DECLARE_LOG_CATEGORY_EXTERN(UGameSparksModuleLog, Log, All); 18 | 19 | class UGameSparksModule : public IGameSparks, public FTickableGameObject 20 | { 21 | public: 22 | 23 | /** IModuleInterface implementation */ 24 | virtual void StartupModule(); 25 | virtual void ShutdownModule(); 26 | 27 | /** FTickableGameObject implementation */ 28 | virtual bool IsTickableWhenPaused() const; 29 | virtual bool IsTickableInEditor() const; 30 | virtual void Tick(float DeltaTime); 31 | virtual bool IsTickable() const; 32 | virtual TStatId GetStatId() const; 33 | 34 | /* Initialization and destruction of gamesparks */ 35 | void Initialize(FString apikey, FString secret, bool previewServer, bool clearCachedAuthentication); 36 | void Shutdown(); 37 | void Logout(); 38 | 39 | static UGameSparksModule* GetModulePtr(); 40 | 41 | void SendGameSparksAvailableToComponents(bool available); 42 | void SendDebugLogToComponents(const gsstl::string& message); 43 | 44 | GameSparks::Core::GS& GetGSInstance() { return GS; } 45 | const GameSparks::Core::GS& GetGSInstance() const { return GS; } 46 | 47 | void RegisterListeners(); 48 | 49 | /// returns true, iff the GameSparks instance is ready to be used 50 | bool IsInitialized() const; 51 | 52 | private: 53 | 54 | 55 | GameSparks::Core::GS GS; 56 | 57 | bool isInitialised = false; 58 | 59 | 60 | }; 61 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksModule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameSparks/gsstl.h" 4 | #if PLATFORM_WINDOWS 5 | #include "AllowWindowsPlatformTypes.h" 6 | #endif 7 | #include "GameSparks/GS.h" 8 | #if PLATFORM_WINDOWS 9 | #include "HideWindowsPlatformTypes.h" 10 | #endif 11 | #include "GSMessageListeners.h" 12 | #include "IGameSparks.h" 13 | #include "Runtime/Engine/Public/Tickable.h" 14 | #include "GameSparksComponent.h" 15 | 16 | 17 | DECLARE_LOG_CATEGORY_EXTERN(UGameSparksModuleLog, Log, All); 18 | 19 | class UGameSparksModule : public IGameSparks, public FTickableGameObject 20 | { 21 | public: 22 | 23 | /** IModuleInterface implementation */ 24 | virtual void StartupModule(); 25 | virtual void ShutdownModule(); 26 | 27 | /** FTickableGameObject implementation */ 28 | virtual bool IsTickableWhenPaused() const; 29 | virtual bool IsTickableInEditor() const; 30 | virtual void Tick(float DeltaTime); 31 | virtual bool IsTickable() const; 32 | virtual TStatId GetStatId() const; 33 | 34 | /* Initialization and destruction of gamesparks */ 35 | void Initialize(FString apikey, FString secret, bool previewServer, bool clearCachedAuthentication); 36 | void Shutdown(); 37 | void Logout(); 38 | 39 | static UGameSparksModule* GetModulePtr(); 40 | 41 | void SendGameSparksAvailableToComponents(bool available); 42 | void SendDebugLogToComponents(const gsstl::string& message); 43 | 44 | GameSparks::Core::GS& GetGSInstance() { return GS; } 45 | const GameSparks::Core::GS& GetGSInstance() const { return GS; } 46 | 47 | void RegisterListeners(); 48 | 49 | /// returns true, iff the GameSparks instance is ready to be used 50 | bool IsInitialized() const; 51 | 52 | private: 53 | 54 | 55 | GameSparks::Core::GS GS; 56 | 57 | bool isInitialised = false; 58 | 59 | 60 | }; 61 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/0002GSAmalgamated.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | 3 | #if defined(_MSC_VER) 4 | # pragma warning(disable: 4530) // concrt.h(313): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc 5 | # pragma warning(disable: 4702) // xtree(1826): warning C4702: unreachable code 6 | #endif 7 | 8 | #define UI GET_OF_MY_LAWN 9 | 10 | // silence warnings on windows 11 | 12 | #if defined(_MSC_VER) 13 | # if !defined(_CRT_SECURE_NO_WARNINGS) 14 | # define _CRT_SECURE_NO_WARNINGS 15 | # endif 16 | # if !defined(_CRT_SECURE_NO_DEPRECATE) 17 | # define _CRT_SECURE_NO_DEPRECATE 18 | # endif 19 | #endif 20 | 21 | //dependencies 22 | #if defined(WIN32) 23 | # ifdef _MSC_VER 24 | # include 25 | # endif 26 | #else 27 | # define _CRTIMP __declspec(dllimport) _CRTIMP bool __cdecl __uncaught_exception(); 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #undef PF_MAX 50 | 51 | // so that unreal still includes MinWindows.h 52 | #ifdef _WINDOWS_ 53 | # undef _WINDOWS_ 54 | // Undo any Windows defines. 55 | # undef uint8 56 | # undef uint16 57 | # undef uint32 58 | # undef int32 59 | # undef float 60 | # undef MAX_uint8 61 | # undef MAX_uint16 62 | # undef MAX_uint32 63 | # undef MAX_int32 64 | # undef CDECL 65 | # undef PF_MAX 66 | # undef PlaySound 67 | # undef DrawText 68 | # undef CaptureStackBackTrace 69 | # undef MemoryBarrier 70 | # undef DeleteFile 71 | # undef MoveFile 72 | # undef CopyFile 73 | # undef CreateDirectory 74 | #endif 75 | 76 | #undef UI 77 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/0002GSAmalgamated.cpp: -------------------------------------------------------------------------------- 1 | #include "GameSparksPrivatePCH.h" 2 | 3 | #if defined(_MSC_VER) 4 | # pragma warning(disable: 4530) // concrt.h(313): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc 5 | # pragma warning(disable: 4702) // xtree(1826): warning C4702: unreachable code 6 | #endif 7 | 8 | #define UI GET_OF_MY_LAWN 9 | 10 | // silence warnings on windows 11 | 12 | #if defined(_MSC_VER) 13 | # if !defined(_CRT_SECURE_NO_WARNINGS) 14 | # define _CRT_SECURE_NO_WARNINGS 15 | # endif 16 | # if !defined(_CRT_SECURE_NO_DEPRECATE) 17 | # define _CRT_SECURE_NO_DEPRECATE 18 | # endif 19 | #endif 20 | 21 | //dependencies 22 | #if defined(WIN32) 23 | # ifdef _MSC_VER 24 | # include 25 | # endif 26 | #else 27 | # define _CRTIMP __declspec(dllimport) _CRTIMP bool __cdecl __uncaught_exception(); 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #undef PF_MAX 50 | 51 | // so that unreal still includes MinWindows.h 52 | #ifdef _WINDOWS_ 53 | # undef _WINDOWS_ 54 | // Undo any Windows defines. 55 | # undef uint8 56 | # undef uint16 57 | # undef uint32 58 | # undef int32 59 | # undef float 60 | # undef MAX_uint8 61 | # undef MAX_uint16 62 | # undef MAX_uint32 63 | # undef MAX_int32 64 | # undef CDECL 65 | # undef PF_MAX 66 | # undef PlaySound 67 | # undef DrawText 68 | # undef CaptureStackBackTrace 69 | # undef MemoryBarrier 70 | # undef DeleteFile 71 | # undef MoveFile 72 | # undef CopyFile 73 | # undef CreateDirectory 74 | #endif 75 | 76 | #undef UI 77 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSConnection_h__ 3 | #define GSConnection_h__ 4 | 5 | #pragma once 6 | 7 | #include "GS.h" 8 | #include "IGSPlatform.h" 9 | #include "GSRequest.h" 10 | #include 11 | 12 | namespace easywsclient 13 | { 14 | class WebSocket; 15 | struct WSError; 16 | } 17 | 18 | namespace GameSparks 19 | { 20 | namespace Core 21 | { 22 | class GS; 23 | class GSRequest; 24 | 25 | /// represents a connection. This is an internal class and there should be no need to interact with it directly. 26 | class GSConnection 27 | { 28 | public: 29 | GSConnection(GS* gs, IGSPlatform* gsPlatform); 30 | ~GSConnection(); 31 | 32 | void Terminate(); 33 | void Stop(); 34 | void Close(); 35 | void OnOpened(); 36 | void OnClosed(); 37 | void OnError(const gsstl::string& errorMessage); 38 | void EnsureConnected(); 39 | bool GetReady() const; 40 | void SetReady(bool ready); 41 | void SendImmediate(GSRequest& request); 42 | 43 | bool Update(float deltaTime); 44 | GS* GetGSInstance() const { return m_GS; } 45 | bool IsWebSocketConnectionAlive() const; 46 | protected: 47 | static void OnWebSocketCallback(const gsstl::string& message, void* userData); 48 | static void OnWebSocketError(const easywsclient::WSError& error, void* userData); 49 | private: 50 | GS* m_GS; 51 | IGSPlatform* m_GSPlatform; 52 | 53 | easywsclient::WebSocket* m_WebSocket; 54 | gsstl::string m_URL; 55 | bool m_Initialized; 56 | bool m_Stopped; 57 | float m_lastActivity; 58 | 59 | typedef gsstl::map t_RequestMap; 60 | typedef gsstl::pair t_RequestMapPair; 61 | t_RequestMap m_PendingRequests; 62 | 63 | friend class GS; 64 | 65 | GS_LEAK_DETECTOR(GSConnection) 66 | }; 67 | } 68 | } 69 | #endif // GSConnection_h__ 70 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSConnection_h__ 3 | #define GSConnection_h__ 4 | 5 | #pragma once 6 | 7 | #include "GS.h" 8 | #include "IGSPlatform.h" 9 | #include "GSRequest.h" 10 | #include 11 | 12 | namespace easywsclient 13 | { 14 | class WebSocket; 15 | struct WSError; 16 | } 17 | 18 | namespace GameSparks 19 | { 20 | namespace Core 21 | { 22 | class GS; 23 | class GSRequest; 24 | 25 | /// represents a connection. This is an internal class and there should be no need to interact with it directly. 26 | class GSConnection 27 | { 28 | public: 29 | GSConnection(GS* gs, IGSPlatform* gsPlatform); 30 | ~GSConnection(); 31 | 32 | void Terminate(); 33 | void Stop(); 34 | void Close(); 35 | void OnOpened(); 36 | void OnClosed(); 37 | void OnError(const gsstl::string& errorMessage); 38 | void EnsureConnected(); 39 | bool GetReady() const; 40 | void SetReady(bool ready); 41 | void SendImmediate(GSRequest& request); 42 | 43 | bool Update(float deltaTime); 44 | GS* GetGSInstance() const { return m_GS; } 45 | bool IsWebSocketConnectionAlive() const; 46 | protected: 47 | static void OnWebSocketCallback(const gsstl::string& message, void* userData); 48 | static void OnWebSocketError(const easywsclient::WSError& error, void* userData); 49 | private: 50 | GS* m_GS; 51 | IGSPlatform* m_GSPlatform; 52 | 53 | easywsclient::WebSocket* m_WebSocket; 54 | gsstl::string m_URL; 55 | bool m_Initialized; 56 | bool m_Stopped; 57 | float m_lastActivity; 58 | 59 | typedef gsstl::map t_RequestMap; 60 | typedef gsstl::pair t_RequestMapPair; 61 | t_RequestMap m_PendingRequests; 62 | 63 | friend class GS; 64 | 65 | GS_LEAK_DETECTOR(GSConnection) 66 | }; 67 | } 68 | } 69 | #endif // GSConnection_h__ 70 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/Cocos2dxPlatform.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | 3 | #ifndef Cocos2dxPlatform_h__ 4 | #define Cocos2dxPlatform_h__ 5 | 6 | #pragma once 7 | 8 | #include "./IGSPlatform.h" 9 | 10 | #ifndef CC_TARGET_PLATFORM 11 | # error "This file is meant for inclusion in Cocos2d-x projects only. Please make sure, that this file is included AFTER the Cocos2d-x headers." 12 | #endif /* CC_TARGET_PLATFORM */ 13 | 14 | namespace GameSparks 15 | { 16 | namespace Core 17 | { 18 | //! IGSPlatform implementation for [Cocos2d-x](http://www.cocos2d-x.org/). 19 | class Cocos2dxPlatform : public IGSPlatform 20 | { 21 | public: 22 | /*! 23 | Construct a Cocos2dxPlatform with the given credentials 24 | 25 | @param usePreviewServer true if you want to use the preview server, false if you want to use the production server 26 | @param verboseLogging true for verbose logging, false for less verbose logging 27 | */ 28 | Cocos2dxPlatform(const gsstl::string& apikey, const gsstl::string& secret, bool usePreviewServer, bool verboseLogging=false) 29 | : IGSPlatform(apikey, secret, usePreviewServer, verboseLogging) 30 | {} 31 | 32 | //! Gets a unique identifier for the device 33 | /*virtual gsstl::string GetDeviceId() const 34 | { 35 | // TODO: implement 36 | return "NOT-IMPLEMENTED"; 37 | }*/ 38 | 39 | //! Will be used in analytics reports 40 | virtual gsstl::string GetSDK() const 41 | { 42 | return "GameSparks SDK C++ 1.0 for Cocos2d-x"; 43 | } 44 | 45 | //! Will be used in analytics reports 46 | virtual gsstl::string GetDeviceType() const 47 | { 48 | // TODO: implement 49 | return "Cocos2d-x"; 50 | } 51 | 52 | //! Receives debugging information from the API 53 | virtual void DebugMsg(const gsstl::string& message) const 54 | { 55 | cocos2d::log("[GameSparks]: %s", message.c_str()); 56 | } 57 | }; 58 | } 59 | } 60 | #endif // Cocos2dxPlatform_h__ 61 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/mbedtls/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Version information 3 | * 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 5 | * SPDX-License-Identifier: Apache-2.0 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | * not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * This file is part of mbed TLS (https://tls.mbed.org) 20 | */ 21 | 22 | /* 23 | GameSparks LLC: 24 | The Source files have been changed so that they can be compiled by a C++ 25 | Compiler. This was required, because the Unreal Engine and Windows 10 26 | Phone / Universal Apps do not support direct compilation of C Source 27 | code. Also changes where made to enable the compilation from a single 28 | translation unit (amalgamated build). 29 | */ 30 | 31 | #if !defined(MBEDTLS_CONFIG_FILE) 32 | #include "mbedtls/config.h" 33 | #else 34 | #include MBEDTLS_CONFIG_FILE 35 | #endif 36 | 37 | #if defined(MBEDTLS_VERSION_C) 38 | 39 | #include "mbedtls/version.h" 40 | #include 41 | 42 | unsigned int mbedtls_version_get_number() 43 | { 44 | return( MBEDTLS_VERSION_NUMBER ); 45 | } 46 | 47 | void mbedtls_version_get_string( char *string ) 48 | { 49 | memcpy( string, MBEDTLS_VERSION_STRING, 50 | sizeof( MBEDTLS_VERSION_STRING ) ); 51 | } 52 | 53 | void mbedtls_version_get_string_full( char *string ) 54 | { 55 | memcpy( string, MBEDTLS_VERSION_STRING_FULL, 56 | sizeof( MBEDTLS_VERSION_STRING_FULL ) ); 57 | } 58 | 59 | #endif /* MBEDTLS_VERSION_C */ 60 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/Cocos2dxPlatform.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | 3 | #ifndef Cocos2dxPlatform_h__ 4 | #define Cocos2dxPlatform_h__ 5 | 6 | #pragma once 7 | 8 | #include "./IGSPlatform.h" 9 | 10 | #ifndef CC_TARGET_PLATFORM 11 | # error "This file is meant for inclusion in Cocos2d-x projects only. Please make sure, that this file is included AFTER the Cocos2d-x headers." 12 | #endif /* CC_TARGET_PLATFORM */ 13 | 14 | namespace GameSparks 15 | { 16 | namespace Core 17 | { 18 | //! IGSPlatform implementation for [Cocos2d-x](http://www.cocos2d-x.org/). 19 | class Cocos2dxPlatform : public IGSPlatform 20 | { 21 | public: 22 | /*! 23 | Construct a Cocos2dxPlatform with the given credentials 24 | 25 | @param usePreviewServer true if you want to use the preview server, false if you want to use the production server 26 | @param verboseLogging true for verbose logging, false for less verbose logging 27 | */ 28 | Cocos2dxPlatform(const gsstl::string& apikey, const gsstl::string& secret, bool usePreviewServer, bool verboseLogging=false) 29 | : IGSPlatform(apikey, secret, usePreviewServer, verboseLogging) 30 | {} 31 | 32 | //! Gets a unique identifier for the device 33 | /*virtual gsstl::string GetDeviceId() const 34 | { 35 | // TODO: implement 36 | return "NOT-IMPLEMENTED"; 37 | }*/ 38 | 39 | //! Will be used in analytics reports 40 | virtual gsstl::string GetSDK() const 41 | { 42 | return "GameSparks SDK C++ 1.0 for Cocos2d-x"; 43 | } 44 | 45 | //! Will be used in analytics reports 46 | virtual gsstl::string GetDeviceType() const 47 | { 48 | // TODO: implement 49 | return "Cocos2d-x"; 50 | } 51 | 52 | //! Receives debugging information from the API 53 | virtual void DebugMsg(const gsstl::string& message) const 54 | { 55 | cocos2d::log("[GameSparks]: %s", message.c_str()); 56 | } 57 | }; 58 | } 59 | } 60 | #endif // Cocos2dxPlatform_h__ 61 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/mbedtls/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Version information 3 | * 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 5 | * SPDX-License-Identifier: Apache-2.0 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | * not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * This file is part of mbed TLS (https://tls.mbed.org) 20 | */ 21 | 22 | /* 23 | GameSparks LLC: 24 | The Source files have been changed so that they can be compiled by a C++ 25 | Compiler. This was required, because the Unreal Engine and Windows 10 26 | Phone / Universal Apps do not support direct compilation of C Source 27 | code. Also changes where made to enable the compilation from a single 28 | translation unit (amalgamated build). 29 | */ 30 | 31 | #if !defined(MBEDTLS_CONFIG_FILE) 32 | #include "mbedtls/config.h" 33 | #else 34 | #include MBEDTLS_CONFIG_FILE 35 | #endif 36 | 37 | #if defined(MBEDTLS_VERSION_C) 38 | 39 | #include "mbedtls/version.h" 40 | #include 41 | 42 | unsigned int mbedtls_version_get_number() 43 | { 44 | return( MBEDTLS_VERSION_NUMBER ); 45 | } 46 | 47 | void mbedtls_version_get_string( char *string ) 48 | { 49 | memcpy( string, MBEDTLS_VERSION_STRING, 50 | sizeof( MBEDTLS_VERSION_STRING ) ); 51 | } 52 | 53 | void mbedtls_version_get_string_full( char *string ) 54 | { 55 | memcpy( string, MBEDTLS_VERSION_STRING_FULL, 56 | sizeof( MBEDTLS_VERSION_STRING_FULL ) ); 57 | } 58 | 59 | #endif /* MBEDTLS_VERSION_C */ 60 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSRequest.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace GameSparks; 7 | using namespace GameSparks::Core; 8 | 9 | GSRequest::GSRequest(GS& gsInstance, const gsstl::string& requestType) 10 | : m_GSInstance(&gsInstance) 11 | , m_Durable(false) 12 | , m_CancelSeconds(10) 13 | , m_WaitForResponseSeconds(10) 14 | , m_DurableRetrySeconds(0) // if the request is durable, we'll try to send it immediately 15 | , m_ResponseTimeout(0) 16 | , m_userData() 17 | { 18 | AddString("@class", requestType); 19 | } 20 | 21 | GameSparks::Core::GSRequest::GSRequest(GS& gsInstance, cJSON* data) 22 | : GSObject(data) 23 | , m_GSInstance(&gsInstance) 24 | , m_Durable(false) 25 | , m_CancelSeconds(10) 26 | , m_WaitForResponseSeconds(10) 27 | , m_DurableRetrySeconds(0) // if the request is durable, we'll try to send it immediately 28 | , m_ResponseTimeout(0) 29 | , m_userData() 30 | { 31 | 32 | } 33 | 34 | bool GameSparks::Core::GSRequest::operator==(const GSRequest& other) const 35 | { 36 | return GetJSON() == other.GetJSON(); 37 | } 38 | 39 | 40 | void GameSparks::Core::GSRequest::Send(const BaseCallbacksPtr& callbacks, Seconds timeoutSeconds) 41 | { 42 | assert(callbacks); 43 | m_ResponseTimeout = timeoutSeconds; 44 | m_callbacks = callbacks; 45 | m_GSInstance->Send(*this); 46 | m_callbacks = 0; // release the callback, so that this GSRequest instance can be re-used - Note: a copy is inside m_GSInstance 47 | } 48 | 49 | void GameSparks::Core::GSRequest::Send() 50 | { 51 | m_GSInstance->Send(*this); 52 | } 53 | 54 | void GameSparks::Core::GSRequest::Complete(const GSObject& response) 55 | { 56 | m_Response = response; 57 | 58 | if (m_callbacks) 59 | { 60 | if (response.ContainsKey("error")) 61 | { 62 | m_callbacks->OnError(*m_GSInstance, response); 63 | } 64 | else 65 | { 66 | m_callbacks->OnSucess(*m_GSInstance, response); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSRequest.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace GameSparks; 7 | using namespace GameSparks::Core; 8 | 9 | GSRequest::GSRequest(GS& gsInstance, const gsstl::string& requestType) 10 | : m_GSInstance(&gsInstance) 11 | , m_Durable(false) 12 | , m_CancelSeconds(10) 13 | , m_WaitForResponseSeconds(10) 14 | , m_DurableRetrySeconds(0) // if the request is durable, we'll try to send it immediately 15 | , m_ResponseTimeout(0) 16 | , m_userData() 17 | { 18 | AddString("@class", requestType); 19 | } 20 | 21 | GameSparks::Core::GSRequest::GSRequest(GS& gsInstance, cJSON* data) 22 | : GSObject(data) 23 | , m_GSInstance(&gsInstance) 24 | , m_Durable(false) 25 | , m_CancelSeconds(10) 26 | , m_WaitForResponseSeconds(10) 27 | , m_DurableRetrySeconds(0) // if the request is durable, we'll try to send it immediately 28 | , m_ResponseTimeout(0) 29 | , m_userData() 30 | { 31 | 32 | } 33 | 34 | bool GameSparks::Core::GSRequest::operator==(const GSRequest& other) const 35 | { 36 | return GetJSON() == other.GetJSON(); 37 | } 38 | 39 | 40 | void GameSparks::Core::GSRequest::Send(const BaseCallbacksPtr& callbacks, Seconds timeoutSeconds) 41 | { 42 | assert(callbacks); 43 | m_ResponseTimeout = timeoutSeconds; 44 | m_callbacks = callbacks; 45 | m_GSInstance->Send(*this); 46 | m_callbacks = 0; // release the callback, so that this GSRequest instance can be re-used - Note: a copy is inside m_GSInstance 47 | } 48 | 49 | void GameSparks::Core::GSRequest::Send() 50 | { 51 | m_GSInstance->Send(*this); 52 | } 53 | 54 | void GameSparks::Core::GSRequest::Complete(const GSObject& response) 55 | { 56 | m_Response = response; 57 | 58 | if (m_callbacks) 59 | { 60 | if (response.ContainsKey("error")) 61 | { 62 | m_callbacks->OnError(*m_GSInstance, response); 63 | } 64 | else 65 | { 66 | m_callbacks->OnSucess(*m_GSInstance, response); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/havege.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file havege.h 3 | * 4 | * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_HAVEGE_H 24 | #define MBEDTLS_HAVEGE_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * \brief HAVEGE state structure 36 | */ 37 | typedef struct 38 | { 39 | int PT1, PT2, offset[2]; 40 | int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; 41 | int WALK[8192]; 42 | } 43 | mbedtls_havege_state; 44 | 45 | /** 46 | * \brief HAVEGE initialization 47 | * 48 | * \param hs HAVEGE state to be initialized 49 | */ 50 | void mbedtls_havege_init( mbedtls_havege_state *hs ); 51 | 52 | /** 53 | * \brief Clear HAVEGE state 54 | * 55 | * \param hs HAVEGE state to be cleared 56 | */ 57 | void mbedtls_havege_free( mbedtls_havege_state *hs ); 58 | 59 | /** 60 | * \brief HAVEGE rand function 61 | * 62 | * \param p_rng A HAVEGE state 63 | * \param output Buffer to fill 64 | * \param len Length of buffer 65 | * 66 | * \return 0 67 | */ 68 | int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* havege.h */ 75 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/havege.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file havege.h 3 | * 4 | * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_HAVEGE_H 24 | #define MBEDTLS_HAVEGE_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * \brief HAVEGE state structure 36 | */ 37 | typedef struct 38 | { 39 | int PT1, PT2, offset[2]; 40 | int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; 41 | int WALK[8192]; 42 | } 43 | mbedtls_havege_state; 44 | 45 | /** 46 | * \brief HAVEGE initialization 47 | * 48 | * \param hs HAVEGE state to be initialized 49 | */ 50 | void mbedtls_havege_init( mbedtls_havege_state *hs ); 51 | 52 | /** 53 | * \brief Clear HAVEGE state 54 | * 55 | * \param hs HAVEGE state to be cleared 56 | */ 57 | void mbedtls_havege_free( mbedtls_havege_state *hs ); 58 | 59 | /** 60 | * \brief HAVEGE rand function 61 | * 62 | * \param p_rng A HAVEGE state 63 | * \param output Buffer to fill 64 | * \param len Length of buffer 65 | * 66 | * \return 0 67 | */ 68 | int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* havege.h */ 75 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSDateTime.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSDateTime_h__ 3 | #define GSDateTime_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace GameSparks 12 | { 13 | namespace Core 14 | { 15 | /// Represents a point in time. 16 | /// \includelineno sampleExtra01DateTimeConversion.cpp 17 | class GSDateTime 18 | { 19 | public: 20 | typedef GameSparks::Optional::Optional t_Optional; 21 | 22 | GSDateTime(); 23 | GSDateTime(int day, int month, int year, int hour, int minute, int second, bool isLocalTime); 24 | GSDateTime(time_t time, bool isLocalTime); 25 | GSDateTime(const gsstl::string& iso8601_str); 26 | static GSDateTime Now(); 27 | 28 | GSDateTime ToLocalTime() const; 29 | GSDateTime ToGMTime() const; 30 | // Returns the DateTime object as a ISO 8601 string (eg. '2011-10-08T07:07:09Z') representation 31 | gsstl::string ToString() const; 32 | 33 | int GetDay() const; 34 | int GetMonth() const; 35 | int GetYear() const; 36 | int GetHour() const; 37 | int GetMinute() const; 38 | int GetSecond() const; 39 | bool IsLocalTime() const; 40 | 41 | /// caution: Those do NOT account for leap-seconds and DST switches 42 | /// add *seconds* seconds 43 | GSDateTime AddSeconds(int seconds); 44 | /// add 60 seconds 45 | GSDateTime AddMinutes(int minutes); 46 | /// add 60*60 seconds 47 | GSDateTime AddHours(int hours); 48 | /// add 24*60*60 seconds 49 | GSDateTime AddDays(int days); 50 | 51 | /// equality means, both time have to be equal and either both in UTC or both in local time. So timezone conversion will be attempted. 52 | bool operator == (const GSDateTime& o) const; 53 | private: 54 | time_t m_time; 55 | bool m_IsLocalTime; 56 | 57 | GS_LEAK_DETECTOR(GSDateTime) 58 | }; 59 | 60 | /// \example sampleExtra01DateTimeConversion.cpp This is an example on how to use the GSDateTime class to convert dates to/from strings and to GMT/local time 61 | } 62 | } 63 | #endif // GSDateTime_h__ 64 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/google/timesupport.h: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | // This files includes functions to support time related operations. 17 | // It defines common functions, which are only available on platforms. 18 | // It also provides functions to parse RFC times. 19 | 20 | #ifndef COMMON_TIMESUPPORT_H__ 21 | #define COMMON_TIMESUPPORT_H__ 22 | 23 | #include 24 | #include 25 | 26 | #if defined(WIN32) || defined(MARMALADE) 27 | // Convert a string representation time to a time tm structure. 28 | // It is the conversion function of strftime(). 29 | // Linux provides this function. 30 | char *strptime(const char *buf, const char *fmt, struct tm *tm); 31 | #endif 32 | 33 | #if defined(__linux__) || defined(__unix__) || defined(__APPLE__) || defined(MARMALADE) 34 | // Convert GMT time to UTC time value. 35 | // It is like mktime(), but interprets the fields as GMT rather than local. 36 | // This is the inverse of gmtime(). 37 | // Windows provides this function. 38 | time_t _mkgmtime(const struct tm *tm); 39 | #endif 40 | 41 | // Tries various rfc's to convert a buffer to a struct tm. 42 | // Warning: this function only handles a few cases and completely ignores 43 | // time zones! 44 | bool ParseRfcTime(const char* buf, struct tm *tm); 45 | 46 | // Covert the time to W3C Datetime formats. 47 | // See http://www.w3.org/TR/NOTE-datetime 48 | const gsstl::string FormatW3CTime(const time_t &time, bool local); 49 | 50 | // A helper method used to format HttpDate. 51 | gsstl::string FormatHttpDate(time_t t); 52 | 53 | #endif // COMMON_TIMESUPPORT_H__ 54 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSDateTime.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSDateTime_h__ 3 | #define GSDateTime_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace GameSparks 12 | { 13 | namespace Core 14 | { 15 | /// Represents a point in time. 16 | /// \includelineno sampleExtra01DateTimeConversion.cpp 17 | class GSDateTime 18 | { 19 | public: 20 | typedef GameSparks::Optional::Optional t_Optional; 21 | 22 | GSDateTime(); 23 | GSDateTime(int day, int month, int year, int hour, int minute, int second, bool isLocalTime); 24 | GSDateTime(time_t time, bool isLocalTime); 25 | GSDateTime(const gsstl::string& iso8601_str); 26 | static GSDateTime Now(); 27 | 28 | GSDateTime ToLocalTime() const; 29 | GSDateTime ToGMTime() const; 30 | // Returns the DateTime object as a ISO 8601 string (eg. '2011-10-08T07:07:09Z') representation 31 | gsstl::string ToString() const; 32 | 33 | int GetDay() const; 34 | int GetMonth() const; 35 | int GetYear() const; 36 | int GetHour() const; 37 | int GetMinute() const; 38 | int GetSecond() const; 39 | bool IsLocalTime() const; 40 | 41 | /// caution: Those do NOT account for leap-seconds and DST switches 42 | /// add *seconds* seconds 43 | GSDateTime AddSeconds(int seconds); 44 | /// add 60 seconds 45 | GSDateTime AddMinutes(int minutes); 46 | /// add 60*60 seconds 47 | GSDateTime AddHours(int hours); 48 | /// add 24*60*60 seconds 49 | GSDateTime AddDays(int days); 50 | 51 | /// equality means, both time have to be equal and either both in UTC or both in local time. So timezone conversion will be attempted. 52 | bool operator == (const GSDateTime& o) const; 53 | private: 54 | time_t m_time; 55 | bool m_IsLocalTime; 56 | 57 | GS_LEAK_DETECTOR(GSDateTime) 58 | }; 59 | 60 | /// \example sampleExtra01DateTimeConversion.cpp This is an example on how to use the GSDateTime class to convert dates to/from strings and to GMT/local time 61 | } 62 | } 63 | #endif // GSDateTime_h__ 64 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/google/timesupport.h: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | // This files includes functions to support time related operations. 17 | // It defines common functions, which are only available on platforms. 18 | // It also provides functions to parse RFC times. 19 | 20 | #ifndef COMMON_TIMESUPPORT_H__ 21 | #define COMMON_TIMESUPPORT_H__ 22 | 23 | #include 24 | #include 25 | 26 | #if defined(WIN32) || defined(MARMALADE) 27 | // Convert a string representation time to a time tm structure. 28 | // It is the conversion function of strftime(). 29 | // Linux provides this function. 30 | char *strptime(const char *buf, const char *fmt, struct tm *tm); 31 | #endif 32 | 33 | #if defined(__linux__) || defined(__unix__) || defined(__APPLE__) || defined(MARMALADE) 34 | // Convert GMT time to UTC time value. 35 | // It is like mktime(), but interprets the fields as GMT rather than local. 36 | // This is the inverse of gmtime(). 37 | // Windows provides this function. 38 | time_t _mkgmtime(const struct tm *tm); 39 | #endif 40 | 41 | // Tries various rfc's to convert a buffer to a struct tm. 42 | // Warning: this function only handles a few cases and completely ignores 43 | // time zones! 44 | bool ParseRfcTime(const char* buf, struct tm *tm); 45 | 46 | // Covert the time to W3C Datetime formats. 47 | // See http://www.w3.org/TR/NOTE-datetime 48 | const gsstl::string FormatW3CTime(const time_t &time, bool local); 49 | 50 | // A helper method used to format HttpDate. 51 | gsstl::string FormatHttpDate(time_t t); 52 | 53 | #endif // COMMON_TIMESUPPORT_H__ 54 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GSTypes.h" 4 | #include "Components/SceneComponent.h" 5 | #include "GameSparksComponent.generated.h" 6 | 7 | UCLASS(ClassGroup=(GameSparks), meta = (BlueprintSpawnableComponent)) 8 | class GAMESPARKS_API UGameSparksComponent : public USceneComponent 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | 14 | UGameSparksComponent(const FObjectInitializer& ObjectInitializer); 15 | 16 | // Connects to the GameSparks service with the supplied details 17 | // * apiKey - The API Key of the game to connect to 18 | // * secret - The API Secret of the game to connect to 19 | // * Preview Server - Whether to connect to the live, or preview servers 20 | // * clearCachedAuthentication - Forgets any cached authentication details before connecting 21 | UFUNCTION(Category = GameSparks, BlueprintCallable) 22 | void Connect(FString apikey, FString secret, bool previewServer=true, bool clearCachedAuthentication=false); 23 | 24 | // Disconnects the socket, clears cached authentication details, and reconnects 25 | UFUNCTION(Category = GameSparks, BlueprintCallable) 26 | void Logout(); 27 | 28 | // Disconnects the from GameSparks 29 | UFUNCTION(Category = GameSparks, BlueprintCallable) 30 | void Disconnect(); 31 | 32 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGameSparksAvailable, bool, available); 33 | 34 | // Called by GameSparks when the availability changed 35 | UPROPERTY(BlueprintAssignable, Category = GameSparks) 36 | FOnGameSparksAvailable OnGameSparksAvailableDelegate; 37 | 38 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGameSparksLogEvent, FString, logMessage); 39 | 40 | // Called by GameSparks when a new log message was generated, useful for debugging 41 | UPROPERTY(BlueprintAssignable, Category = GameSparks) 42 | FOnGameSparksLogEvent OnGameSparksDebugLog; 43 | 44 | // Indicates if the current socket is connected and has an associated player 45 | UFUNCTION(Category = GameSparks, BlueprintCallable) 46 | bool IsAuthenticated(); 47 | 48 | // Indicates if the current socket is connected 49 | UFUNCTION(Category = GameSparks, BlueprintCallable) 50 | bool IsAvailable(); 51 | 52 | }; -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GSTypes.h" 4 | #include "Components/SceneComponent.h" 5 | #include "GameSparksComponent.generated.h" 6 | 7 | UCLASS(ClassGroup=(GameSparks), meta = (BlueprintSpawnableComponent)) 8 | class GAMESPARKS_API UGameSparksComponent : public USceneComponent 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | 14 | UGameSparksComponent(const FObjectInitializer& ObjectInitializer); 15 | 16 | // Connects to the GameSparks service with the supplied details 17 | // * apiKey - The API Key of the game to connect to 18 | // * secret - The API Secret of the game to connect to 19 | // * Preview Server - Whether to connect to the live, or preview servers 20 | // * clearCachedAuthentication - Forgets any cached authentication details before connecting 21 | UFUNCTION(Category = GameSparks, BlueprintCallable) 22 | void Connect(FString apikey, FString secret, bool previewServer=true, bool clearCachedAuthentication=false); 23 | 24 | // Disconnects the socket, clears cached authentication details, and reconnects 25 | UFUNCTION(Category = GameSparks, BlueprintCallable) 26 | void Logout(); 27 | 28 | // Disconnects the from GameSparks 29 | UFUNCTION(Category = GameSparks, BlueprintCallable) 30 | void Disconnect(); 31 | 32 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGameSparksAvailable, bool, available); 33 | 34 | // Called by GameSparks when the availability changed 35 | UPROPERTY(BlueprintAssignable, Category = GameSparks) 36 | FOnGameSparksAvailable OnGameSparksAvailableDelegate; 37 | 38 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGameSparksLogEvent, FString, logMessage); 39 | 40 | // Called by GameSparks when a new log message was generated, useful for debugging 41 | UPROPERTY(BlueprintAssignable, Category = GameSparks) 42 | FOnGameSparksLogEvent OnGameSparksDebugLog; 43 | 44 | // Indicates if the current socket is connected and has an associated player 45 | UFUNCTION(Category = GameSparks, BlueprintCallable) 46 | bool IsAuthenticated(); 47 | 48 | // Indicates if the current socket is connected 49 | UFUNCTION(Category = GameSparks, BlueprintCallable) 50 | bool IsAvailable(); 51 | 52 | }; -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSIosHelper.mm: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if GS_TARGET_PLATFORM == GS_PLATFORM_IOS 5 | # import 6 | 7 | gsstl::string gs_ios_get_writeable_base_path() 8 | { 9 | NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject]; 10 | 11 | return [libraryPath UTF8String]; 12 | } 13 | 14 | 15 | gsstl::string get_ios_device_id() 16 | { 17 | static gsstl::string device_id; 18 | 19 | if(device_id.empty()) 20 | { 21 | UIDevice *device = [UIDevice currentDevice]; 22 | #pragma clang diagnostic ignored "-Wundeclared-selector" 23 | if ([UIDevice instancesRespondToSelector:@selector(identifierForVendor)]) { 24 | device_id = [[[device identifierForVendor] UUIDString] UTF8String]; 25 | } else { 26 | #pragma clang diagnostic push 27 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 28 | device_id = [[device performSelector:@selector(uniqueIdentifier)] UTF8String]; 29 | 30 | } 31 | #pragma clang diagnostic pop 32 | } 33 | 34 | return device_id; 35 | } 36 | 37 | #elif GS_TARGET_PLATFORM == GS_PLATFORM_MAC 38 | # import 39 | 40 | gsstl::string get_osx_device_id() 41 | { 42 | static gsstl::string device_id; 43 | 44 | if (device_id.empty()) 45 | { 46 | NSArray * args = @[@"-rd1", @"-c", @"IOPlatformExpertDevice", @"|", @"grep", @"model"]; 47 | NSTask * task = [NSTask new]; 48 | [task setLaunchPath:@"/usr/sbin/ioreg"]; 49 | [task setArguments:args]; 50 | 51 | NSPipe * pipe = [NSPipe new]; 52 | [task setStandardOutput:pipe]; 53 | [task launch]; 54 | 55 | NSArray * args2 = @[@"/IOPlatformUUID/ { split($0, line, \"\\\"\"); printf(\"%s\\n\", line[4]); }"]; 56 | NSTask * task2 = [NSTask new]; 57 | [task2 setLaunchPath:@"/usr/bin/awk"]; 58 | [task2 setArguments:args2]; 59 | 60 | NSPipe * pipe2 = [NSPipe new]; 61 | [task2 setStandardInput:pipe]; 62 | [task2 setStandardOutput:pipe2]; 63 | NSFileHandle * fileHandle2 = [pipe2 fileHandleForReading]; 64 | [task2 launch]; 65 | 66 | NSData * data = [fileHandle2 readDataToEndOfFile]; 67 | NSString * uuid = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 68 | 69 | device_id = [uuid UTF8String]; 70 | } 71 | 72 | return device_id; 73 | } 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/src/GameSparks/GSIosHelper.mm: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if GS_TARGET_PLATFORM == GS_PLATFORM_IOS 5 | # import 6 | 7 | gsstl::string gs_ios_get_writeable_base_path() 8 | { 9 | NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject]; 10 | 11 | return [libraryPath UTF8String]; 12 | } 13 | 14 | 15 | gsstl::string get_ios_device_id() 16 | { 17 | static gsstl::string device_id; 18 | 19 | if(device_id.empty()) 20 | { 21 | UIDevice *device = [UIDevice currentDevice]; 22 | #pragma clang diagnostic ignored "-Wundeclared-selector" 23 | if ([UIDevice instancesRespondToSelector:@selector(identifierForVendor)]) { 24 | device_id = [[[device identifierForVendor] UUIDString] UTF8String]; 25 | } else { 26 | #pragma clang diagnostic push 27 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 28 | device_id = [[device performSelector:@selector(uniqueIdentifier)] UTF8String]; 29 | 30 | } 31 | #pragma clang diagnostic pop 32 | } 33 | 34 | return device_id; 35 | } 36 | 37 | #elif GS_TARGET_PLATFORM == GS_PLATFORM_MAC 38 | # import 39 | 40 | gsstl::string get_osx_device_id() 41 | { 42 | static gsstl::string device_id; 43 | 44 | if (device_id.empty()) 45 | { 46 | NSArray * args = @[@"-rd1", @"-c", @"IOPlatformExpertDevice", @"|", @"grep", @"model"]; 47 | NSTask * task = [NSTask new]; 48 | [task setLaunchPath:@"/usr/sbin/ioreg"]; 49 | [task setArguments:args]; 50 | 51 | NSPipe * pipe = [NSPipe new]; 52 | [task setStandardOutput:pipe]; 53 | [task launch]; 54 | 55 | NSArray * args2 = @[@"/IOPlatformUUID/ { split($0, line, \"\\\"\"); printf(\"%s\\n\", line[4]); }"]; 56 | NSTask * task2 = [NSTask new]; 57 | [task2 setLaunchPath:@"/usr/bin/awk"]; 58 | [task2 setArguments:args2]; 59 | 60 | NSPipe * pipe2 = [NSPipe new]; 61 | [task2 setStandardInput:pipe]; 62 | [task2 setStandardOutput:pipe2]; 63 | NSFileHandle * fileHandle2 = [pipe2 fileHandleForReading]; 64 | [task2 launch]; 65 | 66 | NSData * data = [fileHandle2 readDataToEndOfFile]; 67 | NSString * uuid = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 68 | 69 | device_id = [uuid UTF8String]; 70 | } 71 | 72 | return device_id; 73 | } 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /GameSparksSample/Source/GameSparksSample/Resources/Windows/GameSparksSample.rc: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. 2 | 3 | #define APSTUDIO_READONLY_SYMBOLS 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Generated from the TEXTINCLUDE 2 resource. 7 | // 8 | #include 9 | #include "Runtime/Launch/Resources/Version.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Version 27 | // 28 | 29 | VS_VERSION_INFO VERSIONINFO 30 | FILEVERSION ENGINE_MAJOR_VERSION,ENGINE_MINOR_VERSION,ENGINE_PATCH_VERSION,0 31 | PRODUCTVERSION ENGINE_MAJOR_VERSION,ENGINE_MINOR_VERSION,ENGINE_PATCH_VERSION,0 32 | FILEFLAGSMASK 0x17L 33 | #ifdef _DEBUG 34 | FILEFLAGS 0x1L 35 | #else 36 | FILEFLAGS 0x0L 37 | #endif 38 | FILEOS 0x4L 39 | FILETYPE 0x2L 40 | FILESUBTYPE 0x0L 41 | BEGIN 42 | BLOCK "StringFileInfo" 43 | BEGIN 44 | BLOCK "040904b0" 45 | BEGIN 46 | VALUE "CompanyName", EPIC_COMPANY_NAME 47 | VALUE "LegalCopyright", EPIC_COPYRIGHT_STRING 48 | VALUE "ProductName", EPIC_PRODUCT_NAME 49 | VALUE "ProductVersion", ENGINE_VERSION_STRING 50 | VALUE "FileDescription", "GameSparksSample" 51 | VALUE "InternalName", "GameSparksSample" 52 | VALUE "OriginalFilename", "GameSparksSample.exe" 53 | END 54 | END 55 | BLOCK "VarFileInfo" 56 | BEGIN 57 | VALUE "Translation", 0x409, 1200 58 | END 59 | END 60 | 61 | ///////////////////////////////////////////////////////////////////////////// 62 | // 63 | // Icon 64 | // 65 | 66 | // Icon with lowest ID value placed first to ensure application icon 67 | // remains consistent on all systems. 68 | IDICON_UE4Game ICON "../../../../Build/Windows/Application.ico" 69 | 70 | #endif // English (U.S.) resources 71 | ///////////////////////////////////////////////////////////////////////////// 72 | 73 | 74 | 75 | //#ifndef APSTUDIO_INVOKED 76 | ///////////////////////////////////////////////////////////////////////////// 77 | // 78 | // Generated from the TEXTINCLUDE 3 resource. 79 | // 80 | 81 | 82 | ///////////////////////////////////////////////////////////////////////////// 83 | //#endif // not APSTUDIO_INVOKED 84 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSLeakDetector.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSLeakDetector_h__ 3 | #define GSLeakDetector_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #undef GS_USE_LEAK_DETECTOR 10 | //#define GS_USE_LEAK_DETECTOR 1 11 | 12 | #if defined(GS_USE_LEAK_DETECTOR) && !defined(DOXYGEN) 13 | namespace GameSparks { 14 | namespace Util 15 | { 16 | namespace LeakDetector 17 | { 18 | struct LeakedObjectDetectorBase 19 | { 20 | LeakedObjectDetectorBase() 21 | { 22 | getAliveObjects().insert(this); 23 | } 24 | 25 | virtual ~LeakedObjectDetectorBase() 26 | { 27 | getAliveObjects().erase(this); 28 | } 29 | 30 | virtual const char* getLeakedObjectClassName() const = 0; 31 | 32 | typedef gsstl::set AliveObjects; 33 | static AliveObjects& getAliveObjects() 34 | { 35 | static AliveObjects aliveObjects; 36 | return aliveObjects; 37 | } 38 | 39 | static gsstl::string getLeakedClasses() 40 | { 41 | gsstl::string ret; 42 | 43 | for(AliveObjects::iterator i=getAliveObjects().begin(); i!=getAliveObjects().end(); ++i) 44 | { 45 | ret += gsstl::string("Leaked: ") + (*i)->getLeakedObjectClassName() + "\n"; 46 | } 47 | 48 | return ret; 49 | } 50 | 51 | static void Cleanup() 52 | { 53 | getAliveObjects().clear(); 54 | } 55 | }; 56 | 57 | template 58 | struct LeakedObjectDetector : public LeakedObjectDetectorBase 59 | { 60 | virtual const char* getLeakedObjectClassName() const 61 | { 62 | return OwnerClass::getLeakedObjectClassName(); 63 | } 64 | }; 65 | } 66 | } 67 | } 68 | 69 | # define GS_LEAK_DETECTOR(OwnerClass) \ 70 | friend struct GameSparks::Util::LeakDetector::LeakedObjectDetector; \ 71 | static const char* getLeakedObjectClassName() { return #OwnerClass; } \ 72 | GameSparks::Util::LeakDetector::LeakedObjectDetector _gs_leak_detector_; 73 | #else 74 | # define GS_LEAK_DETECTOR(OwnerClass) 75 | #endif /* GS_USE_LEAK_DETECTOR */ 76 | 77 | #endif // GSLeakDetector_h__ 78 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSLeakDetector.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSLeakDetector_h__ 3 | #define GSLeakDetector_h__ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #undef GS_USE_LEAK_DETECTOR 10 | //#define GS_USE_LEAK_DETECTOR 1 11 | 12 | #if defined(GS_USE_LEAK_DETECTOR) && !defined(DOXYGEN) 13 | namespace GameSparks { 14 | namespace Util 15 | { 16 | namespace LeakDetector 17 | { 18 | struct LeakedObjectDetectorBase 19 | { 20 | LeakedObjectDetectorBase() 21 | { 22 | getAliveObjects().insert(this); 23 | } 24 | 25 | virtual ~LeakedObjectDetectorBase() 26 | { 27 | getAliveObjects().erase(this); 28 | } 29 | 30 | virtual const char* getLeakedObjectClassName() const = 0; 31 | 32 | typedef gsstl::set AliveObjects; 33 | static AliveObjects& getAliveObjects() 34 | { 35 | static AliveObjects aliveObjects; 36 | return aliveObjects; 37 | } 38 | 39 | static gsstl::string getLeakedClasses() 40 | { 41 | gsstl::string ret; 42 | 43 | for(AliveObjects::iterator i=getAliveObjects().begin(); i!=getAliveObjects().end(); ++i) 44 | { 45 | ret += gsstl::string("Leaked: ") + (*i)->getLeakedObjectClassName() + "\n"; 46 | } 47 | 48 | return ret; 49 | } 50 | 51 | static void Cleanup() 52 | { 53 | getAliveObjects().clear(); 54 | } 55 | }; 56 | 57 | template 58 | struct LeakedObjectDetector : public LeakedObjectDetectorBase 59 | { 60 | virtual const char* getLeakedObjectClassName() const 61 | { 62 | return OwnerClass::getLeakedObjectClassName(); 63 | } 64 | }; 65 | } 66 | } 67 | } 68 | 69 | # define GS_LEAK_DETECTOR(OwnerClass) \ 70 | friend struct GameSparks::Util::LeakDetector::LeakedObjectDetector; \ 71 | static const char* getLeakedObjectClassName() { return #OwnerClass; } \ 72 | GameSparks::Util::LeakDetector::LeakedObjectDetector _gs_leak_detector_; 73 | #else 74 | # define GS_LEAK_DETECTOR(OwnerClass) 75 | #endif /* GS_USE_LEAK_DETECTOR */ 76 | 77 | #endif // GSLeakDetector_h__ 78 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksUnrealPlatform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Platform.h" 4 | #if PLATFORM_WINDOWS 5 | #include "AllowWindowsPlatformTypes.h" 6 | #endif 7 | #include 8 | #include 9 | #if PLATFORM_WINDOWS 10 | #include "HideWindowsPlatformTypes.h" 11 | #endif 12 | #include "GameSparksModule.h" 13 | 14 | namespace GameSparks 15 | { 16 | namespace UnrealEngineSDK 17 | { 18 | class GameSparksUnrealPlatform : public GameSparks::Core::IGSPlatform 19 | { 20 | public: 21 | GameSparksUnrealPlatform(const gsstl::string& apikey, const gsstl::string& secret, bool previewServer) 22 | : GameSparks::Core::IGSPlatform(apikey, secret, previewServer) 23 | { 24 | } 25 | 26 | virtual gsstl::string GetDeviceId() const 27 | { 28 | return TCHAR_TO_ANSI(*FPlatformMisc::GetUniqueDeviceId()); 29 | } 30 | 31 | virtual gsstl::string GetDeviceOS() const 32 | { 33 | return FPlatformProperties::IniPlatformName(); 34 | } 35 | 36 | virtual gsstl::string GetPlatform() const 37 | { 38 | return FPlatformProperties::PlatformName(); 39 | } 40 | 41 | virtual gsstl::string GetSDK() const 42 | { 43 | return "GameSparks Unreal Engine SDK"; 44 | } 45 | 46 | virtual gsstl::string GetDeviceType() const 47 | { 48 | #if PLATFORM_DESKTOP 49 | return "Desktop"; 50 | #else 51 | return "Handheld"; 52 | #endif 53 | } 54 | 55 | virtual bool GetExtraDebug() const 56 | { 57 | return true; 58 | } 59 | 60 | virtual gsstl::string GetPreviewServiceUrl() const 61 | { 62 | return "wss://preview.gamesparks.net/ws/" + m_apiKey; 63 | } 64 | 65 | virtual gsstl::string GetLiveServiceUrl() const 66 | { 67 | return "wss://live.gamesparks.net/ws/" + m_apiKey; 68 | } 69 | 70 | virtual void DebugMsg(const gsstl::string& message) const 71 | { 72 | if (UGameSparksModule::GetModulePtr()) 73 | UGameSparksModule::GetModulePtr()->SendDebugLogToComponents(message); 74 | } 75 | 76 | virtual gsstl::string ToWritableLocation(gsstl::string desired_name) const{ 77 | #if PLATFORM_IOS || PLATFORM_ANDROID || PLATFORM_PS4 || defined(__ORBIS__) 78 | // Conditional since ConvertRelativePathToFull does not work on mobile devices. 79 | // see https://answers.unrealengine.com/questions/120796/adding-custom-files-to-the-android-content.html 80 | return GameSparks::Core::IGSPlatform::ToWritableLocation(desired_name); 81 | #else 82 | FString writeableLocation = FPaths::ConvertRelativePathToFull(FPaths::GameSavedDir()); 83 | writeableLocation += "gamesparks_"; 84 | writeableLocation += desired_name.c_str(); 85 | return TCHAR_TO_UTF8(*writeableLocation); 86 | #endif 87 | } 88 | }; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksUnrealPlatform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Platform.h" 4 | #if PLATFORM_WINDOWS 5 | #include "AllowWindowsPlatformTypes.h" 6 | #endif 7 | #include 8 | #include 9 | #if PLATFORM_WINDOWS 10 | #include "HideWindowsPlatformTypes.h" 11 | #endif 12 | #include "GameSparksModule.h" 13 | 14 | namespace GameSparks 15 | { 16 | namespace UnrealEngineSDK 17 | { 18 | class GameSparksUnrealPlatform : public GameSparks::Core::IGSPlatform 19 | { 20 | public: 21 | GameSparksUnrealPlatform(const gsstl::string& apikey, const gsstl::string& secret, bool previewServer) 22 | : GameSparks::Core::IGSPlatform(apikey, secret, previewServer) 23 | { 24 | } 25 | 26 | virtual gsstl::string GetDeviceId() const 27 | { 28 | return TCHAR_TO_ANSI(*FPlatformMisc::GetUniqueDeviceId()); 29 | } 30 | 31 | virtual gsstl::string GetDeviceOS() const 32 | { 33 | return FPlatformProperties::IniPlatformName(); 34 | } 35 | 36 | virtual gsstl::string GetPlatform() const 37 | { 38 | return FPlatformProperties::PlatformName(); 39 | } 40 | 41 | virtual gsstl::string GetSDK() const 42 | { 43 | return "GameSparks Unreal Engine SDK"; 44 | } 45 | 46 | virtual gsstl::string GetDeviceType() const 47 | { 48 | #if PLATFORM_DESKTOP 49 | return "Desktop"; 50 | #else 51 | return "Handheld"; 52 | #endif 53 | } 54 | 55 | virtual bool GetExtraDebug() const 56 | { 57 | return true; 58 | } 59 | 60 | virtual gsstl::string GetPreviewServiceUrl() const 61 | { 62 | return "wss://preview.gamesparks.net/ws/" + m_apiKey; 63 | } 64 | 65 | virtual gsstl::string GetLiveServiceUrl() const 66 | { 67 | return "wss://live.gamesparks.net/ws/" + m_apiKey; 68 | } 69 | 70 | virtual void DebugMsg(const gsstl::string& message) const 71 | { 72 | if (UGameSparksModule::GetModulePtr()) 73 | UGameSparksModule::GetModulePtr()->SendDebugLogToComponents(message); 74 | } 75 | 76 | virtual gsstl::string ToWritableLocation(gsstl::string desired_name) const{ 77 | #if PLATFORM_IOS || PLATFORM_ANDROID || PLATFORM_PS4 || defined(__ORBIS__) 78 | // Conditional since ConvertRelativePathToFull does not work on mobile devices. 79 | // see https://answers.unrealengine.com/questions/120796/adding-custom-files-to-the-android-content.html 80 | return GameSparks::Core::IGSPlatform::ToWritableLocation(desired_name); 81 | #else 82 | FString writeableLocation = FPaths::ConvertRelativePathToFull(FPaths::GameSavedDir()); 83 | writeableLocation += "gamesparks_"; 84 | writeableLocation += desired_name.c_str(); 85 | return TCHAR_TO_UTF8(*writeableLocation); 86 | #endif 87 | } 88 | }; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /GameSparksSample/Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | [URL] 2 | [/Script/Engine.UserInterfaceSettings] 3 | UIScaleCurve=(EditorCurveData=(Keys=((Time=480,Value=0.444),(Time=720,Value=0.666),(Time=1080,Value=1.0),(Time=8640,Value=8.0))),ExternalCurve=None) 4 | UIScaleCurve=(EditorCurveData=(Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000))),ExternalCurve=None) 5 | 6 | [/Script/Engine.RendererSettings] 7 | r.MobileHDR=False 8 | r.AllowOcclusionQueries=True 9 | r.MinScreenRadiusForLights=0.030000 10 | r.MinScreenRadiusForDepthPrepass=0.030000 11 | r.PrecomputedVisibilityWarning=False 12 | r.TextureStreaming=True 13 | Compat.UseDXT5NormalMaps=False 14 | r.AllowStaticLighting=True 15 | r.NormalMapsForStaticLighting=False 16 | r.GBuffer=True 17 | r.GenerateMeshDistanceFields=False 18 | r.Shadow.DistanceFieldPenumbraSize=0.050000 19 | r.TessellationAdaptivePixelsPerTriangle=48.000000 20 | r.SeparateTranslucency=False 21 | r.CustomDepth=1 22 | r.DefaultFeature.Bloom=False 23 | r.DefaultFeature.AmbientOcclusion=False 24 | r.DefaultFeature.AmbientOcclusionStaticFraction=True 25 | r.DefaultFeature.AutoExposure=False 26 | r.DefaultFeature.MotionBlur=False 27 | r.DefaultFeature.LensFlare=False 28 | r.DefaultFeature.AntiAliasing=0 29 | r.EarlyZPass=3 30 | r.EarlyZPassMovable=False 31 | r.DBuffer=False 32 | r.ClearSceneMethod=1 33 | r.MSAA.CompositingSampleCount=4 34 | r.WireframeCullThreshold=5.000000 35 | UIScaleRule=ShortestSide 36 | UIScaleCurve=(EditorCurveData=(Keys=),ExternalCurve=None) 37 | 38 | [/Script/HardwareTargeting.HardwareTargetingSettings] 39 | TargetedHardwareClass=Mobile 40 | AppliedTargetedHardwareClass=Mobile 41 | DefaultGraphicsPerformance=Scalable 42 | AppliedDefaultGraphicsPerformance=Scalable 43 | 44 | [/Script/EngineSettings.GameMapsSettings] 45 | EditorStartupMap=/Game/GameSparksLevel 46 | LocalMapOptions= 47 | TransitionMap= 48 | bUseSplitscreen=False 49 | TwoPlayerSplitscreenLayout=Horizontal 50 | ThreePlayerSplitscreenLayout=FavorTop 51 | GameInstanceClass=/Script/Engine.GameInstance 52 | GameDefaultMap=/Game/GameSparksLevel 53 | ServerDefaultMap=/Engine/Maps/Entry 54 | GlobalDefaultGameMode=/Script/Engine.GameMode 55 | GlobalDefaultServerGameMode=None 56 | 57 | [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings] 58 | PackageName=com.YourCompany.[PROJECT] 59 | StoreVersion=1 60 | VersionDisplayName=1.0 61 | MinSDKVersion=9 62 | bPackageDataInsideApk=False 63 | Orientation=Landscape 64 | DepthBufferPreference=Default 65 | ExtraApplicationSettings= 66 | ExtraActivitySettings= 67 | +ExtraPermissions=android.permission.WRITE_EXTERNAL_STORAGE 68 | +ExtraPermissions= 69 | bPackageForGearVR=False 70 | KeyStore= 71 | KeyAlias= 72 | KeyStorePassword= 73 | KeyPassword= 74 | bBuildForArmV7=True 75 | bBuildForX86=False 76 | bBuildForES2=True 77 | bBuildForES31=False 78 | bEnableGooglePlaySupport=False 79 | GamesAppID= 80 | AdMobAdUnitID= 81 | GooglePlayLicenseKey= 82 | AndroidAudio=Default 83 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSOptional.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSOptional_h__ 3 | #define GSOptional_h__ 4 | 5 | #pragma once 6 | 7 | #include "./gsstl.h" 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | //! namespace for optional types 13 | //! This is roughly equivalent to C-Sharps Nullable or boost::optional 14 | namespace Optional 15 | { 16 | /*! 17 | * Template class for optional values. 18 | * @tparam ValueType the wrapped data type 19 | */ 20 | 21 | template 22 | class Optional 23 | { 24 | public: 25 | //! construct an empty Optional 26 | Optional() 27 | : m_Value(ValueType()) 28 | , m_HasValue(false) 29 | { 30 | 31 | } 32 | 33 | //! construct an Optional from a given value 34 | Optional(const ValueType& value) 35 | : m_Value(value) 36 | , m_HasValue(true) 37 | { 38 | 39 | } 40 | 41 | /// construct an optional from value and hasValue 42 | Optional(const ValueType& value, bool hasValue) 43 | : m_Value(value) 44 | , m_HasValue(hasValue) 45 | { 46 | 47 | } 48 | 49 | /// copy constructor 50 | Optional(const Optional& other) 51 | : m_Value(other.m_Value) 52 | , m_HasValue(other.m_HasValue) 53 | { 54 | 55 | } 56 | 57 | //! compare two Optional. No implicity type conversion will be performed. 58 | //! Two Optional are equal, if the wrapped value is equal AND both are set. 59 | Optional& operator=(const Optional& other) 60 | { 61 | if (&other != this) 62 | { 63 | m_HasValue = other.m_HasValue; 64 | m_Value = other.m_Value; 65 | } 66 | return *this; 67 | } 68 | 69 | //! return the wrapped value. You have to check HasValue before doing this, otherwise the default constructed wrapped type will be returned. 70 | ValueType& GetValue() 71 | { 72 | return m_Value; 73 | } 74 | 75 | //! checks wether a value has been set or not 76 | bool HasValue() const 77 | { 78 | return m_HasValue; 79 | } 80 | 81 | private: 82 | ValueType m_Value; 83 | bool m_HasValue; 84 | 85 | GS_LEAK_DETECTOR(Optional) 86 | }; 87 | 88 | /// an optional string 89 | typedef Optional t_StringOptional; 90 | /// an optional int 91 | typedef Optional t_IntOptional; 92 | /// an optional long 93 | typedef Optional t_LongOptional; 94 | /// an optional float 95 | typedef Optional t_FloatOptional; 96 | /// an optional double 97 | typedef Optional t_DoubleOptional; 98 | /// an optional bool 99 | typedef Optional t_BoolOptional; 100 | } 101 | 102 | } 103 | #endif // GSOptional_h__ 104 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSOptional.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSOptional_h__ 3 | #define GSOptional_h__ 4 | 5 | #pragma once 6 | 7 | #include "./gsstl.h" 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | //! namespace for optional types 13 | //! This is roughly equivalent to C-Sharps Nullable or boost::optional 14 | namespace Optional 15 | { 16 | /*! 17 | * Template class for optional values. 18 | * @tparam ValueType the wrapped data type 19 | */ 20 | 21 | template 22 | class Optional 23 | { 24 | public: 25 | //! construct an empty Optional 26 | Optional() 27 | : m_Value(ValueType()) 28 | , m_HasValue(false) 29 | { 30 | 31 | } 32 | 33 | //! construct an Optional from a given value 34 | Optional(const ValueType& value) 35 | : m_Value(value) 36 | , m_HasValue(true) 37 | { 38 | 39 | } 40 | 41 | /// construct an optional from value and hasValue 42 | Optional(const ValueType& value, bool hasValue) 43 | : m_Value(value) 44 | , m_HasValue(hasValue) 45 | { 46 | 47 | } 48 | 49 | /// copy constructor 50 | Optional(const Optional& other) 51 | : m_Value(other.m_Value) 52 | , m_HasValue(other.m_HasValue) 53 | { 54 | 55 | } 56 | 57 | //! compare two Optional. No implicity type conversion will be performed. 58 | //! Two Optional are equal, if the wrapped value is equal AND both are set. 59 | Optional& operator=(const Optional& other) 60 | { 61 | if (&other != this) 62 | { 63 | m_HasValue = other.m_HasValue; 64 | m_Value = other.m_Value; 65 | } 66 | return *this; 67 | } 68 | 69 | //! return the wrapped value. You have to check HasValue before doing this, otherwise the default constructed wrapped type will be returned. 70 | ValueType& GetValue() 71 | { 72 | return m_Value; 73 | } 74 | 75 | //! checks wether a value has been set or not 76 | bool HasValue() const 77 | { 78 | return m_HasValue; 79 | } 80 | 81 | private: 82 | ValueType m_Value; 83 | bool m_HasValue; 84 | 85 | GS_LEAK_DETECTOR(Optional) 86 | }; 87 | 88 | /// an optional string 89 | typedef Optional t_StringOptional; 90 | /// an optional int 91 | typedef Optional t_IntOptional; 92 | /// an optional long 93 | typedef Optional t_LongOptional; 94 | /// an optional float 95 | typedef Optional t_FloatOptional; 96 | /// an optional double 97 | typedef Optional t_DoubleOptional; 98 | /// an optional bool 99 | typedef Optional t_BoolOptional; 100 | } 101 | 102 | } 103 | #endif // GSOptional_h__ 104 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/entropy_poll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file entropy_poll.h 3 | * 4 | * \brief Platform-specific and custom entropy polling functions 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ENTROPY_POLL_H 24 | #define MBEDTLS_ENTROPY_POLL_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /* 39 | * Default thresholds for built-in sources, in bytes 40 | */ 41 | #define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ 42 | #define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */ 43 | #define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */ 44 | #define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ 45 | 46 | #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) 47 | /** 48 | * \brief Platform-specific entropy poll callback 49 | */ 50 | int mbedtls_platform_entropy_poll( void *data, 51 | unsigned char *output, size_t len, size_t *olen ); 52 | #endif 53 | 54 | #if defined(MBEDTLS_HAVEGE_C) 55 | /** 56 | * \brief HAVEGE based entropy poll callback 57 | * 58 | * Requires an HAVEGE state as its data pointer. 59 | */ 60 | int mbedtls_havege_poll( void *data, 61 | unsigned char *output, size_t len, size_t *olen ); 62 | #endif 63 | 64 | #if defined(MBEDTLS_TIMING_C) 65 | /** 66 | * \brief mbedtls_timing_hardclock-based entropy poll callback 67 | */ 68 | int mbedtls_hardclock_poll( void *data, 69 | unsigned char *output, size_t len, size_t *olen ); 70 | #endif 71 | 72 | #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) 73 | /** 74 | * \brief Entropy poll callback for a hardware source 75 | * 76 | * \warning This is not provided by mbed TLS! 77 | * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h. 78 | * 79 | * \note This must accept NULL as its first argument. 80 | */ 81 | int mbedtls_hardware_poll( void *data, 82 | unsigned char *output, size_t len, size_t *olen ); 83 | #endif 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* entropy_poll.h */ 90 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/entropy_poll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file entropy_poll.h 3 | * 4 | * \brief Platform-specific and custom entropy polling functions 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ENTROPY_POLL_H 24 | #define MBEDTLS_ENTROPY_POLL_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /* 39 | * Default thresholds for built-in sources, in bytes 40 | */ 41 | #define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ 42 | #define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */ 43 | #define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */ 44 | #define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ 45 | 46 | #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) 47 | /** 48 | * \brief Platform-specific entropy poll callback 49 | */ 50 | int mbedtls_platform_entropy_poll( void *data, 51 | unsigned char *output, size_t len, size_t *olen ); 52 | #endif 53 | 54 | #if defined(MBEDTLS_HAVEGE_C) 55 | /** 56 | * \brief HAVEGE based entropy poll callback 57 | * 58 | * Requires an HAVEGE state as its data pointer. 59 | */ 60 | int mbedtls_havege_poll( void *data, 61 | unsigned char *output, size_t len, size_t *olen ); 62 | #endif 63 | 64 | #if defined(MBEDTLS_TIMING_C) 65 | /** 66 | * \brief mbedtls_timing_hardclock-based entropy poll callback 67 | */ 68 | int mbedtls_hardclock_poll( void *data, 69 | unsigned char *output, size_t len, size_t *olen ); 70 | #endif 71 | 72 | #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) 73 | /** 74 | * \brief Entropy poll callback for a hardware source 75 | * 76 | * \warning This is not provided by mbed TLS! 77 | * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h. 78 | * 79 | * \note This must accept NULL as its first argument. 80 | */ 81 | int mbedtls_hardware_poll( void *data, 82 | unsigned char *output, size_t len, size_t *olen ); 83 | #endif 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* entropy_poll.h */ 90 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparks/Private/GameSparksLogEventData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "GameSparksPrivatePCH.h" 3 | #include "Engine.h" 4 | #include "GameSparksClasses.h" 5 | 6 | #include "GameSparks/generated/GSRequests.h" 7 | #include "GameSparksModule.h" 8 | #include "GameSparksLogEventData.generated.h" 9 | 10 | UCLASS(BlueprintType, Blueprintable) 11 | class UGameSparksLogEventData : public UObject 12 | { 13 | GENERATED_UCLASS_BODY() 14 | 15 | public: 16 | 17 | /* Create a new Log Event Data object. */ 18 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Create Log Event Attributes", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "GameSparks|Data") 19 | static UGameSparksLogEventData* CreateGameSparksLogEventAttributes(UObject* WorldContextObject); 20 | 21 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 22 | UGameSparksLogEventData* SetString(const FString& name, const FString& value); 23 | 24 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 25 | UGameSparksLogEventData* SetNumber(const FString& name, const int32 value); 26 | 27 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 28 | UGameSparksLogEventData* SetObject(const FString& name, UGameSparksScriptData* value); 29 | 30 | void AddToLogEvent(GameSparks::Api::Requests::LogEventRequest* event){ 31 | 32 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogEventRequest")); 33 | for (const auto& Entry : m_strings) 34 | { 35 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogEventRequest_SetString")); 36 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), TCHAR_TO_ANSI(*Entry.Value)); 37 | } 38 | for (const auto& Entry : m_numbers) 39 | { 40 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value); 41 | } 42 | for (const auto& Entry : m_objects) 43 | { 44 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value->ToRequestData()); 45 | } 46 | 47 | } 48 | 49 | void AddToLogEvent(GameSparks::Api::Requests::LogChallengeEventRequest* event){ 50 | 51 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogChallengeEventRequest")); 52 | for (const auto& Entry : m_strings) 53 | { 54 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogChallengeEventRequest_SetString")); 55 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), TCHAR_TO_ANSI(*Entry.Value)); 56 | } 57 | for (const auto& Entry : m_numbers) 58 | { 59 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value); 60 | } 61 | for (const auto& Entry : m_objects) 62 | { 63 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value->ToRequestData()); 64 | } 65 | 66 | } 67 | 68 | protected: 69 | TMap m_strings; 70 | TMap m_numbers; 71 | TMap m_objects; 72 | 73 | }; 74 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/MarmaladePlatform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "./IGSPlatform.h" 4 | 5 | #ifndef IW_SDK 6 | # error "This file is meant for inclusion in marmalade projects only." 7 | #endif /* IW_SDK */ 8 | 9 | #include 10 | #include 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | /// IGSPlatform implementation for [Marmalade](https://www.madewithmarmalade.com/) 17 | class MarmaladePlatform : public IGSPlatform 18 | { 19 | public: 20 | MarmaladePlatform(const gsstl::string& apikey, const gsstl::string& secret, bool usePreviewServer, bool verboseLogging=false, size_t maxLogEntriesToKeep=0) 21 | : IGSPlatform(apikey, secret, usePreviewServer, verboseLogging), m_maxLogEntriesToKeep(maxLogEntriesToKeep) {} 22 | 23 | //Gets a unique identifier for the device 24 | virtual gsstl::string GetDeviceId() const 25 | { 26 | return s3eDeviceGetString(S3E_DEVICE_UNIQUE_ID); 27 | } 28 | 29 | //IOS or AND or WP8 - Required for in app purchases 30 | virtual gsstl::string GetDeviceOS() const 31 | { 32 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#ga35cf28487294cc1c7cee7b4a73e122db 33 | return s3eDeviceGetString(S3E_DEVICE_OS); 34 | } 35 | 36 | //Will be used in analytics reports 37 | virtual gsstl::string GetPlatform() const 38 | { 39 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#ga42c616710c895108e5f31a7e2787b77d 40 | return s3eDeviceGetString(S3E_DEVICE_ARCHITECTURE); 41 | } 42 | 43 | //Will be used in analytics reports 44 | virtual gsstl::string GetSDK() const 45 | { 46 | return "GameSparks SDK C++ 1.0 for Marmalade"; 47 | } 48 | 49 | //Will be used in analytics reports 50 | virtual gsstl::string GetDeviceType() const 51 | { 52 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#gaf67bd64343f477244ca9e8a821020db0 53 | return s3eDeviceGetString(S3E_DEVICE_CLASS); 54 | } 55 | 56 | //Receives debugging information from the API 57 | virtual void DebugMsg(const gsstl::string& message) const 58 | { 59 | IwTrace(GameSparks, ("%s", message.c_str())); 60 | 61 | if(m_maxLogEntriesToKeep > 0) 62 | { 63 | MarmaladePlatform* self = const_cast(this); // not to nice! 64 | 65 | while(self->m_log.size() >= m_maxLogEntriesToKeep) 66 | self->m_log.pop_front(); 67 | 68 | self->m_log.push_back(message); 69 | } 70 | } 71 | 72 | gsstl::string getLog() const 73 | { 74 | gsstl::string ret; 75 | for( Log::const_iterator i = m_log.begin(); i != m_log.end(); ++i ) 76 | ret += *i + "\n"; 77 | 78 | return ret; 79 | } 80 | private: 81 | typedef gsstl::list Log; 82 | Log m_log; 83 | size_t m_maxLogEntriesToKeep; 84 | }; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparks/Private/GameSparksLogEventData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "GameSparksPrivatePCH.h" 3 | #include "Engine.h" 4 | #include "GameSparksClasses.h" 5 | 6 | #include "GameSparks/generated/GSRequests.h" 7 | #include "GameSparksModule.h" 8 | #include "GameSparksLogEventData.generated.h" 9 | 10 | UCLASS(BlueprintType, Blueprintable) 11 | class UGameSparksLogEventData : public UObject 12 | { 13 | GENERATED_UCLASS_BODY() 14 | 15 | public: 16 | 17 | /* Create a new Log Event Data object. */ 18 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Create Log Event Attributes", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "GameSparks|Data") 19 | static UGameSparksLogEventData* CreateGameSparksLogEventAttributes(UObject* WorldContextObject); 20 | 21 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 22 | UGameSparksLogEventData* SetString(const FString& name, const FString& value); 23 | 24 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 25 | UGameSparksLogEventData* SetNumber(const FString& name, const int32 value); 26 | 27 | UFUNCTION(BlueprintPure, Category = "GameSparks|Data") 28 | UGameSparksLogEventData* SetObject(const FString& name, UGameSparksScriptData* value); 29 | 30 | void AddToLogEvent(GameSparks::Api::Requests::LogEventRequest* event){ 31 | 32 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogEventRequest")); 33 | for (const auto& Entry : m_strings) 34 | { 35 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogEventRequest_SetString")); 36 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), TCHAR_TO_ANSI(*Entry.Value)); 37 | } 38 | for (const auto& Entry : m_numbers) 39 | { 40 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value); 41 | } 42 | for (const auto& Entry : m_objects) 43 | { 44 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value->ToRequestData()); 45 | } 46 | 47 | } 48 | 49 | void AddToLogEvent(GameSparks::Api::Requests::LogChallengeEventRequest* event){ 50 | 51 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogChallengeEventRequest")); 52 | for (const auto& Entry : m_strings) 53 | { 54 | UE_LOG(UGameSparksModuleLog, Warning, TEXT("%s"), TEXT("UGameSparksLogEventData::AddToLogEvent_LogChallengeEventRequest_SetString")); 55 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), TCHAR_TO_ANSI(*Entry.Value)); 56 | } 57 | for (const auto& Entry : m_numbers) 58 | { 59 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value); 60 | } 61 | for (const auto& Entry : m_objects) 62 | { 63 | event->SetEventAttribute(TCHAR_TO_ANSI(*Entry.Key), Entry.Value->ToRequestData()); 64 | } 65 | 66 | } 67 | 68 | protected: 69 | TMap m_strings; 70 | TMap m_numbers; 71 | TMap m_objects; 72 | 73 | }; 74 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/MarmaladePlatform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "./IGSPlatform.h" 4 | 5 | #ifndef IW_SDK 6 | # error "This file is meant for inclusion in marmalade projects only." 7 | #endif /* IW_SDK */ 8 | 9 | #include 10 | #include 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | /// IGSPlatform implementation for [Marmalade](https://www.madewithmarmalade.com/) 17 | class MarmaladePlatform : public IGSPlatform 18 | { 19 | public: 20 | MarmaladePlatform(const gsstl::string& apikey, const gsstl::string& secret, bool usePreviewServer, bool verboseLogging=false, size_t maxLogEntriesToKeep=0) 21 | : IGSPlatform(apikey, secret, usePreviewServer, verboseLogging), m_maxLogEntriesToKeep(maxLogEntriesToKeep) {} 22 | 23 | //Gets a unique identifier for the device 24 | virtual gsstl::string GetDeviceId() const 25 | { 26 | return s3eDeviceGetString(S3E_DEVICE_UNIQUE_ID); 27 | } 28 | 29 | //IOS or AND or WP8 - Required for in app purchases 30 | virtual gsstl::string GetDeviceOS() const 31 | { 32 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#ga35cf28487294cc1c7cee7b4a73e122db 33 | return s3eDeviceGetString(S3E_DEVICE_OS); 34 | } 35 | 36 | //Will be used in analytics reports 37 | virtual gsstl::string GetPlatform() const 38 | { 39 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#ga42c616710c895108e5f31a7e2787b77d 40 | return s3eDeviceGetString(S3E_DEVICE_ARCHITECTURE); 41 | } 42 | 43 | //Will be used in analytics reports 44 | virtual gsstl::string GetSDK() const 45 | { 46 | return "GameSparks SDK C++ 1.0 for Marmalade"; 47 | } 48 | 49 | //Will be used in analytics reports 50 | virtual gsstl::string GetDeviceType() const 51 | { 52 | // http://api.madewithmarmalade.com/group__deviceapigroup.html#gaf67bd64343f477244ca9e8a821020db0 53 | return s3eDeviceGetString(S3E_DEVICE_CLASS); 54 | } 55 | 56 | //Receives debugging information from the API 57 | virtual void DebugMsg(const gsstl::string& message) const 58 | { 59 | IwTrace(GameSparks, ("%s", message.c_str())); 60 | 61 | if(m_maxLogEntriesToKeep > 0) 62 | { 63 | MarmaladePlatform* self = const_cast(this); // not to nice! 64 | 65 | while(self->m_log.size() >= m_maxLogEntriesToKeep) 66 | self->m_log.pop_front(); 67 | 68 | self->m_log.push_back(message); 69 | } 70 | } 71 | 72 | gsstl::string getLog() const 73 | { 74 | gsstl::string ret; 75 | for( Log::const_iterator i = m_log.begin(); i != m_log.end(); ++i ) 76 | ret += *i + "\n"; 77 | 78 | return ret; 79 | } 80 | private: 81 | typedef gsstl::list Log; 82 | Log m_log; 83 | size_t m_maxLogEntriesToKeep; 84 | }; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSTypedResponse.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSTypedResponse_h__ 3 | #define GSTypedResponse_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSData.h" 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | namespace Core 13 | { 14 | /// base class for all responses 15 | class GSTypedResponse 16 | { 17 | protected: 18 | const static gsstl::string SCRIPT_DATA_KEY; ///< the key name of the users script data inside the response object 19 | const static gsstl::string ERROR_KEY; ///< the key name of the server-side errors embedded in this response 20 | const static gsstl::string REQUEST_ID_KEY; ///< the key name of the request id 21 | public: 22 | 23 | /// construct from GSData 24 | GSTypedResponse(const GSData& response) 25 | : m_Response(response) 26 | , m_userData() 27 | { 28 | } 29 | 30 | /// construct from GSTypedResponse 31 | GSTypedResponse(const GSTypedResponse& other) 32 | : m_Response(other.m_Response) 33 | , m_userData() 34 | { 35 | 36 | } 37 | 38 | /// get the response-data as a JSON formated string 39 | gsstl::string GetJSONString() const 40 | { 41 | return m_Response.GetJSON(); 42 | } 43 | 44 | /// accessor for the internal cJSON object associated with this response. 45 | const cJSON* GetJSONData() const 46 | { 47 | return m_Response.GetBaseData(); 48 | } 49 | 50 | /// get the ScriptData associated with this response 51 | GSData::t_Optional GetScriptData() const 52 | { 53 | return m_Response.GetGSDataObject(SCRIPT_DATA_KEY); 54 | } 55 | 56 | /// returns true, if a server-side error occured, false otherwise. 57 | bool GetHasErrors() const 58 | { 59 | return m_Response.ContainsKey(ERROR_KEY); 60 | } 61 | 62 | /// return an Optional GSData object containing the errors associated with this response 63 | GSData::t_Optional GetErrors() const 64 | { 65 | return m_Response.GetGSDataObject(ERROR_KEY); 66 | } 67 | 68 | /// the id of the request that caused this response 69 | Optional::t_StringOptional GetRequestId() const 70 | { 71 | return m_Response.GetString(REQUEST_ID_KEY); 72 | } 73 | 74 | /// the internal GSData object 75 | const GSData& GetBaseData() const 76 | { 77 | return m_Response; 78 | } 79 | 80 | bool HasUserData() const 81 | { 82 | return m_userData != 0; 83 | } 84 | 85 | void* GetUserData() const 86 | { 87 | return m_userData; 88 | } 89 | 90 | protected: 91 | GSData m_Response; ///< the wrapped response data 92 | private: 93 | template 94 | friend class GSTypedRequest; 95 | 96 | void* m_userData; 97 | GS_LEAK_DETECTOR(GSTypedResponse) 98 | }; 99 | } 100 | } 101 | #endif // GSTypedResponse_h__ 102 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSTypedResponse.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSTypedResponse_h__ 3 | #define GSTypedResponse_h__ 4 | 5 | #pragma once 6 | 7 | #include "GSData.h" 8 | #include 9 | 10 | namespace GameSparks 11 | { 12 | namespace Core 13 | { 14 | /// base class for all responses 15 | class GSTypedResponse 16 | { 17 | protected: 18 | const static gsstl::string SCRIPT_DATA_KEY; ///< the key name of the users script data inside the response object 19 | const static gsstl::string ERROR_KEY; ///< the key name of the server-side errors embedded in this response 20 | const static gsstl::string REQUEST_ID_KEY; ///< the key name of the request id 21 | public: 22 | 23 | /// construct from GSData 24 | GSTypedResponse(const GSData& response) 25 | : m_Response(response) 26 | , m_userData() 27 | { 28 | } 29 | 30 | /// construct from GSTypedResponse 31 | GSTypedResponse(const GSTypedResponse& other) 32 | : m_Response(other.m_Response) 33 | , m_userData() 34 | { 35 | 36 | } 37 | 38 | /// get the response-data as a JSON formated string 39 | gsstl::string GetJSONString() const 40 | { 41 | return m_Response.GetJSON(); 42 | } 43 | 44 | /// accessor for the internal cJSON object associated with this response. 45 | const cJSON* GetJSONData() const 46 | { 47 | return m_Response.GetBaseData(); 48 | } 49 | 50 | /// get the ScriptData associated with this response 51 | GSData::t_Optional GetScriptData() const 52 | { 53 | return m_Response.GetGSDataObject(SCRIPT_DATA_KEY); 54 | } 55 | 56 | /// returns true, if a server-side error occured, false otherwise. 57 | bool GetHasErrors() const 58 | { 59 | return m_Response.ContainsKey(ERROR_KEY); 60 | } 61 | 62 | /// return an Optional GSData object containing the errors associated with this response 63 | GSData::t_Optional GetErrors() const 64 | { 65 | return m_Response.GetGSDataObject(ERROR_KEY); 66 | } 67 | 68 | /// the id of the request that caused this response 69 | Optional::t_StringOptional GetRequestId() const 70 | { 71 | return m_Response.GetString(REQUEST_ID_KEY); 72 | } 73 | 74 | /// the internal GSData object 75 | const GSData& GetBaseData() const 76 | { 77 | return m_Response; 78 | } 79 | 80 | bool HasUserData() const 81 | { 82 | return m_userData != 0; 83 | } 84 | 85 | void* GetUserData() const 86 | { 87 | return m_userData; 88 | } 89 | 90 | protected: 91 | GSData m_Response; ///< the wrapped response data 92 | private: 93 | template 94 | friend class GSTypedRequest; 95 | 96 | void* m_userData; 97 | GS_LEAK_DETECTOR(GSTypedResponse) 98 | }; 99 | } 100 | } 101 | #endif // GSTypedResponse_h__ 102 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/arc4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file arc4.h 3 | * 4 | * \brief The ARCFOUR stream cipher 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ARC4_H 24 | #define MBEDTLS_ARC4_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #if !defined(MBEDTLS_ARC4_ALT) 35 | // Regular implementation 36 | // 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * \brief ARC4 context structure 44 | */ 45 | typedef struct 46 | { 47 | int x; /*!< permutation index */ 48 | int y; /*!< permutation index */ 49 | unsigned char m[256]; /*!< permutation table */ 50 | } 51 | mbedtls_arc4_context; 52 | 53 | /** 54 | * \brief Initialize ARC4 context 55 | * 56 | * \param ctx ARC4 context to be initialized 57 | */ 58 | void mbedtls_arc4_init( mbedtls_arc4_context *ctx ); 59 | 60 | /** 61 | * \brief Clear ARC4 context 62 | * 63 | * \param ctx ARC4 context to be cleared 64 | */ 65 | void mbedtls_arc4_free( mbedtls_arc4_context *ctx ); 66 | 67 | /** 68 | * \brief ARC4 key schedule 69 | * 70 | * \param ctx ARC4 context to be setup 71 | * \param key the secret key 72 | * \param keylen length of the key, in bytes 73 | */ 74 | void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, 75 | unsigned int keylen ); 76 | 77 | /** 78 | * \brief ARC4 cipher function 79 | * 80 | * \param ctx ARC4 context 81 | * \param length length of the input data 82 | * \param input buffer holding the input data 83 | * \param output buffer for the output data 84 | * 85 | * \return 0 if successful 86 | */ 87 | int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, 88 | unsigned char *output ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #else /* MBEDTLS_ARC4_ALT */ 95 | #include "arc4_alt.h" 96 | #endif /* MBEDTLS_ARC4_ALT */ 97 | 98 | #ifdef __cplusplus 99 | extern "C" { 100 | #endif 101 | 102 | /** 103 | * \brief Checkup routine 104 | * 105 | * \return 0 if successful, or 1 if the test failed 106 | */ 107 | int mbedtls_arc4_self_test( int verbose ); 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* arc4.h */ 114 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file base64.h 3 | * 4 | * \brief RFC 1521 base64 encoding/decoding 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_BASE64_H 24 | #define MBEDTLS_BASE64_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ 29 | #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /** 36 | * \brief Encode a buffer into base64 format 37 | * 38 | * \param dst destination buffer 39 | * \param dlen size of the destination buffer 40 | * \param olen number of bytes written 41 | * \param src source buffer 42 | * \param slen amount of data to be encoded 43 | * 44 | * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. 45 | * *olen is always updated to reflect the amount 46 | * of data that has (or would have) been written. 47 | * 48 | * \note Call this function with dlen = 0 to obtain the 49 | * required buffer size in *olen 50 | */ 51 | int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, 52 | const unsigned char *src, size_t slen ); 53 | 54 | /** 55 | * \brief Decode a base64-formatted buffer 56 | * 57 | * \param dst destination buffer (can be NULL for checking size) 58 | * \param dlen size of the destination buffer 59 | * \param olen number of bytes written 60 | * \param src source buffer 61 | * \param slen amount of data to be decoded 62 | * 63 | * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or 64 | * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is 65 | * not correct. *olen is always updated to reflect the amount 66 | * of data that has (or would have) been written. 67 | * 68 | * \note Call this function with *dst = NULL or dlen = 0 to obtain 69 | * the required buffer size in *olen 70 | */ 71 | int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, 72 | const unsigned char *src, size_t slen ); 73 | 74 | /** 75 | * \brief Checkup routine 76 | * 77 | * \return 0 if successful, or 1 if the test failed 78 | */ 79 | int mbedtls_base64_self_test( int verbose ); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* base64.h */ 86 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/arc4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file arc4.h 3 | * 4 | * \brief The ARCFOUR stream cipher 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ARC4_H 24 | #define MBEDTLS_ARC4_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #if !defined(MBEDTLS_ARC4_ALT) 35 | // Regular implementation 36 | // 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * \brief ARC4 context structure 44 | */ 45 | typedef struct 46 | { 47 | int x; /*!< permutation index */ 48 | int y; /*!< permutation index */ 49 | unsigned char m[256]; /*!< permutation table */ 50 | } 51 | mbedtls_arc4_context; 52 | 53 | /** 54 | * \brief Initialize ARC4 context 55 | * 56 | * \param ctx ARC4 context to be initialized 57 | */ 58 | void mbedtls_arc4_init( mbedtls_arc4_context *ctx ); 59 | 60 | /** 61 | * \brief Clear ARC4 context 62 | * 63 | * \param ctx ARC4 context to be cleared 64 | */ 65 | void mbedtls_arc4_free( mbedtls_arc4_context *ctx ); 66 | 67 | /** 68 | * \brief ARC4 key schedule 69 | * 70 | * \param ctx ARC4 context to be setup 71 | * \param key the secret key 72 | * \param keylen length of the key, in bytes 73 | */ 74 | void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, 75 | unsigned int keylen ); 76 | 77 | /** 78 | * \brief ARC4 cipher function 79 | * 80 | * \param ctx ARC4 context 81 | * \param length length of the input data 82 | * \param input buffer holding the input data 83 | * \param output buffer for the output data 84 | * 85 | * \return 0 if successful 86 | */ 87 | int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, 88 | unsigned char *output ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #else /* MBEDTLS_ARC4_ALT */ 95 | #include "arc4_alt.h" 96 | #endif /* MBEDTLS_ARC4_ALT */ 97 | 98 | #ifdef __cplusplus 99 | extern "C" { 100 | #endif 101 | 102 | /** 103 | * \brief Checkup routine 104 | * 105 | * \return 0 if successful, or 1 if the test failed 106 | */ 107 | int mbedtls_arc4_self_test( int verbose ); 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* arc4.h */ 114 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file base64.h 3 | * 4 | * \brief RFC 1521 base64 encoding/decoding 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_BASE64_H 24 | #define MBEDTLS_BASE64_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ 29 | #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /** 36 | * \brief Encode a buffer into base64 format 37 | * 38 | * \param dst destination buffer 39 | * \param dlen size of the destination buffer 40 | * \param olen number of bytes written 41 | * \param src source buffer 42 | * \param slen amount of data to be encoded 43 | * 44 | * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. 45 | * *olen is always updated to reflect the amount 46 | * of data that has (or would have) been written. 47 | * 48 | * \note Call this function with dlen = 0 to obtain the 49 | * required buffer size in *olen 50 | */ 51 | int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, 52 | const unsigned char *src, size_t slen ); 53 | 54 | /** 55 | * \brief Decode a base64-formatted buffer 56 | * 57 | * \param dst destination buffer (can be NULL for checking size) 58 | * \param dlen size of the destination buffer 59 | * \param olen number of bytes written 60 | * \param src source buffer 61 | * \param slen amount of data to be decoded 62 | * 63 | * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or 64 | * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is 65 | * not correct. *olen is always updated to reflect the amount 66 | * of data that has (or would have) been written. 67 | * 68 | * \note Call this function with *dst = NULL or dlen = 0 to obtain 69 | * the required buffer size in *olen 70 | */ 71 | int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, 72 | const unsigned char *src, size_t slen ); 73 | 74 | /** 75 | * \brief Checkup routine 76 | * 77 | * \return 0 if successful, or 1 if the test failed 78 | */ 79 | int mbedtls_base64_self_test( int verbose ); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* base64.h */ 86 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/gsstl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef gsstl_h__ 3 | #define gsstl_h__ 4 | 5 | #pragma once 6 | 7 | /*! 8 | This header is here, so that we can easily switch between 9 | different STL implementations. Current choices are: 10 | - STD-STL (what ever your compiler uses) 11 | 12 | */ 13 | 14 | 15 | 16 | #if defined(DOXYGEN) 17 | 18 | /// if set to 1, the stl provided by the compiler is used. 19 | /// @ingroup CompileOptions 20 | #define USE_STD_STL 21 | 22 | /// if set to 1, std::function will be used for callbacks. This also enables support for C++11 lambdas. 23 | /// This is disabled on Marmalade. 24 | /// @ingroup CompileOptions 25 | #define STL_FUNCTIONAL_SUPPORTED 26 | 27 | #endif 28 | 29 | #define USE_STD_STL 1 30 | 31 | 32 | #if !defined(STL_FUNCTIONAL_SUPPORTED) && !defined(MARMALADE) 33 | #define STL_FUNCTIONAL_SUPPORTED 1 34 | #endif 35 | 36 | // std function can only be used, if we have at least c++11 37 | #if (__cplusplus >= 201103L || _MSC_VER >= 1800 ) /*&& USE_STD_STL*/ && STL_FUNCTIONAL_SUPPORTED 38 | # define GS_USE_STD_FUNCTION 1 39 | # include 40 | #else 41 | # undef GS_USE_STD_FUNCTION 42 | #endif /* __cplusplus >= 201103L */ 43 | 44 | // include required headers 45 | #if defined(USE_STD_STL) 46 | # include 47 | # include 48 | # include 49 | # include 50 | # include 51 | # include 52 | #endif /* defined(USE_STD_STL) */ 53 | 54 | //! This namespace provides forwarding to the concrete STL implementation used. 55 | namespace gsstl 56 | { 57 | #if defined(USE_STD_STL) 58 | using namespace std; 59 | #endif /* defined(USE_STD_STL) */ 60 | 61 | #if GS_USE_STD_FUNCTION 62 | using std::function; 63 | #endif 64 | } 65 | 66 | #if !defined(nullptr) && !defined(DOXYGEN) && !defined(GS_COMPILER_HAS_NULLPTR_SUPPORT) 67 | namespace gsstl 68 | { 69 | //! a nullptr implementation for compilers that do not support the C++11 nullptr yet. 70 | //! based on SC22/WG21/N2431 = J16/07-0301 71 | struct nullptr_t 72 | { 73 | template operator any * () const 74 | { 75 | return 0; 76 | } 77 | template operator T any:: * () const 78 | { 79 | return 0; 80 | } 81 | private: 82 | #ifdef _MSC_VER 83 | struct pad {}; 84 | pad __[sizeof(void*)/sizeof(pad)]; 85 | #else 86 | char __[sizeof(void*)]; 87 | #endif 88 | 89 | // nullptr_t();// {} 90 | // nullptr_t(const nullptr_t&); 91 | // void operator = (const nullptr_t&); 92 | void operator &() const; 93 | template void operator +(any) const 94 | { 95 | /*I Love MSVC 2005!*/ 96 | } 97 | template void operator -(any) const 98 | { 99 | /*I Love MSVC 2005!*/ 100 | } 101 | }; 102 | static const nullptr_t nullptr_instance = nullptr_t();// = {}; 103 | } 104 | 105 | #if !defined(WINAPI_FAMILY) && __cplusplus <= 199711L 106 | # define nullptr gsstl::nullptr_instance 107 | #endif 108 | #endif 109 | 110 | 111 | #endif // gsstl_h__ 112 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/gsstl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef gsstl_h__ 3 | #define gsstl_h__ 4 | 5 | #pragma once 6 | 7 | /*! 8 | This header is here, so that we can easily switch between 9 | different STL implementations. Current choices are: 10 | - STD-STL (what ever your compiler uses) 11 | 12 | */ 13 | 14 | 15 | 16 | #if defined(DOXYGEN) 17 | 18 | /// if set to 1, the stl provided by the compiler is used. 19 | /// @ingroup CompileOptions 20 | #define USE_STD_STL 21 | 22 | /// if set to 1, std::function will be used for callbacks. This also enables support for C++11 lambdas. 23 | /// This is disabled on Marmalade. 24 | /// @ingroup CompileOptions 25 | #define STL_FUNCTIONAL_SUPPORTED 26 | 27 | #endif 28 | 29 | #define USE_STD_STL 1 30 | 31 | 32 | #if !defined(STL_FUNCTIONAL_SUPPORTED) && !defined(MARMALADE) 33 | #define STL_FUNCTIONAL_SUPPORTED 1 34 | #endif 35 | 36 | // std function can only be used, if we have at least c++11 37 | #if (__cplusplus >= 201103L || _MSC_VER >= 1800 ) /*&& USE_STD_STL*/ && STL_FUNCTIONAL_SUPPORTED 38 | # define GS_USE_STD_FUNCTION 1 39 | # include 40 | #else 41 | # undef GS_USE_STD_FUNCTION 42 | #endif /* __cplusplus >= 201103L */ 43 | 44 | // include required headers 45 | #if defined(USE_STD_STL) 46 | # include 47 | # include 48 | # include 49 | # include 50 | # include 51 | # include 52 | #endif /* defined(USE_STD_STL) */ 53 | 54 | //! This namespace provides forwarding to the concrete STL implementation used. 55 | namespace gsstl 56 | { 57 | #if defined(USE_STD_STL) 58 | using namespace std; 59 | #endif /* defined(USE_STD_STL) */ 60 | 61 | #if GS_USE_STD_FUNCTION 62 | using std::function; 63 | #endif 64 | } 65 | 66 | #if !defined(nullptr) && !defined(DOXYGEN) && !defined(GS_COMPILER_HAS_NULLPTR_SUPPORT) 67 | namespace gsstl 68 | { 69 | //! a nullptr implementation for compilers that do not support the C++11 nullptr yet. 70 | //! based on SC22/WG21/N2431 = J16/07-0301 71 | struct nullptr_t 72 | { 73 | template operator any * () const 74 | { 75 | return 0; 76 | } 77 | template operator T any:: * () const 78 | { 79 | return 0; 80 | } 81 | private: 82 | #ifdef _MSC_VER 83 | struct pad {}; 84 | pad __[sizeof(void*)/sizeof(pad)]; 85 | #else 86 | char __[sizeof(void*)]; 87 | #endif 88 | 89 | // nullptr_t();// {} 90 | // nullptr_t(const nullptr_t&); 91 | // void operator = (const nullptr_t&); 92 | void operator &() const; 93 | template void operator +(any) const 94 | { 95 | /*I Love MSVC 2005!*/ 96 | } 97 | template void operator -(any) const 98 | { 99 | /*I Love MSVC 2005!*/ 100 | } 101 | }; 102 | static const nullptr_t nullptr_instance = nullptr_t();// = {}; 103 | } 104 | 105 | #if !defined(WINAPI_FAMILY) && __cplusplus <= 199711L 106 | # define nullptr gsstl::nullptr_instance 107 | #endif 108 | #endif 109 | 110 | 111 | #endif // gsstl_h__ 112 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSData.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSData_h__ 3 | #define GSData_h__ 4 | 5 | #pragma once 6 | 7 | #include "IGSData.h" 8 | #include "GSOptional.h" 9 | #include "GSDateTime.h" 10 | 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | /// You can think of this as a convenient C++ wrapper around cJSON. 17 | /// This class is used to construct json objects in memory. 18 | class GSData : public IGSData 19 | { 20 | public: 21 | /// optional GSData 22 | typedef GameSparks::Optional::Optional t_Optional; 23 | 24 | /// construct an empty GSData object 25 | GSData(); 26 | 27 | /// copy-constructor 28 | GSData(const GSData& other); 29 | 30 | /// construct a GSData object from a cJSON object 31 | GSData(cJSON* data); 32 | 33 | /// destructor 34 | virtual ~GSData(); 35 | 36 | /// assingment operator 37 | GSData& operator=(GSData other); 38 | 39 | /// returns true, if this GSData objects contains the given key. false otherwise. 40 | /// @param key the key to check for 41 | virtual bool ContainsKey(const gsstl::string& key) const; 42 | 43 | /// try to retrieve the string names name from this GSData object 44 | virtual Optional::t_StringOptional GetString(const gsstl::string& name) const; 45 | 46 | /// get an optional int 47 | virtual Optional::t_IntOptional GetInt(const gsstl::string& name) const; 48 | 49 | /// get an optional long 50 | virtual Optional::t_LongOptional GetLong(const gsstl::string& name) const; 51 | 52 | /// get an optional long 53 | virtual Optional::t_LongOptional GetNumber(const gsstl::string& name) const; 54 | 55 | /// get an optional double 56 | virtual Optional::t_DoubleOptional GetDouble(const gsstl::string& name) const; 57 | 58 | /// get an optional float 59 | virtual Optional::t_FloatOptional GetFloat(const gsstl::string& name) const; 60 | 61 | /// get an optional boolean 62 | virtual Optional::t_BoolOptional GetBoolean(const gsstl::string& name) const; 63 | 64 | /// get an optional embedded object 65 | virtual t_Optional GetGSDataObject(const gsstl::string& name) const; 66 | 67 | /// get an optional date 68 | virtual GSDateTime::t_Optional GetDate(const gsstl::string& name) const; 69 | 70 | /// get a list of strings 71 | virtual gsstl::vector GetStringList(const gsstl::string& name) const; 72 | 73 | /// get a list of floats 74 | virtual gsstl::vector GetFloatList(const gsstl::string& name) const; 75 | 76 | /// get a list of doubles 77 | virtual gsstl::vector GetDoubleList(const gsstl::string& name) const; 78 | 79 | /// get a list of ints 80 | virtual gsstl::vector GetIntList(const gsstl::string& name) const; 81 | 82 | /// get a list of longs 83 | virtual gsstl::vector GetLongList(const gsstl::string& name) const; 84 | 85 | /// get a list of GSData-objects 86 | virtual gsstl::vector GetGSDataObjectList(const gsstl::string& name) const; 87 | 88 | /// get the internal cJSON object. be careful when using this 89 | virtual cJSON* GetBaseData() const; 90 | 91 | /// serialize this GSData object to json 92 | virtual gsstl::string GetJSON() const; 93 | protected: 94 | cJSON* m_Data; 95 | 96 | private: 97 | GS_LEAK_DETECTOR(GSData) 98 | }; 99 | } 100 | } 101 | #endif // GSData_h__ 102 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/GameSparks/GSData.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 GameSparks Ltd 2015, Inc. All Rights Reserved. 2 | #ifndef GSData_h__ 3 | #define GSData_h__ 4 | 5 | #pragma once 6 | 7 | #include "IGSData.h" 8 | #include "GSOptional.h" 9 | #include "GSDateTime.h" 10 | 11 | 12 | namespace GameSparks 13 | { 14 | namespace Core 15 | { 16 | /// You can think of this as a convenient C++ wrapper around cJSON. 17 | /// This class is used to construct json objects in memory. 18 | class GSData : public IGSData 19 | { 20 | public: 21 | /// optional GSData 22 | typedef GameSparks::Optional::Optional t_Optional; 23 | 24 | /// construct an empty GSData object 25 | GSData(); 26 | 27 | /// copy-constructor 28 | GSData(const GSData& other); 29 | 30 | /// construct a GSData object from a cJSON object 31 | GSData(cJSON* data); 32 | 33 | /// destructor 34 | virtual ~GSData(); 35 | 36 | /// assingment operator 37 | GSData& operator=(GSData other); 38 | 39 | /// returns true, if this GSData objects contains the given key. false otherwise. 40 | /// @param key the key to check for 41 | virtual bool ContainsKey(const gsstl::string& key) const; 42 | 43 | /// try to retrieve the string names name from this GSData object 44 | virtual Optional::t_StringOptional GetString(const gsstl::string& name) const; 45 | 46 | /// get an optional int 47 | virtual Optional::t_IntOptional GetInt(const gsstl::string& name) const; 48 | 49 | /// get an optional long 50 | virtual Optional::t_LongOptional GetLong(const gsstl::string& name) const; 51 | 52 | /// get an optional long 53 | virtual Optional::t_LongOptional GetNumber(const gsstl::string& name) const; 54 | 55 | /// get an optional double 56 | virtual Optional::t_DoubleOptional GetDouble(const gsstl::string& name) const; 57 | 58 | /// get an optional float 59 | virtual Optional::t_FloatOptional GetFloat(const gsstl::string& name) const; 60 | 61 | /// get an optional boolean 62 | virtual Optional::t_BoolOptional GetBoolean(const gsstl::string& name) const; 63 | 64 | /// get an optional embedded object 65 | virtual t_Optional GetGSDataObject(const gsstl::string& name) const; 66 | 67 | /// get an optional date 68 | virtual GSDateTime::t_Optional GetDate(const gsstl::string& name) const; 69 | 70 | /// get a list of strings 71 | virtual gsstl::vector GetStringList(const gsstl::string& name) const; 72 | 73 | /// get a list of floats 74 | virtual gsstl::vector GetFloatList(const gsstl::string& name) const; 75 | 76 | /// get a list of doubles 77 | virtual gsstl::vector GetDoubleList(const gsstl::string& name) const; 78 | 79 | /// get a list of ints 80 | virtual gsstl::vector GetIntList(const gsstl::string& name) const; 81 | 82 | /// get a list of longs 83 | virtual gsstl::vector GetLongList(const gsstl::string& name) const; 84 | 85 | /// get a list of GSData-objects 86 | virtual gsstl::vector GetGSDataObjectList(const gsstl::string& name) const; 87 | 88 | /// get the internal cJSON object. be careful when using this 89 | virtual cJSON* GetBaseData() const; 90 | 91 | /// serialize this GSData object to json 92 | virtual gsstl::string GetJSON() const; 93 | protected: 94 | cJSON* m_Data; 95 | 96 | private: 97 | GS_LEAK_DETECTOR(GSData) 98 | }; 99 | } 100 | } 101 | #endif // GSData_h__ 102 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/pkcs5.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file pkcs5.h 3 | * 4 | * \brief PKCS#5 functions 5 | * 6 | * \author Mathias Olsson 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_PKCS5_H 26 | #define MBEDTLS_PKCS5_H 27 | 28 | #include "asn1.h" 29 | #include "md.h" 30 | 31 | #include 32 | #include 33 | 34 | #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ 35 | #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ 36 | #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ 37 | #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00 /**< Given private key password does not allow for correct decryption. */ 38 | 39 | #define MBEDTLS_PKCS5_DECRYPT 0 40 | #define MBEDTLS_PKCS5_ENCRYPT 1 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** 47 | * \brief PKCS#5 PBES2 function 48 | * 49 | * \param pbe_params the ASN.1 algorithm parameters 50 | * \param mode either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT 51 | * \param pwd password to use when generating key 52 | * \param pwdlen length of password 53 | * \param data data to process 54 | * \param datalen length of data 55 | * \param output output buffer 56 | * 57 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 58 | */ 59 | int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, 60 | const unsigned char *pwd, size_t pwdlen, 61 | const unsigned char *data, size_t datalen, 62 | unsigned char *output ); 63 | 64 | /** 65 | * \brief PKCS#5 PBKDF2 using HMAC 66 | * 67 | * \param ctx Generic HMAC context 68 | * \param password Password to use when generating key 69 | * \param plen Length of password 70 | * \param salt Salt to use when generating key 71 | * \param slen Length of salt 72 | * \param iteration_count Iteration count 73 | * \param key_length Length of generated key in bytes 74 | * \param output Generated key. Must be at least as big as key_length 75 | * 76 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 77 | */ 78 | int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, 79 | size_t plen, const unsigned char *salt, size_t slen, 80 | unsigned int iteration_count, 81 | uint32_t key_length, unsigned char *output ); 82 | 83 | /** 84 | * \brief Checkup routine 85 | * 86 | * \return 0 if successful, or 1 if the test failed 87 | */ 88 | int mbedtls_pkcs5_self_test( int verbose ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* pkcs5.h */ 95 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/pkcs5.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file pkcs5.h 3 | * 4 | * \brief PKCS#5 functions 5 | * 6 | * \author Mathias Olsson 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_PKCS5_H 26 | #define MBEDTLS_PKCS5_H 27 | 28 | #include "asn1.h" 29 | #include "md.h" 30 | 31 | #include 32 | #include 33 | 34 | #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ 35 | #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ 36 | #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ 37 | #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00 /**< Given private key password does not allow for correct decryption. */ 38 | 39 | #define MBEDTLS_PKCS5_DECRYPT 0 40 | #define MBEDTLS_PKCS5_ENCRYPT 1 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** 47 | * \brief PKCS#5 PBES2 function 48 | * 49 | * \param pbe_params the ASN.1 algorithm parameters 50 | * \param mode either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT 51 | * \param pwd password to use when generating key 52 | * \param pwdlen length of password 53 | * \param data data to process 54 | * \param datalen length of data 55 | * \param output output buffer 56 | * 57 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 58 | */ 59 | int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, 60 | const unsigned char *pwd, size_t pwdlen, 61 | const unsigned char *data, size_t datalen, 62 | unsigned char *output ); 63 | 64 | /** 65 | * \brief PKCS#5 PBKDF2 using HMAC 66 | * 67 | * \param ctx Generic HMAC context 68 | * \param password Password to use when generating key 69 | * \param plen Length of password 70 | * \param salt Salt to use when generating key 71 | * \param slen Length of salt 72 | * \param iteration_count Iteration count 73 | * \param key_length Length of generated key in bytes 74 | * \param output Generated key. Must be at least as big as key_length 75 | * 76 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 77 | */ 78 | int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, 79 | size_t plen, const unsigned char *salt, size_t slen, 80 | unsigned int iteration_count, 81 | uint32_t key_length, unsigned char *output ); 82 | 83 | /** 84 | * \brief Checkup routine 85 | * 86 | * \return 0 if successful, or 1 if the test failed 87 | */ 88 | int mbedtls_pkcs5_self_test( int verbose ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* pkcs5.h */ 95 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/md_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file md_internal.h 3 | * 4 | * \brief Message digest wrappers. 5 | * 6 | * \warning This in an internal header. Do not include directly. 7 | * 8 | * \author Adriaan de Jong 9 | * 10 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 11 | * SPDX-License-Identifier: Apache-2.0 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 14 | * not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * This file is part of mbed TLS (https://tls.mbed.org) 26 | */ 27 | #ifndef MBEDTLS_MD_WRAP_H 28 | #define MBEDTLS_MD_WRAP_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | #include "md.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * Message digest information. 44 | * Allows message digest functions to be called in a generic way. 45 | */ 46 | struct mbedtls_md_info_t 47 | { 48 | /** Digest identifier */ 49 | mbedtls_md_type_t type; 50 | 51 | /** Name of the message digest */ 52 | const char * name; 53 | 54 | /** Output length of the digest function in bytes */ 55 | int size; 56 | 57 | /** Block length of the digest function in bytes */ 58 | int block_size; 59 | 60 | /** Digest initialisation function */ 61 | void (*starts_func)( void *ctx ); 62 | 63 | /** Digest update function */ 64 | void (*update_func)( void *ctx, const unsigned char *input, size_t ilen ); 65 | 66 | /** Digest finalisation function */ 67 | void (*finish_func)( void *ctx, unsigned char *output ); 68 | 69 | /** Generic digest function */ 70 | void (*digest_func)( const unsigned char *input, size_t ilen, 71 | unsigned char *output ); 72 | 73 | /** Allocate a new context */ 74 | void * (*ctx_alloc_func)( void ); 75 | 76 | /** Free the given context */ 77 | void (*ctx_free_func)( void *ctx ); 78 | 79 | /** Clone state from a context */ 80 | void (*clone_func)( void *dst, const void *src ); 81 | 82 | /** Internal use only */ 83 | void (*process_func)( void *ctx, const unsigned char *input ); 84 | }; 85 | 86 | #if defined(MBEDTLS_MD2_C) 87 | extern const mbedtls_md_info_t mbedtls_md2_info; 88 | #endif 89 | #if defined(MBEDTLS_MD4_C) 90 | extern const mbedtls_md_info_t mbedtls_md4_info; 91 | #endif 92 | #if defined(MBEDTLS_MD5_C) 93 | extern const mbedtls_md_info_t mbedtls_md5_info; 94 | #endif 95 | #if defined(MBEDTLS_RIPEMD160_C) 96 | extern const mbedtls_md_info_t mbedtls_ripemd160_info; 97 | #endif 98 | #if defined(MBEDTLS_SHA1_C) 99 | extern const mbedtls_md_info_t mbedtls_sha1_info; 100 | #endif 101 | #if defined(MBEDTLS_SHA256_C) 102 | extern const mbedtls_md_info_t mbedtls_sha224_info; 103 | extern const mbedtls_md_info_t mbedtls_sha256_info; 104 | #endif 105 | #if defined(MBEDTLS_SHA512_C) 106 | extern const mbedtls_md_info_t mbedtls_sha384_info; 107 | extern const mbedtls_md_info_t mbedtls_sha512_info; 108 | #endif 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* MBEDTLS_MD_WRAP_H */ 115 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/padlock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file padlock.h 3 | * 4 | * \brief VIA PadLock ACE for HW encryption/decryption supported by some 5 | * processors 6 | * 7 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * This file is part of mbed TLS (https://tls.mbed.org) 23 | */ 24 | #ifndef MBEDTLS_PADLOCK_H 25 | #define MBEDTLS_PADLOCK_H 26 | 27 | #include "aes.h" 28 | 29 | #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ 30 | 31 | #if defined(__has_feature) 32 | #if __has_feature(address_sanitizer) 33 | #define MBEDTLS_HAVE_ASAN 34 | #endif 35 | #endif 36 | 37 | /* Some versions of ASan result in errors about not enough registers */ 38 | #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ 39 | !defined(MBEDTLS_HAVE_ASAN) 40 | 41 | #ifndef MBEDTLS_HAVE_X86 42 | #define MBEDTLS_HAVE_X86 43 | #endif 44 | 45 | #include 46 | 47 | #define MBEDTLS_PADLOCK_RNG 0x000C 48 | #define MBEDTLS_PADLOCK_ACE 0x00C0 49 | #define MBEDTLS_PADLOCK_PHE 0x0C00 50 | #define MBEDTLS_PADLOCK_PMM 0x3000 51 | 52 | #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | /** 59 | * \brief PadLock detection routine 60 | * 61 | * \param feature The feature to detect 62 | * 63 | * \return 1 if CPU has support for the feature, 0 otherwise 64 | */ 65 | int mbedtls_padlock_has_support( int feature ); 66 | 67 | /** 68 | * \brief PadLock AES-ECB block en(de)cryption 69 | * 70 | * \param ctx AES context 71 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 72 | * \param input 16-byte input block 73 | * \param output 16-byte output block 74 | * 75 | * \return 0 if success, 1 if operation failed 76 | */ 77 | int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, 78 | int mode, 79 | const unsigned char input[16], 80 | unsigned char output[16] ); 81 | 82 | /** 83 | * \brief PadLock AES-CBC buffer en(de)cryption 84 | * 85 | * \param ctx AES context 86 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 87 | * \param length length of the input data 88 | * \param iv initialization vector (updated after use) 89 | * \param input buffer holding the input data 90 | * \param output buffer holding the output data 91 | * 92 | * \return 0 if success, 1 if operation failed 93 | */ 94 | int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, 95 | int mode, 96 | size_t length, 97 | unsigned char iv[16], 98 | const unsigned char *input, 99 | unsigned char *output ); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* HAVE_X86 */ 106 | 107 | #endif /* padlock.h */ 108 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/md_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file md_internal.h 3 | * 4 | * \brief Message digest wrappers. 5 | * 6 | * \warning This in an internal header. Do not include directly. 7 | * 8 | * \author Adriaan de Jong 9 | * 10 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 11 | * SPDX-License-Identifier: Apache-2.0 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 14 | * not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * This file is part of mbed TLS (https://tls.mbed.org) 26 | */ 27 | #ifndef MBEDTLS_MD_WRAP_H 28 | #define MBEDTLS_MD_WRAP_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | #include "md.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * Message digest information. 44 | * Allows message digest functions to be called in a generic way. 45 | */ 46 | struct mbedtls_md_info_t 47 | { 48 | /** Digest identifier */ 49 | mbedtls_md_type_t type; 50 | 51 | /** Name of the message digest */ 52 | const char * name; 53 | 54 | /** Output length of the digest function in bytes */ 55 | int size; 56 | 57 | /** Block length of the digest function in bytes */ 58 | int block_size; 59 | 60 | /** Digest initialisation function */ 61 | void (*starts_func)( void *ctx ); 62 | 63 | /** Digest update function */ 64 | void (*update_func)( void *ctx, const unsigned char *input, size_t ilen ); 65 | 66 | /** Digest finalisation function */ 67 | void (*finish_func)( void *ctx, unsigned char *output ); 68 | 69 | /** Generic digest function */ 70 | void (*digest_func)( const unsigned char *input, size_t ilen, 71 | unsigned char *output ); 72 | 73 | /** Allocate a new context */ 74 | void * (*ctx_alloc_func)( void ); 75 | 76 | /** Free the given context */ 77 | void (*ctx_free_func)( void *ctx ); 78 | 79 | /** Clone state from a context */ 80 | void (*clone_func)( void *dst, const void *src ); 81 | 82 | /** Internal use only */ 83 | void (*process_func)( void *ctx, const unsigned char *input ); 84 | }; 85 | 86 | #if defined(MBEDTLS_MD2_C) 87 | extern const mbedtls_md_info_t mbedtls_md2_info; 88 | #endif 89 | #if defined(MBEDTLS_MD4_C) 90 | extern const mbedtls_md_info_t mbedtls_md4_info; 91 | #endif 92 | #if defined(MBEDTLS_MD5_C) 93 | extern const mbedtls_md_info_t mbedtls_md5_info; 94 | #endif 95 | #if defined(MBEDTLS_RIPEMD160_C) 96 | extern const mbedtls_md_info_t mbedtls_ripemd160_info; 97 | #endif 98 | #if defined(MBEDTLS_SHA1_C) 99 | extern const mbedtls_md_info_t mbedtls_sha1_info; 100 | #endif 101 | #if defined(MBEDTLS_SHA256_C) 102 | extern const mbedtls_md_info_t mbedtls_sha224_info; 103 | extern const mbedtls_md_info_t mbedtls_sha256_info; 104 | #endif 105 | #if defined(MBEDTLS_SHA512_C) 106 | extern const mbedtls_md_info_t mbedtls_sha384_info; 107 | extern const mbedtls_md_info_t mbedtls_sha512_info; 108 | #endif 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* MBEDTLS_MD_WRAP_H */ 115 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/padlock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file padlock.h 3 | * 4 | * \brief VIA PadLock ACE for HW encryption/decryption supported by some 5 | * processors 6 | * 7 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * This file is part of mbed TLS (https://tls.mbed.org) 23 | */ 24 | #ifndef MBEDTLS_PADLOCK_H 25 | #define MBEDTLS_PADLOCK_H 26 | 27 | #include "aes.h" 28 | 29 | #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ 30 | 31 | #if defined(__has_feature) 32 | #if __has_feature(address_sanitizer) 33 | #define MBEDTLS_HAVE_ASAN 34 | #endif 35 | #endif 36 | 37 | /* Some versions of ASan result in errors about not enough registers */ 38 | #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ 39 | !defined(MBEDTLS_HAVE_ASAN) 40 | 41 | #ifndef MBEDTLS_HAVE_X86 42 | #define MBEDTLS_HAVE_X86 43 | #endif 44 | 45 | #include 46 | 47 | #define MBEDTLS_PADLOCK_RNG 0x000C 48 | #define MBEDTLS_PADLOCK_ACE 0x00C0 49 | #define MBEDTLS_PADLOCK_PHE 0x0C00 50 | #define MBEDTLS_PADLOCK_PMM 0x3000 51 | 52 | #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | /** 59 | * \brief PadLock detection routine 60 | * 61 | * \param feature The feature to detect 62 | * 63 | * \return 1 if CPU has support for the feature, 0 otherwise 64 | */ 65 | int mbedtls_padlock_has_support( int feature ); 66 | 67 | /** 68 | * \brief PadLock AES-ECB block en(de)cryption 69 | * 70 | * \param ctx AES context 71 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 72 | * \param input 16-byte input block 73 | * \param output 16-byte output block 74 | * 75 | * \return 0 if success, 1 if operation failed 76 | */ 77 | int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, 78 | int mode, 79 | const unsigned char input[16], 80 | unsigned char output[16] ); 81 | 82 | /** 83 | * \brief PadLock AES-CBC buffer en(de)cryption 84 | * 85 | * \param ctx AES context 86 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 87 | * \param length length of the input data 88 | * \param iv initialization vector (updated after use) 89 | * \param input buffer holding the input data 90 | * \param output buffer holding the output data 91 | * 92 | * \return 0 if success, 1 if operation failed 93 | */ 94 | int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, 95 | int mode, 96 | size_t length, 97 | unsigned char iv[16], 98 | const unsigned char *input, 99 | unsigned char *output ); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* HAVE_X86 */ 106 | 107 | #endif /* padlock.h */ 108 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/ssl_cookie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file ssl_cookie.h 3 | * 4 | * \brief DTLS cookie callbacks implementation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_SSL_COOKIE_H 24 | #define MBEDTLS_SSL_COOKIE_H 25 | 26 | #include "ssl.h" 27 | 28 | #if defined(MBEDTLS_THREADING_C) 29 | #include "threading.h" 30 | #endif 31 | 32 | /** 33 | * \name SECTION: Module settings 34 | * 35 | * The configuration options you can set for this module are in this section. 36 | * Either change them in config.h or define them on the compiler command line. 37 | * \{ 38 | */ 39 | #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT 40 | #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ 41 | #endif 42 | 43 | /* \} name SECTION: Module settings */ 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Context for the default cookie functions. 51 | */ 52 | typedef struct 53 | { 54 | mbedtls_md_context_t hmac_ctx; /*!< context for the HMAC portion */ 55 | #if !defined(MBEDTLS_HAVE_TIME) 56 | unsigned long serial; /*!< serial number for expiration */ 57 | #endif 58 | unsigned long timeout; /*!< timeout delay, in seconds if HAVE_TIME, 59 | or in number of tickets issued */ 60 | 61 | #if defined(MBEDTLS_THREADING_C) 62 | mbedtls_threading_mutex_t mutex; 63 | #endif 64 | } mbedtls_ssl_cookie_ctx; 65 | 66 | /** 67 | * \brief Initialize cookie context 68 | */ 69 | void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ); 70 | 71 | /** 72 | * \brief Setup cookie context (generate keys) 73 | */ 74 | int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, 75 | int (*f_rng)(void *, unsigned char *, size_t), 76 | void *p_rng ); 77 | 78 | /** 79 | * \brief Set expiration delay for cookies 80 | * (Default MBEDTLS_SSL_COOKIE_TIMEOUT) 81 | * 82 | * \param ctx Cookie contex 83 | * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies 84 | * issued in the meantime. 85 | * 0 to disable expiration (NOT recommended) 86 | */ 87 | void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ); 88 | 89 | /** 90 | * \brief Free cookie context 91 | */ 92 | void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ); 93 | 94 | /** 95 | * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t 96 | */ 97 | mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write; 98 | 99 | /** 100 | * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t 101 | */ 102 | mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check; 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif /* ssl_cookie.h */ 109 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/ssl_cookie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file ssl_cookie.h 3 | * 4 | * \brief DTLS cookie callbacks implementation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_SSL_COOKIE_H 24 | #define MBEDTLS_SSL_COOKIE_H 25 | 26 | #include "ssl.h" 27 | 28 | #if defined(MBEDTLS_THREADING_C) 29 | #include "threading.h" 30 | #endif 31 | 32 | /** 33 | * \name SECTION: Module settings 34 | * 35 | * The configuration options you can set for this module are in this section. 36 | * Either change them in config.h or define them on the compiler command line. 37 | * \{ 38 | */ 39 | #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT 40 | #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ 41 | #endif 42 | 43 | /* \} name SECTION: Module settings */ 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Context for the default cookie functions. 51 | */ 52 | typedef struct 53 | { 54 | mbedtls_md_context_t hmac_ctx; /*!< context for the HMAC portion */ 55 | #if !defined(MBEDTLS_HAVE_TIME) 56 | unsigned long serial; /*!< serial number for expiration */ 57 | #endif 58 | unsigned long timeout; /*!< timeout delay, in seconds if HAVE_TIME, 59 | or in number of tickets issued */ 60 | 61 | #if defined(MBEDTLS_THREADING_C) 62 | mbedtls_threading_mutex_t mutex; 63 | #endif 64 | } mbedtls_ssl_cookie_ctx; 65 | 66 | /** 67 | * \brief Initialize cookie context 68 | */ 69 | void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ); 70 | 71 | /** 72 | * \brief Setup cookie context (generate keys) 73 | */ 74 | int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, 75 | int (*f_rng)(void *, unsigned char *, size_t), 76 | void *p_rng ); 77 | 78 | /** 79 | * \brief Set expiration delay for cookies 80 | * (Default MBEDTLS_SSL_COOKIE_TIMEOUT) 81 | * 82 | * \param ctx Cookie contex 83 | * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies 84 | * issued in the meantime. 85 | * 0 to disable expiration (NOT recommended) 86 | */ 87 | void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ); 88 | 89 | /** 90 | * \brief Free cookie context 91 | */ 92 | void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ); 93 | 94 | /** 95 | * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t 96 | */ 97 | mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write; 98 | 99 | /** 100 | * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t 101 | */ 102 | mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check; 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif /* ssl_cookie.h */ 109 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/error.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file error.h 3 | * 4 | * \brief Error to string translation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ERROR_H 24 | #define MBEDTLS_ERROR_H 25 | 26 | #include 27 | 28 | /** 29 | * Error code layout. 30 | * 31 | * Currently we try to keep all error codes within the negative space of 16 32 | * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In 33 | * addition we'd like to give two layers of information on the error if 34 | * possible. 35 | * 36 | * For that purpose the error codes are segmented in the following manner: 37 | * 38 | * 16 bit error code bit-segmentation 39 | * 40 | * 1 bit - Unused (sign bit) 41 | * 3 bits - High level module ID 42 | * 5 bits - Module-dependent error code 43 | * 7 bits - Low level module errors 44 | * 45 | * For historical reasons, low-level error codes are divided in even and odd, 46 | * even codes were assigned first, and -1 is reserved for other errors. 47 | * 48 | * Low-level module errors (0x0002-0x007E, 0x0003-0x007F) 49 | * 50 | * Module Nr Codes assigned 51 | * MPI 7 0x0002-0x0010 52 | * GCM 2 0x0012-0x0014 53 | * BLOWFISH 2 0x0016-0x0018 54 | * THREADING 3 0x001A-0x001E 55 | * AES 2 0x0020-0x0022 56 | * CAMELLIA 2 0x0024-0x0026 57 | * XTEA 1 0x0028-0x0028 58 | * BASE64 2 0x002A-0x002C 59 | * OID 1 0x002E-0x002E 0x000B-0x000B 60 | * PADLOCK 1 0x0030-0x0030 61 | * DES 1 0x0032-0x0032 62 | * CTR_DBRG 4 0x0034-0x003A 63 | * ENTROPY 3 0x003C-0x0040 0x003D-0x003F 64 | * NET 11 0x0042-0x0052 0x0043-0x0045 65 | * ASN1 7 0x0060-0x006C 66 | * PBKDF2 1 0x007C-0x007C 67 | * HMAC_DRBG 4 0x0003-0x0009 68 | * CCM 2 0x000D-0x000F 69 | * 70 | * High-level module nr (3 bits - 0x0...-0x7...) 71 | * Name ID Nr of Errors 72 | * PEM 1 9 73 | * PKCS#12 1 4 (Started from top) 74 | * X509 2 19 75 | * PKCS5 2 4 (Started from top) 76 | * DHM 3 9 77 | * PK 3 14 (Started from top) 78 | * RSA 4 9 79 | * ECP 4 8 (Started from top) 80 | * MD 5 4 81 | * CIPHER 6 6 82 | * SSL 6 16 (Started from top) 83 | * SSL 7 31 84 | * 85 | * Module dependent error code (5 bits 0x.00.-0x.F8.) 86 | */ 87 | 88 | #ifdef __cplusplus 89 | extern "C" { 90 | #endif 91 | 92 | /** 93 | * \brief Translate a mbed TLS error code into a string representation, 94 | * Result is truncated if necessary and always includes a terminating 95 | * null byte. 96 | * 97 | * \param errnum error code 98 | * \param buffer buffer to place representation in 99 | * \param buflen length of the buffer 100 | */ 101 | void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif /* error.h */ 108 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/error.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file error.h 3 | * 4 | * \brief Error to string translation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ERROR_H 24 | #define MBEDTLS_ERROR_H 25 | 26 | #include 27 | 28 | /** 29 | * Error code layout. 30 | * 31 | * Currently we try to keep all error codes within the negative space of 16 32 | * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In 33 | * addition we'd like to give two layers of information on the error if 34 | * possible. 35 | * 36 | * For that purpose the error codes are segmented in the following manner: 37 | * 38 | * 16 bit error code bit-segmentation 39 | * 40 | * 1 bit - Unused (sign bit) 41 | * 3 bits - High level module ID 42 | * 5 bits - Module-dependent error code 43 | * 7 bits - Low level module errors 44 | * 45 | * For historical reasons, low-level error codes are divided in even and odd, 46 | * even codes were assigned first, and -1 is reserved for other errors. 47 | * 48 | * Low-level module errors (0x0002-0x007E, 0x0003-0x007F) 49 | * 50 | * Module Nr Codes assigned 51 | * MPI 7 0x0002-0x0010 52 | * GCM 2 0x0012-0x0014 53 | * BLOWFISH 2 0x0016-0x0018 54 | * THREADING 3 0x001A-0x001E 55 | * AES 2 0x0020-0x0022 56 | * CAMELLIA 2 0x0024-0x0026 57 | * XTEA 1 0x0028-0x0028 58 | * BASE64 2 0x002A-0x002C 59 | * OID 1 0x002E-0x002E 0x000B-0x000B 60 | * PADLOCK 1 0x0030-0x0030 61 | * DES 1 0x0032-0x0032 62 | * CTR_DBRG 4 0x0034-0x003A 63 | * ENTROPY 3 0x003C-0x0040 0x003D-0x003F 64 | * NET 11 0x0042-0x0052 0x0043-0x0045 65 | * ASN1 7 0x0060-0x006C 66 | * PBKDF2 1 0x007C-0x007C 67 | * HMAC_DRBG 4 0x0003-0x0009 68 | * CCM 2 0x000D-0x000F 69 | * 70 | * High-level module nr (3 bits - 0x0...-0x7...) 71 | * Name ID Nr of Errors 72 | * PEM 1 9 73 | * PKCS#12 1 4 (Started from top) 74 | * X509 2 19 75 | * PKCS5 2 4 (Started from top) 76 | * DHM 3 9 77 | * PK 3 14 (Started from top) 78 | * RSA 4 9 79 | * ECP 4 8 (Started from top) 80 | * MD 5 4 81 | * CIPHER 6 6 82 | * SSL 6 16 (Started from top) 83 | * SSL 7 31 84 | * 85 | * Module dependent error code (5 bits 0x.00.-0x.F8.) 86 | */ 87 | 88 | #ifdef __cplusplus 89 | extern "C" { 90 | #endif 91 | 92 | /** 93 | * \brief Translate a mbed TLS error code into a string representation, 94 | * Result is truncated if necessary and always includes a terminating 95 | * null byte. 96 | * 97 | * \param errnum error code 98 | * \param buffer buffer to place representation in 99 | * \param buflen length of the buffer 100 | */ 101 | void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif /* error.h */ 108 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/cipher_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file cipher_internal.h 3 | * 4 | * \brief Cipher wrappers. 5 | * 6 | * \author Adriaan de Jong 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_CIPHER_WRAP_H 26 | #define MBEDTLS_CIPHER_WRAP_H 27 | 28 | #if !defined(MBEDTLS_CONFIG_FILE) 29 | #include "config.h" 30 | #else 31 | #include MBEDTLS_CONFIG_FILE 32 | #endif 33 | 34 | #include "cipher.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Base cipher information. The non-mode specific functions and values. 42 | */ 43 | struct mbedtls_cipher_base_t 44 | { 45 | /** Base Cipher type (e.g. MBEDTLS_CIPHER_ID_AES) */ 46 | mbedtls_cipher_id_t cipher; 47 | 48 | /** Encrypt using ECB */ 49 | int (*ecb_func)( void *ctx, mbedtls_operation_t mode, 50 | const unsigned char *input, unsigned char *output ); 51 | 52 | #if defined(MBEDTLS_CIPHER_MODE_CBC) 53 | /** Encrypt using CBC */ 54 | int (*cbc_func)( void *ctx, mbedtls_operation_t mode, size_t length, 55 | unsigned char *iv, const unsigned char *input, 56 | unsigned char *output ); 57 | #endif 58 | 59 | #if defined(MBEDTLS_CIPHER_MODE_CFB) 60 | /** Encrypt using CFB (Full length) */ 61 | int (*cfb_func)( void *ctx, mbedtls_operation_t mode, size_t length, size_t *iv_off, 62 | unsigned char *iv, const unsigned char *input, 63 | unsigned char *output ); 64 | #endif 65 | 66 | #if defined(MBEDTLS_CIPHER_MODE_CTR) 67 | /** Encrypt using CTR */ 68 | int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, 69 | unsigned char *nonce_counter, unsigned char *stream_block, 70 | const unsigned char *input, unsigned char *output ); 71 | #endif 72 | 73 | #if defined(MBEDTLS_CIPHER_MODE_STREAM) 74 | /** Encrypt using STREAM */ 75 | int (*stream_func)( void *ctx, size_t length, 76 | const unsigned char *input, unsigned char *output ); 77 | #endif 78 | 79 | /** Set key for encryption purposes */ 80 | int (*setkey_enc_func)( void *ctx, const unsigned char *key, 81 | unsigned int key_bitlen ); 82 | 83 | /** Set key for decryption purposes */ 84 | int (*setkey_dec_func)( void *ctx, const unsigned char *key, 85 | unsigned int key_bitlen); 86 | 87 | /** Allocate a new context */ 88 | void * (*ctx_alloc_func)( void ); 89 | 90 | /** Free the given context */ 91 | void (*ctx_free_func)( void *ctx ); 92 | 93 | }; 94 | 95 | typedef struct 96 | { 97 | mbedtls_cipher_type_t type; 98 | const mbedtls_cipher_info_t *info; 99 | } mbedtls_cipher_definition_t; 100 | 101 | extern const mbedtls_cipher_definition_t mbedtls_cipher_definitions[]; 102 | 103 | extern int mbedtls_cipher_supported[]; 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_CIPHER_WRAP_H */ 110 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/cipher_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file cipher_internal.h 3 | * 4 | * \brief Cipher wrappers. 5 | * 6 | * \author Adriaan de Jong 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_CIPHER_WRAP_H 26 | #define MBEDTLS_CIPHER_WRAP_H 27 | 28 | #if !defined(MBEDTLS_CONFIG_FILE) 29 | #include "config.h" 30 | #else 31 | #include MBEDTLS_CONFIG_FILE 32 | #endif 33 | 34 | #include "cipher.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Base cipher information. The non-mode specific functions and values. 42 | */ 43 | struct mbedtls_cipher_base_t 44 | { 45 | /** Base Cipher type (e.g. MBEDTLS_CIPHER_ID_AES) */ 46 | mbedtls_cipher_id_t cipher; 47 | 48 | /** Encrypt using ECB */ 49 | int (*ecb_func)( void *ctx, mbedtls_operation_t mode, 50 | const unsigned char *input, unsigned char *output ); 51 | 52 | #if defined(MBEDTLS_CIPHER_MODE_CBC) 53 | /** Encrypt using CBC */ 54 | int (*cbc_func)( void *ctx, mbedtls_operation_t mode, size_t length, 55 | unsigned char *iv, const unsigned char *input, 56 | unsigned char *output ); 57 | #endif 58 | 59 | #if defined(MBEDTLS_CIPHER_MODE_CFB) 60 | /** Encrypt using CFB (Full length) */ 61 | int (*cfb_func)( void *ctx, mbedtls_operation_t mode, size_t length, size_t *iv_off, 62 | unsigned char *iv, const unsigned char *input, 63 | unsigned char *output ); 64 | #endif 65 | 66 | #if defined(MBEDTLS_CIPHER_MODE_CTR) 67 | /** Encrypt using CTR */ 68 | int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, 69 | unsigned char *nonce_counter, unsigned char *stream_block, 70 | const unsigned char *input, unsigned char *output ); 71 | #endif 72 | 73 | #if defined(MBEDTLS_CIPHER_MODE_STREAM) 74 | /** Encrypt using STREAM */ 75 | int (*stream_func)( void *ctx, size_t length, 76 | const unsigned char *input, unsigned char *output ); 77 | #endif 78 | 79 | /** Set key for encryption purposes */ 80 | int (*setkey_enc_func)( void *ctx, const unsigned char *key, 81 | unsigned int key_bitlen ); 82 | 83 | /** Set key for decryption purposes */ 84 | int (*setkey_dec_func)( void *ctx, const unsigned char *key, 85 | unsigned int key_bitlen); 86 | 87 | /** Allocate a new context */ 88 | void * (*ctx_alloc_func)( void ); 89 | 90 | /** Free the given context */ 91 | void (*ctx_free_func)( void *ctx ); 92 | 93 | }; 94 | 95 | typedef struct 96 | { 97 | mbedtls_cipher_type_t type; 98 | const mbedtls_cipher_info_t *info; 99 | } mbedtls_cipher_definition_t; 100 | 101 | extern const mbedtls_cipher_definition_t mbedtls_cipher_definitions[]; 102 | 103 | extern int mbedtls_cipher_supported[]; 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_CIPHER_WRAP_H */ 110 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/certs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file certs.h 3 | * 4 | * \brief Sample certificates and DHM parameters for testing 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_CERTS_H 24 | #define MBEDTLS_CERTS_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #if defined(MBEDTLS_PEM_PARSE_C) 33 | /* Concatenation of all CA certificates in PEM format if available */ 34 | extern const char mbedtls_test_cas_pem[]; 35 | extern const size_t mbedtls_test_cas_pem_len; 36 | #endif 37 | 38 | /* List of all CA certificates, terminated by NULL */ 39 | extern const char * mbedtls_test_cas[]; 40 | extern const size_t mbedtls_test_cas_len[]; 41 | 42 | /* 43 | * Convenience for users who just want a certificate: 44 | * RSA by default, or ECDSA if RSA is not available 45 | */ 46 | extern const char * mbedtls_test_ca_crt; 47 | extern const size_t mbedtls_test_ca_crt_len; 48 | extern const char * mbedtls_test_ca_key; 49 | extern const size_t mbedtls_test_ca_key_len; 50 | extern const char * mbedtls_test_ca_pwd; 51 | extern const size_t mbedtls_test_ca_pwd_len; 52 | extern const char * mbedtls_test_srv_crt; 53 | extern const size_t mbedtls_test_srv_crt_len; 54 | extern const char * mbedtls_test_srv_key; 55 | extern const size_t mbedtls_test_srv_key_len; 56 | extern const char * mbedtls_test_cli_crt; 57 | extern const size_t mbedtls_test_cli_crt_len; 58 | extern const char * mbedtls_test_cli_key; 59 | extern const size_t mbedtls_test_cli_key_len; 60 | 61 | #if defined(MBEDTLS_ECDSA_C) 62 | extern const char mbedtls_test_ca_crt_ec[]; 63 | extern const size_t mbedtls_test_ca_crt_ec_len; 64 | extern const char mbedtls_test_ca_key_ec[]; 65 | extern const size_t mbedtls_test_ca_key_ec_len; 66 | extern const char mbedtls_test_ca_pwd_ec[]; 67 | extern const size_t mbedtls_test_ca_pwd_ec_len; 68 | extern const char mbedtls_test_srv_crt_ec[]; 69 | extern const size_t mbedtls_test_srv_crt_ec_len; 70 | extern const char mbedtls_test_srv_key_ec[]; 71 | extern const size_t mbedtls_test_srv_key_ec_len; 72 | extern const char mbedtls_test_cli_crt_ec[]; 73 | extern const size_t mbedtls_test_cli_crt_ec_len; 74 | extern const char mbedtls_test_cli_key_ec[]; 75 | extern const size_t mbedtls_test_cli_key_ec_len; 76 | #endif 77 | 78 | #if defined(MBEDTLS_RSA_C) 79 | extern const char mbedtls_test_ca_crt_rsa[]; 80 | extern const size_t mbedtls_test_ca_crt_rsa_len; 81 | extern const char mbedtls_test_ca_key_rsa[]; 82 | extern const size_t mbedtls_test_ca_key_rsa_len; 83 | extern const char mbedtls_test_ca_pwd_rsa[]; 84 | extern const size_t mbedtls_test_ca_pwd_rsa_len; 85 | extern const char mbedtls_test_srv_crt_rsa[]; 86 | extern const size_t mbedtls_test_srv_crt_rsa_len; 87 | extern const char mbedtls_test_srv_key_rsa[]; 88 | extern const size_t mbedtls_test_srv_key_rsa_len; 89 | extern const char mbedtls_test_cli_crt_rsa[]; 90 | extern const size_t mbedtls_test_cli_crt_rsa_len; 91 | extern const char mbedtls_test_cli_key_rsa[]; 92 | extern const size_t mbedtls_test_cli_key_rsa_len; 93 | #endif 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* certs.h */ 100 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file version.h 3 | * 4 | * \brief Run-time version information 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | /* 24 | * This set of compile-time defines and run-time variables can be used to 25 | * determine the version number of the mbed TLS library used. 26 | */ 27 | #ifndef MBEDTLS_VERSION_H 28 | #define MBEDTLS_VERSION_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | /** 37 | * The version number x.y.z is split into three parts. 38 | * Major, Minor, Patchlevel 39 | */ 40 | #define MBEDTLS_VERSION_MAJOR 2 41 | #define MBEDTLS_VERSION_MINOR 1 42 | #define MBEDTLS_VERSION_PATCH 1 43 | 44 | /** 45 | * The single version number has the following structure: 46 | * MMNNPP00 47 | * Major version | Minor version | Patch version 48 | */ 49 | #define MBEDTLS_VERSION_NUMBER 0x02010100 50 | #define MBEDTLS_VERSION_STRING "2.1.1" 51 | #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.1.1" 52 | 53 | #if defined(MBEDTLS_VERSION_C) 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | /** 60 | * Get the version number. 61 | * 62 | * \return The constructed version number in the format 63 | * MMNNPP00 (Major, Minor, Patch). 64 | */ 65 | unsigned int mbedtls_version_get_number( void ); 66 | 67 | /** 68 | * Get the version string ("x.y.z"). 69 | * 70 | * \param string The string that will receive the value. 71 | * (Should be at least 9 bytes in size) 72 | */ 73 | void mbedtls_version_get_string( char *string ); 74 | 75 | /** 76 | * Get the full version string ("mbed TLS x.y.z"). 77 | * 78 | * \param string The string that will receive the value. The mbed TLS version 79 | * string will use 18 bytes AT MOST including a terminating 80 | * null byte. 81 | * (So the buffer should be at least 18 bytes to receive this 82 | * version string). 83 | */ 84 | void mbedtls_version_get_string_full( char *string ); 85 | 86 | /** 87 | * \brief Check if support for a feature was compiled into this 88 | * mbed TLS binary. This allows you to see at runtime if the 89 | * library was for instance compiled with or without 90 | * Multi-threading support. 91 | * 92 | * \note only checks against defines in the sections "System 93 | * support", "mbed TLS modules" and "mbed TLS feature 94 | * support" in config.h 95 | * 96 | * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") 97 | * 98 | * \return 0 if the feature is present, 99 | * -1 if the feature is not present and 100 | * -2 if support for feature checking as a whole was not 101 | * compiled in. 102 | */ 103 | int mbedtls_version_check_feature( const char *feature ); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_VERSION_C */ 110 | 111 | #endif /* version.h */ 112 | -------------------------------------------------------------------------------- /plugin/GameSparks/Source/GameSparksBaseSDK/include/easywsclient/easywsclient.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EASYWSCLIENT_HPP_20120819_MIOFVASDTNUASZDQPLFD 2 | #define EASYWSCLIENT_HPP_20120819_MIOFVASDTNUASZDQPLFD 3 | 4 | // This code comes from: 5 | // https://github.com/dhbaird/easywsclient 6 | // 7 | // To get the latest version: 8 | // wget https://raw.github.com/dhbaird/easywsclient/master/easywsclient.hpp 9 | // wget https://raw.github.com/dhbaird/easywsclient/master/easywsclient.cpp 10 | 11 | #include 12 | 13 | namespace easywsclient { 14 | /* Used to pass Errors to the error callback */ 15 | struct WSError 16 | { 17 | enum Code 18 | { 19 | UNEXPECTED_MESSAGE, ///< The server sent an unexpected message 20 | DNS_LOOKUP_FAILED, ///< gethostbyname failed to lookup the host 21 | RECV_FAILED, ///< recv or SSL_read returned a nagative value 22 | CONNECTION_CLOSED, ///< the connection was closed - i.e. recv or SSL_read returned zero. Not necessarily an error 23 | SEND_FAILED, ///< send or SSL_write returned a nagative value 24 | SOCKET_CREATION_FAILED, ///< The socket constructor returned INVALID_SOCKET 25 | CONNECT_FAILED, ///< The call to connect() returned SOCKET_ERROR 26 | SSL_CTX_NEW_FAILED, ///< SSL_CTX_new returned null 27 | SSL_NEW_FAILED, ///< SSL_new returned null 28 | SSL_SET_FD_FAILED, ///< SSL_set_fd returned 0 29 | SSL_CONNECT_FAILED, ///< SSL_connect returned a value not equal to 1 30 | CLOSED_DURING_WS_HANDSHAKE, ///< recv or SSL_read returned 0 during the websocket handshake 31 | INVALID_STATUS_LINE_DURING_WS_HANDSHAKE, ///< the status line received from the server during the websocket handshake was to long to fit into the buffer 32 | BAD_STATUS_CODE ///< the HTTP status code returned was not 101 (Switching Protocols) 33 | }; 34 | 35 | WSError(Code code_, const gsstl::string& message_) : code(code_), message(message_){} 36 | 37 | const Code code; ///< one of the error codes 38 | const gsstl::string message; ///< a more or less human readable error description 39 | 40 | private: 41 | const WSError& operator=( const WSError& ); 42 | }; 43 | 44 | class WebSocket 45 | { 46 | public: 47 | typedef void (*WSMessageCallback)(const gsstl::string &, void*); 48 | typedef void(*WSErrorCallback)(const WSError&, void*); 49 | typedef WebSocket * pointer; 50 | typedef enum readyStateValues { CLOSING, CLOSED, CONNECTING, OPEN } readyStateValues; 51 | 52 | // Factories: 53 | static pointer create_dummy(); 54 | static pointer from_url(const gsstl::string& url, const gsstl::string& origin = gsstl::string()); 55 | static pointer from_url_no_mask(const gsstl::string& url, const gsstl::string& origin = gsstl::string()); 56 | 57 | // Interfaces: 58 | virtual ~WebSocket() { } 59 | virtual void poll(int timeout, WSErrorCallback errorCallback, void* userData) = 0; // timeout in milliseconds 60 | virtual void send(const gsstl::string& message) = 0; 61 | virtual void sendPing() = 0; 62 | virtual void close() = 0; 63 | virtual readyStateValues getReadyState() const = 0; 64 | 65 | void dispatch(WSMessageCallback messageCallback, WSErrorCallback errorCallback, void* userData) { 66 | _dispatch(messageCallback, errorCallback, userData); 67 | } 68 | 69 | protected: 70 | //struct Callback { virtual void operator()(const gsstl::string& message) = 0; }; 71 | virtual void _dispatch(WSMessageCallback message_callback, WSErrorCallback error_callback, void* data) = 0; 72 | 73 | protected: 74 | enum dnsLookup 75 | { 76 | keNone, 77 | keInprogress, 78 | keComplete, 79 | keFailed 80 | }; 81 | 82 | volatile dnsLookup ipLookup; 83 | 84 | gsstl::string m_host; 85 | gsstl::string m_path; 86 | gsstl::string m_url; 87 | gsstl::string m_origin; 88 | 89 | int m_port; 90 | }; 91 | 92 | } // namespace easywsclient 93 | 94 | #endif /* EASYWSCLIENT_HPP_20120819_MIOFVASDTNUASZDQPLFD */ 95 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file version.h 3 | * 4 | * \brief Run-time version information 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | /* 24 | * This set of compile-time defines and run-time variables can be used to 25 | * determine the version number of the mbed TLS library used. 26 | */ 27 | #ifndef MBEDTLS_VERSION_H 28 | #define MBEDTLS_VERSION_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | /** 37 | * The version number x.y.z is split into three parts. 38 | * Major, Minor, Patchlevel 39 | */ 40 | #define MBEDTLS_VERSION_MAJOR 2 41 | #define MBEDTLS_VERSION_MINOR 1 42 | #define MBEDTLS_VERSION_PATCH 1 43 | 44 | /** 45 | * The single version number has the following structure: 46 | * MMNNPP00 47 | * Major version | Minor version | Patch version 48 | */ 49 | #define MBEDTLS_VERSION_NUMBER 0x02010100 50 | #define MBEDTLS_VERSION_STRING "2.1.1" 51 | #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.1.1" 52 | 53 | #if defined(MBEDTLS_VERSION_C) 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | /** 60 | * Get the version number. 61 | * 62 | * \return The constructed version number in the format 63 | * MMNNPP00 (Major, Minor, Patch). 64 | */ 65 | unsigned int mbedtls_version_get_number( void ); 66 | 67 | /** 68 | * Get the version string ("x.y.z"). 69 | * 70 | * \param string The string that will receive the value. 71 | * (Should be at least 9 bytes in size) 72 | */ 73 | void mbedtls_version_get_string( char *string ); 74 | 75 | /** 76 | * Get the full version string ("mbed TLS x.y.z"). 77 | * 78 | * \param string The string that will receive the value. The mbed TLS version 79 | * string will use 18 bytes AT MOST including a terminating 80 | * null byte. 81 | * (So the buffer should be at least 18 bytes to receive this 82 | * version string). 83 | */ 84 | void mbedtls_version_get_string_full( char *string ); 85 | 86 | /** 87 | * \brief Check if support for a feature was compiled into this 88 | * mbed TLS binary. This allows you to see at runtime if the 89 | * library was for instance compiled with or without 90 | * Multi-threading support. 91 | * 92 | * \note only checks against defines in the sections "System 93 | * support", "mbed TLS modules" and "mbed TLS feature 94 | * support" in config.h 95 | * 96 | * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") 97 | * 98 | * \return 0 if the feature is present, 99 | * -1 if the feature is not present and 100 | * -2 if support for feature checking as a whole was not 101 | * compiled in. 102 | */ 103 | int mbedtls_version_check_feature( const char *feature ); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_VERSION_C */ 110 | 111 | #endif /* version.h */ 112 | -------------------------------------------------------------------------------- /GameSparksSample/Plugins/GameSparks/Source/GameSparksBaseSDK/include/mbedtls/certs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file certs.h 3 | * 4 | * \brief Sample certificates and DHM parameters for testing 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_CERTS_H 24 | #define MBEDTLS_CERTS_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #if defined(MBEDTLS_PEM_PARSE_C) 33 | /* Concatenation of all CA certificates in PEM format if available */ 34 | extern const char mbedtls_test_cas_pem[]; 35 | extern const size_t mbedtls_test_cas_pem_len; 36 | #endif 37 | 38 | /* List of all CA certificates, terminated by NULL */ 39 | extern const char * mbedtls_test_cas[]; 40 | extern const size_t mbedtls_test_cas_len[]; 41 | 42 | /* 43 | * Convenience for users who just want a certificate: 44 | * RSA by default, or ECDSA if RSA is not available 45 | */ 46 | extern const char * mbedtls_test_ca_crt; 47 | extern const size_t mbedtls_test_ca_crt_len; 48 | extern const char * mbedtls_test_ca_key; 49 | extern const size_t mbedtls_test_ca_key_len; 50 | extern const char * mbedtls_test_ca_pwd; 51 | extern const size_t mbedtls_test_ca_pwd_len; 52 | extern const char * mbedtls_test_srv_crt; 53 | extern const size_t mbedtls_test_srv_crt_len; 54 | extern const char * mbedtls_test_srv_key; 55 | extern const size_t mbedtls_test_srv_key_len; 56 | extern const char * mbedtls_test_cli_crt; 57 | extern const size_t mbedtls_test_cli_crt_len; 58 | extern const char * mbedtls_test_cli_key; 59 | extern const size_t mbedtls_test_cli_key_len; 60 | 61 | #if defined(MBEDTLS_ECDSA_C) 62 | extern const char mbedtls_test_ca_crt_ec[]; 63 | extern const size_t mbedtls_test_ca_crt_ec_len; 64 | extern const char mbedtls_test_ca_key_ec[]; 65 | extern const size_t mbedtls_test_ca_key_ec_len; 66 | extern const char mbedtls_test_ca_pwd_ec[]; 67 | extern const size_t mbedtls_test_ca_pwd_ec_len; 68 | extern const char mbedtls_test_srv_crt_ec[]; 69 | extern const size_t mbedtls_test_srv_crt_ec_len; 70 | extern const char mbedtls_test_srv_key_ec[]; 71 | extern const size_t mbedtls_test_srv_key_ec_len; 72 | extern const char mbedtls_test_cli_crt_ec[]; 73 | extern const size_t mbedtls_test_cli_crt_ec_len; 74 | extern const char mbedtls_test_cli_key_ec[]; 75 | extern const size_t mbedtls_test_cli_key_ec_len; 76 | #endif 77 | 78 | #if defined(MBEDTLS_RSA_C) 79 | extern const char mbedtls_test_ca_crt_rsa[]; 80 | extern const size_t mbedtls_test_ca_crt_rsa_len; 81 | extern const char mbedtls_test_ca_key_rsa[]; 82 | extern const size_t mbedtls_test_ca_key_rsa_len; 83 | extern const char mbedtls_test_ca_pwd_rsa[]; 84 | extern const size_t mbedtls_test_ca_pwd_rsa_len; 85 | extern const char mbedtls_test_srv_crt_rsa[]; 86 | extern const size_t mbedtls_test_srv_crt_rsa_len; 87 | extern const char mbedtls_test_srv_key_rsa[]; 88 | extern const size_t mbedtls_test_srv_key_rsa_len; 89 | extern const char mbedtls_test_cli_crt_rsa[]; 90 | extern const size_t mbedtls_test_cli_crt_rsa_len; 91 | extern const char mbedtls_test_cli_key_rsa[]; 92 | extern const size_t mbedtls_test_cli_key_rsa_len; 93 | #endif 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* certs.h */ 100 | --------------------------------------------------------------------------------