Add Network debug panel

This commit is contained in:
Sofia 2017-05-17 00:25:29 +03:00
parent 7feff52f69
commit 68c16523e5
9 changed files with 680 additions and 15 deletions

View File

@ -303,6 +303,80 @@ MeshFilter:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 248140502} m_GameObject: {fileID: 248140502}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &269324197
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 269324198}
- component: {fileID: 269324200}
- component: {fileID: 269324199}
m_Layer: 5
m_Name: PacketsReceivedNumber
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &269324198
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 269324197}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9999967, y: 0.9999967, z: 0.9999967}
m_Children: []
m_Father: {fileID: 1519408168}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 166.5, y: 30.64998}
m_SizeDelta: {x: 72.2, y: 30}
m_Pivot: {x: 0.50000024, y: 0.49999967}
--- !u!114 &269324199
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 269324197}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0
--- !u!222 &269324200
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 269324197}
--- !u!1 &270758321 --- !u!1 &270758321
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -524,6 +598,80 @@ MonoBehaviour:
ID: 0 ID: 0
DoorRoot: {fileID: 1708261007} DoorRoot: {fileID: 1708261007}
IsOpen: 0 IsOpen: 0
--- !u!1 &326257202
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 326257203}
- component: {fileID: 326257205}
- component: {fileID: 326257204}
m_Layer: 5
m_Name: PacketsReceived
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &326257203
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 326257202}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9999967, y: 0.9999967, z: 0.9999967}
m_Children: []
m_Father: {fileID: 1519408168}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 68.2, y: 30.399998}
m_SizeDelta: {x: 122.6, y: 29.5}
m_Pivot: {x: 0.50000006, y: 0.5000002}
--- !u!114 &326257204
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 326257202}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Packets Received:'
--- !u!222 &326257205
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 326257202}
--- !u!1 &344272454 --- !u!1 &344272454
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1024,6 +1172,80 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9d715320baa1f401ab0f46b603399dc3, type: 3} m_Script: {fileID: 11500000, guid: 9d715320baa1f401ab0f46b603399dc3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1 &743520476
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 743520477}
- component: {fileID: 743520479}
- component: {fileID: 743520478}
m_Layer: 5
m_Name: PingNumber
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &743520477
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 743520476}
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: 1519408168}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 166.5, y: 89.7}
m_SizeDelta: {x: 72.2, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &743520478
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 743520476}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0
--- !u!222 &743520479
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 743520476}
--- !u!1 &746314094 --- !u!1 &746314094
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1415,6 +1637,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0}
m_Children: m_Children:
- {fileID: 2000206070} - {fileID: 2000206070}
- {fileID: 2132934770}
m_Father: {fileID: 1490933147} m_Father: {fileID: 1490933147}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1692,6 +1915,82 @@ Transform:
m_Father: {fileID: 1490933147} m_Father: {fileID: 1490933147}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1144056834
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1144056835}
- component: {fileID: 1144056837}
- component: {fileID: 1144056836}
m_Layer: 5
m_Name: PacketLoss
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1144056835
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1144056834}
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: 1519408168}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 68.2, y: 59.9}
m_SizeDelta: {x: 122.6, y: 29.5}
m_Pivot: {x: 0.50000006, y: 0.5000002}
--- !u!114 &1144056836
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1144056834}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Packet Loss:
'
--- !u!222 &1144056837
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1144056834}
--- !u!1 &1199326062 --- !u!1 &1199326062
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1938,6 +2237,82 @@ Transform:
m_Father: {fileID: 949094013} m_Father: {fileID: 949094013}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1392110886
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1392110887}
- component: {fileID: 1392110889}
- component: {fileID: 1392110888}
m_Layer: 5
m_Name: Ping
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1392110887
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1392110886}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9999967, y: 0.9999967, z: 0.9999967}
m_Children: []
m_Father: {fileID: 1519408168}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 68.2, y: 89.4}
m_SizeDelta: {x: 122.6, y: 29.5}
m_Pivot: {x: 0.50000006, y: 0.5000002}
--- !u!114 &1392110888
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1392110886}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Ping:
'
--- !u!222 &1392110889
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1392110886}
--- !u!1 &1444061381 --- !u!1 &1444061381
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2186,6 +2561,80 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1519408167
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1519408168}
- component: {fileID: 1519408170}
- component: {fileID: 1519408169}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1519408168
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519408167}
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: 1144056835}
- {fileID: 1392110887}
- {fileID: 743520477}
- {fileID: 1628431918}
- {fileID: 326257203}
- {fileID: 269324198}
m_Father: {fileID: 2132934770}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 106.6, y: 55.6}
m_SizeDelta: {x: 212.3, y: 111.1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1519408169
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519408167}
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: 0.392}
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: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1519408170
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1519408167}
--- !u!1 &1610252928 --- !u!1 &1610252928
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2230,6 +2679,80 @@ Transform:
m_Father: {fileID: 344272455} m_Father: {fileID: 344272455}
m_RootOrder: 4 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1628431917
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1628431918}
- component: {fileID: 1628431920}
- component: {fileID: 1628431919}
m_Layer: 5
m_Name: PacketLossNumber
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1628431918
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1628431917}
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: 1519408168}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 166.5, y: 58.9}
m_SizeDelta: {x: 72.2, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1628431919
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1628431917}
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: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0
--- !u!222 &1628431920
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1628431917}
--- !u!4 &1693409232 stripped --- !u!4 &1693409232 stripped
Transform: Transform:
m_PrefabParentObject: {fileID: 4689370038551000, guid: 3da42b42c71f841c2a977cfb5255b00f, m_PrefabParentObject: {fileID: 4689370038551000, guid: 3da42b42c71f841c2a977cfb5255b00f,
@ -2871,3 +3394,53 @@ Camera:
m_StereoConvergence: 10 m_StereoConvergence: 10
m_StereoSeparation: 0.022 m_StereoSeparation: 0.022
m_StereoMirrorMode: 0 m_StereoMirrorMode: 0
--- !u!1 &2132934769
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2132934770}
- component: {fileID: 2132934771}
m_Layer: 5
m_Name: DebugNetworkDebugRoot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2132934770
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2132934769}
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: 1519408168}
m_Father: {fileID: 822377732}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 105.2, y: 56.4}
m_SizeDelta: {x: 210.5, y: 112.9}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2132934771
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2132934769}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 582dedc3d9feabd44bf03f191e5df88a, type: 3}
m_Name:
m_EditorClassIdentifier:
PacketLossNumberText: {fileID: 1628431919}
PingNumberText: {fileID: 743520478}
PacketsReceivedNumberText: {fileID: 269324199}
ActualPanel: {fileID: 1519408168}

