diff --git a/Assets/Debug/DebugScene/Constants.cs b/Assets/Debug/DebugScene/Constants.cs new file mode 100644 index 0000000..b23bead --- /dev/null +++ b/Assets/Debug/DebugScene/Constants.cs @@ -0,0 +1,14 @@ +using MDMulti; +using UnityEngine; + +namespace MDMulti_DEBUG.DebugScene +{ + public class Constants : MonoBehaviour + { + public void LogTest() + { + MDMulti.Constants.ConstantsObject c = ConstantsHelper.Get(); + Debug.Log("ConstantsLogTest: Multicast Information\n" + c.Lan.Multicast.Address + ":" + c.Lan.Multicast.Port); + } + } +} \ No newline at end of file diff --git a/Assets/Debug/DebugScene/Constants.cs.meta b/Assets/Debug/DebugScene/Constants.cs.meta new file mode 100644 index 0000000..8baf42d --- /dev/null +++ b/Assets/Debug/DebugScene/Constants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afb9aa56d4d0270458c55b0c7cec3409 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Debug/DebugScene/DebugScene.unity b/Assets/Debug/DebugScene/DebugScene.unity index afbf3c6..6185b33 100644 --- a/Assets/Debug/DebugScene/DebugScene.unity +++ b/Assets/Debug/DebugScene/DebugScene.unity @@ -844,6 +844,125 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 150561442} m_CullTransparentMesh: 0 +--- !u!1001 &161055706 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2013164481} + m_Modifications: + - target: {fileID: 1290408108987661695, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Name + value: Constants + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 145 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -197.49 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_SizeDelta.x + value: 225 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_SizeDelta.y + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, type: 3} --- !u!1 &166911124 GameObject: m_ObjectHideFlags: 0 @@ -2184,7 +2303,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 619351115} m_CullTransparentMesh: 0 ---- !u!1 &657236372 +--- !u!1 &644420371 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2192,78 +2311,128 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 657236373} - - component: {fileID: 657236375} - - component: {fileID: 657236374} + - component: {fileID: 644420372} + - component: {fileID: 644420375} + - component: {fileID: 644420374} + - component: {fileID: 644420373} m_Layer: 5 - m_Name: Text + m_Name: Constants_LogTest m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &657236373 +--- !u!224 &644420372 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 657236372} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_GameObject: {fileID: 644420371} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 463801156} + m_Children: + - {fileID: 1810866622} + m_Father: {fileID: 1970463316} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -51.7, y: 0} + m_SizeDelta: {x: 100, y: 30} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &657236374 +--- !u!114 &644420373 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 657236372} + m_GameObject: {fileID: 644420371} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 644420374} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1970463317} + m_MethodName: LogTest + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &644420374 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 644420371} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Create User ---- !u!222 &657236375 + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &644420375 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 657236372} + m_GameObject: {fileID: 644420371} m_CullTransparentMesh: 0 ---- !u!1 &750983555 +--- !u!1 &657236372 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2271,9 +2440,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 750983556} - - component: {fileID: 750983558} - - component: {fileID: 750983557} + - component: {fileID: 657236373} + - component: {fileID: 657236375} + - component: {fileID: 657236374} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -2281,18 +2450,18 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &750983556 +--- !u!224 &657236373 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 750983555} + m_GameObject: {fileID: 657236372} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 993842680} + m_Father: {fileID: 463801156} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -2300,13 +2469,13 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &750983557 +--- !u!114 &657236374 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 750983555} + m_GameObject: {fileID: 657236372} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} @@ -2333,34 +2502,242 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Stop ---- !u!222 &750983558 + m_Text: Create User +--- !u!222 &657236375 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 750983555} + m_GameObject: {fileID: 657236372} m_CullTransparentMesh: 0 ---- !u!1 &768158936 -GameObject: +--- !u!1001 &669699736 +PrefabInstance: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 768158940} - - component: {fileID: 768158939} - - component: {fileID: 768158938} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &768158938 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1176862476} + m_Modifications: + - target: {fileID: 6101637671845785379, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Name + value: TEXTPREFAB + objectReference: {fileID: 0} + - target: {fileID: 6101637671845785379, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 80.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -3.2 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_SizeDelta.x + value: 160 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_SizeDelta.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 873434211562065042, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Text + value: SHA2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2e8e46b2076394b499aaa4d49bc28218, type: 3} +--- !u!1 &750983555 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 750983556} + - component: {fileID: 750983558} + - component: {fileID: 750983557} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &750983556 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 750983555} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 993842680} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &750983557 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 750983555} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Stop +--- !u!222 &750983558 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 750983555} + m_CullTransparentMesh: 0 +--- !u!1 &768158936 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 768158940} + - component: {fileID: 768158939} + - component: {fileID: 768158938} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &768158938 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3003,41 +3380,160 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1034108690} m_CullTransparentMesh: 0 ---- !u!1 &1111416823 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1111416824} - - component: {fileID: 1111416827} - - component: {fileID: 1111416826} - - component: {fileID: 1111416825} - m_Layer: 5 - m_Name: TX Stop - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1111416824 -RectTransform: +--- !u!1001 &1088100995 +PrefabInstance: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1111416823} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 2.0625} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1368378904} - m_Father: {fileID: 589088835} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2013164481} + m_Modifications: + - target: {fileID: 1290408108987661695, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Name + value: SHA2 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchoredPosition.x + value: -24.3 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -197.49 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_SizeDelta.x + value: 125 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_SizeDelta.y + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, type: 3} +--- !u!1 &1111416823 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1111416824} + - component: {fileID: 1111416827} + - component: {fileID: 1111416826} + - component: {fileID: 1111416825} + m_Layer: 5 + m_Name: TX Stop + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1111416824 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1111416823} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 2.0625} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1368378904} + m_Father: {fileID: 589088835} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -104, y: -60.773193} m_SizeDelta: {x: 60, y: 30} @@ -3340,6 +3836,159 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1123157563} m_CullTransparentMesh: 0 +--- !u!1001 &1164197553 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1970463316} + m_Modifications: + - target: {fileID: 6101637671845785379, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Name + value: TEXTPREFAB + objectReference: {fileID: 0} + - target: {fileID: 6101637671845785379, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 83.8 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -3.2 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_SizeDelta.x + value: 160 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_SizeDelta.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 746092036223162167, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 873434211562065042, guid: 2e8e46b2076394b499aaa4d49bc28218, + type: 3} + propertyPath: m_Text + value: Constants + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2e8e46b2076394b499aaa4d49bc28218, type: 3} +--- !u!1 &1176862475 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1290408108987661695, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + m_PrefabInstance: {fileID: 1088100995} + m_PrefabAsset: {fileID: 0} +--- !u!224 &1176862476 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + m_PrefabInstance: {fileID: 1088100995} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1176862477 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1176862475} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2faa3740cc66fe64da85c9e6e292643a, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1215308964 PrefabInstance: m_ObjectHideFlags: 0 @@ -3944,29 +4593,158 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 20 - m_FontStyle: 1 - m_BestFit: 0 - m_MinSize: 2 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: LAN Discovery ---- !u!222 &1534634980 + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 20 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: LAN Discovery +--- !u!222 &1534634980 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1534634977} + m_CullTransparentMesh: 0 +--- !u!1 &1561323785 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1561323786} + - component: {fileID: 1561323789} + - component: {fileID: 1561323788} + - component: {fileID: 1561323787} + m_Layer: 5 + m_Name: PeerConn_AddListener + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1561323786 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1561323785} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 166911125} + m_Father: {fileID: 499340969} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -51.7, y: 0} + m_SizeDelta: {x: 100, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1561323787 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1561323785} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1561323788} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 499340971} + m_MethodName: AddListener + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1561323788 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1561323785} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &1561323789 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1534634977} + m_GameObject: {fileID: 1561323785} m_CullTransparentMesh: 0 ---- !u!1 &1561323785 +--- !u!1 &1651399813 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3974,44 +4752,79 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1561323786} - - component: {fileID: 1561323789} - - component: {fileID: 1561323788} - - component: {fileID: 1561323787} + - component: {fileID: 1651399814} + m_Layer: 0 + m_Name: Multicast + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1651399814 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1651399813} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.8841429, y: 96.77319, z: -2.0625} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1123157564} + - {fileID: 1847045798} + - {fileID: 1121899401} + - {fileID: 853373499} + - {fileID: 392003338} + m_Father: {fileID: 2122928410} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1712182060 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1712182061} + - component: {fileID: 1712182064} + - component: {fileID: 1712182063} + - component: {fileID: 1712182062} m_Layer: 5 - m_Name: PeerConn_AddListener + m_Name: SHA2_TEST m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1561323786 +--- !u!224 &1712182061 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1561323785} + m_GameObject: {fileID: 1712182060} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 166911125} - m_Father: {fileID: 499340969} + - {fileID: 1797689698} + m_Father: {fileID: 1176862476} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -51.7, y: 0} - m_SizeDelta: {x: 100, y: 30} + m_AnchoredPosition: {x: -28, y: 0} + m_SizeDelta: {x: 50, y: 30} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1561323787 +--- !u!114 &1712182062 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1561323785} + m_GameObject: {fileID: 1712182060} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} @@ -4041,12 +4854,12 @@ MonoBehaviour: m_PressedTrigger: Pressed m_DisabledTrigger: Disabled m_Interactable: 1 - m_TargetGraphic: {fileID: 1561323788} + m_TargetGraphic: {fileID: 1712182063} m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 499340971} - m_MethodName: AddListener + - m_Target: {fileID: 1176862477} + m_MethodName: Test m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -4058,13 +4871,13 @@ MonoBehaviour: m_CallState: 2 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ---- !u!114 &1561323788 +--- !u!114 &1712182063 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1561323785} + m_GameObject: {fileID: 1712182060} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} @@ -4087,15 +4900,15 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 ---- !u!222 &1561323789 +--- !u!222 &1712182064 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1561323785} + m_GameObject: {fileID: 1712182060} m_CullTransparentMesh: 0 ---- !u!1 &1651399813 +--- !u!1 &1749062262 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -4103,34 +4916,78 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1651399814} - m_Layer: 0 - m_Name: Multicast + - component: {fileID: 1749062263} + - component: {fileID: 1749062265} + - component: {fileID: 1749062264} + m_Layer: 5 + m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1651399814 -Transform: +--- !u!224 &1749062263 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1651399813} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.8841429, y: 96.77319, z: -2.0625} + m_GameObject: {fileID: 1749062262} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1123157564} - - {fileID: 1847045798} - - {fileID: 1121899401} - - {fileID: 853373499} - - {fileID: 392003338} - m_Father: {fileID: 2122928410} + m_Children: [] + m_Father: {fileID: 388635203} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1749062262 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1749062264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749062262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Start +--- !u!222 &1749062265 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749062262} + m_CullTransparentMesh: 0 +--- !u!1 &1797689697 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -4138,9 +4995,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1749062263} - - component: {fileID: 1749062265} - - component: {fileID: 1749062264} + - component: {fileID: 1797689698} + - component: {fileID: 1797689700} + - component: {fileID: 1797689699} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -4148,18 +5005,18 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1749062263 +--- !u!224 &1797689698 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1749062262} + m_GameObject: {fileID: 1797689697} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 388635203} + m_Father: {fileID: 1712182061} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -4167,13 +5024,13 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1749062264 +--- !u!114 &1797689699 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1749062262} + m_GameObject: {fileID: 1797689697} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} @@ -4200,14 +5057,93 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Start ---- !u!222 &1749062265 + m_Text: Test +--- !u!222 &1797689700 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1749062262} + m_GameObject: {fileID: 1797689697} + m_CullTransparentMesh: 0 +--- !u!1 &1810866621 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1810866622} + - component: {fileID: 1810866624} + - component: {fileID: 1810866623} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1810866622 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1810866621} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 644420372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1810866623 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1810866621} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Logging Test +--- !u!222 &1810866624 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1810866621} m_CullTransparentMesh: 0 --- !u!1 &1847045797 GameObject: @@ -4338,6 +5274,30 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1847045797} m_CullTransparentMesh: 0 +--- !u!1 &1970463315 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1290408108987661695, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + m_PrefabInstance: {fileID: 161055706} + m_PrefabAsset: {fileID: 0} +--- !u!224 &1970463316 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 1688249289041980399, guid: ab998dca4e3cb6440bb3fe2a32c8ed82, + type: 3} + m_PrefabInstance: {fileID: 161055706} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1970463317 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1970463315} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: afb9aa56d4d0270458c55b0c7cec3409, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &2013164477 GameObject: m_ObjectHideFlags: 0 @@ -4433,6 +5393,8 @@ RectTransform: - {fileID: 2122928410} - {fileID: 546077433} - {fileID: 1375305754} + - {fileID: 1970463316} + - {fileID: 1176862476} m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Debug/DebugScene/Latest.cs b/Assets/Debug/DebugScene/Latest.cs index e0cd9ec..686a458 100644 --- a/Assets/Debug/DebugScene/Latest.cs +++ b/Assets/Debug/DebugScene/Latest.cs @@ -1,30 +1,32 @@ -using System.Text; -using UnityEngine; +using UnityEngine; namespace MDMulti_DEBUG.DebugScene { public class Latest : MonoBehaviour { - public void Latest1() + public async void Latest1() { Debug.Log("L"); - //Debug.Log(MDMulti.SHA2Helper.ComputeHash(new byte[0])); - //Debug.Log(MDMulti.SHA2Helper.ComputeHashStr("")); - MDMulti.ConstantsHelper.Test(); + + // KEYDB Testing | AddIfNotPresent + + MDMulti.PeerDB.KeyFile s = await MDMulti.PeerDB.GetObject(); + + s.AddX509IfNotPresent(await MDMulti.CertHelper.GetCertificateFromFile("p4.crt")); + s.SaveToFile(); } - public void Latest2() + public async void Latest2() { Debug.Log("L2"); - byte[] s = MDMulti.Net.Core.GenerateAndAddHash(Encoding.UTF8.GetBytes("This is a SHA256 function.")); - Debug.Log(MDMulti.Net.Core.GetHash(s)); - Debug.Log("3"); - byte[] s3 = MDMulti.Net.Core.GenerateAndAddHash(Encoding.UTF8.GetBytes("This is a SHA256 function.")); - var ss = MDMulti.Net.Core.SplitHashAndMessage(s3); + // KEYDB Testing + + var kf = await MDMulti.PeerDB.GetObject(); + + Debug.Log(kf.keys[0].GetAID()); + Debug.Log(MDMulti.CertHelper.IsUserCertificate(kf.keys[0].GetCert())); - Debug.Log("MSG: " + Encoding.UTF8.GetString(ss.Item1)); - Debug.Log("HASH: " + ss.Item2); } } } \ No newline at end of file diff --git a/Assets/Debug/DebugScene/SHA2.cs b/Assets/Debug/DebugScene/SHA2.cs new file mode 100644 index 0000000..8b5beb4 --- /dev/null +++ b/Assets/Debug/DebugScene/SHA2.cs @@ -0,0 +1,75 @@ +using MDMulti.Net; +using System; +using System.Text; +using UnityEngine; + +namespace MDMulti_DEBUG.DebugScene +{ + public class SHA2 : MonoBehaviour + { + private readonly string dataToHash = "This is a SHA256 test."; + // No point adding readonly here as there is only a getter anyways. + private byte[] dataToHashB { get { return Encoding.UTF8.GetBytes(dataToHash); } } + + private readonly string expectedHash = "4816482f8b4149f687a1a33d61a0de6b611364ec0fb7adffa59ff2af672f7232".ToUpper(); + + public void Test() + { + Debug.LogWarning("----- Starting SHA2 Test -----"); + + + // Test Phase 1: Creation and validation + Debug.LogWarning("----- PHASE 1: CREATION + VALIDATION -----"); + + Debug.Log("Hashing string '" + dataToHash + "'"); + + byte[] combined = Core.GenerateAndAddHash(dataToHashB); + + string gotHash = Core.GetHash(combined); + + Debug.Log("Got hash " + gotHash); + Debug.Log("Expected hash " + expectedHash); + + if (gotHash == expectedHash) + { + Debug.Log("Hashes match!"); + } else + { + Debug.LogError("Hashes do not match!"); + } + + + // Test Phase 2: Extraction + Debug.LogWarning("----- PHASE 2: EXTRACTION -----"); + + Debug.Log("Extracting string and hash..."); + + Tuple split = Core.SplitHashAndMessage(combined); + + string extractedMessage = Encoding.UTF8.GetString(split.Item1); + + Debug.Log("Extracted message '" + extractedMessage + "'"); + Debug.Log("Extracted hash " + split.Item2); + + if (dataToHash == extractedMessage) + { + Debug.Log("Messages match!"); + } else + { + Debug.LogError("Extracted message did not match original!"); + } + + if (expectedHash == split.Item2) + { + Debug.Log("Hashes match!"); + } else + { + Debug.LogError("Extracted hash did not match original!"); + } + + + // End of test + Debug.LogWarning("----- SHA2 Test Finished! -----\nPlease check logs for possible errors."); + } + } +} \ No newline at end of file diff --git a/Assets/Debug/DebugScene/SHA2.cs.meta b/Assets/Debug/DebugScene/SHA2.cs.meta new file mode 100644 index 0000000..0e192fa --- /dev/null +++ b/Assets/Debug/DebugScene/SHA2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2faa3740cc66fe64da85c9e6e292643a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MDMulti/Resources/constants.json b/Assets/MDMulti/Resources/constants.json index c6d5abb..a0711d4 100644 --- a/Assets/MDMulti/Resources/constants.json +++ b/Assets/MDMulti/Resources/constants.json @@ -1,8 +1,12 @@ { "this_loc": "https://raw.githubusercontent.com/mdmulti/constants/master/constants.json", - "version" : 1, + "version" : 2, "mdmc_version": 3, "mdms_version": 1, + "peerdb_file": { + "name": "peerdb.mdm.json", + "version": 1 + }, "oid": { "base": "1.3.6.1.4.1.54622.0.1" }, @@ -15,4 +19,4 @@ "port": 25816 } } -} +} \ No newline at end of file diff --git a/Assets/MDMulti/Scripts/Constants.cs b/Assets/MDMulti/Scripts/Constants.cs index a4a4c20..3077148 100644 --- a/Assets/MDMulti/Scripts/Constants.cs +++ b/Assets/MDMulti/Scripts/Constants.cs @@ -21,6 +21,9 @@ public partial class ConstantsObject [JsonProperty("mdms_version", Required = Required.Always)] public long MdmsVersion { get; set; } + [JsonProperty("peerdb_file", Required = Required.Always)] + public PeerdbFile PeerdbFile { get; set; } + [JsonProperty("oid", Required = Required.Always)] public Oid Oid { get; set; } @@ -58,6 +61,15 @@ public partial class Oid public string Base { get; set; } } + public partial class PeerdbFile + { + [JsonProperty("name", Required = Required.Always)] + public string Name { get; set; } + + [JsonProperty("version", Required = Required.Always)] + public long Version { get; set; } + } + public partial class ConstantsObject { public static ConstantsObject FromJson(string json) => JsonConvert.DeserializeObject(json, MDMulti.Constants.Converter.Settings); diff --git a/Assets/MDMulti/Scripts/Helpers/ConstantsHelper.cs b/Assets/MDMulti/Scripts/Helpers/ConstantsHelper.cs index f0d4014..1acd7b6 100644 --- a/Assets/MDMulti/Scripts/Helpers/ConstantsHelper.cs +++ b/Assets/MDMulti/Scripts/Helpers/ConstantsHelper.cs @@ -5,15 +5,13 @@ namespace MDMulti { public class ConstantsHelper { + /// + /// Get the Constants Object. + /// public static ConstantsObject Get() { string data = Resources.Load("constants").text; return ConstantsObject.FromJson(data); } - - public static void Test() - { - Debug.Log(Get().Lan.Multicast.Address + ":" + Get().Lan.Multicast.Port); - } } } \ No newline at end of file diff --git a/Assets/MDMulti/Scripts/Helpers/StorageHelper.cs b/Assets/MDMulti/Scripts/Helpers/StorageHelper.cs index 26a6b27..f4470e4 100644 --- a/Assets/MDMulti/Scripts/Helpers/StorageHelper.cs +++ b/Assets/MDMulti/Scripts/Helpers/StorageHelper.cs @@ -1,8 +1,13 @@ -using System.IO; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System.IO; using System.Runtime.Serialization.Formatters.Binary; +using System.Text; using System.Threading.Tasks; using UnityEngine; +// Always close your streams to avoid IOExceptions! + namespace MDMulti { public class StorageHelper @@ -30,6 +35,11 @@ public static void SaveToFile(System.SerializableAttribute data, string filename file.Close(); } + /// + /// Save to a File (Alternate) - Suitable for JSON files. + /// + /// The data to save. + /// The filename to use. public static void SaveToFileAlternate(string data, string filename) { Debug.Log(Application.persistentDataPath); @@ -41,11 +51,44 @@ public static bool FileExists(string filename) return File.Exists(Application.persistentDataPath + "/" + filename); } + /// + /// Tests to see if the specified **existing** file is valid JSON. + /// + /// File to test + /// async Boolean exists + private static async Task FileIsJson(string filename) + { + try + { + JObject.Parse(Encoding.UTF8.GetString(await ReadFileByte(filename))); + // If we get to this line then the file is valid JSON. + return true; + } catch (JsonReaderException) + { + // File is not valid JSON. + return false; + } + } + + public static async Task FileExistsAndIsJson(string filename) + { + bool exists = FileExists(filename); + + if (!exists) + { + return false; + } else + { + return await FileIsJson(filename); + } + } + public static async Task ReadFileByte(string filename) { FileStream file = File.OpenRead(GetFullPath(filename)); byte[] buffer = new byte[file.Length]; await file.ReadAsync(buffer, 0, (int)file.Length); + file.Close(); return buffer; } @@ -54,6 +97,7 @@ public static byte[] ReadFileByteSync(string filename) FileStream file = File.OpenRead(GetFullPath(filename)); byte[] buffer = new byte[file.Length]; file.Read(buffer, 0, (int)file.Length); + file.Close(); return buffer; } } diff --git a/Assets/MDMulti/Scripts/KeyDB.cs b/Assets/MDMulti/Scripts/KeyDB.cs new file mode 100644 index 0000000..7ef7eb6 --- /dev/null +++ b/Assets/MDMulti/Scripts/KeyDB.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace MDMulti +{ + public class PeerDB + { + /// + /// Get the PeerDB / KeyDB constants object. + /// See object . + /// + /// The constants object. + private static Constants.PeerdbFile GetConstants() + { + return ConstantsHelper.Get().PeerdbFile; + } + + /// + /// Create or load an object. + /// + public static async Task GetObject() + { + if (!await StorageHelper.FileExistsAndIsJson(GetConstants().Name)) + { + UnityEngine.Debug.Log("KEYDB - Creating new"); + return new KeyFile(); + } else + { + UnityEngine.Debug.Log("KEYDB - Loading"); + return await LoadFromFile(); + } + } + + private static async Task LoadFromFile() + { + string data = Encoding.UTF8.GetString(await StorageHelper.ReadFileByte(GetConstants().Name)); + return JsonConvert.DeserializeObject(data); + } + + /// + /// Schema / Class file for the Root Key File + /// + public class KeyFile + { + // We do it this way so that it is still serialized as JSON. + public int version { get { return (int)GetConstants().Version; } } + public List keys; + + public KeyFile() + { + keys = new List(); + } + + public void SaveToFile() + { + StorageHelper.SaveToFileAlternate(JsonConvert.SerializeObject(this), GetConstants().Name); + } + + /// + /// Add a new certificate item to the database, even if it already exists. + /// + /// + public void AddX509Force(X509Certificate2 cert) + { + keys.Add(new KeyItem(cert)); + } + + /// + /// Add a new certificate item to the database if it was not already present. + /// + public void AddX509IfNotPresent(X509Certificate2 cert) + { + KeyItem certKI = new KeyItem(cert); + + bool exists = keys.Any(item => item.GetAID() == certKI.GetAID() && item.GetPublicKeyString() == certKI.GetPublicKeyString()); + + if (!exists) AddX509Force(cert); + } + + } + + /// + /// Schema / Class file for the Key Item(s) + /// + public class KeyItem + { + public KeyItem(X509Certificate2 cert) + { + _x509Pub = cert; + } + + [JsonProperty("apparentID")] + // This object has been made private so that we can + // freely rename these in the future without affecting compatability. + private string _apparentID { get { return GetCert().GetSerialNumberString().ToUpper(); } } + + + [JsonProperty("x509Pub")] + [JsonConverter(typeof(X509Certificate2Converter))] + // This object has been made private so that we can + // freely rename these in the future without affecting compatability. + private X509Certificate2 _x509Pub; + + /// + /// Get the X509Certificate2 object for this item. + /// + public X509Certificate2 GetCert() + { + return _x509Pub; + } + + /// + /// Get the apparent ID for this item. + /// + public string GetAID() + { + return _apparentID; + } + + /// + /// Get the public key for this item as a string. + /// + /// The string representation of the public key. + public string GetPublicKeyString() + { + return GetCert().GetPublicKeyString(); + } + } + + /// + /// NewtonSoft.JSON converter to serialize an X509Certificate2 to a Base64 string. + /// Uses + /// + public class X509Certificate2Converter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + X509Certificate2 cert = value as X509Certificate2; + writer.WriteValue(CertHelper.ExportCertificate(cert)); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + byte[] certData = Convert.FromBase64String((string)reader.Value); + return new X509Certificate2(certData); + } + + // CanRead is not required as it is enabled by default + // It also takes no arguments + + public override bool CanConvert(Type objectType) + { + return objectType == typeof(X509Certificate2); + } + } + } +} diff --git a/Assets/MDMulti/Scripts/KeyDB.cs.meta b/Assets/MDMulti/Scripts/KeyDB.cs.meta new file mode 100644 index 0000000..e91be03 --- /dev/null +++ b/Assets/MDMulti/Scripts/KeyDB.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0ae558b3e2876c45b8ef8f2b3e52475 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs b/Assets/Plugins/AsyncAwaitUtil/AwaitExtensions.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs rename to Assets/Plugins/AsyncAwaitUtil/AwaitExtensions.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs.meta b/Assets/Plugins/AsyncAwaitUtil/AwaitExtensions.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/AwaitExtensions.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/AwaitExtensions.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Awaiters.cs b/Assets/Plugins/AsyncAwaitUtil/Awaiters.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Awaiters.cs rename to Assets/Plugins/AsyncAwaitUtil/Awaiters.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Awaiters.cs.meta b/Assets/Plugins/AsyncAwaitUtil/Awaiters.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Awaiters.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/Awaiters.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/IEnumeratorAwaitExtensions.cs b/Assets/Plugins/AsyncAwaitUtil/IEnumeratorAwaitExtensions.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/IEnumeratorAwaitExtensions.cs rename to Assets/Plugins/AsyncAwaitUtil/IEnumeratorAwaitExtensions.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/IEnumeratorAwaitExtensions.cs.meta b/Assets/Plugins/AsyncAwaitUtil/IEnumeratorAwaitExtensions.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/IEnumeratorAwaitExtensions.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/IEnumeratorAwaitExtensions.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Internal.meta b/Assets/Plugins/AsyncAwaitUtil/Internal.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Internal.meta rename to Assets/Plugins/AsyncAwaitUtil/Internal.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Internal/AsyncCoroutineRunner.cs b/Assets/Plugins/AsyncAwaitUtil/Internal/AsyncCoroutineRunner.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Internal/AsyncCoroutineRunner.cs rename to Assets/Plugins/AsyncAwaitUtil/Internal/AsyncCoroutineRunner.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Internal/AsyncCoroutineRunner.cs.meta b/Assets/Plugins/AsyncAwaitUtil/Internal/AsyncCoroutineRunner.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Internal/AsyncCoroutineRunner.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/Internal/AsyncCoroutineRunner.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Internal/SyncContextUtil.cs b/Assets/Plugins/AsyncAwaitUtil/Internal/SyncContextUtil.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Internal/SyncContextUtil.cs rename to Assets/Plugins/AsyncAwaitUtil/Internal/SyncContextUtil.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/Internal/SyncContextUtil.cs.meta b/Assets/Plugins/AsyncAwaitUtil/Internal/SyncContextUtil.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/Internal/SyncContextUtil.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/Internal/SyncContextUtil.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/README.txt b/Assets/Plugins/AsyncAwaitUtil/README.txt new file mode 100644 index 0000000..740bb89 --- /dev/null +++ b/Assets/Plugins/AsyncAwaitUtil/README.txt @@ -0,0 +1,25 @@ +Original Project: https://github.com/modesttree/Unity3dAsyncAwaitUtil + +Original Project (Asset Store): https://assetstore.unity.com/packages/tools/integration/async-await-support-101056 + +-------------- + +Production fork at: https://github.com/mdmulti/unity-async-await-util + +Using commit: 9f776694a35dad430dd5718238798a429118ce31 as of last update. + +------------- + +Licensed under MIT. + +-------------- + +MIT License + +Copyright (c) 2016 Modest Tree Media Inc + +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. \ No newline at end of file diff --git a/Assets/Plugins/AsyncAwaitUtil/README.txt.meta b/Assets/Plugins/AsyncAwaitUtil/README.txt.meta new file mode 100644 index 0000000..c5317bd --- /dev/null +++ b/Assets/Plugins/AsyncAwaitUtil/README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dbd584c879ce51d4b85d455eb5331a24 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncAwaitUtil/Source.meta b/Assets/Plugins/AsyncAwaitUtil/Source.meta deleted file mode 100644 index d0b4231..0000000 --- a/Assets/Plugins/AsyncAwaitUtil/Source.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1855bfca81559324fa5a5d116a289bc6 -folderAsset: yes -timeCreated: 1506067485 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs b/Assets/Plugins/AsyncAwaitUtil/TaskExtensions.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs rename to Assets/Plugins/AsyncAwaitUtil/TaskExtensions.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs.meta b/Assets/Plugins/AsyncAwaitUtil/TaskExtensions.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/TaskExtensions.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/TaskExtensions.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/WaitForBackgroundThread.cs b/Assets/Plugins/AsyncAwaitUtil/WaitForBackgroundThread.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/WaitForBackgroundThread.cs rename to Assets/Plugins/AsyncAwaitUtil/WaitForBackgroundThread.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/WaitForBackgroundThread.cs.meta b/Assets/Plugins/AsyncAwaitUtil/WaitForBackgroundThread.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/WaitForBackgroundThread.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/WaitForBackgroundThread.cs.meta diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/WaitForUpdate.cs b/Assets/Plugins/AsyncAwaitUtil/WaitForUpdate.cs similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/WaitForUpdate.cs rename to Assets/Plugins/AsyncAwaitUtil/WaitForUpdate.cs diff --git a/Assets/Plugins/AsyncAwaitUtil/Source/WaitForUpdate.cs.meta b/Assets/Plugins/AsyncAwaitUtil/WaitForUpdate.cs.meta similarity index 100% rename from Assets/Plugins/AsyncAwaitUtil/Source/WaitForUpdate.cs.meta rename to Assets/Plugins/AsyncAwaitUtil/WaitForUpdate.cs.meta