diff --git a/Assets/Mirror/Examples/DataBenchmark.meta b/Assets/Mirror/Examples/DataBenchmark.meta new file mode 100644 index 00000000000..c9679022ee7 --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf4553ce0b886e94484435bdbd169fcc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs b/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs new file mode 100644 index 00000000000..7e77780a073 --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Security.Cryptography; +using UnityEngine; +namespace Mirror.Examples.DataBenchmark +{ + public class BenchmarkSender : NetworkBehaviour + { + + public int DataSize = 256; + public int SendsPerFrame = 100; + [ReadOnly] + public int DataPerFrame; + + public bool Reliable = true; + private byte[] data; + private void Awake() + { + data = new byte[DataSize]; + + using (RandomNumberGenerator rng = RandomNumberGenerator.Create()) + { + rng.GetBytes(data); + } + } + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + if (!NetworkServer.active) + { + return; + } + for (int i = 0; i < SendsPerFrame; i++) + { + if (Reliable) + { + RpcSendReliable(new ArraySegment(data)); + } + else + { + RpcSendUnreliable(new ArraySegment(data)); + } + } + } + + + [ClientRpc(channel = Channels.Reliable)] + void RpcSendReliable(ArraySegment data) + { + + } + + [ClientRpc(channel = Channels.Unreliable)] + void RpcSendUnreliable(ArraySegment data) + { + + } + + protected override void OnValidate() + { + base.OnValidate(); + DataPerFrame = DataSize * SendsPerFrame; + } + } +} diff --git a/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs.meta b/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs.meta new file mode 100644 index 00000000000..6c5ad15ab60 --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/BenchmarkSender.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c3971ab1d2370e4183dbd3fafd71b58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity b/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity new file mode 100644 index 00000000000..4c115c1a5ba --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity @@ -0,0 +1,531 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &113766596 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 113766598} + - component: {fileID: 113766597} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &113766597 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 113766596} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &113766598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 113766596} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &741766868 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 741766871} + - component: {fileID: 741766870} + - component: {fileID: 741766869} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &741766869 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741766868} + m_Enabled: 1 +--- !u!20 &741766870 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741766868} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &741766871 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741766868} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &897533007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 897533008} + - component: {fileID: 897533010} + - component: {fileID: 897533009} + m_Layer: 0 + m_Name: Sender + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &897533008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 897533007} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.2742552, y: 3.9124136, z: -1.5819865} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &897533009 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 897533007} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c3971ab1d2370e4183dbd3fafd71b58, type: 3} + m_Name: + m_EditorClassIdentifier: + syncDirection: 0 + syncMode: 0 + syncInterval: 0 + DataSize: 213 + SendsPerFrame: 50 + DataPerFrame: 10650 + Reliable: 0 +--- !u!114 &897533010 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 897533007} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} + m_Name: + m_EditorClassIdentifier: + sceneId: 1432977087 + _assetId: 0 + serverOnly: 0 + visibility: 2 + hasSpawned: 0 +--- !u!1 &1778933501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1778933504} + - component: {fileID: 1778933503} + - component: {fileID: 1778933505} + - component: {fileID: 1778933506} + - component: {fileID: 1778933507} + - component: {fileID: 1778933508} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1778933503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8aab4c8111b7c411b9b92cf3dbc5bd4e, type: 3} + m_Name: + m_EditorClassIdentifier: + dontDestroyOnLoad: 1 + runInBackground: 1 + headlessStartMode: 1 + editorAutoStart: 0 + sendRate: 60 + autoStartServerBuild: 0 + autoConnectClientBuild: 0 + offlineScene: + onlineScene: + transport: {fileID: 1778933506} + networkAddress: localhost + maxConnections: 100 + disconnectInactiveConnections: 0 + disconnectInactiveTimeout: 60 + authenticator: {fileID: 0} + playerPrefab: {fileID: 2927449985943778525, guid: b6c8baa4d2ac3be46b983ae8a6f7b65f, + type: 3} + autoCreatePlayer: 1 + playerSpawnMethod: 0 + spawnPrefabs: [] + exceptionsDisconnect: 1 + snapshotSettings: + bufferTimeMultiplier: 2 + bufferLimit: 32 + catchupNegativeThreshold: -1 + catchupPositiveThreshold: 1 + catchupSpeed: 0.019999999552965164 + slowdownSpeed: 0.03999999910593033 + driftEmaDuration: 1 + dynamicAdjustment: 1 + dynamicAdjustmentTolerance: 1 + deliveryTimeEmaDuration: 2 + evaluationMethod: 0 + evaluationInterval: 3 + timeInterpolationGui: 0 +--- !u!4 &1778933504 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.2742552, y: 3.9124136, z: -1.5819865} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1778933505 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6442dc8070ceb41f094e44de0bf87274, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 0 + offsetY: 0 +--- !u!114 &1778933506 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0aa135acc32a4383ae9a5817f018cb06, type: 3} + m_Name: + m_EditorClassIdentifier: + inner: {fileID: 1778933508} + clientValidateServerPubKey: 0 + clientTrustedPubKeySignatures: [] + serverLoadKeyPairFromFile: 0 + serverKeypairPath: ./server-keys.json +--- !u!114 &1778933507 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bc654f29862fc2643b948f772ebb9e68, type: 3} + m_Name: + m_EditorClassIdentifier: + color: {r: 1, g: 1, b: 1, a: 1} + padding: 2 + width: 150 + height: 25 +--- !u!114 &1778933508 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778933501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3} + m_Name: + m_EditorClassIdentifier: + port: 7777 + DualMode: 1 + NoDelay: 1 + Interval: 10 + Timeout: 10000 + RecvBufferSize: 7361536 + SendBufferSize: 7361536 + FastResend: 2 + ReceiveWindowSize: 4096 + SendWindowSize: 4096 + MaxRetransmit: 40 + MaximizeSocketBuffers: 1 + ReliableMaxMessageSize: 297433 + UnreliableMaxMessageSize: 1194 + debugLog: 0 + statisticsGUI: 0 + statisticsLog: 0 diff --git a/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity.meta b/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity.meta new file mode 100644 index 00000000000..6478e1f699f --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/DataBenchmark.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7d651cfc474b2b48bae43e51c82833e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Examples/DataBenchmark/Player.prefab b/Assets/Mirror/Examples/DataBenchmark/Player.prefab new file mode 100644 index 00000000000..3092d0da4bb --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/Player.prefab @@ -0,0 +1,51 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2927449985943778525 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2927449985943778527} + - component: {fileID: 2927449985943778526} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2927449985943778527 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2927449985943778525} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.2742552, y: 3.9124136, z: -1.5819865} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2927449985943778526 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2927449985943778525} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} + m_Name: + m_EditorClassIdentifier: + sceneId: 0 + _assetId: 0 + serverOnly: 0 + visibility: 0 + hasSpawned: 0 diff --git a/Assets/Mirror/Examples/DataBenchmark/Player.prefab.meta b/Assets/Mirror/Examples/DataBenchmark/Player.prefab.meta new file mode 100644 index 00000000000..d769e2a0183 --- /dev/null +++ b/Assets/Mirror/Examples/DataBenchmark/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b6c8baa4d2ac3be46b983ae8a6f7b65f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/EncryptedConnection.cs b/Assets/Mirror/Transports/Encryption/EncryptedConnection.cs index 9515e74dbf3..18771d77506 100644 --- a/Assets/Mirror/Transports/Encryption/EncryptedConnection.cs +++ b/Assets/Mirror/Transports/Encryption/EncryptedConnection.cs @@ -1,5 +1,6 @@ using System; using System.Security.Cryptography; +using Mirror.Transports.Encryption.Native; using System.Text; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Agreement; @@ -131,6 +132,7 @@ enum State * The client does this, since the fin is not acked explicitly, but by receiving data to decrypt */ private readonly bool _sendsFirst; + private byte[] _keyRaw; public EncryptedConnection(EncryptionCredentials credentials, bool isClient, @@ -168,120 +170,131 @@ private static byte[] GenerateSecureBytes(int size) public void OnReceiveRaw(ArraySegment data, int channel) { - if (data.Count < 1) + try { - _error(TransportError.Unexpected, "Received empty packet"); - return; - } + Profiler.BeginSample("EncryptedConnection.OnReceiveRaw"); + if (data.Count < 1) + { + _error(TransportError.Unexpected, "Received empty packet"); + return; + } - using (NetworkReaderPooled reader = NetworkReaderPool.Get(data)) - { - OpCodes opcode = (OpCodes)reader.ReadByte(); - switch (opcode) + using (NetworkReaderPooled reader = NetworkReaderPool.Get(data)) { - case OpCodes.Data: - // first sender ready is implicit when data is received - if (_sendsFirst && _state == State.WaitingHandshakeReply) - { + OpCodes opcode = (OpCodes)reader.ReadByte(); + switch (opcode) + { + case OpCodes.Data: + // first sender ready is implicit when data is received + if (_sendsFirst && _state == State.WaitingHandshakeReply) + { + SetReady(); + } + else if (!IsReady) + { + _error(TransportError.Unexpected, "Unexpected data while not ready."); + } + + if (reader.Remaining < Overhead) + { + _error(TransportError.Unexpected, "received data packet smaller than metadata size"); + return; + } + + ArraySegment ciphertext = reader.ReadBytesSegment(reader.Remaining - NonceSize); + reader.ReadBytes(ReceiveNonce, NonceSize); + + Profiler.BeginSample("EncryptedConnection.Decrypt"); + ArraySegment plaintext = Decrypt(ciphertext); + Profiler.EndSample(); + if (plaintext.Count == 0) + { + // error + return; + } + Profiler.BeginSample("EncryptedConnection._receive"); + _receive(plaintext, channel); + Profiler.EndSample(); + break; + case OpCodes.HandshakeStart: + if (_sendsFirst) + { + _error(TransportError.Unexpected, "Received HandshakeStart packet, we don't expect this."); + return; + } + + if (_state == State.WaitingHandshakeReply) + { + // this is fine, packets may arrive out of order + return; + } + + _state = State.WaitingHandshakeReply; + ResetTimeouts(); + CompleteExchange(reader.ReadBytesSegment(reader.Remaining), _hkdfSalt); + SendHandshakeAndPubKey(OpCodes.HandshakeAck); + break; + case OpCodes.HandshakeAck: + if (!_sendsFirst) + { + _error(TransportError.Unexpected, "Received HandshakeAck packet, we don't expect this."); + return; + } + + if (IsReady) + { + // this is fine, packets may arrive out of order + return; + } + + if (_state == State.WaitingHandshakeReply) + { + // this is fine, packets may arrive out of order + return; + } + + + _state = State.WaitingHandshakeReply; + ResetTimeouts(); + reader.ReadBytes(_tmpRemoteSaltBuffer, HkdfSaltSize); + CompleteExchange(reader.ReadBytesSegment(reader.Remaining), _tmpRemoteSaltBuffer); + SendHandshakeFin(); + break; + case OpCodes.HandshakeFin: + if (_sendsFirst) + { + _error(TransportError.Unexpected, "Received HandshakeFin packet, we don't expect this."); + return; + } + + if (IsReady) + { + // this is fine, packets may arrive out of order + return; + } + + if (_state != State.WaitingHandshakeReply) + { + _error(TransportError.Unexpected, + "Received HandshakeFin packet, we didn't expect this yet."); + return; + } + SetReady(); - } - else if (!IsReady) - { - _error(TransportError.Unexpected, "Unexpected data while not ready."); - } - - if (reader.Remaining < Overhead) - { - _error(TransportError.Unexpected, "received data packet smaller than metadata size"); - return; - } - - ArraySegment ciphertext = reader.ReadBytesSegment(reader.Remaining - NonceSize); - reader.ReadBytes(ReceiveNonce, NonceSize); - - Profiler.BeginSample("EncryptedConnection.Decrypt"); - ArraySegment plaintext = Decrypt(ciphertext); - Profiler.EndSample(); - if (plaintext.Count == 0) - { - // error - return; - } - _receive(plaintext, channel); - break; - case OpCodes.HandshakeStart: - if (_sendsFirst) - { - _error(TransportError.Unexpected, "Received HandshakeStart packet, we don't expect this."); - return; - } - - if (_state == State.WaitingHandshakeReply) - { - // this is fine, packets may arrive out of order - return; - } - - _state = State.WaitingHandshakeReply; - ResetTimeouts(); - CompleteExchange(reader.ReadBytesSegment(reader.Remaining), _hkdfSalt); - SendHandshakeAndPubKey(OpCodes.HandshakeAck); - break; - case OpCodes.HandshakeAck: - if (!_sendsFirst) - { - _error(TransportError.Unexpected, "Received HandshakeAck packet, we don't expect this."); - return; - } - - if (IsReady) - { - // this is fine, packets may arrive out of order - return; - } - - if (_state == State.WaitingHandshakeReply) - { - // this is fine, packets may arrive out of order - return; - } - - - _state = State.WaitingHandshakeReply; - ResetTimeouts(); - reader.ReadBytes(_tmpRemoteSaltBuffer, HkdfSaltSize); - CompleteExchange(reader.ReadBytesSegment(reader.Remaining), _tmpRemoteSaltBuffer); - SendHandshakeFin(); - break; - case OpCodes.HandshakeFin: - if (_sendsFirst) - { - _error(TransportError.Unexpected, "Received HandshakeFin packet, we don't expect this."); - return; - } - - if (IsReady) - { - // this is fine, packets may arrive out of order - return; - } - - if (_state != State.WaitingHandshakeReply) - { - _error(TransportError.Unexpected, - "Received HandshakeFin packet, we didn't expect this yet."); - return; - } - - SetReady(); - - break; - default: - _error(TransportError.InvalidReceive, $"Unhandled opcode {(byte)opcode:x}"); - break; + + break; + default: + _error(TransportError.InvalidReceive, $"Unhandled opcode {(byte)opcode:x}"); + break; + } } } + finally + { + Profiler.EndSample(); + } } + private void SetReady() { // done with credentials, null out the reference @@ -299,22 +312,33 @@ private void ResetTimeouts() public void Send(ArraySegment data, int channel) { - using (NetworkWriterPooled writer = NetworkWriterPool.Get()) + try { - writer.WriteByte((byte)OpCodes.Data); - Profiler.BeginSample("EncryptedConnection.Encrypt"); - ArraySegment encrypted = Encrypt(data); - Profiler.EndSample(); + Profiler.BeginSample("EncryptedConnection.Send"); - if (encrypted.Count == 0) + using (NetworkWriterPooled writer = NetworkWriterPool.Get()) { - // error - return; + writer.WriteByte((byte)OpCodes.Data); + Profiler.BeginSample("EncryptedConnection.Encrypt"); + ArraySegment encrypted = Encrypt(data); + Profiler.EndSample(); + + if (encrypted.Count == 0) + { + // error + return; + } + writer.WriteBytes(encrypted.Array, 0, encrypted.Count); + // write nonce after since Encrypt will update it + writer.WriteBytes(_nonce, 0, NonceSize); + Profiler.BeginSample("EncryptedConnection._send"); + _send(writer.ToArraySegment(), channel); + Profiler.EndSample(); } - writer.WriteBytes(encrypted.Array, 0, encrypted.Count); - // write nonce after since Encrypt will update it - writer.WriteBytes(_nonce, 0, NonceSize); - _send(writer.ToArraySegment(), channel); + } + finally + { + Profiler.EndSample(); } } @@ -327,20 +351,34 @@ private ArraySegment Encrypt(ArraySegment plaintext) } // Need to make the nonce unique again before encrypting another message UpdateNonce(); + int outSize = plaintext.Count + MacSizeBytes; + // Resize the static buffer to fit + EnsureSize(ref _tmpCryptBuffer, outSize); + if (AesGCMEncryptionNative.IsSupported) + { + ArraySegment nativeRes = AesGCMEncryptionNative.Encrypt(_keyRaw, _nonce, plaintext, new ArraySegment(_tmpCryptBuffer)); + if (nativeRes.Count == 0) + { + _error(TransportError.Unexpected, $"Native Encryption failed. Please check STDERR (or editor log) for the error."); + return new ArraySegment(); + } + return nativeRes; + } + // Re-initialize the cipher with our cached parameters Cipher.Init(true, _cipherParametersEncrypt); - // Calculate the expected output size, this should always be input size + mac size - int outSize = Cipher.GetOutputSize(plaintext.Count); #if UNITY_EDITOR + // Sanity check! + // Calculate the expected output size, this should always be input size + mac size + int calcOutSize = Cipher.GetOutputSize(plaintext.Count); // expecting the outSize to be input size + MacSize - if (outSize != plaintext.Count + MacSizeBytes) + if (calcOutSize != outSize) { - throw new Exception($"Encrypt: Unexpected output size (Expected {plaintext.Count + MacSizeBytes}, got {outSize}"); + throw new Exception($"Encrypt: Unexpected output size (Expected {outSize}, got {calcOutSize}"); } #endif - // Resize the static buffer to fit - EnsureSize(ref _tmpCryptBuffer, outSize); + int resultLen; try { @@ -375,20 +413,36 @@ private ArraySegment Decrypt(ArraySegment ciphertext) // Invalid return new ArraySegment(); } + + + int outSize = ciphertext.Count - MacSizeBytes; + // Resize the static buffer to fit + EnsureSize(ref _tmpCryptBuffer, outSize); + if (AesGCMEncryptionNative.IsSupported) + { + var nativeRes = AesGCMEncryptionNative.Decrypt(_keyRaw, ReceiveNonce, ciphertext, new ArraySegment(_tmpCryptBuffer)); + if (nativeRes.Count == 0) + { + _error(TransportError.Unexpected, $"Native Encryption failed. Please check STDERR (or editor log) for the error."); + return new ArraySegment(); + } + return nativeRes; + } + // Re-initialize the cipher with our cached parameters Cipher.Init(false, _cipherParametersDecrypt); - // Calculate the expected output size, this should always be input size - mac size - int outSize = Cipher.GetOutputSize(ciphertext.Count); #if UNITY_EDITOR + // Sanity check! + // Calculate the expected output size, this should always be input size - mac size + int calcOutSize = Cipher.GetOutputSize(ciphertext.Count); // expecting the outSize to be input size - MacSize - if (outSize != ciphertext.Count - MacSizeBytes) + if (outSize != calcOutSize) { throw new Exception($"Decrypt: Unexpected output size (Expected {ciphertext.Count - MacSizeBytes}, got {outSize}"); } #endif - // Resize the static buffer to fit - EnsureSize(ref _tmpCryptBuffer, outSize); + int resultLen; try { @@ -515,12 +569,12 @@ private void CompleteExchange(ArraySegment remotePubKeyRaw, byte[] salt) Hkdf.Init(new HkdfParameters(sharedSecret, salt, HkdfInfo)); // Allocate a buffer for the output key - byte[] keyRaw = new byte[KeyLength]; + _keyRaw = new byte[KeyLength]; // Generate the output keying material - Hkdf.GenerateBytes(keyRaw, 0, keyRaw.Length); + Hkdf.GenerateBytes(_keyRaw, 0, _keyRaw.Length); - KeyParameter key = new KeyParameter(keyRaw); + KeyParameter key = new KeyParameter(_keyRaw); // generate a starting nonce _nonce = GenerateSecureBytes(NonceSize); diff --git a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs index 5d9d9bb9aed..ee7599add42 100644 --- a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs +++ b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Mirror.Transports.Encryption.Native; using UnityEngine; using UnityEngine.Profiling; using UnityEngine.Serialization; @@ -38,6 +39,11 @@ public enum ValidationMode public string EncryptionPublicKeyFingerprint => _credentials?.PublicKeyFingerprint; public byte[] EncryptionPublicKey => _credentials?.PublicKeySerialized; + + public override string ToString() + { + return $"EncryptionTransport(native: {AesGCMEncryptionNative.IsSupported})"; + } private void ServerRemoveFromPending(EncryptedConnection con) { for (int i = 0; i < _serverPendingConnections.Count; i++) diff --git a/Assets/Mirror/Transports/Encryption/Native.meta b/Assets/Mirror/Transports/Encryption/Native.meta new file mode 100644 index 00000000000..dbac4c8a491 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f4ce017555fd48b7974abd511fd855c1 +timeCreated: 1708980635 \ No newline at end of file diff --git a/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs b/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs new file mode 100644 index 00000000000..923849585d3 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs @@ -0,0 +1,81 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; +using UnityEngine; +namespace Mirror.Transports.Encryption.Native +{ + public class AesGCMEncryptionNative + { + [SuppressUnmanagedCodeSecurity] + [DllImport("rusty_mirror_encryption", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] + private static extern byte is_supported(); + + [SuppressUnmanagedCodeSecurity] + [DllImport("rusty_mirror_encryption", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] + private static extern uint aes_gcm_encrypt( + UIntPtr key, uint key_size, + UIntPtr nonce, uint nonce_size, + UIntPtr data, uint data_in_size, uint data_capacity); + + [SuppressUnmanagedCodeSecurity] + [DllImport("rusty_mirror_encryption", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] + private static extern uint aes_gcm_decrypt( + UIntPtr key, uint key_size, + UIntPtr nonce, uint nonce_size, + UIntPtr data, uint data_size); + + private static bool _supported; + static AesGCMEncryptionNative() + { + try + { + _supported = is_supported() == 1; + } + catch (Exception e) + { + // TODO: silent? + Debug.LogWarning($"Native AES GCM is not supported: {e}"); + } + } + public static bool IsSupported => _supported; + public static unsafe ArraySegment Encrypt(byte[] key, byte[] nonce, ArraySegment plaintext, ArraySegment dataOut) + { + Array.Copy(plaintext.Array, plaintext.Offset, dataOut.Array, dataOut.Offset ,plaintext.Count); + fixed (byte* keyPtr = key) + { + fixed (byte* noncePtr = nonce) + { + fixed (byte* dataPtr = dataOut.Array) + { + UIntPtr data = ((UIntPtr)dataPtr) + dataOut.Offset; + uint resultLength = aes_gcm_encrypt( + (UIntPtr)keyPtr, (uint)key.Length, + (UIntPtr)noncePtr, (uint)nonce.Length, + data, (uint)plaintext.Count, (uint)dataOut.Count); + return new ArraySegment(dataOut.Array, dataOut.Offset, (int)resultLength); + } + } + } + } + + public static unsafe ArraySegment Decrypt(byte[] key, byte[] nonce, ArraySegment ciphertext, ArraySegment dataOut) + { + Array.Copy(ciphertext.Array, ciphertext.Offset, dataOut.Array, dataOut.Offset, ciphertext.Count); + fixed (byte* keyPtr = key) + { + fixed (byte* noncePtr = nonce) + { + fixed (byte* dataPtr = dataOut.Array) + { + UIntPtr data = ((UIntPtr)dataPtr) + dataOut.Offset; + uint resultLength = aes_gcm_decrypt( + (UIntPtr)keyPtr, (uint)key.Length, + (UIntPtr)noncePtr, (uint)nonce.Length, + data, (uint)ciphertext.Count); + return new ArraySegment(dataOut.Array, dataOut.Offset, (int)resultLength); + } + } + } + } + } +} diff --git a/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs.meta b/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs.meta new file mode 100644 index 00000000000..550eb58faf3 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/AesGCMEncryptionNative.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 62ce567e6de54179a7e71c6173c07074 +timeCreated: 1708980733 \ No newline at end of file diff --git a/Assets/Mirror/Transports/Encryption/Native/LICENSE b/Assets/Mirror/Transports/Encryption/Native/LICENSE new file mode 100644 index 00000000000..c737e631623 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Robin Rolf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Assets/Mirror/Transports/Encryption/Native/LICENSE.meta b/Assets/Mirror/Transports/Encryption/Native/LICENSE.meta new file mode 100644 index 00000000000..f2404dac32f --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/LICENSE.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3b3ffcf9d4944ce1ba77dc8853552169 +timeCreated: 1708988561 \ No newline at end of file diff --git a/Assets/Mirror/Transports/Encryption/Native/README.md b/Assets/Mirror/Transports/Encryption/Native/README.md new file mode 100644 index 00000000000..1220c0412c9 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/README.md @@ -0,0 +1,4 @@ +# [RustyMirrorEncryption](https://github.com/imerr/RustyMirrorEncryption) +A tiny native library for hardware accelerated AES-GCM encryption and decryption for the EncryptionTransport in [Mirror](https://github.com/MirrorNetworking/Mirror) + +Uses [RustCryptos aes_gcm crate](https://github.com/RustCrypto/AEADs/tree/master/aes-gcm) crate diff --git a/Assets/Mirror/Transports/Encryption/Native/README.md.meta b/Assets/Mirror/Transports/Encryption/Native/README.md.meta new file mode 100644 index 00000000000..d95afc7e7b6 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/README.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1d335f0e47b24038886233a1c8622cd3 +timeCreated: 1708988530 \ No newline at end of file diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin.meta new file mode 100644 index 00000000000..6bd08b6f686 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b590fe1f91b89f7429f7718e41d5c627 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib new file mode 100644 index 00000000000..faa3a69a747 Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib differ diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib.meta new file mode 100644 index 00000000000..1a75580dc4b --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-darwin/librusty_mirror_encryption.dylib.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: b76b42eea65583d48a419394df29a98f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: ARM64 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios.meta new file mode 100644 index 00000000000..549dfc36f22 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52afa74b55d70ff4b944c270cded1621 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib new file mode 100644 index 00000000000..9cdecc7e0a0 Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib differ diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib.meta new file mode 100644 index 00000000000..4b3259a9550 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-apple-ios/librusty_mirror_encryption.dylib.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 2549b603494fff7469d56bda37b69109 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android.meta new file mode 100644 index 00000000000..6fcb7a2d1f8 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 12721f4888703aa46b3d1ccf95574933 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so new file mode 100644 index 00000000000..1a6db55a0c6 Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so differ diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so.meta new file mode 100644 index 00000000000..2f5eb25ede7 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-linux-android/librusty_mirror_encryption.so.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 27733f6020cceb14c8f496b32d0e7fbd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu.meta new file mode 100644 index 00000000000..b402e7bd3fa --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab9fb4d0e4db8104ca0b081fdb5ed39b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so new file mode 100644 index 00000000000..c710c3ff04b Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so differ diff --git a/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so.meta b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so.meta new file mode 100644 index 00000000000..db24004d123 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/aarch64-unknown-linux-gnu/librusty_mirror_encryption.so.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 8b444b5607bfebe45b55f3738101e467 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi.meta b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi.meta new file mode 100644 index 00000000000..81a9e6a0823 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8232f87006729a4097558e850130da4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so new file mode 100644 index 00000000000..0435f0bfd1b Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so differ diff --git a/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so.meta b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so.meta new file mode 100644 index 00000000000..02efafd6380 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/armv7-linux-androideabi/librusty_mirror_encryption.so.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: b49434d36bc0ad54db4779b5d09edb63 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc.meta b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc.meta new file mode 100644 index 00000000000..89607765173 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cfeeb87517fcd8d43a1e82b9b2bc0ede +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll new file mode 100644 index 00000000000..bb35db5634c Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll differ diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll.meta b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll.meta new file mode 100644 index 00000000000..b5736a6f60d --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/i686-pc-windows-msvc/rusty_mirror_encryption.dll.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: f52c61e71c4975e46810869fc35f9bae +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu.meta b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu.meta new file mode 100644 index 00000000000..144991dc1ee --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de0f8585ba061a54aa46ada04c1eb8ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so new file mode 100644 index 00000000000..5e78220bd82 Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so differ diff --git a/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so.meta b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so.meta new file mode 100644 index 00000000000..5fc5127d7da --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/i686-unknown-linux-gnu/librusty_mirror_encryption.so.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 46bfc9351689e844cad51ad69f5e4827 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin.meta new file mode 100644 index 00000000000..f8c9bb2781b --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4280b4d4efd76e4cbc4e3cf208c350e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib new file mode 100644 index 00000000000..5e26cf98f4e Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib differ diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib.meta new file mode 100644 index 00000000000..2ce8d224613 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-apple-darwin/librusty_mirror_encryption.dylib.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 05c6164d5fd90e54e84a20f6c249a9f6 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc.meta new file mode 100644 index 00000000000..f25adcb5ee5 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e8552804ac328fe4cb6d1eabdc6c16e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll new file mode 100644 index 00000000000..7adf425a23c Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll differ diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll.meta new file mode 100644 index 00000000000..92966480fa3 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-pc-windows-msvc/rusty_mirror_encryption.dll.meta @@ -0,0 +1,63 @@ +fileFormatVersion: 2 +guid: e998ea81dd4a7db4895f9dd0a7b1b851 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 0 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu.meta new file mode 100644 index 00000000000..3e59b34ca61 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 229ad37adf003944cbe12c48c0cabd39 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so new file mode 100644 index 00000000000..5686fa41c74 Binary files /dev/null and b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so differ diff --git a/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so.meta b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so.meta new file mode 100644 index 00000000000..4fc89a9e163 --- /dev/null +++ b/Assets/Mirror/Transports/Encryption/Native/x86_64-unknown-linux-gnu/librusty_mirror_encryption.so.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 7ec268e885af5d64ab9519ac0026b5a9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: