├── GraphQL ├── mutation list.txt └── query list.txt ├── Enjin Test Project ├── Assets │ ├── Enjin │ │ ├── Resources │ │ │ ├── Version.txt │ │ │ ├── Textures │ │ │ │ ├── textures.txt │ │ │ │ ├── BG01.png │ │ │ │ ├── TrashCan.png │ │ │ │ ├── clipboard.png │ │ │ │ ├── enj-large-png.png │ │ │ │ ├── enjin-logo-mark-white.png │ │ │ │ ├── textures.txt.meta │ │ │ │ ├── BG01.png.meta │ │ │ │ ├── TrashCan.png.meta │ │ │ │ ├── clipboard.png.meta │ │ │ │ ├── enj-large-png.png.meta │ │ │ │ └── enjin-logo-mark-white.png.meta │ │ │ ├── Version.txt.meta │ │ │ ├── Templates.meta │ │ │ ├── Templates │ │ │ │ ├── IdentityTemplate.txt.meta │ │ │ │ ├── PlatformTemplate.txt.meta │ │ │ │ ├── UserTemplate.txt.meta │ │ │ │ ├── UserTemplate.txt │ │ │ │ ├── PlatformTemplate.txt │ │ │ │ └── IdentityTemplate.txt │ │ │ └── Textures.meta │ │ ├── Plugins │ │ │ ├── websocket-sharp.dll │ │ │ ├── MiniJSON.meta │ │ │ ├── SimpleJSON.meta │ │ │ ├── MiniJSON │ │ │ │ ├── MiniJSON.cs.meta │ │ │ │ ├── MiniJsonExtensions.cs.meta │ │ │ │ └── MiniJsonExtensions.cs │ │ │ ├── SimpleJSON │ │ │ │ └── SimpleJSON.cs.meta │ │ │ └── websocket-sharp.dll.meta │ │ ├── SDK │ │ │ ├── PusherClient │ │ │ │ ├── ChannelTypes.cs │ │ │ │ ├── IAuthorizer.cs │ │ │ │ ├── Helper.meta │ │ │ │ ├── PrivateChannel.cs │ │ │ │ ├── ConnectionState.cs │ │ │ │ ├── Channel.cs.meta │ │ │ │ ├── Pusher.cs.meta │ │ │ │ ├── ChannelTypes.cs.meta │ │ │ │ ├── Connection.cs.meta │ │ │ │ ├── Constants.cs.meta │ │ │ │ ├── ErrorCodes.cs.meta │ │ │ │ ├── EventEmitter.cs.meta │ │ │ │ ├── IAuthorizer.cs.meta │ │ │ │ ├── ConnectionState.cs.meta │ │ │ │ ├── Helper │ │ │ │ │ ├── JsonHelper.cs.meta │ │ │ │ │ ├── DataFactoryHelper.cs.meta │ │ │ │ │ ├── DataFactoryHelper.cs │ │ │ │ │ └── JsonHelper.cs │ │ │ │ ├── HttpAuthorizer.cs.meta │ │ │ │ ├── PresenceChannel.cs.meta │ │ │ │ ├── PrivateChannel.cs.meta │ │ │ │ ├── PusherEventData.cs.meta │ │ │ │ ├── PusherException.cs.meta │ │ │ │ ├── PusherOptions.cs.meta │ │ │ │ ├── PusherSettings.cs.meta │ │ │ │ ├── PusherException.cs │ │ │ │ ├── PusherOptions.cs │ │ │ │ ├── ErrorCodes.cs │ │ │ │ ├── Constants.cs │ │ │ │ ├── PusherSettings.cs │ │ │ │ ├── HttpAuthorizer.cs │ │ │ │ ├── PusherEventData.cs │ │ │ │ ├── Channel.cs │ │ │ │ ├── EventEmitter.cs │ │ │ │ ├── PresenceChannel.cs │ │ │ │ ├── Connection.cs │ │ │ │ └── Pusher.cs │ │ │ ├── Core.meta │ │ │ ├── GraphQL.meta │ │ │ ├── Template.meta │ │ │ ├── Utility.meta │ │ │ ├── DataTypes.meta │ │ │ ├── PusherClient.meta │ │ │ ├── DataTypes │ │ │ │ ├── EnjinInterfaces.cs │ │ │ │ ├── EnjinInterfaces.cs.meta │ │ │ │ ├── EnjinUserClasses.cs.meta │ │ │ │ └── EnjinUserClasses.cs │ │ │ ├── Core │ │ │ │ ├── Enjin.cs.meta │ │ │ │ ├── EnjinUsers.cs.meta │ │ │ │ ├── EnjinClasses.cs.meta │ │ │ │ ├── EnjinIdentities.cs.meta │ │ │ │ ├── EnjinPlatform.cs.meta │ │ │ │ ├── EnjinRequests.cs.meta │ │ │ │ ├── EnjinCryptoItems.cs.meta │ │ │ │ ├── EnjinEventManager.cs.meta │ │ │ │ ├── EnjinUsers.cs │ │ │ │ ├── EnjinCryptoItems.cs │ │ │ │ ├── EnjinIdentities.cs │ │ │ │ ├── EnjinEventManager.cs │ │ │ │ └── EnjinPlatform.cs │ │ │ ├── GraphQL │ │ │ │ ├── GraphQuery.cs.meta │ │ │ │ └── GraphQuery.cs │ │ │ ├── Utility │ │ │ │ ├── EnjinHelpers.cs.meta │ │ │ │ └── EnjinHelpers.cs │ │ │ └── Template │ │ │ │ ├── GraphQLTemplate.cs.meta │ │ │ │ └── GraphQLTemplate.cs │ │ ├── Scenes │ │ │ ├── EnjinSDK.unity.meta │ │ │ └── EnjinSDK.unity │ │ ├── Editor.meta │ │ ├── Plugins.meta │ │ ├── SDK.meta │ │ ├── Scenes.meta │ │ ├── Third-Party Notices.txt.meta │ │ ├── Resources.meta │ │ ├── Editor │ │ │ ├── EnjinMenu.cs.meta │ │ │ └── EnjinMenu.cs │ │ └── Third-Party Notices.txt │ ├── ENJ.png │ ├── Scenes │ │ └── SampleScene.unity.meta │ ├── Enjin.meta │ ├── Scenes.meta │ ├── EnjinManager.cs.meta │ ├── EnjinUIManager.cs.meta │ ├── EnjinWallet.cs.meta │ ├── PlatformSelector.cs.meta │ ├── PlatformSelector.cs │ ├── ENJ.png.meta │ ├── EnjinUIManager.cs │ ├── EnjinManager.cs │ └── EnjinWallet.cs ├── .vs │ └── Enjin Test Project │ │ └── v16 │ │ ├── Server │ │ └── sqlite3 │ │ │ ├── db.lock │ │ │ └── storage.ide │ │ └── .suo ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── EditorBuildSettings.asset │ ├── XRSettings.asset │ ├── TimeManager.asset │ ├── VFXManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── PackageManagerSettings.asset │ ├── EditorSettings.asset │ ├── DynamicsManager.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ └── QualitySettings.asset ├── .vsconfig ├── obj │ └── Debug │ │ ├── Assembly-CSharp.csprojAssemblyReference.cache │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Assembly-CSharp-Editor.csprojAssemblyReference.cache ├── Enjin Test Project.sln ├── Packages │ ├── manifest.json │ └── packages-lock.json └── Logs │ └── Packages-Update.log ├── .gitignore ├── .vs ├── ProjectSettings.json ├── slnx.sqlite ├── VSWorkspaceState.json └── Enjin-Unity-sample │ └── v16 │ └── .suo ├── .gitattributes ├── LICENSE └── README.md /GraphQL/mutation list.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Version.txt: -------------------------------------------------------------------------------- 1 | 0.1.2 -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/textures.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Enjin Test Project/Library/ 2 | Enjin Test Project/Temp/ -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /Enjin Test Project/.vs/Enjin Test Project/v16/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/.vs/slnx.sqlite -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "PreviewInSolutionExplorer": false 6 | } -------------------------------------------------------------------------------- /.vs/Enjin-Unity-sample/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/.vs/Enjin-Unity-sample/v16/.suo -------------------------------------------------------------------------------- /Enjin Test Project/Assets/ENJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/ENJ.png -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.21f1 2 | m_EditorVersionWithRevision: 2019.4.21f1 (b76dac84db26) 3 | -------------------------------------------------------------------------------- /Enjin Test Project/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Enjin Test Project/.vs/Enjin Test Project/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/.vs/Enjin Test Project/v16/.suo -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/websocket-sharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Plugins/websocket-sharp.dll -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/BG01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Resources/Textures/BG01.png -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/TrashCan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Resources/Textures/TrashCan.png -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Resources/Textures/clipboard.png -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/enj-large-png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Resources/Textures/enj-large-png.png -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Enjin Test Project/.vs/Enjin Test Project/v16/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/.vs/Enjin Test Project/v16/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/enjin-logo-mark-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/Assets/Enjin/Resources/Textures/enjin-logo-mark-white.png -------------------------------------------------------------------------------- /Enjin Test Project/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /Enjin Test Project/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ChannelTypes.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public enum ChannelTypes 4 | { 5 | Public, 6 | Private, 7 | Presence 8 | } 9 | } -------------------------------------------------------------------------------- /Enjin Test Project/obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twglhk/Enjin-Unity-sample/HEAD/Enjin Test Project/obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/IAuthorizer.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public interface IAuthorizer 4 | { 5 | string Authorize(string channelName, string socketId); 6 | } 7 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c1d36b9739a52345bb297537175ff1e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c66a98a9567048f4c9d3566899ea4e55 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Scenes/EnjinSDK.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5ffa05c9d82a2b408d514306d41d367 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad6f5b3eff32c9843b63058de593077e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab8b9293ae6e91b47a8a7e5b27a69024 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ab0be640e3f3ea4abc291994d4d088a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Version.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4139e337ffbc6b458d4259a9bc61c8f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97705efafc4631f409c1474889ad4109 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d79924e1b55820d4884eee5d863950cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Third-Party Notices.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 034bb9a5e0dd5c14dbabb89a59c7e886 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c9b7b1d6eba7524da9a799baa78b4dd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92b26f676d1498a4b96428f53bc44cf0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/GraphQL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 181f6ebdd8626684cb837b03b6cd3ec0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Template.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 787b537355ea97f4ab23feb82599f9fe 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a292fe9560492d41a144c9863608b86 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/MiniJSON.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c08513fe9e32ea243b1fae59230ba3c3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/textures.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c428c883494c6d74785cdbf122a4d7f2 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/DataTypes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12104b94ef3454c44883cd5378aaa3b4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0a20f95dfbe4fa44aa0c7a2b6e38253 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/SimpleJSON.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2a2f2d826c2aac4f943d716782a780f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 546d3bca5c09c5a48afd18ce36bb15ed 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/IdentityTemplate.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11f76e34e7b700049b9398700ec12730 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/PlatformTemplate.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c7236dd6bda67d4faeced84f7868600 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/UserTemplate.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1f33283b97220944848329bb572477a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4371c4d020c34df49b634d4340aafac4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Helper.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 105a9841e21070945908a97cfe18e4f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/DataTypes/EnjinInterfaces.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.DataTypes 2 | { 3 | public interface IErrorHandle 4 | { 5 | void SetErrorDetails(int code, string description); 6 | } 7 | 8 | public interface IEnjinIdentity 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PrivateChannel.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public class PrivateChannel : Channel 4 | { 5 | public PrivateChannel(string channelName, Pusher pusher) : base(channelName, pusher) 6 | { 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ConnectionState.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public enum ConnectionState 4 | { 5 | Initialized, 6 | Connecting, 7 | Connected, 8 | Unavailable, 9 | Failed, 10 | Disconnected 11 | } 12 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd73317dedfd8364a82dac9255f3d7fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinUIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 885bb06a4ff5b2c4baf7fe6d83cd8ab1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinWallet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d164076ffa5c0b34aa701f0774f98805 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/Enjin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf57a1cf35983824299771d42185122b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/PlatformSelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9de7e61bd4037004aabaeb12aa66a211 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Editor/EnjinMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63b2b96fad5c0fb4c966ffa37d8233bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinUsers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6de46eb28f0ae9c4c93526d90334efad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinClasses.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ae5a3cf3d458274b8ba8af5bdb8e971 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinIdentities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 221b9de1ab13edc40b81bc432b7a9e2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinPlatform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9987c811bdbbda4e98a2f44bcb2a22f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinRequests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bd8ab6fc0f96474aa4d85f9872e76e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/GraphQL/GraphQuery.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 157e616bd1deaa346954025125aa40ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Channel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b2afa4e2f28bf146a5e17027387e0ba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Pusher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b29e515d2d0c3a48b3f3432e58652a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Utility/EnjinHelpers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc00c893a6966fd439144c87066b78d9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/MiniJSON/MiniJSON.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43ca095c64820e6478e194fd464e97bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/SimpleJSON/SimpleJSON.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6db6ca2b9d3512f4b8594bf3d81d2871 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinCryptoItems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ad90eaf49b46f649806b254c46de52f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinEventManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc83526ffe258ec4ca7cd7e3916231c0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/DataTypes/EnjinInterfaces.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 507f71b14ae837544854ea202735247b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ChannelTypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e673e3f45f9465c4eb9260c50cdf26fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25c98e45fa1fcb049ba9d1aabc8035c9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Constants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e12222fff0b3ce84bb284f2081670766 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ErrorCodes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e058b566714f5f42bd59d20ec5de588 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/EventEmitter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a98c937469c1346ad7f35526d39233 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/IAuthorizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b993c3c717f8b914e8515d589f1f38bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Template/GraphQLTemplate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3829416ae0ea4c47800dea9cf7a5d98 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/DataTypes/EnjinUserClasses.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c40a455e90658f4fa88fe65a19c064f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ConnectionState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b48068cb9f2d70d49a060bb539761ae4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Helper/JsonHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f34bc6e749f9aa47a6f5ec035b87bca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/HttpAuthorizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 817059dddcb2b9a4aaadadf604913d72 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PresenceChannel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d3978c63a92b0c438b73f6557ab9c87 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PrivateChannel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ec34e0573b8e134b8eac1c9b4d478ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherEventData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5410517509157d84faa8350f4ad57a2a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8e2d940b67c54b408bcb8adabe0bbfd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherOptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f1864810cbcd2642996bb7695456234 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ddb4fa2367ce514895c75492f9aa974 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/MiniJSON/MiniJsonExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee3fe7ac24b2f0a4683d4081b23d14c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Helper/DataFactoryHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c295830148264e54ba5832c3275d4e1b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Third-Party Notices.txt: -------------------------------------------------------------------------------- 1 | "This asset is governed by the Asset Store EULA; however, the following components are governed by the licenses indicated below: 2 | 3 | A. MiniJSON 4 | Custom License 5 | License: https://gist.github.com/darktable/1411710 6 | 7 | 8 | B. simpleJSON 9 | MIT 10 | https://github.com/simplejson/simplejson/blob/master/LICENSE.txt 11 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Enjin.SDK.PusherClient 4 | { 5 | public class PusherException : Exception 6 | { 7 | public ErrorCodes PusherCode { get; set; } 8 | 9 | public PusherException(string message, ErrorCodes code) 10 | : base(message) 11 | { 12 | PusherCode = code; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /GraphQL/query list.txt: -------------------------------------------------------------------------------- 1 | query GetEnjinUser($name:String){ 2 | EnjinUser(name : $name){ 3 | id 4 | name 5 | isPlayer 6 | identities{ 7 | id 8 | linkingCodeQr 9 | } 10 | } 11 | } 12 | 13 | 14 | query GetIdentities($page: Int) { 15 | EnjinIdentities(pagination: {page: $page, limit: 50}) { 16 | id 17 | linkingCode 18 | linkingCodeQr 19 | wallet { 20 | ethAddress 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public class PusherOptions 4 | { 5 | public bool Encrypted = false; 6 | public IAuthorizer Authorizer = null; 7 | 8 | public string Cluster = "mt1"; 9 | 10 | internal string Host 11 | { 12 | get { return string.Format("ws-{0}.pusher.com", this.Cluster); } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Editor/EnjinMenu.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | public class EnjinMenu : MonoBehaviour 5 | { 6 | [MenuItem("Window/Enjin/MainNet Cloud")] 7 | private static void OpenMainNet() 8 | { 9 | Application.OpenURL("https://cloud.enjin.io"); 10 | } 11 | 12 | [MenuItem("Window/Enjin/Kovan Cloud")] 13 | private static void OpenKovan() 14 | { 15 | Application.OpenURL("https://kovan.cloud.enjin.io"); 16 | } 17 | } -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/ErrorCodes.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public enum ErrorCodes 4 | { 5 | // Catch all 6 | Unkown = 0, 7 | 8 | // Reserved codes 9 | MustConnectOverSSL = 4000, 10 | ApplicationDoesNotExist = 4001, 11 | ApplicationDisabled = 4003, 12 | ApplicationOverConnectionQuota = 4004, 13 | PathNotFound = 4005, 14 | ClientOverRateLimit = 4301, 15 | 16 | // Library codes 17 | ConnectionFailed = 5000, 18 | ChannelAuthorizerNotSet = 5001, 19 | NotConnected = 5002, 20 | SubscriptionError = 5003 21 | } 22 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/UserTemplate.txt: -------------------------------------------------------------------------------- 1 | CreateUser|mutation createUser{{user:CreateEnjinUser(name:"{0}"){{id,name,identities{{id,app{{id,name,description,image}},linkingCode}},accessTokens,createdAt,updatedAt}}}} 2 | GetCurrentUser|query getCurrentUser{result:EnjinUser(me:true){id,name,identities{id,app{id},linkingCode,linkingCodeQr,wallet{ethAddress}},updatedAt,createdAt}} 3 | GetUserForId|query getUserForId{{result:EnjinUser(id:{0}){{id,name,identities{{id,app{{id}},linkingCode,linkingCodeQr,wallet{{ethAddress}}}},updatedAt,createdAt}}}} 4 | GetUserForName|query getUserForName{{result:EnjinUser(name:"{0}"){{id,name,identities{{id,app{{id}},linkingCode,linkingCodeQr,wallet{{ethAddress}}}},updatedAt,createdAt}}}} -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/PlatformTemplate.txt: -------------------------------------------------------------------------------- 1 | Login|query login{{result:EnjinOauth(email:"{0}",password:"{1}"){{id,accessTokens}}}} 2 | GetAppByID|query getAppByID{{result:EnjinApps(id:{0}){{id,name,description,image}}}} 3 | GetPlatformInfo|query getPlatform{result:Platform{id,network,name,notifications}} 4 | GetActiveTokens|query getIdentities{{activeTokens:EnjinIdentities(id:{0}){{id,tokens{{balance}}}}}} 5 | SetAllowance|mutation ApproveMAXENJ{{CreateEnjinRequest(appId:{0},identityId:{1},type:APPROVE,approve_enj_data:{{value:-1}}){{id,encodedData}}}} 6 | AuthApp|query authApp{{result:AuthApp(id:{0},secret:"{1}"){{accessToken,expiresIn}}}} 7 | AuthPlayer|query authPlayer{{result:AuthPlayer(id:"{0}"){{accessToken,expiresIn}}}} -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/MiniJSON/MiniJsonExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using MiniJSON; 5 | 6 | #region Extension methods 7 | 8 | public static class MiniJsonExtensions 9 | { 10 | public static string toJson(this Dictionary obj) 11 | { 12 | return Json.Serialize(obj); 13 | } 14 | 15 | public static List listFromJson(this string json) 16 | { 17 | return (List) Json.Deserialize(json); 18 | } 19 | 20 | public static Dictionary dictionaryFromJson(this string json) 21 | { 22 | return (Dictionary) Json.Deserialize(json); 23 | } 24 | } 25 | 26 | #endregion -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | class Constants 4 | { 5 | public const string ERROR = "pusher:error"; 6 | 7 | public const string CONNECTION_ESTABLISHED = "pusher:connection_established"; 8 | 9 | public const string CHANNEL_SUBSCRIBE = "pusher:subscribe"; 10 | public const string CHANNEL_UNSUBSCRIBE = "pusher:unsubscribe"; 11 | public const string CHANNEL_SUBSCRIPTION_SUCCEEDED = "pusher_internal:subscription_succeeded"; 12 | public const string CHANNEL_SUBSCRIPTION_ERROR = "pusher_internal:subscription_error"; 13 | public const string CHANNEL_MEMBER_ADDED = "pusher_internal:member_added"; 14 | public const string CHANNEL_MEMBER_REMOVED = "pusher_internal:member_removed"; 15 | } 16 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Plugins/websocket-sharp.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc77e351c6c693c4c9ec04e59933fcf2 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public class PusherSettings 4 | { 5 | // if true, Pusher will output debug info to console 6 | public static bool Verbose = true; 7 | 8 | // App Key from pusher.com app settings 9 | public static string AppKey = ""; 10 | 11 | // if true, then connection to pusher will be encrypted 12 | public static bool Encrypted = true; 13 | 14 | // if specified, then this will be used as callback url for authorizing connections to private channels 15 | public static string HttpAuthUrl = ""; 16 | 17 | // client name & version for identifying client library 18 | public static string ClientName = "pusher-unity"; 19 | public static string ClientVersion = "1.0"; 20 | } 21 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/HttpAuthorizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace Enjin.SDK.PusherClient 5 | { 6 | public class HttpAuthorizer : IAuthorizer 7 | { 8 | private Uri _authEndpoint; 9 | 10 | public HttpAuthorizer(string authEndpoint) 11 | { 12 | _authEndpoint = new Uri(authEndpoint); 13 | } 14 | 15 | public string Authorize(string channelName, string socketId) 16 | { 17 | string authToken = null; 18 | 19 | using (var webClient = new System.Net.WebClient()) 20 | { 21 | string data = String.Format("channel_name={0}&socket_id={1}", channelName, socketId); 22 | webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; 23 | authToken = webClient.UploadString(_authEndpoint, "POST", data); 24 | } 25 | 26 | return authToken; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/PlatformSelector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class PlatformSelector : MonoBehaviour 7 | { 8 | private static readonly string _kovanURL = "https://kovan.cloud.enjin.io/"; 9 | private static readonly string _mainnetURL = "https://cloud.enjin.io/"; 10 | [SerializeField] private Toggle _kovanToggle; 11 | [SerializeField] private Toggle _mainnetToggle; 12 | 13 | public string GetPlatformURL() 14 | { 15 | if (_kovanToggle.isOn) 16 | return _kovanURL; 17 | else if (_mainnetToggle.isOn) 18 | return _mainnetURL; 19 | else 20 | { 21 | Debug.LogError("Platform selection error"); 22 | return null; 23 | } 24 | } 25 | 26 | public void DisableInteractable() 27 | { 28 | _kovanToggle.interactable = false; 29 | _mainnetToggle.interactable = false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13960, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Templates/IdentityTemplate.txt: -------------------------------------------------------------------------------- 1 | CreateIdentity|mutation createIdentity{{result:CreateEnjinIdentity(userId:{0},ethAddress:"{1}"){{id,app{{id}},user{{id}},wallet{{ethAddress}},linkingCode,updatedAt,createdAt}}}} 2 | GetIdentity|query getIdentity{{result:EnjinIdentities(id:{0}){{id,user{{id}},wallet{{ethAddress}},linkingCode,updatedAt,createdAt}}}} 3 | UpdateIdentity|mutation updateIdentity{{result:UpdateEnjinIdentity(id:{0},ethAddress:"{2}"){{id,app{{id}},user{{id}},wallet{{ethAddress}},linkingCode,updatedAt,createdAt}}}} 4 | UnlinkIdentity|mutation deleteIdentity{{result:UnlinkIdentity(id:{0}){{id,linkingCode,wallet{{ethAddress}}}}}} 5 | DeleteIdentity|mutation deleteIdentity{{result:DeleteEnjinIdentity(id:{0},unlink:false){{id,linkingCode,wallet{{ethAddress}}}}}} 6 | GetWalletBalances|query getWalletBalances{{result:EnjinWallet(ethAddress:"{0}"){{ethAddress,ethBalance,enjBalance,balances{{id,index,value}}}}}} 7 | GetWalletBalancesForApp|query getWalletBalancesForApp{{result:EnjinWallet(ethAddress:"{0}"){{ethAddress,ethBalance,enjBalance,balances(appId: {1}){{id,index,value}}}}}} -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/DataTypes/EnjinUserClasses.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Enjin.SDK.Core; 3 | 4 | namespace Enjin.SDK.DataTypes 5 | { 6 | /// 7 | /// User data structure that contains account info and links to user identity 8 | /// 9 | [Serializable] 10 | public class User 11 | { 12 | public int id; // Account ID 13 | public string name; // Username of account 14 | public DateData updatedAt; // Last update to account 15 | public DateData createAt; // Date account created 16 | public Identity[] identities; // Identity associated to user 17 | public IErrorHandle ErrorStatus; // Error handling object 18 | 19 | /// 20 | /// Constructor 21 | /// 22 | public User() 23 | { 24 | id = -1; 25 | name = string.Empty; 26 | updatedAt = new DateData(); 27 | createAt = new DateData(); 28 | ErrorStatus = new ErrorHandler(); 29 | //identities = new List(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Template/GraphQLTemplate.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace Enjin.SDK.Template 5 | { 6 | public class GraphQLTemplate 7 | { 8 | public Dictionary GetQuery { get; private set; } 9 | 10 | public GraphQLTemplate(string templateFile) 11 | { 12 | GetQuery = new Dictionary(); 13 | ReadTemplate(templateFile); 14 | } 15 | 16 | private void ReadTemplate(string file) 17 | { 18 | TextAsset templateData = Resources.Load("Templates/" + file); 19 | 20 | if (templateData.text == string.Empty) 21 | return; 22 | 23 | string[] lines = templateData.text.Split('\n'); 24 | 25 | foreach (string line in lines) 26 | { 27 | if (line != null || line != "") 28 | { 29 | string[] cmd = line.Split('|'); 30 | GetQuery.Add(cmd[0], cmd[1]); 31 | } 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jong Ha (Blue Egg) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PusherEventData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enjin.SDK.PusherClient.Helper; 3 | using UnityEngine; 4 | 5 | namespace Enjin.SDK.PusherClient 6 | { 7 | internal class PusherEventData 8 | { 9 | public string eventName = string.Empty; 10 | public string channel = string.Empty; 11 | public string data = string.Empty; 12 | 13 | public static PusherEventData FromJson(string json) 14 | { 15 | PusherEventData data = new PusherEventData(); 16 | Dictionary dict = JsonHelper.Deserialize>(json); 17 | if (dict != null) 18 | { 19 | data.eventName = DataFactoryHelper.GetDictonaryValue(dict, "event", string.Empty); 20 | data.data = DataFactoryHelper.GetDictonaryValue(dict, "data", string.Empty); 21 | data.channel = DataFactoryHelper.GetDictonaryValue(dict, "channel", string.Empty); 22 | } 23 | else 24 | { 25 | Debug.LogWarning("invalid pusher event data: '" + json + "'"); 26 | } 27 | 28 | return data; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Channel.cs: -------------------------------------------------------------------------------- 1 | namespace Enjin.SDK.PusherClient 2 | { 3 | public delegate void SubscriptionEventHandler(object sender); 4 | 5 | public class Channel : EventEmitter 6 | { 7 | private Pusher _pusher = null; 8 | private bool _isSubscribed = false; 9 | 10 | public event SubscriptionEventHandler Subscribed; 11 | public string Name = null; 12 | 13 | public bool IsSubscribed 14 | { 15 | get { return _isSubscribed; } 16 | } 17 | 18 | public Channel(string channelName, Pusher pusher) 19 | { 20 | _pusher = pusher; 21 | this.Name = channelName; 22 | } 23 | 24 | internal virtual void SubscriptionSucceeded(string data) 25 | { 26 | _isSubscribed = true; 27 | 28 | if (Subscribed != null) 29 | Subscribed(this); 30 | } 31 | 32 | public void Unsubscribe() 33 | { 34 | _isSubscribed = false; 35 | _pusher.Unsubscribe(this.Name); 36 | } 37 | 38 | public void Trigger(string eventName, object obj) 39 | { 40 | _pusher.Trigger(this.Name, eventName, obj); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /Enjin Test Project/Enjin Test Project.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{6BC095C1-6C99-2754-0A18-26966EB18F69}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{E331513D-7E41-AB02-3945-DF2C6336F622}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6BC095C1-6C99-2754-0A18-26966EB18F69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6BC095C1-6C99-2754-0A18-26966EB18F69}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6BC095C1-6C99-2754-0A18-26966EB18F69}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6BC095C1-6C99-2754-0A18-26966EB18F69}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {E331513D-7E41-AB02-3945-DF2C6336F622}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {E331513D-7E41-AB02-3945-DF2C6336F622}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {E331513D-7E41-AB02-3945-DF2C6336F622}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {E331513D-7E41-AB02-3945-DF2C6336F622}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Enjin-Unity-sample 2 | Enjin tutorial sample project for Unity developer. 3 | You can test Unity Enjin SDK with it. 4 | 5 | ### How to guide 6 | ##### 1. Log in Enjin App 7 | First, you need to log in Enjin platform you have made. If you don't have Enjin ID or App ID, sign up Enjin platform and make Enjin project first. 8 | If you just try to test Enjin and Unity Enjin SDK, then make a project in Kovan Enjin cloud platform. It doesn't need any ENJ or ETH costs. 9 | You can find the kovan Enjin cloud at [here](https://kovan.cloud.enjin.io/) 10 | 11 | ![image](https://user-images.githubusercontent.com/22043884/110468060-1caafc80-811b-11eb-8693-57531a3fb436.png) 12 | 13 | If you make project on Kovan Enjin cloud, then you can find API Credentials from settings tap. 14 | App ID and App Secret are first keys of input information of this project. You can log in app with these in Unity client. 15 | 16 | ##### 2. Log in Enjin User 17 | Next, you need to log in Enjin app with 'User Name'. In this project, you must write user name in string data type (not user ID). 18 | You can find it at 'Team' tap or using query in GraphQL on Kovan Enjin platform. Also you can create user with Enjin SDK or GraphQL. 19 | I'll add this user creation function in Unity as soon as possible. 20 | 21 | ##### 3. Mutate & Query Identities 22 | Next, you can mutate(create) or query identities. The identity is belong to user. 23 | User can have many identities. Each identity has wallet address and linking code that connects to Enjin wallet using QR scan. 24 | Query Identites already added in the project, but mutate is not. I'll update as soon as possible. 25 | 26 | 27 | Updating.. -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/EventEmitter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enjin.SDK.PusherClient.Helper; 4 | 5 | namespace Enjin.SDK.PusherClient 6 | { 7 | public class EventEmitter 8 | { 9 | private Dictionary>> _eventListeners = 10 | new Dictionary>>(); 11 | 12 | private List> _generalListeners = new List>(); 13 | 14 | public void Bind(string eventName, Action listener) 15 | { 16 | if (_eventListeners.ContainsKey(eventName)) 17 | { 18 | _eventListeners[eventName].Add(listener); 19 | } 20 | else 21 | { 22 | List> listeners = new List>(); 23 | listeners.Add(listener); 24 | _eventListeners.Add(eventName, listeners); 25 | } 26 | } 27 | 28 | public void BindAll(Action listener) 29 | { 30 | _generalListeners.Add(listener); 31 | } 32 | 33 | internal void EmitEvent(string eventName, string data) 34 | { 35 | var obj = JsonHelper.Deserialize(data); 36 | 37 | // Emit to general listeners regardless of event type 38 | foreach (var action in _generalListeners) 39 | { 40 | action(eventName, obj); 41 | } 42 | 43 | if (_eventListeners.ContainsKey(eventName)) 44 | { 45 | foreach (var action in _eventListeners[eventName]) 46 | { 47 | action(obj); 48 | } 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Enjin Test Project/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ide.rider": "1.1.4", 5 | "com.unity.ide.vscode": "1.2.3", 6 | "com.unity.test-framework": "1.1.22", 7 | "com.unity.textmeshpro": "2.1.1", 8 | "com.unity.timeline": "1.2.18", 9 | "com.unity.ugui": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.androidjni": "1.0.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.assetbundle": "1.0.0", 14 | "com.unity.modules.audio": "1.0.0", 15 | "com.unity.modules.cloth": "1.0.0", 16 | "com.unity.modules.director": "1.0.0", 17 | "com.unity.modules.imageconversion": "1.0.0", 18 | "com.unity.modules.imgui": "1.0.0", 19 | "com.unity.modules.jsonserialize": "1.0.0", 20 | "com.unity.modules.particlesystem": "1.0.0", 21 | "com.unity.modules.physics": "1.0.0", 22 | "com.unity.modules.physics2d": "1.0.0", 23 | "com.unity.modules.screencapture": "1.0.0", 24 | "com.unity.modules.terrain": "1.0.0", 25 | "com.unity.modules.terrainphysics": "1.0.0", 26 | "com.unity.modules.tilemap": "1.0.0", 27 | "com.unity.modules.ui": "1.0.0", 28 | "com.unity.modules.uielements": "1.0.0", 29 | "com.unity.modules.umbra": "1.0.0", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.modules.unitywebrequest": "1.0.0", 32 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 33 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 34 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 35 | "com.unity.modules.unitywebrequestwww": "1.0.0", 36 | "com.unity.modules.vehicles": "1.0.0", 37 | "com.unity.modules.video": "1.0.0", 38 | "com.unity.modules.vr": "1.0.0", 39 | "com.unity.modules.wind": "1.0.0", 40 | "com.unity.modules.xr": "1.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Enjin Test Project/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Thu Jan 21 09:28:49 2021 3 | 4 | Packages were changed. 5 | Update Mode: mergeDefaultDependencies 6 | 7 | The following packages were added: 8 | com.unity.collab-proxy@1.2.16 9 | com.unity.ide.rider@1.1.4 10 | com.unity.ide.vscode@1.2.3 11 | com.unity.modules.ai@1.0.0 12 | com.unity.modules.androidjni@1.0.0 13 | com.unity.modules.animation@1.0.0 14 | com.unity.modules.assetbundle@1.0.0 15 | com.unity.modules.audio@1.0.0 16 | com.unity.modules.cloth@1.0.0 17 | com.unity.modules.director@1.0.0 18 | com.unity.modules.imageconversion@1.0.0 19 | com.unity.modules.imgui@1.0.0 20 | com.unity.modules.jsonserialize@1.0.0 21 | com.unity.modules.particlesystem@1.0.0 22 | com.unity.modules.physics@1.0.0 23 | com.unity.modules.physics2d@1.0.0 24 | com.unity.modules.screencapture@1.0.0 25 | com.unity.modules.terrain@1.0.0 26 | com.unity.modules.terrainphysics@1.0.0 27 | com.unity.modules.tilemap@1.0.0 28 | com.unity.modules.ui@1.0.0 29 | com.unity.modules.uielements@1.0.0 30 | com.unity.modules.umbra@1.0.0 31 | com.unity.modules.unityanalytics@1.0.0 32 | com.unity.modules.unitywebrequest@1.0.0 33 | com.unity.modules.unitywebrequestassetbundle@1.0.0 34 | com.unity.modules.unitywebrequestaudio@1.0.0 35 | com.unity.modules.unitywebrequesttexture@1.0.0 36 | com.unity.modules.unitywebrequestwww@1.0.0 37 | com.unity.modules.vehicles@1.0.0 38 | com.unity.modules.video@1.0.0 39 | com.unity.modules.vr@1.0.0 40 | com.unity.modules.wind@1.0.0 41 | com.unity.modules.xr@1.0.0 42 | com.unity.test-framework@1.1.19 43 | com.unity.textmeshpro@2.1.1 44 | com.unity.timeline@1.2.17 45 | com.unity.ugui@1.0.0 46 | 47 | === Tue Mar 9 20:31:23 2021 48 | 49 | Packages were changed. 50 | Update Mode: updateDependencies 51 | 52 | The following packages were updated: 53 | com.unity.test-framework from version 1.1.19 to 1.1.22 54 | com.unity.timeline from version 1.2.17 to 1.2.18 55 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinUsers.cs: -------------------------------------------------------------------------------- 1 | using Enjin.SDK.DataTypes; 2 | using Enjin.SDK.GraphQL; 3 | using Enjin.SDK.Utility; 4 | using UnityEngine; 5 | 6 | namespace Enjin.SDK.Core 7 | { 8 | public class EnjinUsers 9 | { 10 | /// 11 | /// Creates a new User 12 | /// 13 | /// User's username 14 | /// Created user object 15 | public User Create(string name) 16 | { 17 | GraphQuery.POST(string.Format(Enjin.UserTemplate.GetQuery["CreateUser"], name)); 18 | 19 | if (Enjin.ServerResponse == ResponseCodes.SUCCESS) 20 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 21 | 22 | return null; 23 | } 24 | 25 | /// 26 | /// Gets a specified user from the current application 27 | /// 28 | /// ID of user to get 29 | /// Specified User 30 | public User Get(int id) 31 | { 32 | GraphQuery.POST(string.Format(Enjin.UserTemplate.GetQuery["GetUserForId"], id.ToString())); 33 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 34 | } 35 | 36 | /// 37 | /// Gets a specified user from the current application 38 | /// 39 | /// ID of user to get 40 | /// Specified User 41 | public User Get(string name) 42 | { 43 | GraphQuery.POST(string.Format(Enjin.UserTemplate.GetQuery["GetUserForName"], name)); 44 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 45 | } 46 | 47 | public User GetCurrentUser() 48 | { 49 | GraphQuery.POST(Enjin.UserTemplate.GetQuery["GetCurrentUser"]); 50 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/ENJ.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5cfa143a6be986b4eb315b3718bf8daf 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/BG01.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 521fa56b49b488d41aaff00040ceadf2 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/TrashCan.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ac982d7ebd985e4fade3c07642d1f6a 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/clipboard.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c867b48567a31af47b5f520d2748d9c6 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/enj-large-png.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6473402986489ea4387819c4566dfdaf 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Resources/Textures/enjin-logo-mark-white.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b03ea13a98cd94caf8c7a2e4359c5b 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinUIManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using UnityEngine.Events; 6 | using Enjin.SDK.Core; 7 | 8 | public class EnjinUIManager : MonoBehaviour 9 | { 10 | [SerializeField] PlatformSelector _platformSelector; 11 | 12 | [SerializeField] Canvas _loginAppCanvas; 13 | [SerializeField] Button _loginAppButton; 14 | [SerializeField] InputField _appIdInputField; 15 | [SerializeField] InputField _appSecretInputField; 16 | 17 | [SerializeField] Canvas _loginUserCanvas; 18 | [SerializeField] Button _loginUserButton; 19 | [SerializeField] InputField _userName; 20 | 21 | [SerializeField] Canvas _identityCanvas; 22 | [SerializeField] Button _queryIdentityButton; 23 | [SerializeField] Text _identityText; 24 | 25 | [SerializeField] Text _loggedInAppId; 26 | [SerializeField] Text _loggedInUserName; 27 | [SerializeField] Text _accessToken; 28 | 29 | public int EnjinAppId 30 | { 31 | get { return System.Convert.ToInt32(_appIdInputField.text); } 32 | set { _loggedInAppId.text = value.ToString(); } 33 | } 34 | 35 | public string EnjinAppSecret 36 | { 37 | get { return _appSecretInputField.text; } 38 | } 39 | 40 | public string EnjinPlatformURL 41 | { 42 | get { return _platformSelector.GetPlatformURL(); } 43 | } 44 | 45 | public string UserName 46 | { 47 | get { return _userName.text; } 48 | set { _loggedInUserName.text = value; } 49 | } 50 | 51 | public string AccessToken 52 | { 53 | get { return _accessToken.text; } 54 | set { _accessToken.text = value; } 55 | } 56 | 57 | public void RegisterAppLoginEvent(UnityAction action) 58 | { 59 | _loginAppButton.onClick.AddListener(action); 60 | } 61 | 62 | public void RegisterUserLoginEvent(UnityAction action) 63 | { 64 | _loginUserButton.onClick.AddListener(action); 65 | } 66 | 67 | public void RegisterGetIdentityEvent(UnityAction action) 68 | { 69 | _queryIdentityButton.onClick.AddListener(action); 70 | } 71 | 72 | public void EnableUserLoginUI() 73 | { 74 | _loginUserCanvas.enabled = true; 75 | } 76 | 77 | public void DisableAppLoginUI() 78 | { 79 | _loginAppCanvas.enabled = false; 80 | _platformSelector.DisableInteractable(); 81 | } 82 | 83 | public void DisableUserLoginUI() 84 | { 85 | _loginUserCanvas.enabled = false; 86 | _identityCanvas.enabled = true; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Helper/DataFactoryHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Enjin.SDK.PusherClient.Helper 4 | { 5 | public static class DataFactoryHelper 6 | { 7 | // utility method for loading string value from dictory, or default if not set 8 | public static string GetDictonaryValue(Dictionary dictionary, string key, string defaultValue = "") 9 | { 10 | if (dictionary.ContainsKey(key)) 11 | { 12 | if (dictionary[key] is string) 13 | { 14 | return (string) dictionary[key]; 15 | } 16 | else if (dictionary[key] != null) 17 | { 18 | return dictionary[key].ToString(); 19 | } 20 | } 21 | 22 | return defaultValue; 23 | } 24 | 25 | public static int GetDictonaryInt(Dictionary dictionary, string key, int defaultValue) 26 | { 27 | string str = GetDictonaryValue(dictionary, key, "null"); 28 | int result = defaultValue; 29 | if (str != "null") 30 | { 31 | if (!int.TryParse(str, out result)) 32 | { 33 | // Debug.LogWarning( "Failed to parse value as int, going with default. Value was: '" + str + "', for key: '"+key+"'" ); 34 | result = defaultValue; 35 | } 36 | } 37 | 38 | return result; 39 | } 40 | 41 | public static double GetDictionaryDouble(Dictionary dictionary, string key, double defaultValue) 42 | { 43 | if (!dictionary.ContainsKey(key)) 44 | { 45 | return defaultValue; 46 | } 47 | else 48 | { 49 | object val = dictionary[key]; 50 | if (val is double) 51 | { 52 | return (double) val; 53 | } 54 | else 55 | { 56 | return double.Parse(val.ToString()); 57 | } 58 | } 59 | } 60 | 61 | public static bool GetDictonaryBool(Dictionary dictionary, string key, bool defaultValue) 62 | { 63 | string str = GetDictonaryValue(dictionary, key, "null"); 64 | return str != "null" ? bool.Parse(str) : defaultValue; 65 | } 66 | 67 | public static T EnumFromString(string str) 68 | { 69 | System.Type enumType = typeof(T); 70 | T[] enumValues = (T[]) System.Enum.GetValues(enumType); 71 | foreach (T enumVal in enumValues) 72 | { 73 | if (enumVal.ToString() == str) 74 | return enumVal; 75 | } 76 | 77 | throw new System.Exception(str + " is not a valid enum type for: " + enumType.ToString()); 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinCryptoItems.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using Enjin.SDK.GraphQL; 5 | using Enjin.SDK.Utility; 6 | using SimpleJSON; 7 | using UnityEngine; 8 | 9 | namespace Enjin.SDK.Core 10 | { 11 | public class EnjinCryptoItems 12 | { 13 | /// 14 | /// Gets all items in a pagination format 15 | /// 16 | /// Page to get 17 | /// Total items per page 18 | /// Identity ID of user 19 | /// 20 | public PaginationHelper GetItems(int page, int limit) 21 | { 22 | string query = string.Empty; 23 | 24 | if (limit == 0) 25 | query = 26 | @"query getAllItems{result:EnjinTokens(pagination:{page:$page^}){items{index,id,name,creator,totalSupply,reserve,circulatingSupply,supplyModel,meltValue,meltFeeRatio,meltFeeMaxRatio,transferable,transferFeeSettings{type,tokenId,value},nonFungible,icon,markedForDelete}cursor{total,hasPages,perPage,currentPage}}}"; 27 | else 28 | { 29 | query = 30 | @"query getAllItems{result:EnjinTokens(pagination:{limit:$limit^,page:$page^}){items{index,id,name,creator,totalSupply,reserve,circulatingSupply,supplyModel,meltValue,meltFeeRatio,meltFeeMaxRatio,transferable,transferFeeSettings{type,tokenId,value},nonFungible,icon,markedForDelete}cursor{total,hasPages,perPage,currentPage}}}"; 31 | GraphQuery.variable["limit"] = limit.ToString(); 32 | } 33 | 34 | GraphQuery.variable["page"] = page.ToString(); 35 | GraphQuery.POST(query); 36 | 37 | return JsonUtility.FromJson>(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 38 | } 39 | 40 | /// 41 | /// Gets a CryptoItem by it's ID 42 | /// 43 | /// ID of CryptoItem 44 | /// CryptoItem of ID requested 45 | public CryptoItem Get(string id) 46 | { 47 | string query = string.Empty; 48 | 49 | try 50 | { 51 | query = 52 | "query getCryptoItem{result:EnjinTokens(id:\"$id^\"){id,name,totalSupply,reserve,circulatingSupply,supplyModel,meltValue,meltFeeRatio,transferable,transferFeeSettings{type,tokenId,value},nonFungible,markedForDelete,itemURI}}"; 53 | GraphQuery.variable["id"] = id.ToString(); 54 | GraphQuery.POST(query); 55 | 56 | var tData = JsonUtility.FromJson>( 57 | EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 1)); 58 | 59 | return tData.result[0]; 60 | } 61 | catch (Exception err) 62 | { 63 | Debug.LogWarning(err); 64 | } 65 | 66 | return null; 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/PresenceChannel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Enjin.SDK.PusherClient 4 | { 5 | public delegate void MemberEventHandler(object sender); 6 | 7 | public class PresenceChannel : PrivateChannel 8 | { 9 | public Dictionary Members = new Dictionary(); 10 | 11 | public event MemberEventHandler MemberAdded; 12 | public event MemberEventHandler MemberRemoved; 13 | 14 | public PresenceChannel(string channelName, Pusher pusher) : base(channelName, pusher) 15 | { 16 | } 17 | 18 | #region Internal Methods 19 | 20 | internal override void SubscriptionSucceeded(string data) 21 | { 22 | Members = ParseMembersList(data); 23 | base.SubscriptionSucceeded(data); 24 | } 25 | 26 | internal void AddMember(string data) 27 | { 28 | var member = ParseMember(data); 29 | 30 | if (!Members.ContainsKey(member.Key)) 31 | Members.Add(member.Key, member.Value); 32 | else 33 | Members[member.Key] = member.Value; 34 | 35 | if (MemberAdded != null) 36 | MemberAdded(this); 37 | } 38 | 39 | internal void RemoveMember(string data) 40 | { 41 | var member = ParseMember(data); 42 | 43 | if (Members.ContainsKey(member.Key)) 44 | { 45 | Members.Remove(member.Key); 46 | 47 | if (MemberRemoved != null) 48 | MemberRemoved(this); 49 | } 50 | } 51 | 52 | #endregion 53 | 54 | #region Private Methods 55 | 56 | private Dictionary ParseMembersList(string data) 57 | { 58 | Dictionary members = new Dictionary(); 59 | return members; 60 | 61 | /* 62 | Dictionary dataAsDict = JsonHelper.Deserialize>(data); 63 | Dictionary presenceDict = (Dictionary)dataAsDict[ "presence" ]; 64 | foreach( KeyValuePair presenceKvp in dataAsDict ) { 65 | string 66 | i++; 67 | } 68 | 69 | for (int i = 0; i < (int)dataAsObj.presence.count; i++) 70 | { 71 | var id = (string)dataAsObj.presence.ids[i]; 72 | var val = (dynamic)dataAsObj.presence.hash[id]; 73 | members.Add(id, val); 74 | } 75 | 76 | return members; 77 | */ 78 | } 79 | 80 | private KeyValuePair ParseMember(string data) 81 | { 82 | /* 83 | var dataAsObj = JsonHelper.Deserialize(data); 84 | 85 | var id = (string)dataAsObj.user_id; 86 | var val = (dynamic)dataAsObj.user_info; 87 | 88 | return new KeyValuePair(id, val); 89 | */ 90 | 91 | var id = ""; 92 | var val = ""; 93 | return new KeyValuePair(id, val); 94 | } 95 | 96 | #endregion 97 | } 98 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using Enjin.SDK.DataTypes; 6 | 7 | namespace Enjin.SDK.Core 8 | { 9 | public class EnjinManager : MonoBehaviour 10 | { 11 | [SerializeField] private EnjinUIManager _enjinUIManager; 12 | 13 | User _currentEnjinUser = null; 14 | bool _isConnecting = false; 15 | string _accessToken = null; 16 | 17 | private void Awake() 18 | { 19 | Enjin.IsDebugLogActive = true; 20 | } 21 | 22 | private void Start() 23 | { 24 | _enjinUIManager.RegisterAppLoginEvent(() => 25 | { 26 | if (Enjin.LoginState == LoginState.VALID) 27 | return; 28 | 29 | if (_isConnecting) 30 | return; 31 | 32 | _isConnecting = true; 33 | StartCoroutine(AppLoginRoutine()); 34 | }); 35 | 36 | _enjinUIManager.RegisterUserLoginEvent(() => 37 | { 38 | if (Enjin.LoginState != LoginState.VALID) 39 | return; 40 | 41 | _currentEnjinUser = Enjin.GetUser(_enjinUIManager.UserName); 42 | _accessToken = Enjin.AccessToken; 43 | 44 | Debug.Log($"[Logined User ID] {_currentEnjinUser.id}"); 45 | Debug.Log($"[Logined User name] {_currentEnjinUser.name}"); 46 | 47 | _enjinUIManager.UserName = _currentEnjinUser.name; 48 | _enjinUIManager.AccessToken = _accessToken; 49 | _enjinUIManager.DisableUserLoginUI(); 50 | }); 51 | 52 | _enjinUIManager.RegisterGetIdentityEvent(() => 53 | { 54 | if (Enjin.LoginState != LoginState.VALID) 55 | return; 56 | 57 | for (int i = 0; i < _currentEnjinUser.identities.Length; ++i) 58 | { 59 | Debug.Log($"[{i} Identity ID] {_currentEnjinUser.identities[i].id}"); 60 | Debug.Log($"[{i} Identity linking Code] {_currentEnjinUser.identities[i].linkingCode}"); 61 | Debug.Log($"[{i} Identity Wallet :: Eth Address] {_currentEnjinUser.identities[i].wallet.ethAddress}"); 62 | } 63 | }); 64 | 65 | // TO DO : BindEvent from pusher 66 | } 67 | 68 | private IEnumerator AppLoginRoutine() 69 | { 70 | Enjin.StartPlatform(_enjinUIManager.EnjinPlatformURL, 71 | _enjinUIManager.EnjinAppId, _enjinUIManager.EnjinAppSecret); 72 | 73 | int tick = 0; 74 | YieldInstruction waitASecond = new WaitForSeconds(1f); 75 | while (tick < 10) 76 | { 77 | if (Enjin.LoginState == LoginState.VALID) 78 | { 79 | Debug.Log("App auth success"); 80 | _enjinUIManager.EnjinAppId = Enjin.AppID; 81 | _enjinUIManager.DisableAppLoginUI(); 82 | _enjinUIManager.EnableUserLoginUI(); 83 | yield break; 84 | } 85 | 86 | tick++; 87 | yield return waitASecond; 88 | } 89 | 90 | Debug.Log("App auth Failed"); 91 | _isConnecting = false; 92 | 93 | yield return null; 94 | } 95 | } 96 | } 97 | 98 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinIdentities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using Enjin.SDK.GraphQL; 5 | using Enjin.SDK.Utility; 6 | using SimpleJSON; 7 | using UnityEngine; 8 | 9 | namespace Enjin.SDK.Core 10 | { 11 | public class EnjinIdentities 12 | { 13 | 14 | /// 15 | /// Gets a specific identity 16 | /// 17 | /// ID of identity to get 18 | /// Identity associated with passed id 19 | public Identity Get(int id) 20 | { 21 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["GetIdentity"], id.ToString())); 22 | 23 | if (Enjin.ServerResponse != ResponseCodes.SUCCESS) 24 | return null; 25 | 26 | return JsonUtility 27 | .FromJson>(EnjinHelpers.GetJSONString( 28 | Regex.Replace(GraphQuery.queryReturn, @"(""[^""\\]*(?:\\.[^""\\]*)*"")|\s+", "$1"), 1)).result[0]; 29 | } 30 | 31 | /// 32 | /// Creates a new identity 33 | /// 34 | /// New Identity to create 35 | /// Created Identity 36 | public Identity Create(Identity newIdentity) 37 | { 38 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["CreateIdentity"], 39 | newIdentity.user.id.ToString(), newIdentity.wallet.ethAddress)); 40 | 41 | if (Enjin.ServerResponse != ResponseCodes.SUCCESS) 42 | return null; 43 | 44 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 1)); 45 | } 46 | 47 | /// 48 | /// Updates an Identty 49 | /// 50 | /// Identity to update 51 | /// Updated Identity 52 | public Identity Update(Identity identity) 53 | { 54 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["UpdateIdentity"], identity.id.ToString(), 55 | identity.user.id.ToString(), identity.wallet.ethAddress)); 56 | 57 | if (Enjin.ServerResponse != ResponseCodes.SUCCESS) 58 | return null; 59 | 60 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 1)); 61 | } 62 | 63 | /// 64 | /// Deletes an identity. if user attached to it, it's deleted as well 65 | /// 66 | /// Identitiy ID to delete 67 | /// true/false on success 68 | public bool Delete(string id) 69 | { 70 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["DeleteIdentity"], id.ToString())); 71 | 72 | if (Enjin.ServerResponse != ResponseCodes.SUCCESS) 73 | return false; 74 | 75 | return true; 76 | } 77 | 78 | /// 79 | /// Unlinks identity from wallet 80 | /// 81 | /// ID of identity to unlink 82 | /// Updated identity 83 | public bool UnLink(int id) 84 | { 85 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["UnlinkIdentity"], id.ToString())); 86 | 87 | if (Enjin.ServerResponse != ResponseCodes.SUCCESS) 88 | return false; 89 | 90 | return true; 91 | } 92 | 93 | public Wallet GetWalletBalances(string ethAddress) 94 | { 95 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["GetWalletBalances"], ethAddress)); 96 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 97 | } 98 | 99 | public Wallet GetWalletBalancesForApp(string ethAddress, int appId) 100 | { 101 | GraphQuery.POST(string.Format(Enjin.IdentityTemplate.GetQuery["GetWalletBalancesForApp"], ethAddress, appId.ToString())); 102 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Utility/EnjinHelpers.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using WebSocketSharp; 3 | 4 | namespace Enjin.SDK.Utility 5 | { 6 | public class EnjinHelpers 7 | { 8 | // Lookup Table for generating passwords 9 | private static string[] lookup = {"abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "1234567890"}; 10 | 11 | /// 12 | /// Converts int to a boolian string 13 | /// 14 | /// Int to convert 15 | /// Boolian in string format ("True" / "False") 16 | public static string IntToBoolString(int num) 17 | { 18 | return (num == 1) ? "True" : "False"; 19 | } 20 | 21 | /// 22 | /// JSON stripper to remove the first and/or second level data headers 23 | /// 24 | /// JSON string 25 | /// Number of header levels to strip ( 1 / 2) 26 | /// Stripped Header level of JSON string 27 | public static string GetJSONString(string str, int levels) 28 | { 29 | return GetJSONString(str, ':', levels); 30 | } 31 | 32 | /// 33 | /// JSON stripper to remove the first and/or second level data headers 34 | /// 35 | /// JSON string 36 | /// Stripped header 2 levels of JSON string 37 | public static string GetJSONString(string str) 38 | { 39 | return GetJSONString(str, ':', 2); 40 | } 41 | 42 | /// 43 | /// Generates pass code with 12 characters by default 44 | /// 45 | /// 12 character pass code 46 | public static string GeneratePassCode() 47 | { 48 | return GeneratePassCode(12); 49 | } 50 | 51 | /// 52 | /// Gets the level of the JSON string based on lead string name 53 | /// 54 | /// String to parse 55 | /// Symbol to parse from (default is ':') 56 | /// 1 = non-array level, 2 = array level 57 | /// 58 | public static string GetJSONString(string str, char symbol, int levels) 59 | { 60 | if (str.IsNullOrEmpty()) 61 | return str; 62 | 63 | int index = str.IndexOf(symbol) + 1; 64 | 65 | str = str.Substring(index, str.Length - 1 - index); 66 | 67 | if (levels >= 2) 68 | { 69 | index = str.IndexOf(symbol) + 1; 70 | if (str[index].Equals('[')) 71 | { 72 | str = str.Substring(index, str.Length - 2 - index); 73 | } 74 | else 75 | { 76 | str = str.Substring(index, str.Length - 1 - index); 77 | } 78 | } 79 | 80 | if (levels == 3) 81 | { 82 | index = str.IndexOf(symbol) + 1; 83 | str = str.Substring(index, str.Length - 1 - index); 84 | } 85 | 86 | return str; 87 | } 88 | 89 | /// 90 | /// Generates a pass code with N number of characters 91 | /// 92 | /// Number of characters pass code should contain 93 | /// N character pass code 94 | public static string GeneratePassCode(int length) 95 | { 96 | string word = ""; 97 | int rnd; 98 | 99 | for (int i = 0; i < length; i++) 100 | { 101 | rnd = Random.Range(0, 3); 102 | word += lookup[rnd][Random.Range(0, lookup[rnd].Length)]; 103 | } 104 | 105 | return word; 106 | } 107 | 108 | public static bool IsNullOrEmpty(T[] array) 109 | { 110 | return array == null || array.Length < 1; 111 | } 112 | 113 | public static bool IsNullOrEmpty(string str) 114 | { 115 | return str == null || str.Length < 1; 116 | } 117 | } 118 | 119 | public class EnjinHelpers 120 | { 121 | public static string ConvertToJSONArrayString(T[] str) 122 | { 123 | string result = "["; 124 | 125 | for (int i = 0; i < str.Length; i++) 126 | { 127 | if (typeof(T).ToString() == "System.String") 128 | result += '"' + str[i].ToString() + '"'; 129 | else 130 | result += str[i].ToString(); 131 | 132 | if (i != str.Length - 1) 133 | result += ","; 134 | } 135 | 136 | result += "]"; 137 | 138 | return result; 139 | } 140 | } 141 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/EnjinWallet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | //using XLegacyEnjinSDK; 4 | using System; 5 | using System.Collections; 6 | using Enjin.SDK.Core; 7 | using Enjin.SDK.DataTypes; 8 | 9 | namespace Enjin.SDK.Core 10 | { 11 | public class EnjinWallet : MonoBehaviour 12 | { 13 | 14 | [SerializeField] string PLATFORM_URL; 15 | [SerializeField] string DEVELOPER_USERNAME; 16 | [SerializeField] int DEVELOPER_IDENTITY_ID; 17 | [SerializeField] int APP_ID; 18 | [SerializeField] string ACCESS_TOKEN; 19 | [SerializeField] string APP_SECRET; 20 | [SerializeField] string PLAYER_ID; 21 | 22 | string DEVELOPER_ADDRESS; 23 | string DEVELOPER_ACCESS_TOKEN; 24 | 25 | int PLAYER_IDENTITY_ID; 26 | string APP_LINK_CODE; 27 | string PLAYER_ADDRESS; 28 | 29 | private void Awake() 30 | { 31 | Enjin.IsDebugLogActive = true; 32 | Enjin.StartPlatform(PLATFORM_URL, APP_ID, APP_SECRET); 33 | StartCoroutine(LoginEnjin()); 34 | } 35 | 36 | public IEnumerator LoginEnjin() 37 | { 38 | yield return null; 39 | 40 | while (Enjin.LoginState != LoginState.VALID) 41 | { 42 | Debug.Log("Connecting"); 43 | yield return null; 44 | } 45 | 46 | Debug.Log("Connected"); 47 | Debug.Log($"Access Token : {Enjin.AccessToken}"); 48 | 49 | //Enjin.StartPlatformWithToken(PLATFORM_URL, APP_ID, ACCESS_TOKEN); 50 | 51 | User admin = Enjin.GetUser(DEVELOPER_USERNAME); 52 | DEVELOPER_ACCESS_TOKEN = Enjin.AccessToken; 53 | 54 | User player = Enjin.GetUser(PLAYER_ID); 55 | 56 | if (player == null) 57 | { 58 | Debug.Log("플레이어 Get 실패"); 59 | Debug.Log("플레이어 생성"); 60 | player = Enjin.CreatePlayer(PLAYER_ID); 61 | } 62 | 63 | Debug.Log($"Get Player Success : {player.name}"); 64 | 65 | for (int i = 0; i < player.identities.Length; i++) 66 | { 67 | Debug.Log("PLAYER NAME : " + player.name); 68 | 69 | Identity identity = player.identities[i]; 70 | 71 | Enjin.CreateIdentity(identity); 72 | if (identity.app.id == APP_ID) 73 | { 74 | PLAYER_IDENTITY_ID = identity.id; 75 | PLAYER_ADDRESS = identity.wallet.ethAddress; 76 | APP_LINK_CODE = identity.linkingCode; 77 | print("_IDENTITY_ID:: " + PLAYER_IDENTITY_ID); 78 | print("_ADDRESS::" + PLAYER_ADDRESS); 79 | print("_ADDRESS_LENGTH::" + PLAYER_ADDRESS.Length); 80 | print("_LINKING_CODE::" + APP_LINK_CODE); 81 | 82 | } 83 | } 84 | 85 | 86 | // Enjin.CreatePlayer(PLAYER_EMAIL); 87 | print(Enjin.AuthPlayer(PLAYER_ID)); 88 | 89 | 90 | yield return null; 91 | } 92 | 93 | IEnumerator MintItem(string itemName, int quantity) 94 | { 95 | string itemId = itemName; 96 | print(Enjin.GetCryptoItemURI(itemId)); 97 | 98 | Enjin.MintFungibleItem(DEVELOPER_IDENTITY_ID, new string[] { PLAYER_ADDRESS }, itemId, quantity, 99 | (requestData) => 100 | { 101 | 102 | print("Item Minted::" + itemName); 103 | 104 | }, true); 105 | 106 | yield return null; 107 | } 108 | 109 | 110 | IEnumerator SendItem(string itemName, int quantiy) 111 | { 112 | string itemId = itemName; 113 | Enjin.SendCryptoItemRequest(PLAYER_IDENTITY_ID, itemName, DEVELOPER_IDENTITY_ID, quantiy, (requestData) => 114 | { 115 | print("Item Sended::" + itemName); 116 | }, true); 117 | 118 | 119 | 120 | yield return null; 121 | } 122 | 123 | 124 | IEnumerator MeltItem(string itemName, int quantity) 125 | { 126 | string itemId = itemName; 127 | Enjin.MeltTokens(PLAYER_IDENTITY_ID, itemId, quantity, (requestData) => 128 | { 129 | print("Item Melted::" + itemName); 130 | }, true); 131 | 132 | yield return null; 133 | } 134 | 135 | 136 | 137 | public void GetItem(string name) 138 | { 139 | print("Verifying transaction.."); 140 | StartCoroutine(MintItem(name, 1)); 141 | } 142 | 143 | public void ReturnItem(string name) 144 | { 145 | print("Verifying transaction.."); 146 | StartCoroutine(MeltItem(name, 1)); 147 | 148 | } 149 | 150 | public void SendItemTo(string name) 151 | { 152 | print("Verifying transaction.."); 153 | StartCoroutine(SendItem(name, 1)); 154 | } 155 | 156 | } 157 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinEventManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Enjin.SDK.Core 5 | { 6 | /// 7 | /// 8 | /// 9 | /// 10 | //public class EnjinAction 11 | //{ 12 | // public Action Action { get; set; } 13 | 14 | // public static Action operator + (EnjinAction a1, EnjinAction a2) 15 | // { 16 | // return a1.Action = => a2.Action; 17 | // } 18 | //} 19 | 20 | /// 21 | /// Event Manager replacement model using C# Action (Delegate) model versus UnityEvent model. 22 | /// Abstract Action is used in the dictionary to provide support for elements beyond the SDK 23 | /// allowing this Event Manager to be used by clients in their applications for events outside 24 | /// of the Enjin SDK scope. 25 | /// 26 | /// Similiarly, the Event Manager is provided with MonoBehavior support allowing it to be used 27 | /// with game objects. 28 | /// 29 | public class EnjinEventManager //: MonoBehaviour 30 | { 31 | #region Private Vars 32 | 33 | private static EnjinEventManager _enjinEventManager; 34 | private Dictionary> _requestEventDictionary; 35 | 36 | #endregion 37 | 38 | #region Manager and Init Methods 39 | 40 | /// 41 | /// Create a new unique manager instance if one does not already exist 42 | /// 43 | public static EnjinEventManager instance 44 | { 45 | get 46 | { 47 | if (_enjinEventManager == null) 48 | { 49 | // To use this event manager as an object attached script, add : MonoBehaviour to the class 50 | // declaration. 51 | #if UNITY_EDITOR 52 | //if (Application.isPlaying) 53 | //{ 54 | // _enjinEventManager = FindObjectOfType(typeof(EnjinEventManager)) as EnjinEventManager; 55 | //} 56 | // and comment out the following. 57 | #endif 58 | if (_enjinEventManager == null) 59 | { 60 | _enjinEventManager = new EnjinEventManager(); 61 | _enjinEventManager.Init(); 62 | } 63 | } 64 | 65 | return _enjinEventManager; 66 | } 67 | } 68 | 69 | /// 70 | /// Initialize the event and action dictionaries 71 | /// 72 | private void Init() 73 | { 74 | if (_requestEventDictionary == null) 75 | { 76 | _requestEventDictionary = new Dictionary>(); 77 | } 78 | } 79 | 80 | #endregion 81 | 82 | #region General Methods 83 | 84 | public void StartListening(string eventName, Action listener) 85 | { 86 | Action thisEvent; 87 | if (instance._requestEventDictionary.TryGetValue(eventName, out thisEvent)) 88 | { 89 | // add to the current event. 90 | thisEvent += listener; 91 | 92 | // update the dictionary now. 93 | instance._requestEventDictionary[eventName] = thisEvent; 94 | } 95 | else 96 | { 97 | // add the event to the dictionary (first pass) 98 | thisEvent += listener; 99 | instance._requestEventDictionary.Add(eventName, thisEvent); 100 | } 101 | } 102 | 103 | public void StopListening(string eventName, Action listener) 104 | { 105 | if (_enjinEventManager == null) return; 106 | Action thisEvent; 107 | if (instance._requestEventDictionary.TryGetValue(eventName, out thisEvent)) 108 | { 109 | // remove event 110 | thisEvent -= listener; 111 | 112 | // update the dictionary 113 | instance._requestEventDictionary[eventName] = thisEvent; 114 | } 115 | } 116 | 117 | public Action FetchAction(string eventName) 118 | { 119 | Action thisAction = null; 120 | if (instance._requestEventDictionary.TryGetValue(eventName, out thisAction)) 121 | { 122 | return thisAction; 123 | } 124 | 125 | return null; 126 | } 127 | 128 | public void TriggerEvent(string eventName, RequestEvent request) 129 | { 130 | Action thisAction = null; 131 | if (instance._requestEventDictionary.TryGetValue(eventName, out thisAction)) 132 | { 133 | thisAction.Invoke(request); 134 | } 135 | } 136 | 137 | #endregion 138 | } 139 | } -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /Enjin Test Project/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/GraphQL/GraphQuery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.Networking; 8 | 9 | namespace Enjin.SDK.GraphQL 10 | { 11 | public class GraphQuery : MonoBehaviour 12 | { 13 | public static GraphQuery instance = null; 14 | 15 | public delegate void QueryComplete(); 16 | 17 | public enum Status 18 | { 19 | Neutral, 20 | Loading, 21 | Complete, 22 | Error 23 | }; 24 | 25 | public static Status queryStatus; 26 | public static string queryReturn; 27 | 28 | public class Query 29 | { 30 | public string query; 31 | } 32 | 33 | public void Awake() 34 | { 35 | if (instance == null) 36 | { 37 | instance = this; 38 | } 39 | else if (instance != this) 40 | { 41 | Destroy(gameObject); 42 | } 43 | 44 | DontDestroyOnLoad(gameObject); 45 | } 46 | 47 | public static Dictionary variable = new Dictionary(); 48 | public static Dictionary array = new Dictionary(); 49 | 50 | public static string GetEndPointData(string endpoint) 51 | { 52 | var client = new WebClient(); 53 | client.Headers.Add(HttpRequestHeader.Accept, "application/json"); 54 | client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); 55 | client.Headers.Add(HttpRequestHeader.UserAgent, "Enjin-Unity-SDK-1.0.8"); 56 | var response = client.DownloadString(endpoint); 57 | return response; 58 | } 59 | 60 | public static void POST(string details) 61 | { 62 | POST(details, "", false, null); 63 | } 64 | 65 | public static void POST(string details, string token) 66 | { 67 | POST(details, token, false, null); 68 | } 69 | 70 | public static void POST(string details, bool async) 71 | { 72 | POST(details, "", async, null); 73 | } 74 | 75 | public static void POST(string details, string token, bool async, System.Action handler) 76 | { 77 | details = details.Trim('\r'); 78 | details = QuerySorter(details); 79 | string jsonData = ""; 80 | 81 | Query query = new Query {query = details}; 82 | jsonData = JsonUtility.ToJson(query); 83 | 84 | if (Enjin.SDK.Core.Enjin.IsDebugLogActive) 85 | { 86 | if (!jsonData.Contains("password:") && !jsonData.Contains("accessTokens:")) 87 | Debug.Log("[GRAPHQL QUERY] " + jsonData); 88 | } 89 | 90 | UnityWebRequest request = UnityWebRequest.Post(Enjin.SDK.Core.Enjin.GraphQLURL, UnityWebRequest.kHttpVerbPOST); 91 | request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(jsonData)) as UploadHandler; 92 | request.SetRequestHeader("Content-Type", "application/json; charset=utf-8"); 93 | 94 | if (token != "login") 95 | request.SetRequestHeader("Authorization", "Bearer " + Enjin.SDK.Core.Enjin.AccessToken); 96 | 97 | request.downloadHandler = new DownloadHandlerBuffer(); 98 | 99 | if (request.error != null) 100 | { 101 | Enjin.SDK.Core.Enjin.IsRequestValid(request.responseCode, request.downloadHandler.text); 102 | } 103 | else 104 | { 105 | if (async) 106 | { 107 | instance.StartCoroutine(WaitForRequest(request, handler)); 108 | queryStatus = Status.Loading; 109 | } 110 | else if (!async) 111 | { 112 | request.SendWebRequest(); 113 | while (!request.isDone) 114 | { 115 | } 116 | 117 | if (Enjin.SDK.Core.Enjin.IsRequestValid(request.responseCode, request.downloadHandler.text)) 118 | { 119 | queryStatus = Status.Complete; 120 | queryReturn = request.downloadHandler.text; 121 | } 122 | } 123 | } 124 | 125 | // NOTE: Turn this conversion on once methods are updated to support this structure 126 | //queryReturn = Regex.Replace(queryReturn, @"(""[^""\\]*(?:\\.[^""\\]*)*"")|\s+", "$1"); 127 | 128 | if (Enjin.SDK.Core.Enjin.IsDebugLogActive && queryReturn != null) 129 | Debug.Log("[GRAPHQL RESULTS] " + queryReturn.ToString()); 130 | } 131 | 132 | static IEnumerator WaitForRequest(UnityWebRequest data, System.Action handler) 133 | { 134 | yield return data.SendWebRequest(); 135 | 136 | if (data.error != null) 137 | { 138 | Enjin.SDK.Core.Enjin.IsRequestValid(data.responseCode, data.downloadHandler.text); 139 | queryStatus = Status.Error; 140 | } 141 | else 142 | { 143 | if (Enjin.SDK.Core.Enjin.IsRequestValid(data.responseCode, data.downloadHandler.text)) 144 | { 145 | queryReturn = data.downloadHandler.text; 146 | queryStatus = Status.Complete; 147 | 148 | if (Enjin.SDK.Core.Enjin.IsDebugLogActive) 149 | Debug.Log("[GRAPHQL RESULTS] " + queryReturn); 150 | 151 | handler(queryReturn); 152 | } 153 | else 154 | queryReturn = "ERROR"; 155 | } 156 | } 157 | 158 | public static string QuerySorter(string query) 159 | { 160 | string finalString; 161 | string[] splitString; 162 | string[] separators = {"$", "^"}; 163 | 164 | splitString = query.Split(separators, StringSplitOptions.RemoveEmptyEntries); 165 | finalString = splitString[0]; 166 | 167 | for (int i = 1; i < splitString.Length; i++) 168 | { 169 | if (i % 2 == 0) 170 | { 171 | finalString += splitString[i]; 172 | } 173 | else 174 | { 175 | if (!splitString[i].Contains("[]")) 176 | { 177 | finalString += variable[splitString[i]]; 178 | } 179 | else 180 | { 181 | finalString += ArraySorter(splitString[i]); 182 | } 183 | } 184 | } 185 | 186 | return finalString; 187 | } 188 | 189 | public static string ArraySorter(string theArray) 190 | { 191 | string[] anArray; 192 | string solution; 193 | 194 | anArray = array[theArray]; 195 | solution = "["; 196 | 197 | for (int i = 0; i < anArray.Length; i++) 198 | { 199 | solution += "\"" + anArray[i]; 200 | 201 | if (i < anArray.Length - 1) 202 | solution += "\","; 203 | else 204 | solution += "\""; 205 | } 206 | 207 | solution += "]"; 208 | 209 | return solution; 210 | } 211 | } 212 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Connection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enjin.SDK.PusherClient.Helper; 4 | using WebSocketSharp; 5 | 6 | namespace Enjin.SDK.PusherClient 7 | { 8 | internal class Connection 9 | { 10 | private WebSocket _websocket = null; 11 | private string _socketId = null; 12 | private string _url = null; 13 | private Pusher _pusher = null; 14 | private ConnectionState _state = ConnectionState.Initialized; 15 | private bool _allowReconnect = true; 16 | 17 | public event ConnectedEventHandler Connected; 18 | public event ConnectionStateChangedEventHandler ConnectionStateChanged; 19 | 20 | #region Properties 21 | 22 | internal string SocketID 23 | { 24 | get { return _socketId; } 25 | } 26 | 27 | internal ConnectionState State 28 | { 29 | get { return _state; } 30 | } 31 | 32 | #endregion 33 | 34 | public Connection(Pusher pusher, string url) 35 | { 36 | this._url = url; 37 | this._pusher = pusher; 38 | } 39 | 40 | #region Internal Methods 41 | 42 | internal void Connect() 43 | { 44 | // TODO: Handle and test disconnection / errors etc 45 | // TODO: Add 'connecting_in' event 46 | 47 | ChangeState(ConnectionState.Connecting); 48 | _allowReconnect = true; 49 | 50 | _websocket = new WebSocket(_url); 51 | _websocket.OnError += websocket_Error; 52 | _websocket.OnOpen += websocket_Opened; 53 | _websocket.OnClose += websocket_Closed; 54 | _websocket.OnMessage += websocket_MessageReceived; 55 | _websocket.EmitOnPing = true; 56 | _websocket.ConnectAsync(); 57 | } 58 | 59 | internal void Disconnect() 60 | { 61 | _allowReconnect = false; 62 | _websocket.Close(); 63 | ChangeState(ConnectionState.Disconnected); 64 | } 65 | 66 | internal void Send(string message) 67 | { 68 | Pusher.Log("Sending: " + message); 69 | _websocket.SendAsync(message, delegate(bool obj) { }); 70 | } 71 | 72 | #endregion 73 | 74 | #region Private Methods 75 | 76 | private void ChangeState(ConnectionState state) 77 | { 78 | this._state = state; 79 | 80 | if (ConnectionStateChanged != null) 81 | ConnectionStateChanged(this, this._state); 82 | } 83 | 84 | private void websocket_MessageReceived(object sender, MessageEventArgs e) 85 | { 86 | Pusher.Log("Websocket message received: " + e.Data); 87 | 88 | if (e.IsPing) 89 | { 90 | Send("{\"event\": \"pusher:pong\"}"); 91 | return; 92 | } 93 | 94 | PusherEventData message = PusherEventData.FromJson(e.Data); 95 | _pusher.EmitEvent(message.eventName, message.data); 96 | 97 | if (message.eventName.StartsWith("pusher")) 98 | { 99 | // Assume Pusher event 100 | switch (message.eventName) 101 | { 102 | case Constants.ERROR: 103 | ParseError(message.data); 104 | break; 105 | 106 | case Constants.CONNECTION_ESTABLISHED: 107 | ParseConnectionEstablished(message.data); 108 | break; 109 | 110 | case Constants.CHANNEL_SUBSCRIPTION_SUCCEEDED: 111 | 112 | if (_pusher.Channels.ContainsKey(message.channel)) 113 | { 114 | var channel = _pusher.Channels[message.channel]; 115 | channel.SubscriptionSucceeded(message.data); 116 | } 117 | 118 | break; 119 | 120 | case Constants.CHANNEL_SUBSCRIPTION_ERROR: 121 | 122 | throw new PusherException("Error received on channel subscriptions: " + e.Data, 123 | ErrorCodes.SubscriptionError); 124 | 125 | case Constants.CHANNEL_MEMBER_ADDED: 126 | 127 | // Assume channel event 128 | if (_pusher.Channels.ContainsKey(message.channel)) 129 | { 130 | var channel = _pusher.Channels[message.channel]; 131 | 132 | if (channel is PresenceChannel) 133 | { 134 | ((PresenceChannel) channel).AddMember(message.data); 135 | break; 136 | } 137 | } 138 | 139 | Pusher.LogWarning("Received a presence event on channel '" + message.channel + 140 | "', however there is no presence channel which matches."); 141 | break; 142 | 143 | case Constants.CHANNEL_MEMBER_REMOVED: 144 | 145 | // Assume channel event 146 | if (_pusher.Channels.ContainsKey(message.channel)) 147 | { 148 | var channel = _pusher.Channels[message.channel]; 149 | 150 | if (channel is PresenceChannel) 151 | { 152 | ((PresenceChannel) channel).RemoveMember(message.data); 153 | break; 154 | } 155 | } 156 | 157 | Pusher.LogWarning("Received a presence event on channel '" + message.channel + 158 | "', however there is no presence channel which matches."); 159 | break; 160 | } 161 | } 162 | else 163 | { 164 | // Assume channel event 165 | if (_pusher.Channels.ContainsKey(message.channel)) 166 | _pusher.Channels[message.channel].EmitEvent(message.eventName, message.data); 167 | } 168 | } 169 | 170 | private void websocket_Opened(object sender, EventArgs e) 171 | { 172 | Pusher.Log("Websocket opened OK."); 173 | } 174 | 175 | private void websocket_Closed(object sender, EventArgs e) 176 | { 177 | Pusher.Log("Websocket connection has been closed"); 178 | 179 | ChangeState(ConnectionState.Disconnected); 180 | 181 | if (_allowReconnect) 182 | Connect(); 183 | } 184 | 185 | private void websocket_Error(object sender, WebSocketSharp.ErrorEventArgs e) 186 | { 187 | // TODO: What happens here? Do I need to re-connect, or do I just log the issue? 188 | Pusher.LogWarning("Websocket error: " + e.Message); 189 | } 190 | 191 | private void ParseConnectionEstablished(string data) 192 | { 193 | Dictionary dict = JsonHelper.Deserialize>(data); 194 | _socketId = DataFactoryHelper.GetDictonaryValue(dict, "socket_id", string.Empty); 195 | 196 | ChangeState(ConnectionState.Connected); 197 | 198 | if (Connected != null) 199 | Connected(this); 200 | } 201 | 202 | private void ParseError(string data) 203 | { 204 | Dictionary dict = JsonHelper.Deserialize>(data); 205 | string message = DataFactoryHelper.GetDictonaryValue(dict, "message", string.Empty); 206 | string errorCodeStr = DataFactoryHelper.GetDictonaryValue(dict, "code", ErrorCodes.Unkown.ToString()); 207 | ErrorCodes error = DataFactoryHelper.EnumFromString(errorCodeStr); 208 | 209 | throw new PusherException(message, error); 210 | } 211 | 212 | #endregion 213 | } 214 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/Scenes/EnjinSDK.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.5748172, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 0 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &1798495782 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 1798495786} 124 | - component: {fileID: 1798495785} 125 | - component: {fileID: 1798495784} 126 | - component: {fileID: 1798495783} 127 | m_Layer: 0 128 | m_Name: Main Camera 129 | m_TagString: MainCamera 130 | m_Icon: {fileID: 0} 131 | m_NavMeshLayer: 0 132 | m_StaticEditorFlags: 0 133 | m_IsActive: 1 134 | --- !u!81 &1798495783 135 | AudioListener: 136 | m_ObjectHideFlags: 0 137 | m_CorrespondingSourceObject: {fileID: 0} 138 | m_PrefabInstance: {fileID: 0} 139 | m_PrefabAsset: {fileID: 0} 140 | m_GameObject: {fileID: 1798495782} 141 | m_Enabled: 1 142 | --- !u!124 &1798495784 143 | Behaviour: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 1798495782} 149 | m_Enabled: 1 150 | --- !u!20 &1798495785 151 | Camera: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 1798495782} 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_ClearFlags: 1 160 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 161 | m_projectionMatrixMode: 1 162 | m_SensorSize: {x: 36, y: 24} 163 | m_LensShift: {x: 0, y: 0} 164 | m_GateFitMode: 2 165 | m_FocalLength: 50 166 | m_NormalizedViewPortRect: 167 | serializedVersion: 2 168 | x: 0 169 | y: 0 170 | width: 1 171 | height: 1 172 | near clip plane: 0.3 173 | far clip plane: 1000 174 | field of view: 60 175 | orthographic: 0 176 | orthographic size: 5 177 | m_Depth: -1 178 | m_CullingMask: 179 | serializedVersion: 2 180 | m_Bits: 4294967295 181 | m_RenderingPath: -1 182 | m_TargetTexture: {fileID: 0} 183 | m_TargetDisplay: 0 184 | m_TargetEye: 3 185 | m_HDR: 1 186 | m_AllowMSAA: 1 187 | m_AllowDynamicResolution: 0 188 | m_ForceIntoRT: 0 189 | m_OcclusionCulling: 1 190 | m_StereoConvergence: 10 191 | m_StereoSeparation: 0.022 192 | --- !u!4 &1798495786 193 | Transform: 194 | m_ObjectHideFlags: 0 195 | m_CorrespondingSourceObject: {fileID: 0} 196 | m_PrefabInstance: {fileID: 0} 197 | m_PrefabAsset: {fileID: 0} 198 | m_GameObject: {fileID: 1798495782} 199 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 200 | m_LocalPosition: {x: 0, y: 1, z: -10} 201 | m_LocalScale: {x: 1, y: 1, z: 1} 202 | m_Children: [] 203 | m_Father: {fileID: 0} 204 | m_RootOrder: 0 205 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 206 | --- !u!1 &1841294604 207 | GameObject: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInstance: {fileID: 0} 211 | m_PrefabAsset: {fileID: 0} 212 | serializedVersion: 6 213 | m_Component: 214 | - component: {fileID: 1841294606} 215 | - component: {fileID: 1841294605} 216 | m_Layer: 0 217 | m_Name: Directional Light 218 | m_TagString: Untagged 219 | m_Icon: {fileID: 0} 220 | m_NavMeshLayer: 0 221 | m_StaticEditorFlags: 0 222 | m_IsActive: 1 223 | --- !u!108 &1841294605 224 | Light: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 1841294604} 230 | m_Enabled: 1 231 | serializedVersion: 8 232 | m_Type: 1 233 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 234 | m_Intensity: 1 235 | m_Range: 10 236 | m_SpotAngle: 30 237 | m_CookieSize: 10 238 | m_Shadows: 239 | m_Type: 2 240 | m_Resolution: -1 241 | m_CustomResolution: -1 242 | m_Strength: 1 243 | m_Bias: 0.05 244 | m_NormalBias: 0.4 245 | m_NearPlane: 0.2 246 | m_Cookie: {fileID: 0} 247 | m_DrawHalo: 0 248 | m_Flare: {fileID: 0} 249 | m_RenderMode: 0 250 | m_CullingMask: 251 | serializedVersion: 2 252 | m_Bits: 4294967295 253 | m_Lightmapping: 4 254 | m_LightShadowCasterMode: 0 255 | m_AreaSize: {x: 1, y: 1} 256 | m_BounceIntensity: 1 257 | m_ColorTemperature: 6570 258 | m_UseColorTemperature: 0 259 | m_ShadowRadius: 0 260 | m_ShadowAngle: 0 261 | --- !u!4 &1841294606 262 | Transform: 263 | m_ObjectHideFlags: 0 264 | m_CorrespondingSourceObject: {fileID: 0} 265 | m_PrefabInstance: {fileID: 0} 266 | m_PrefabAsset: {fileID: 0} 267 | m_GameObject: {fileID: 1841294604} 268 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 269 | m_LocalPosition: {x: 0, y: 3, z: 0} 270 | m_LocalScale: {x: 1, y: 1, z: 1} 271 | m_Children: [] 272 | m_Father: {fileID: 0} 273 | m_RootOrder: 1 274 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 275 | -------------------------------------------------------------------------------- /Enjin Test Project/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": { 4 | "version": "1.2.16", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "1.0.6", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "1.1.4", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.test-framework": "1.1.1" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.vscode": { 27 | "version": "1.2.3", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.test-framework": { 34 | "version": "1.1.22", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": { 38 | "com.unity.ext.nunit": "1.0.6", 39 | "com.unity.modules.imgui": "1.0.0", 40 | "com.unity.modules.jsonserialize": "1.0.0" 41 | }, 42 | "url": "https://packages.unity.com" 43 | }, 44 | "com.unity.textmeshpro": { 45 | "version": "2.1.1", 46 | "depth": 0, 47 | "source": "registry", 48 | "dependencies": { 49 | "com.unity.ugui": "1.0.0" 50 | }, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.timeline": { 54 | "version": "1.2.18", 55 | "depth": 0, 56 | "source": "registry", 57 | "dependencies": { 58 | "com.unity.modules.director": "1.0.0", 59 | "com.unity.modules.animation": "1.0.0", 60 | "com.unity.modules.audio": "1.0.0", 61 | "com.unity.modules.particlesystem": "1.0.0" 62 | }, 63 | "url": "https://packages.unity.com" 64 | }, 65 | "com.unity.ugui": { 66 | "version": "1.0.0", 67 | "depth": 0, 68 | "source": "builtin", 69 | "dependencies": { 70 | "com.unity.modules.ui": "1.0.0", 71 | "com.unity.modules.imgui": "1.0.0" 72 | } 73 | }, 74 | "com.unity.modules.ai": { 75 | "version": "1.0.0", 76 | "depth": 0, 77 | "source": "builtin", 78 | "dependencies": {} 79 | }, 80 | "com.unity.modules.androidjni": { 81 | "version": "1.0.0", 82 | "depth": 0, 83 | "source": "builtin", 84 | "dependencies": {} 85 | }, 86 | "com.unity.modules.animation": { 87 | "version": "1.0.0", 88 | "depth": 0, 89 | "source": "builtin", 90 | "dependencies": {} 91 | }, 92 | "com.unity.modules.assetbundle": { 93 | "version": "1.0.0", 94 | "depth": 0, 95 | "source": "builtin", 96 | "dependencies": {} 97 | }, 98 | "com.unity.modules.audio": { 99 | "version": "1.0.0", 100 | "depth": 0, 101 | "source": "builtin", 102 | "dependencies": {} 103 | }, 104 | "com.unity.modules.cloth": { 105 | "version": "1.0.0", 106 | "depth": 0, 107 | "source": "builtin", 108 | "dependencies": { 109 | "com.unity.modules.physics": "1.0.0" 110 | } 111 | }, 112 | "com.unity.modules.director": { 113 | "version": "1.0.0", 114 | "depth": 0, 115 | "source": "builtin", 116 | "dependencies": { 117 | "com.unity.modules.audio": "1.0.0", 118 | "com.unity.modules.animation": "1.0.0" 119 | } 120 | }, 121 | "com.unity.modules.imageconversion": { 122 | "version": "1.0.0", 123 | "depth": 0, 124 | "source": "builtin", 125 | "dependencies": {} 126 | }, 127 | "com.unity.modules.imgui": { 128 | "version": "1.0.0", 129 | "depth": 0, 130 | "source": "builtin", 131 | "dependencies": {} 132 | }, 133 | "com.unity.modules.jsonserialize": { 134 | "version": "1.0.0", 135 | "depth": 0, 136 | "source": "builtin", 137 | "dependencies": {} 138 | }, 139 | "com.unity.modules.particlesystem": { 140 | "version": "1.0.0", 141 | "depth": 0, 142 | "source": "builtin", 143 | "dependencies": {} 144 | }, 145 | "com.unity.modules.physics": { 146 | "version": "1.0.0", 147 | "depth": 0, 148 | "source": "builtin", 149 | "dependencies": {} 150 | }, 151 | "com.unity.modules.physics2d": { 152 | "version": "1.0.0", 153 | "depth": 0, 154 | "source": "builtin", 155 | "dependencies": {} 156 | }, 157 | "com.unity.modules.screencapture": { 158 | "version": "1.0.0", 159 | "depth": 0, 160 | "source": "builtin", 161 | "dependencies": { 162 | "com.unity.modules.imageconversion": "1.0.0" 163 | } 164 | }, 165 | "com.unity.modules.subsystems": { 166 | "version": "1.0.0", 167 | "depth": 1, 168 | "source": "builtin", 169 | "dependencies": { 170 | "com.unity.modules.jsonserialize": "1.0.0" 171 | } 172 | }, 173 | "com.unity.modules.terrain": { 174 | "version": "1.0.0", 175 | "depth": 0, 176 | "source": "builtin", 177 | "dependencies": {} 178 | }, 179 | "com.unity.modules.terrainphysics": { 180 | "version": "1.0.0", 181 | "depth": 0, 182 | "source": "builtin", 183 | "dependencies": { 184 | "com.unity.modules.physics": "1.0.0", 185 | "com.unity.modules.terrain": "1.0.0" 186 | } 187 | }, 188 | "com.unity.modules.tilemap": { 189 | "version": "1.0.0", 190 | "depth": 0, 191 | "source": "builtin", 192 | "dependencies": { 193 | "com.unity.modules.physics2d": "1.0.0" 194 | } 195 | }, 196 | "com.unity.modules.ui": { 197 | "version": "1.0.0", 198 | "depth": 0, 199 | "source": "builtin", 200 | "dependencies": {} 201 | }, 202 | "com.unity.modules.uielements": { 203 | "version": "1.0.0", 204 | "depth": 0, 205 | "source": "builtin", 206 | "dependencies": { 207 | "com.unity.modules.imgui": "1.0.0", 208 | "com.unity.modules.jsonserialize": "1.0.0" 209 | } 210 | }, 211 | "com.unity.modules.umbra": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": {} 216 | }, 217 | "com.unity.modules.unityanalytics": { 218 | "version": "1.0.0", 219 | "depth": 0, 220 | "source": "builtin", 221 | "dependencies": { 222 | "com.unity.modules.unitywebrequest": "1.0.0", 223 | "com.unity.modules.jsonserialize": "1.0.0" 224 | } 225 | }, 226 | "com.unity.modules.unitywebrequest": { 227 | "version": "1.0.0", 228 | "depth": 0, 229 | "source": "builtin", 230 | "dependencies": {} 231 | }, 232 | "com.unity.modules.unitywebrequestassetbundle": { 233 | "version": "1.0.0", 234 | "depth": 0, 235 | "source": "builtin", 236 | "dependencies": { 237 | "com.unity.modules.assetbundle": "1.0.0", 238 | "com.unity.modules.unitywebrequest": "1.0.0" 239 | } 240 | }, 241 | "com.unity.modules.unitywebrequestaudio": { 242 | "version": "1.0.0", 243 | "depth": 0, 244 | "source": "builtin", 245 | "dependencies": { 246 | "com.unity.modules.unitywebrequest": "1.0.0", 247 | "com.unity.modules.audio": "1.0.0" 248 | } 249 | }, 250 | "com.unity.modules.unitywebrequesttexture": { 251 | "version": "1.0.0", 252 | "depth": 0, 253 | "source": "builtin", 254 | "dependencies": { 255 | "com.unity.modules.unitywebrequest": "1.0.0", 256 | "com.unity.modules.imageconversion": "1.0.0" 257 | } 258 | }, 259 | "com.unity.modules.unitywebrequestwww": { 260 | "version": "1.0.0", 261 | "depth": 0, 262 | "source": "builtin", 263 | "dependencies": { 264 | "com.unity.modules.unitywebrequest": "1.0.0", 265 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 266 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 267 | "com.unity.modules.audio": "1.0.0", 268 | "com.unity.modules.assetbundle": "1.0.0", 269 | "com.unity.modules.imageconversion": "1.0.0" 270 | } 271 | }, 272 | "com.unity.modules.vehicles": { 273 | "version": "1.0.0", 274 | "depth": 0, 275 | "source": "builtin", 276 | "dependencies": { 277 | "com.unity.modules.physics": "1.0.0" 278 | } 279 | }, 280 | "com.unity.modules.video": { 281 | "version": "1.0.0", 282 | "depth": 0, 283 | "source": "builtin", 284 | "dependencies": { 285 | "com.unity.modules.audio": "1.0.0", 286 | "com.unity.modules.ui": "1.0.0", 287 | "com.unity.modules.unitywebrequest": "1.0.0" 288 | } 289 | }, 290 | "com.unity.modules.vr": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.jsonserialize": "1.0.0", 296 | "com.unity.modules.physics": "1.0.0", 297 | "com.unity.modules.xr": "1.0.0" 298 | } 299 | }, 300 | "com.unity.modules.wind": { 301 | "version": "1.0.0", 302 | "depth": 0, 303 | "source": "builtin", 304 | "dependencies": {} 305 | }, 306 | "com.unity.modules.xr": { 307 | "version": "1.0.0", 308 | "depth": 0, 309 | "source": "builtin", 310 | "dependencies": { 311 | "com.unity.modules.physics": "1.0.0", 312 | "com.unity.modules.jsonserialize": "1.0.0", 313 | "com.unity.modules.subsystems": "1.0.0" 314 | } 315 | } 316 | } 317 | } 318 | -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Helper/JsonHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace Enjin.SDK.PusherClient.Helper 8 | { 9 | /* 10 | * Utilites + thin wrapper around MiniJSON. If all JSON serializing / deserializing 11 | * goes through JsonHelper.Serialize / Deserialize then underlying JSON library can 12 | * be changed more easily 13 | */ 14 | public static class JsonHelper 15 | { 16 | public static List ToList(Vector2 ob) 17 | { 18 | List list = new List(); 19 | list.Add(ob.x); 20 | list.Add(ob.y); 21 | return list; 22 | } 23 | 24 | public static List ToList(Vector3 ob) 25 | { 26 | List list = new List(); 27 | list.Add(ob.x); 28 | list.Add(ob.y); 29 | list.Add(ob.z); 30 | return list; 31 | } 32 | 33 | public static List ToList(Vector4 ob) 34 | { 35 | List list = new List(); 36 | list.Add(ob.x); 37 | list.Add(ob.y); 38 | list.Add(ob.z); 39 | list.Add(ob.w); 40 | return list; 41 | } 42 | 43 | public static List ToList(Quaternion ob) 44 | { 45 | List list = new List(); 46 | list.Add(ob.x); 47 | list.Add(ob.y); 48 | list.Add(ob.z); 49 | list.Add(ob.w); 50 | return list; 51 | } 52 | 53 | public static List ToList(T[] array) 54 | { 55 | List list = new List(); 56 | foreach (T item in array) 57 | { 58 | list.Add(item); 59 | } 60 | 61 | return list; 62 | } 63 | 64 | public static float[] FloatArrayFromDoubleArray(double[] doubleArray) 65 | { 66 | float[] array = new float[doubleArray.Length]; 67 | int i = 0; 68 | foreach (double dbl in doubleArray) 69 | { 70 | array[i] = (float) dbl; 71 | i++; 72 | } 73 | 74 | return array; 75 | } 76 | 77 | public static T[] ArrayFromList(List list) 78 | { 79 | T[] array = new T[list.Count]; 80 | int i = 0; 81 | foreach (object ob in list) 82 | { 83 | array[i] = (T) ob; 84 | i++; 85 | } 86 | 87 | return array; 88 | } 89 | 90 | public static Vector2 Vector2FromList(List list) 91 | { 92 | return new Vector3 93 | ( 94 | (float) (double) list[0], 95 | (float) (double) list[1] 96 | ); 97 | } 98 | 99 | public static Vector3 Vector3FromList(List list) 100 | { 101 | return new Vector3 102 | ( 103 | (float) (double) list[0], 104 | (float) (double) list[1], 105 | (float) (double) list[2] 106 | ); 107 | } 108 | 109 | public static Vector4 Vector4FromList(List list) 110 | { 111 | return new Vector4 112 | ( 113 | (float) (double) list[0], 114 | (float) (double) list[1], 115 | (float) (double) list[2], 116 | (float) (double) list[3] 117 | ); 118 | } 119 | 120 | public static Quaternion QuaternionFromList(List list) 121 | { 122 | return new Quaternion 123 | ( 124 | (float) (double) list[0], 125 | (float) (double) list[1], 126 | (float) (double) list[2], 127 | (float) (double) list[3] 128 | ); 129 | } 130 | 131 | public static T[] EnumArrayFromList(List list) 132 | { 133 | T[] array = new T[list.Count]; 134 | int i = 0; 135 | foreach (object ob in list) 136 | { 137 | array[i] = EnumFromObject(ob); 138 | i++; 139 | } 140 | 141 | return array; 142 | } 143 | 144 | public static T EnumFromInteger(int index) 145 | { 146 | if (!Enum.IsDefined(typeof(T), index)) 147 | return default(T); 148 | 149 | return (T) Enum.ToObject(typeof(T), index); 150 | } 151 | 152 | public static T EnumFromObject(object ob) 153 | { 154 | if (!Enum.IsDefined(typeof(T), (string) ob)) 155 | return default(T); 156 | 157 | return (T) Enum.Parse(typeof(T), (string) ob); 158 | } 159 | 160 | public static List ToTypedList(object ob) 161 | { 162 | List resultList = new List(); 163 | if (!(ob is List)) 164 | { 165 | Debug.LogWarning("Attempt to convert " + ob + " into List"); 166 | return resultList; 167 | } 168 | 169 | List objList = (List) ob; 170 | foreach (object o in objList) 171 | { 172 | if (o is T) 173 | resultList.Add((T) o); 174 | } 175 | 176 | return resultList; 177 | } 178 | 179 | private const string INDENT_STRING = " "; 180 | 181 | public static string FormatJson(string str) 182 | { 183 | var indent = 0; 184 | var quoted = false; 185 | var sb = new StringBuilder(); 186 | for (var i = 0; i < str.Length; i++) 187 | { 188 | var ch = str[i]; 189 | switch (ch) 190 | { 191 | case '{': 192 | case '[': 193 | sb.Append(ch); 194 | if (!quoted) 195 | { 196 | sb.AppendLine(); 197 | System.Linq.Enumerable.Range(0, ++indent).ForEach(item => sb.Append(INDENT_STRING)); 198 | } 199 | 200 | break; 201 | case '}': 202 | case ']': 203 | if (!quoted) 204 | { 205 | sb.AppendLine(); 206 | System.Linq.Enumerable.Range(0, --indent) 207 | .ForEach(item => 208 | sb.Append( 209 | INDENT_STRING)); //NOTE: Including entire Linq library for a simple debug function, might not be a big deal but worth considering avoiding 210 | } 211 | 212 | sb.Append(ch); 213 | break; 214 | case '"': 215 | sb.Append(ch); 216 | bool escaped = false; 217 | var index = i; 218 | while (index > 0 && str[--index] == '\\') 219 | escaped = !escaped; 220 | if (!escaped) 221 | quoted = !quoted; 222 | break; 223 | case ',': 224 | sb.Append(ch); 225 | if (!quoted) 226 | { 227 | sb.AppendLine(); 228 | System.Linq.Enumerable.Range(0, indent).ForEach(item => sb.Append(INDENT_STRING)); 229 | } 230 | 231 | break; 232 | case ':': 233 | sb.Append(ch); 234 | if (!quoted) 235 | sb.Append(" "); 236 | break; 237 | default: 238 | sb.Append(ch); 239 | break; 240 | } 241 | } 242 | 243 | return sb.ToString(); 244 | } 245 | 246 | public static T Deserialize(string json) 247 | { 248 | object obj = default(T); 249 | try 250 | { 251 | obj = Deserialize(json); 252 | if (obj is T) 253 | return (T) obj; 254 | } 255 | catch (Exception ex) 256 | { 257 | Debug.LogWarning("Invalid json, exception while parsing: " + ex.Message); 258 | } 259 | 260 | return default(T); 261 | } 262 | 263 | /** 264 | * MiniJSON versions of Serialize / Deserialize 265 | */ 266 | public static object Deserialize(string json) 267 | { 268 | object obj = null; 269 | try 270 | { 271 | obj = MiniJSON.Json.Deserialize(json); 272 | } 273 | catch (Exception) 274 | { 275 | obj = null; 276 | } 277 | 278 | return obj; 279 | } 280 | 281 | public static string Serialize(object obj) 282 | { 283 | return MiniJSON.Json.Serialize(obj); 284 | } 285 | } 286 | 287 | 288 | static class MiniJSONExtensions 289 | { 290 | public static void ForEach(this IEnumerable ie, Action action) 291 | { 292 | foreach (var i in ie) 293 | { 294 | action(i); 295 | } 296 | } 297 | } 298 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/PusherClient/Pusher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enjin.SDK.PusherClient.Helper; 4 | 5 | namespace Enjin.SDK.PusherClient 6 | { 7 | /* TODO: Write tests 8 | * - Websocket disconnect 9 | - Connection lost, not cleanly closed 10 | - MustConnectOverSSL = 4000, 11 | - App does not exist 12 | - App disabled 13 | - Over connection limit 14 | - Path not found 15 | - Client over rate limie 16 | - Conditions for client event triggering 17 | */ 18 | // TODO: NUGET Package 19 | // TODO: Ping & pong, are these handled by the Webscoket library out of the box? 20 | // TODO: Add assembly info file? 21 | // TODO: Implement connection fallback strategy 22 | 23 | // A delegate type for hooking up change notifications. 24 | public delegate void ConnectedEventHandler(object sender); 25 | 26 | public delegate void ConnectionStateChangedEventHandler(object sender, ConnectionState state); 27 | 28 | public class Pusher : EventEmitter 29 | { 30 | public static void Log(string message) 31 | { 32 | if (PusherSettings.Verbose) 33 | UnityEngine.Debug.Log("Pusher: " + message); 34 | } 35 | 36 | public static void LogWarning(string message) 37 | { 38 | UnityEngine.Debug.LogWarning("Pusher: " + message); 39 | } 40 | 41 | const int PROTOCOL_NUMBER = 5; 42 | string _applicationKey = null; 43 | PusherOptions _options = null; 44 | 45 | public string Host = "ws.pusherapp.com"; 46 | private Connection _connection = null; 47 | 48 | public event ConnectedEventHandler Connected; 49 | public event ConnectionStateChangedEventHandler ConnectionStateChanged; 50 | public Dictionary Channels = new Dictionary(); 51 | 52 | #region Properties 53 | 54 | public string SocketID 55 | { 56 | get { return _connection.SocketID; } 57 | } 58 | 59 | public ConnectionState State 60 | { 61 | get { return _connection.State; } 62 | } 63 | 64 | #endregion 65 | 66 | 67 | /// 68 | /// Initializes a new instance of the class. 69 | /// 70 | /// The application key. 71 | /// The options. 72 | public Pusher(string applicationKey, PusherOptions options = null) 73 | { 74 | _applicationKey = applicationKey; 75 | 76 | if (options == null) 77 | _options = new PusherOptions() {Encrypted = false}; 78 | else 79 | _options = options; 80 | 81 | if (PusherSettings.HttpAuthUrl.Length > 0) 82 | _options.Authorizer = new HttpAuthorizer(PusherSettings.HttpAuthUrl); 83 | } 84 | 85 | #region Public Methods 86 | 87 | public void Connect() 88 | { 89 | // Check current connection state 90 | if (_connection != null) 91 | { 92 | switch (_connection.State) 93 | { 94 | case ConnectionState.Connected: 95 | LogWarning( 96 | "Attempt to connect when connection is already in 'Connected' state. New attempt has been ignored."); 97 | break; 98 | case ConnectionState.Connecting: 99 | LogWarning( 100 | "Attempt to connect when connection is already in 'Connecting' state. New attempt has been ignored."); 101 | break; 102 | case ConnectionState.Failed: 103 | LogWarning("Cannot attempt re-connection once in 'Failed' state"); 104 | throw new PusherException("Cannot attempt re-connection once in 'Failed' state", 105 | ErrorCodes.ConnectionFailed); 106 | } 107 | } 108 | 109 | var scheme = "ws://"; 110 | 111 | if (_options.Encrypted) 112 | scheme = "wss://"; 113 | 114 | // TODO: Fallback to secure? 115 | 116 | string url = String.Format("{0}{1}/app/{2}?protocol={3}&client={4}&version={5}", 117 | scheme, _options.Host, _applicationKey, Pusher.PROTOCOL_NUMBER, PusherSettings.ClientName, 118 | PusherSettings.ClientVersion 119 | ); 120 | 121 | Log("Connecting to url: '" + url + "'"); 122 | _connection = new Connection(this, url); 123 | _connection.Connected += _connection_Connected; 124 | _connection.ConnectionStateChanged += _connection_ConnectionStateChanged; 125 | _connection.Connect(); 126 | } 127 | 128 | public void Disconnect() 129 | { 130 | _connection.Disconnect(); 131 | } 132 | 133 | public Channel Subscribe(string channelName) 134 | { 135 | if (_connection.State != ConnectionState.Connected) 136 | LogWarning("You must wait for Pusher to connect before you can subscribe to a channel"); 137 | 138 | if (Channels.ContainsKey(channelName)) 139 | { 140 | LogWarning("Channel '" + channelName + 141 | "' is already subscribed to. Subscription event has been ignored."); 142 | return Channels[channelName]; 143 | } 144 | 145 | // If private or presence channel, check that auth endpoint has been set 146 | var chanType = ChannelTypes.Public; 147 | 148 | if (channelName.ToLower().StartsWith("private-")) 149 | chanType = ChannelTypes.Private; 150 | else if (channelName.ToLower().StartsWith("presence-")) 151 | chanType = ChannelTypes.Presence; 152 | 153 | return SubscribeToChannel(chanType, channelName); 154 | } 155 | 156 | private Channel SubscribeToChannel(ChannelTypes type, string channelName) 157 | { 158 | switch (type) 159 | { 160 | case ChannelTypes.Public: 161 | Channels.Add(channelName, new Channel(channelName, this)); 162 | break; 163 | case ChannelTypes.Private: 164 | AuthEndpointCheck(); 165 | Channels.Add(channelName, new PrivateChannel(channelName, this)); 166 | break; 167 | case ChannelTypes.Presence: 168 | AuthEndpointCheck(); 169 | Channels.Add(channelName, new PresenceChannel(channelName, this)); 170 | break; 171 | } 172 | 173 | if (type == ChannelTypes.Presence || type == ChannelTypes.Private) 174 | { 175 | Log("Calling auth for channel for: " + channelName); 176 | AuthorizeChannel(channelName); 177 | } 178 | else 179 | { 180 | // No need for auth details. Just send subscribe event 181 | _connection.Send(JsonHelper.Serialize(new Dictionary() 182 | { 183 | {"event", Constants.CHANNEL_SUBSCRIBE}, 184 | { 185 | "data", new Dictionary() 186 | { 187 | {"channel", channelName} 188 | } 189 | } 190 | })); 191 | } 192 | 193 | return Channels[channelName]; 194 | } 195 | 196 | private void AuthorizeChannel(string channelName) 197 | { 198 | string authJson = _options.Authorizer.Authorize(channelName, _connection.SocketID); 199 | Log("Got replay from server auth: " + authJson); 200 | SendChannelAuthData(channelName, authJson); 201 | } 202 | 203 | private void SendChannelAuthData(string channelName, string jsonAuth) 204 | { 205 | // parse info from json data 206 | Dictionary authDict = JsonHelper.Deserialize>(jsonAuth); 207 | string authFromMessage = DataFactoryHelper.GetDictonaryValue(authDict, "auth", string.Empty); 208 | string channelDataFromMessage = DataFactoryHelper.GetDictonaryValue(authDict, "channel_data", string.Empty); 209 | 210 | _connection.Send(JsonHelper.Serialize(new Dictionary() 211 | { 212 | {"event", Constants.CHANNEL_SUBSCRIBE}, 213 | { 214 | "data", new Dictionary() 215 | { 216 | {"channel", channelName}, 217 | {"auth", authFromMessage}, 218 | {"channel_data", channelDataFromMessage} 219 | } 220 | } 221 | })); 222 | } 223 | 224 | private void AuthEndpointCheck() 225 | { 226 | if (_options.Authorizer == null) 227 | { 228 | throw new PusherException( 229 | "You must set a ChannelAuthorizer property to use private or presence channels", 230 | ErrorCodes.ChannelAuthorizerNotSet); 231 | } 232 | } 233 | 234 | public void Send(string eventName, object data, string channel = null) 235 | { 236 | _connection.Send(JsonHelper.Serialize(new Dictionary() 237 | { 238 | {"event", eventName}, 239 | {"data", data}, 240 | {"channel", channel} 241 | })); 242 | } 243 | 244 | #endregion 245 | 246 | #region Internal Methods 247 | 248 | internal void Trigger(string channelName, string eventName, object obj) 249 | { 250 | _connection.Send(JsonHelper.Serialize(new Dictionary() 251 | { 252 | {"event", eventName}, 253 | {"channel", channelName}, 254 | {"data", obj} 255 | })); 256 | } 257 | 258 | internal void Unsubscribe(string channelName) 259 | { 260 | _connection.Send(JsonHelper.Serialize(new Dictionary() 261 | { 262 | {"event", Constants.CHANNEL_UNSUBSCRIBE}, 263 | { 264 | "data", new Dictionary() 265 | { 266 | {"channel", channelName} 267 | } 268 | } 269 | })); 270 | } 271 | 272 | #endregion 273 | 274 | #region Connection Event Handlers 275 | 276 | private void _connection_ConnectionStateChanged(object sender, ConnectionState state) 277 | { 278 | if (ConnectionStateChanged != null) 279 | ConnectionStateChanged(sender, state); 280 | } 281 | 282 | void _connection_Connected(object sender) 283 | { 284 | if (this.Connected != null) 285 | this.Connected(sender); 286 | } 287 | 288 | #endregion 289 | } 290 | } -------------------------------------------------------------------------------- /Enjin Test Project/Assets/Enjin/SDK/Core/EnjinPlatform.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enjin.SDK.GraphQL; 4 | using Enjin.SDK.PusherClient; 5 | using Enjin.SDK.PusherClient.Helper; 6 | using Enjin.SDK.Utility; 7 | using SimpleJSON; 8 | using UnityEngine; 9 | 10 | namespace Enjin.SDK.Core 11 | { 12 | public enum ResponseCodes 13 | { 14 | INITIALIZED = 000, 15 | SUCCESS = 200, 16 | BADREQUEST = 400, 17 | UNAUTHORIZED = 401, 18 | NOTFOUND = 404, 19 | INVALID = 405, 20 | DATACONFLICT = 409, 21 | UNKNOWNERROR = 999, 22 | INTERNAL = 001 23 | } 24 | 25 | public enum LoginState 26 | { 27 | NONE, 28 | VALID, 29 | INVALIDUSERPASS, 30 | INVALIDTPURL, 31 | AUTO, 32 | UNAUTHORIZED 33 | } 34 | 35 | public enum SupplyModel 36 | { 37 | FIXED, 38 | SETTABLE, 39 | INFINITE, 40 | COLLAPSING, 41 | ANNUAL_VALUE, 42 | ANNUAL_PERCENTAGE 43 | } 44 | 45 | public enum SupplyModel2 46 | { 47 | FIXED, 48 | SETTABLE, 49 | INFINITE, 50 | COLLAPSING 51 | } 52 | 53 | public enum Transferable 54 | { 55 | PERMANENT, 56 | TEMPORARY, 57 | BOUND 58 | } 59 | 60 | public enum TransferType 61 | { 62 | NONE, 63 | PER_TRANSFER, 64 | PER_CRYPTO_ITEM, 65 | RATIO_CUT, 66 | RATIO_EXTRA 67 | } // TYPE_COUNT removed for V1, will be added back post V1 68 | 69 | public enum CryptoItemFieldType 70 | { 71 | NAME, 72 | TRANSFERABLE, 73 | TRANSFERFEE, 74 | MELTFEE, 75 | MAXMELTFEE, 76 | MAXTRANSFERFEE 77 | } 78 | 79 | public class EnjinPlatform 80 | { 81 | // Private variables & objects 82 | private int _appID; // Application ID 83 | private PlatformInfo _platformInfo; // Information about the platform 84 | 85 | // Pusher objects 86 | private Pusher _client; // Pucher client connector 87 | private Channel _channel; // Pusher channel connection 88 | private PusherOptions _options; // Pusher connection options 89 | 90 | // Public URL properties 91 | public int PlatformID 92 | { 93 | get { return System.Convert.ToInt32(_platformInfo.id); } 94 | } 95 | 96 | public int ApplicationID 97 | { 98 | get { return _appID; } 99 | set { _appID = value; } 100 | } 101 | 102 | public PlatformInfo GetPlatform 103 | { 104 | get 105 | { 106 | _platformInfo = GetPlatformInfo(); 107 | return _platformInfo; 108 | } 109 | } 110 | 111 | public string TRData; 112 | 113 | /// 114 | /// Initializes platform 115 | /// 116 | public void InitializePlatform() 117 | { 118 | _platformInfo = GetPlatformInfo(); 119 | 120 | PusherSettings.Verbose = false; 121 | _options = new PusherOptions 122 | { 123 | Cluster = _platformInfo.notifications.pusher.options.cluster, 124 | Encrypted = _platformInfo.notifications.pusher.options.encrypted == "true" 125 | }; 126 | 127 | _client = new Pusher(_platformInfo.notifications.pusher.key, _options); 128 | _client.Connected += EventConnected; 129 | _client.ConnectionStateChanged += EventStateChange; 130 | _client.Connect(); 131 | } 132 | 133 | /// 134 | /// Cleans up platform objects 135 | /// 136 | public void CleanUp() 137 | { 138 | _client.Disconnect(); 139 | } 140 | 141 | /// 142 | /// Reconnects pusher on applicaiton change 143 | /// 144 | public void PusherReconnect() 145 | { 146 | _client.Disconnect(); 147 | _client.Connect(); 148 | } 149 | 150 | public JSONNode AuthApp(int appId, string secret) 151 | { 152 | var query = string.Format(Enjin.PlatformTemplate.GetQuery["AuthApp"], appId, secret); 153 | GraphQuery.POST(query, "login"); 154 | var resultGql = JSON.Parse(GraphQuery.queryReturn); 155 | return resultGql["data"]["result"]; 156 | } 157 | 158 | public JSONNode AuthPlayer(string id) 159 | { 160 | GraphQuery.POST(string.Format(global::Enjin.SDK.Core.Enjin.PlatformTemplate.GetQuery["AuthPlayer"], id)); 161 | var resultGql = JSON.Parse(GraphQuery.queryReturn); 162 | return resultGql["data"]["result"]; 163 | } 164 | 165 | /// 166 | /// Set the ENJ approval to max 167 | /// 168 | /// Identity of user to set max approval on 169 | public void SetAllowance(int identityId) 170 | { 171 | GraphQuery.POST(string.Format(Enjin.PlatformTemplate.GetQuery["SetAllowance"], Enjin.AppID, identityId)); 172 | } 173 | 174 | /// 175 | /// Geta an application's information by ID 176 | /// 177 | /// ID of application to get information for 178 | /// Application information object 179 | public App GetAppByID(int id) 180 | { 181 | GraphQuery.POST(string.Format(Enjin.PlatformTemplate.GetQuery["GetAppByID"], 182 | id.ToString())); 183 | 184 | var resultGQL = JSON.Parse(GraphQuery.queryReturn); 185 | // TODO: Convert this to json parsing to datatype (Updates to read back in GraphQuery.cs) 186 | App appData = new App() 187 | { 188 | id = resultGQL["data"]["result"][0]["id"].AsInt, 189 | name = resultGQL["data"]["result"][0]["name"].Value, 190 | description = resultGQL["data"]["result"][0]["description"].Value, 191 | image = resultGQL["data"]["result"][0]["image"].Value 192 | }; 193 | 194 | return appData; 195 | } 196 | 197 | /// 198 | /// Updates App information 199 | /// 200 | /// App to update information for 201 | /// Updated App 202 | public App UpdateApp(App app) 203 | { 204 | string query; 205 | query = 206 | @"mutation updateApp{App:UpdateEnjinApp(name:""$appName^"",description:""$appDescription^"",image:""$appImageURL^""){id,name,description,image}}"; 207 | GraphQuery.variable["appName"] = app.name; 208 | GraphQuery.variable["appDescription"] = app.description; 209 | GraphQuery.variable["appImageURL"] = app.image; 210 | GraphQuery.POST(query); 211 | 212 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 1)); 213 | } 214 | 215 | /// 216 | /// Gets the platform information for intiializing platform 217 | /// 218 | /// PlatformInfo object containing platform info 219 | private PlatformInfo GetPlatformInfo() 220 | { 221 | GraphQuery.POST(Enjin.PlatformTemplate.GetQuery["GetPlatformInfo"], Enjin.AccessToken); 222 | 223 | return JsonUtility.FromJson(EnjinHelpers.GetJSONString(GraphQuery.queryReturn, 2)); 224 | } 225 | 226 | #region Pusher Methods 227 | 228 | /// 229 | /// Pusher connected event 230 | /// 231 | /// Object connector for pusher 232 | private void EventConnected(object sender) 233 | { 234 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 235 | Debug.Log("[PUSHER] Client connected"); 236 | 237 | _channel = _client.Subscribe("enjin.server." + _platformInfo.network 238 | + "." + _platformInfo.id.ToString() + 239 | "." + Enjin.AppID.ToString()); 240 | _channel.BindAll(ChannelEvent); 241 | } 242 | 243 | /// 244 | /// Pusher event channel. Can be subscribed to for handling pusher events 245 | /// 246 | /// Event type 247 | /// Data associated to event 248 | private void ChannelEvent(string eventName, object eventData) 249 | { 250 | TRData = JsonHelper.Serialize(eventData); 251 | RequestEvent trackData = JsonUtility.FromJson(TRData); 252 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 253 | { 254 | Debug.Log("[PUSHER] Event: " + trackData.event_type); 255 | } 256 | 257 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 258 | { 259 | Debug.Log("[PUSHER] Event " + eventName + " recieved. Data: " + TRData); 260 | } 261 | 262 | // Temp fix for action duplication issue. Will replace with event manager integration 263 | // Execute any event handlers which are listening to this specific event. 264 | if (global::Enjin.SDK.Core.Enjin.EventListeners.ContainsKey(eventName)) 265 | { 266 | for (int i = 0; i < global::Enjin.SDK.Core.Enjin.EventListeners[eventName].Count; i++) 267 | { 268 | global::Enjin.SDK.Core.Enjin.EventListeners[eventName][i](trackData); 269 | } 270 | } 271 | 272 | // Notify any callback functions listening for this request that we've broadcasted. 273 | /* 274 | if (trackData.event_type.Equals("tx_broadcast")) 275 | { 276 | int requestId = trackData.data.id; 277 | if (Enjin.RequestCallbacks.ContainsKey(requestId)) 278 | { 279 | System.Action callback = Enjin.RequestCallbacks[requestId]; 280 | callback(trackData); 281 | } 282 | } 283 | */ 284 | 285 | // Execute any callback function which is listening for this request. 286 | if (trackData.event_type.Equals("tx_executed")) 287 | { 288 | int requestId = trackData.data.transaction_id; 289 | if (global::Enjin.SDK.Core.Enjin.RequestCallbacks.ContainsKey(requestId)) 290 | { 291 | System.Action callback = global::Enjin.SDK.Core.Enjin.RequestCallbacks[requestId]; 292 | callback(trackData); 293 | global::Enjin.SDK.Core.Enjin.RequestCallbacks.Remove(requestId); 294 | } 295 | } 296 | } 297 | 298 | /// 299 | /// Pusher state change. Reports any state changes from pusher 300 | /// 301 | /// Object connector to track 302 | /// State change of pusher connector 303 | private void EventStateChange(object sender, ConnectionState state) 304 | { 305 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 306 | Debug.Log("[PUSHER] Connection state changed to: " + state); 307 | } 308 | 309 | /// 310 | /// Bind a listener to fire each time some named event is received from pusher 311 | /// 312 | /// The string name of the event to track 313 | /// The listening action to fire with the responding event data 314 | public void BindEvent(string eventName, System.Action listener) 315 | { 316 | bool hasListeners = global::Enjin.SDK.Core.Enjin.EventListeners.ContainsKey(eventName); 317 | if (hasListeners) 318 | { 319 | List> listenerList = global::Enjin.SDK.Core.Enjin.EventListeners[eventName]; 320 | listenerList.Add(listener); 321 | global::Enjin.SDK.Core.Enjin.EventListeners[eventName] = listenerList; 322 | } 323 | else 324 | { 325 | List> listenerList = new List> 326 | { 327 | listener 328 | }; 329 | global::Enjin.SDK.Core.Enjin.EventListeners[eventName] = listenerList; 330 | } 331 | } 332 | 333 | /// 334 | /// Bind a listener to fire when an event indicating that the given Identity ID has linked a wallet is received from pusher 335 | /// 336 | /// The integer ID of the Identity to listen for a linked wallet on 337 | /// The listening action to fire with the responding event data 338 | internal void ListenForLink(int identityID, System.Action listener) 339 | { 340 | Channel channel = _client.Subscribe("enjin.server." + _platformInfo.network + "." + 341 | _platformInfo.id.ToString() + "." + 342 | global::Enjin.SDK.Core.Enjin.AppID.ToString() + "." + 343 | identityID); 344 | channel.BindAll((eventName, eventData) => 345 | { 346 | string dataString = JsonHelper.Serialize(eventData); 347 | RequestEvent transactionData = JsonUtility.FromJson(dataString); 348 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 349 | { 350 | Debug.Log("[PUSHER] Event: " + transactionData.event_type); 351 | } 352 | 353 | if (global::Enjin.SDK.Core.Enjin.IsDebugLogActive) 354 | { 355 | Debug.Log("[PUSHER] Event " + eventName + " recieved. Data: " + dataString); 356 | } 357 | 358 | // If we see that this client has updated their event, fire our awaiting callback. 359 | if (transactionData.event_type.Equals("identity_updated")) 360 | { 361 | listener(transactionData); 362 | channel.Unsubscribe(); 363 | } 364 | }); 365 | } 366 | 367 | #endregion 368 | } 369 | } --------------------------------------------------------------------------------