|
| 1 | +#if UNITY_EDITOR |
| 2 | +using System.Text; |
| 3 | +using UnityEngine; |
| 4 | + |
| 5 | +namespace Unity.Netcode |
| 6 | +{ |
| 7 | + internal struct NetworkManagerAnalytics |
| 8 | + { |
| 9 | + public bool IsUsingMultiplayerSDK; |
| 10 | + public bool UsedCMBService; |
| 11 | + public string NetworkTopology; |
| 12 | + public string NetworkTransport; |
| 13 | + public bool PlayerPrefabSet; |
| 14 | + public bool ConnectionApproval; |
| 15 | + public float ClientConnectionBufferTimeout; |
| 16 | + public bool EnsureNetworkVariableLengthSafety; |
| 17 | + public bool EnableSceneManagement; |
| 18 | + public float LoadSceneTimeOut; |
| 19 | + public float SpawnTimeout; |
| 20 | + public bool ForceSamePrefabs; |
| 21 | + public bool RecycleNetworkIds; |
| 22 | + public float NetworkIdRecycleDelay; |
| 23 | + public int RpcHashSize; |
| 24 | + public bool EnableTimeResync; |
| 25 | + public float TimeResyncInterval; |
| 26 | + public int TickRate; |
| 27 | + public bool IsUsingMultiplayerTools; |
| 28 | + public bool NetworkMessageMetrics; |
| 29 | + public bool NetworkProfilingMetrics; |
| 30 | + public bool WasServer; |
| 31 | + public bool WasClient; |
| 32 | + public float SessionDuration; |
| 33 | + internal void LogAnalytics(int sessionNumber) |
| 34 | + { |
| 35 | + var message = new StringBuilder(); |
| 36 | + message.AppendLine($"{nameof(NetworkManagerAnalytics)}-{sessionNumber} Session Duration: {SessionDuration} Sever: {WasServer} Client: {WasClient}"); |
| 37 | + message.AppendLine($"{nameof(IsUsingMultiplayerSDK)}: {IsUsingMultiplayerSDK}"); |
| 38 | + message.AppendLine($"{nameof(UsedCMBService)}: {UsedCMBService}"); |
| 39 | + message.AppendLine($"{nameof(NetworkTopology)}: {NetworkTopology}"); |
| 40 | + message.AppendLine($"{nameof(NetworkTransport)}: {NetworkTransport}"); |
| 41 | + message.AppendLine($"{nameof(PlayerPrefabSet)}: {PlayerPrefabSet}"); |
| 42 | + message.AppendLine($"{nameof(ConnectionApproval)}: {ConnectionApproval}"); |
| 43 | + message.AppendLine($"{nameof(ClientConnectionBufferTimeout)}: {ClientConnectionBufferTimeout}"); |
| 44 | + message.AppendLine($"{nameof(EnsureNetworkVariableLengthSafety)}: {EnsureNetworkVariableLengthSafety}"); |
| 45 | + message.AppendLine($"{nameof(EnableSceneManagement)}: {EnableSceneManagement}"); |
| 46 | + message.AppendLine($"{nameof(LoadSceneTimeOut)}: {LoadSceneTimeOut}"); |
| 47 | + message.AppendLine($"{nameof(SpawnTimeout)}: {SpawnTimeout}"); |
| 48 | + message.AppendLine($"{nameof(ForceSamePrefabs)}: {ForceSamePrefabs}"); |
| 49 | + message.AppendLine($"{nameof(RecycleNetworkIds)}: {RecycleNetworkIds}"); |
| 50 | + message.AppendLine($"{nameof(NetworkIdRecycleDelay)}: {NetworkIdRecycleDelay}"); |
| 51 | + message.AppendLine($"{nameof(RpcHashSize)}: {RpcHashSize}"); |
| 52 | + message.AppendLine($"{nameof(EnableTimeResync)}: {EnableTimeResync}"); |
| 53 | + message.AppendLine($"{nameof(TimeResyncInterval)}: {TimeResyncInterval}"); |
| 54 | + message.AppendLine($"{nameof(TickRate)}: {TickRate}"); |
| 55 | + message.AppendLine($"{nameof(IsUsingMultiplayerTools)}: {IsUsingMultiplayerTools}"); |
| 56 | + message.AppendLine($"{nameof(NetworkMessageMetrics)}: {NetworkMessageMetrics}"); |
| 57 | + message.AppendLine($"{nameof(NetworkProfilingMetrics)}: {NetworkProfilingMetrics}"); |
| 58 | + Debug.Log($"{message}"); |
| 59 | + } |
| 60 | + } |
| 61 | +} |
| 62 | +#endif |
0 commit comments