View File

@ -0,0 +1,32 @@
using Cyber.Networking.Clientside;
using UnityEngine;
using UnityEngine.UI;
public class NetworkDebugControl : MonoBehaviour {
public Text PacketLossNumberText;
public Text PingNumberText;
public Text PacketsReceivedNumberText;
public RectTransform ActualPanel;
private bool visible = false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetButtonDown("ToggleNetworkDebug")) {
visible = !visible && Client.IsRunning();
ActualPanel.gameObject.SetActive(visible);
}
if (visible) {
PingNumberText.text = ((int) (Client.GetSyncHandler().GetPing())) + "ms";
PacketLossNumberText.text = ((int) (Client.GetSyncHandler().GetPacketLoss() * 10000) * 1f / 100) + "%";
PacketsReceivedNumberText.text = Client.GetSyncHandler().GetSyncPacketsReceived() + "";
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 582dedc3d9feabd44bf03f191e5df88a
timeCreated: 1494966639
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -29,14 +29,14 @@ namespace Cyber.Networking.Clientside {
private Spawner Spawner; private Spawner Spawner;
private SyncHandler SyncHandler;
/// <summary> /// <summary>
/// The player of this client /// The player of this client
/// </summary> /// </summary>
private CConnectedPlayer Player; private CConnectedPlayer Player;
private Dictionary<int, CConnectedPlayer> Players = new Dictionary<int, CConnectedPlayer>(); private Dictionary<int, CConnectedPlayer> Players = new Dictionary<int, CConnectedPlayer>();
private SyncHandler SyncHandler;
/// <summary> /// <summary>
/// Creates the client and sets it as the signleton. /// Creates the client and sets it as the signleton.
/// </summary> /// </summary>
@ -135,6 +135,14 @@ namespace Cyber.Networking.Clientside {
} }
} }
/// <summary>
/// Get the Client <see cref="SyncHandler"/>, null if client is not active.
/// </summary>
/// <returns></returns>
public static SyncHandler GetSyncHandler() {
return Singleton.SyncHandler;
}
private void Start() { private void Start() {
Spawner = GetComponent<Spawner>(); Spawner = GetComponent<Spawner>();
SyncHandler = new SyncHandler(Spawner.SyncDB); SyncHandler = new SyncHandler(Spawner.SyncDB);

View File

@ -1,9 +1,9 @@
 
using Cyber.Console;
using Cyber.Entities; using Cyber.Entities;
using Cyber.Entities.SyncBases; using Cyber.Entities.SyncBases;
using Cyber.Networking.Messages; using Cyber.Networking.Messages;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking; using UnityEngine.Networking;
namespace Cyber.Networking.Clientside { namespace Cyber.Networking.Clientside {
@ -14,11 +14,15 @@ namespace Cyber.Networking.Clientside {
/// </summary> /// </summary>
public class SyncHandler { public class SyncHandler {
public static double LastTimestamp = NetworkHelper.GetCurrentSystemTime(); public static double LastTimestamp = NetworkHelper.GetTime();
private SyncDB SyncDB; private SyncDB SyncDB;
private int LatestSyncID = -1; private int LatestSyncID = -1;
private int SmallestSyncID = -1;
private int LastSyncID = -1;
private int SyncPacketsTotal = -1;
/// <summary> /// <summary>
/// Creates the SyncHandler with SyncDB. /// Creates the SyncHandler with SyncDB.
/// </summary> /// </summary>
@ -52,13 +56,31 @@ namespace Cyber.Networking.Clientside {
if (FailedSyncBases.Count > 0) { if (FailedSyncBases.Count > 0) {
Client.Send(PktType.FailedChecksums, new IntListPkt(FailedSyncBases.ToArray())); Client.Send(PktType.FailedChecksums, new IntListPkt(FailedSyncBases.ToArray()));
} }
}
LastTimestamp = SyncPacket.Timestamp; LastTimestamp = SyncPacket.Timestamp;
LastSyncID = SyncPacket.SyncPacketID;
if (SmallestSyncID == -1) {
SmallestSyncID = SyncPacket.SyncPacketID;
} }
SyncPacketsTotal++;
} }
// Otherwise disregard the sync. // Otherwise disregard the sync.
} }
public float GetPing() {
return (float) ((NetworkHelper.GetTime() - LastTimestamp) / 1000f);
}
public float GetPacketLoss() {
return 1f - (SyncPacketsTotal * 1f / (LastSyncID - SmallestSyncID));
}
public int GetSyncPacketsReceived() {
return SyncPacketsTotal;
}
} }
} }

View File

@ -1,5 +1,4 @@
 
using Cyber.Console;
using Cyber.Entities; using Cyber.Entities;
using UnityEngine.Networking; using UnityEngine.Networking;
@ -13,7 +12,7 @@ namespace Cyber.Networking.Messages {
/// <summary> /// <summary>
/// Timestamp of the sync packet when sent from the server. /// Timestamp of the sync packet when sent from the server.
/// </summary> /// </summary>
public double Timestamp; public float Timestamp;
/// <summary> /// <summary>
/// The Sync Packet ID of this packet. /// The Sync Packet ID of this packet.
@ -45,13 +44,13 @@ namespace Cyber.Networking.Messages {
/// <param name="checksummedSyncBases"></param> /// <param name="checksummedSyncBases"></param>
/// <param name="checksums"></param> /// <param name="checksums"></param>
/// <param name="syncPacketID">ID of the sync packet itself.</param> /// <param name="syncPacketID">ID of the sync packet itself.</param>
public SyncPkt(SyncDB syncDB, int[] syncBases, int[] checksummedSyncBases, int[] checksums, int syncPacketID, double timestamp) { public SyncPkt(SyncDB syncDB, int[] syncBases, int[] checksummedSyncBases, int[] checksums, int syncPacketID, float timestamp) {
SyncPacketID = syncPacketID; SyncPacketID = syncPacketID;
SyncDB = syncDB; SyncDB = syncDB;
SyncedSyncBases = syncBases; SyncedSyncBases = syncBases;
ChecksummedSyncBases = checksummedSyncBases; ChecksummedSyncBases = checksummedSyncBases;
Checksums = checksums; Checksums = checksums;
timestamp = Timestamp; Timestamp = timestamp;
} }
/// <summary> /// <summary>
@ -70,6 +69,8 @@ namespace Cyber.Networking.Messages {
/// <param name="reader"></param> /// <param name="reader"></param>
public override void Deserialize(NetworkReader reader) { public override void Deserialize(NetworkReader reader) {
SyncPacketID = reader.ReadInt32(); SyncPacketID = reader.ReadInt32();
Timestamp = (float) reader.ReadDouble();
} }
/// <summary> /// <summary>
@ -77,6 +78,7 @@ namespace Cyber.Networking.Messages {
/// </summary> /// </summary>
/// <param name="reader"></param> /// <param name="reader"></param>
public void ApplySync(NetworkReader reader) { public void ApplySync(NetworkReader reader) {
byte[][] ByteArray = new byte[4][]; byte[][] ByteArray = new byte[4][];
ByteArray[0] = reader.ReadBytesAndSize(); ByteArray[0] = reader.ReadBytesAndSize();
ByteArray[1] = reader.ReadBytesAndSize(); ByteArray[1] = reader.ReadBytesAndSize();
@ -115,6 +117,8 @@ namespace Cyber.Networking.Messages {
public override void Serialize(NetworkWriter writer) { public override void Serialize(NetworkWriter writer) {
writer.Write(SyncPacketID); writer.Write(SyncPacketID);
writer.Write((double) Timestamp);
byte[][] SyncedIdsByteArray = NetworkHelper.SerializeIntArray(SyncedSyncBases); byte[][] SyncedIdsByteArray = NetworkHelper.SerializeIntArray(SyncedSyncBases);
writer.WriteBytesFull(SyncedIdsByteArray[0]); writer.WriteBytesFull(SyncedIdsByteArray[0]);
writer.WriteBytesFull(SyncedIdsByteArray[1]); writer.WriteBytesFull(SyncedIdsByteArray[1]);

View File

@ -55,10 +55,8 @@ namespace Cyber.Networking {
/// Returns the current system time in seconds. /// Returns the current system time in seconds.
/// </summary> /// </summary>
/// <returns>The system time in seconds.</returns> /// <returns>The system time in seconds.</returns>
public static double GetCurrentSystemTime() { public static double GetTime() {
return DateTime.Now.ToUniversalTime().Subtract( return Network.time;
new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))
.TotalMilliseconds * 1.0 / 1000;
} }
} }

View File

@ -63,7 +63,7 @@ namespace Cyber.Networking.Serverside {
if (QueuedSyncs.Count > 0) { if (QueuedSyncs.Count > 0) {
int[] SyncIDs = QueuedSyncs.ToArray(); int[] SyncIDs = QueuedSyncs.ToArray();
SyncPkt SyncPacket = new SyncPkt(Database, SyncIDs, checksummedIds.ToArray(), SyncPkt SyncPacket = new SyncPkt(Database, SyncIDs, checksummedIds.ToArray(),
checksums.ToArray(), NextSyncID(), NetworkHelper.GetCurrentSystemTime()); checksums.ToArray(), NextSyncID(), (float) NetworkHelper.GetTime());
Server.SendToAllByChannel(PktType.Sync, SyncPacket, NetworkChannelID.Unreliable); Server.SendToAllByChannel(PktType.Sync, SyncPacket, NetworkChannelID.Unreliable);
QueuedSyncs.Clear(); QueuedSyncs.Clear();

View File

@ -85,6 +85,22 @@ InputManager:
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3
m_Name: ToggleNetworkDebug
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: f6
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Equip m_Name: Equip
descriptiveName: descriptiveName: