From 4ed1e5b868bc1c115a98a13fad5f4a78d457b79c Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Sat, 21 Jun 2025 19:10:20 -0400 Subject: [PATCH 01/14] Updates to dependencies, packages, and git ignore --- .gitignore | 1 + Assets/FishNet.meta | 8 ++++++++ Assets/FishNet/package.json | 3 ++- package.json | 27 --------------------------- packages.config | 4 ---- 5 files changed, 11 insertions(+), 32 deletions(-) create mode 100644 Assets/FishNet.meta delete mode 100644 package.json delete mode 100644 packages.config diff --git a/.gitignore b/.gitignore index 350a49dde..f55cb4747 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Ignore everything: /Assets/* !/Assets/FishNet +!/Assets/FishNet.meta !.gitignore DefaultPrefabObjects.asset diff --git a/Assets/FishNet.meta b/Assets/FishNet.meta new file mode 100644 index 000000000..fe2d4d5c7 --- /dev/null +++ b/Assets/FishNet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04c0f770bcb73bc46a75fedc3f97d40d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/package.json b/Assets/FishNet/package.json index 1c9baf12c..c86b860a2 100644 --- a/Assets/FishNet/package.json +++ b/Assets/FishNet/package.json @@ -25,6 +25,7 @@ "url": "http://www.firstgeargames.com" }, "dependencies": { - "com.unity.nuget.newtonsoft-json": "3.2.1" + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.profiling.core": "1.0.2" } } \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 456c627f1..000000000 --- a/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "com.firstgeargames.fishnet", - "version": "3.11.15", - "displayName": "FishNet: Networking Evolved", - "description": "A feature-rich Unity networking solution aimed towards reliability, ease of use, efficiency, and flexibility.", - "unity": "2019.4", - "documentationUrl": "https://fish-networking.gitbook.io/docs/", - "licensesUrl": "https://github.com/FirstGearGames/FishNet/blob/main/LICENSE.md", - "license": "See LICENSE.txt file", - "keywords": [ - "FishNetworking", - "Networking", - "FishNet", - "Unity Networking", - "Bolt", - "Mirror", - "Photon", - "DarkRift", - "DedicatedServer", - "Fusion", - "Netcode" - ], - "author": { - "name": "FirstGearGames", - "url": "http://www.firstgeargames.com" - } -} \ No newline at end of file diff --git a/packages.config b/packages.config deleted file mode 100644 index d6a8f0776..000000000 --- a/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 3743ac8f62b7f13491aa31315b90b162d2a7e102 Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Mon, 23 Jun 2025 00:23:49 -0400 Subject: [PATCH 02/14] Initial profiler commit --- .idea/.idea.FishNet/.idea/.gitignore | 13 + .idea/.idea.FishNet/.idea/indexLayout.xml | 8 + .idea/.idea.FishNet/.idea/vcs.xml | 6 + Assets/FishNet/Runtime/Profiler.meta | 8 + Assets/FishNet/Runtime/Profiler/CHANGELOG.md | 339 ++++++++++++++++++ .../Runtime/Profiler/CHANGELOG.md.meta | 7 + Assets/FishNet/Runtime/Profiler/Editor.meta | 8 + .../Runtime/Profiler/Editor/AssemblyInfo.cs | 3 + .../Profiler/Editor/AssemblyInfo.cs.meta | 11 + .../Profiler/Editor/ICountRecorderProvider.cs | 7 + .../Editor/ICountRecorderProvider.cs.meta | 11 + .../Runtime/Profiler/Editor/Messages.meta | 8 + .../Profiler/Editor/Messages/Columns.cs | 89 +++++ .../Profiler/Editor/Messages/Columns.cs.meta | 11 + .../Profiler/Editor/Messages/CounterNames.cs | 16 + .../Editor/Messages/CounterNames.cs.meta | 11 + .../Profiler/Editor/Messages/DrawnMessage.cs | 10 + .../Editor/Messages/DrawnMessage.cs.meta | 11 + .../Runtime/Profiler/Editor/Messages/Group.cs | 123 +++++++ .../Profiler/Editor/Messages/Group.cs.meta | 11 + .../Profiler/Editor/Messages/GroupSorter.cs | 94 +++++ .../Editor/Messages/GroupSorter.cs.meta | 11 + .../Profiler/Editor/Messages/MessageView.cs | 141 ++++++++ .../Editor/Messages/MessageView.cs.meta | 11 + .../Editor/Messages/MessageViewController.cs | 280 +++++++++++++++ .../Messages/MessageViewController.cs.meta | 11 + .../Profiler/Editor/Messages/TableSorter.cs | 27 ++ .../Editor/Messages/TableSorter.cs.meta | 11 + .../Editor/Mirage.Profiler.Editor.asmdef | 20 ++ .../Editor/Mirage.Profiler.Editor.asmdef.meta | 7 + .../Runtime/Profiler/Editor/ModuleNames.cs | 12 + .../Profiler/Editor/ModuleNames.cs.meta | 11 + .../Runtime/Profiler/Editor/ReceivedModule.cs | 35 ++ .../Profiler/Editor/ReceivedModule.cs.meta | 11 + .../Runtime/Profiler/Editor/SavedData.cs | 231 ++++++++++++ .../Runtime/Profiler/Editor/SavedData.cs.meta | 11 + .../Runtime/Profiler/Editor/SentModule.cs | 35 ++ .../Profiler/Editor/SentModule.cs.meta | 11 + .../Runtime/Profiler/Editor/ServerModule.cs | 108 ++++++ .../Profiler/Editor/ServerModule.cs.meta | 11 + .../Runtime/Profiler/Editor/Table.meta | 8 + .../Profiler/Editor/Table/ColumnInfo.cs | 66 ++++ .../Profiler/Editor/Table/ColumnInfo.cs.meta | 11 + .../Runtime/Profiler/Editor/Table/EmptyRow.cs | 22 ++ .../Profiler/Editor/Table/EmptyRow.cs.meta | 11 + .../Profiler/Editor/Table/ITableSorter.cs | 7 + .../Editor/Table/ITableSorter.cs.meta | 11 + .../Runtime/Profiler/Editor/Table/LabelRow.cs | 56 +++ .../Profiler/Editor/Table/LabelRow.cs.meta | 11 + .../Runtime/Profiler/Editor/Table/Row.cs | 46 +++ .../Runtime/Profiler/Editor/Table/Row.cs.meta | 11 + .../Profiler/Editor/Table/SortHeader.cs | 63 ++++ .../Profiler/Editor/Table/SortHeader.cs.meta | 11 + .../Profiler/Editor/Table/SortHeaderRow.cs | 54 +++ .../Editor/Table/SortHeaderRow.cs.meta | 11 + .../Runtime/Profiler/Editor/Table/SortMode.cs | 9 + .../Profiler/Editor/Table/SortMode.cs.meta | 11 + .../Runtime/Profiler/Editor/Table/Table.cs | 113 ++++++ .../Profiler/Editor/Table/Table.cs.meta | 11 + Assets/FishNet/Runtime/Profiler/LICENSE | 21 ++ Assets/FishNet/Runtime/Profiler/LICENSE.meta | 7 + Assets/FishNet/Runtime/Profiler/Readme.txt | 1 + .../FishNet/Runtime/Profiler/Readme.txt.meta | 7 + Assets/FishNet/Runtime/Profiler/Runtime.meta | 8 + .../Runtime/Profiler/Runtime/AssemblyInfo.cs | 6 + .../Profiler/Runtime/AssemblyInfo.cs.meta | 11 + .../Runtime/Profiler/Runtime/CountRecorder.cs | 86 +++++ .../Profiler/Runtime/CountRecorder.cs.meta | 11 + .../Runtime/Profiler/Runtime/Counters.cs | 24 ++ .../Runtime/Profiler/Runtime/Counters.cs.meta | 11 + .../FishNet/Runtime/Profiler/Runtime/Frame.cs | 44 +++ .../Runtime/Profiler/Runtime/Frame.cs.meta | 11 + .../Runtime/Profiler/Runtime/MessageInfo.cs | 44 +++ .../Profiler/Runtime/MessageInfo.cs.meta | 11 + .../Profiler/Runtime/Mirage.Profiler.asmdef | 17 + .../Runtime/Mirage.Profiler.asmdef.meta | 7 + .../FishNet/Runtime/Profiler/Runtime/Names.cs | 25 ++ .../Runtime/Profiler/Runtime/Names.cs.meta | 11 + .../Profiler/Runtime/NetworkInfoProvider.cs | 74 ++++ .../Runtime/NetworkInfoProvider.cs.meta | 11 + .../Runtime/NetworkProfilerRecorder.cs | 174 +++++++++ .../Runtime/NetworkProfilerRecorder.cs.meta | 11 + Assets/FishNet/Runtime/Profiler/package.json | 12 + .../Runtime/Profiler/package.json.meta | 7 + FishNet.sln | 169 ++++++--- 85 files changed, 3121 insertions(+), 43 deletions(-) create mode 100644 .idea/.idea.FishNet/.idea/.gitignore create mode 100644 .idea/.idea.FishNet/.idea/indexLayout.xml create mode 100644 .idea/.idea.FishNet/.idea/vcs.xml create mode 100644 Assets/FishNet/Runtime/Profiler.meta create mode 100644 Assets/FishNet/Runtime/Profiler/CHANGELOG.md create mode 100644 Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/LICENSE create mode 100644 Assets/FishNet/Runtime/Profiler/LICENSE.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Readme.txt create mode 100644 Assets/FishNet/Runtime/Profiler/Readme.txt.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Names.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs create mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta create mode 100644 Assets/FishNet/Runtime/Profiler/package.json create mode 100644 Assets/FishNet/Runtime/Profiler/package.json.meta diff --git a/.idea/.idea.FishNet/.idea/.gitignore b/.idea/.idea.FishNet/.idea/.gitignore new file mode 100644 index 000000000..535ce6d11 --- /dev/null +++ b/.idea/.idea.FishNet/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/modules.xml +/contentModel.xml +/.idea.FishNet.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.FishNet/.idea/indexLayout.xml b/.idea/.idea.FishNet/.idea/indexLayout.xml new file mode 100644 index 000000000..7b08163ce --- /dev/null +++ b/.idea/.idea.FishNet/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.FishNet/.idea/vcs.xml b/.idea/.idea.FishNet/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/.idea.FishNet/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler.meta b/Assets/FishNet/Runtime/Profiler.meta new file mode 100644 index 000000000..ca902e0fb --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 084aef25b51176a43978f1cfe92272db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md new file mode 100644 index 000000000..43c4f1331 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md @@ -0,0 +1,339 @@ +## [1.2.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.2.1...v1.2.2) (2024-08-21) + + +### Bug Fixes + +* setting new mirage version in package ([23db36c](https://github.com/James-Frowen/Mirage.Profiler/commit/23db36cf3a55aaeb29a5695a8fc5f6a57326afc3)) + +## [1.2.1](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.2.0...v1.2.1) (2024-08-21) + + +### Bug Fixes + +* fixing recorder not taking reference to client ([21693d1](https://github.com/James-Frowen/Mirage.Profiler/commit/21693d10fbec7cd5acf86cd7e77592af77939c43)) +* stopping message name from overflowing ([3a151c1](https://github.com/James-Frowen/Mirage.Profiler/commit/3a151c1d2c68872bedc1f9602dab0a69fdcf56ec)) + +# [1.2.0](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.1.0...v1.2.0) (2022-09-23) + + +### Features + +* adding support for counter in built player ([fdcf4bb](https://github.com/James-Frowen/Mirage.Profiler/commit/fdcf4bbb65044c4bc7c3ea0ecef39e81a9db3940)) + +# [1.1.0](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.4...v1.1.0) (2022-09-08) + + +### Bug Fixes + +* fixes null ref when sort header is null ([d233036](https://github.com/James-Frowen/Mirage.Profiler/commit/d233036255497a8c49f61a657ed61022ed671020)), closes [#4](https://github.com/James-Frowen/Mirage.Profiler/issues/4) +* fixing header being squashed if vertical scroll is full ([ad29f2e](https://github.com/James-Frowen/Mirage.Profiler/commit/ad29f2ee756793d15f2701b6d06fccac7d78b950)) +* fixing null ref when group message is false ([004ba4e](https://github.com/James-Frowen/Mirage.Profiler/commit/004ba4e26ea9ff0dfeacba3e7f6440a85497ddc3)), closes [#6](https://github.com/James-Frowen/Mirage.Profiler/issues/6) +* stopping exception if rpc name does not contain dot ([#3](https://github.com/James-Frowen/Mirage.Profiler/issues/3)) ([324a374](https://github.com/James-Frowen/Mirage.Profiler/commit/324a374800b784595cf752f5d3943efe9ff91c6d)) + + +### Features + +* adding group message to save data ([3061381](https://github.com/James-Frowen/Mirage.Profiler/commit/306138196805e949e68a8b7517f2c846506b32ad)) + +## [1.0.4](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.3...v1.0.4) (2022-08-08) + + +### Bug Fixes + +* movng files into package ([0ab735c](https://github.com/James-Frowen/Mirage.Profiler/commit/0ab735c63dffe35eff2f841ef6f5079cf334150a)) + +## [1.0.3](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.2...v1.0.3) (2022-08-08) + + +### Bug Fixes + +* fixing version not being added by CI ([b340957](https://github.com/James-Frowen/Mirage.Profiler/commit/b34095760942b57dc2a160d2c247a6f9b591ad38)) + +## [1.0.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.1...v1.0.2) (2022-08-07) + + +### Bug Fixes + +* adding runtime folder to fix package layout ([0ed3a93](https://github.com/James-Frowen/Mirage.Profiler/commit/0ed3a935b570a6770f8db6b1c38615d34cce2207)) + +## [1.0.1](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0...v1.0.1) (2022-08-07) + + +### Bug Fixes + +* fixing error when rpc name is empty ([5660db0](https://github.com/James-Frowen/Mirage.Profiler/commit/5660db058c522b0eaf39651ec5b33f9a444849c4)) + +# 1.0.0 (2022-08-07) + + +### Bug Fixes + +* adding note about maybe missing NetworkProfilerBehaviour ([91b2420](https://github.com/James-Frowen/Mirage.Profiler/commit/91b242030cf64cc7a80bd0b5e8f3e38317e6a246)) +* changing order to be int.max ([4c40e61](https://github.com/James-Frowen/Mirage.Profiler/commit/4c40e61bc23884dff13de35db84dd8ed4abc0724)) +* clearing byte count at end of frame ([f2270a8](https://github.com/James-Frowen/Mirage.Profiler/commit/f2270a8960543a8bfd70fbc2a8fc628e788a1a43)) +* disabling debug message by default ([7f16136](https://github.com/James-Frowen/Mirage.Profiler/commit/7f161365b0f54d32e34773b3eb5645046b12bed4)) +* enabling example bullet on server ([ea15bf6](https://github.com/James-Frowen/Mirage.Profiler/commit/ea15bf6301b736a328f51edadf5f127cdf704729)) +* fixing client spawn in example ([5ff2c0a](https://github.com/James-Frowen/Mirage.Profiler/commit/5ff2c0ae7ed0a3c89baff1aed7316761d7342338)) +* fixing crash when closing unity ([cf2513a](https://github.com/James-Frowen/Mirage.Profiler/commit/cf2513ac150fc67533d6c41e9e44ec894d81ca0e)) +* fixing define to hide debug toggle ([8d22bf7](https://github.com/James-Frowen/Mirage.Profiler/commit/8d22bf7cd6ccf32b0af0866235587c136d09072b)) +* fixing example auto connect ([6b5163e](https://github.com/James-Frowen/Mirage.Profiler/commit/6b5163e9577e0b8304d78a5ec87df7650f63fe9d)) +* fixing example where field was not being used ([4417cdc](https://github.com/James-Frowen/Mirage.Profiler/commit/4417cdcf0504723ba25e8e342c1c91757fd11743)) +* fixing frame index for saved messages ([49d9e70](https://github.com/James-Frowen/Mirage.Profiler/commit/49d9e705b7db99e05b3089eed502553369752522)) +* fixing groups not un-expanding ([196feae](https://github.com/James-Frowen/Mirage.Profiler/commit/196feae6e7e49f54478f575c7c3668160b01e0e3)) +* fixing index out of range on first frame ([036f104](https://github.com/James-Frowen/Mirage.Profiler/commit/036f10487e469c4cf39fe6b431c2f22499157b6d)) +* fixing player count sample being skipped ([740b4f8](https://github.com/James-Frowen/Mirage.Profiler/commit/740b4f8816dfd783e7465856f0380c7fc8b9b2f2)) +* fixing profier behaviour ([53f0614](https://github.com/James-Frowen/Mirage.Profiler/commit/53f06143befb02caa8c415a05fb10d53bf484906)) +* fixing ProfilerCounter ([81344fe](https://github.com/James-Frowen/Mirage.Profiler/commit/81344fe871224a773d014b9bb76f028ff4aba21d)) +* fixing sort arrow not updated ([3ced312](https://github.com/James-Frowen/Mirage.Profiler/commit/3ced312f20f5c24657bd635fc93ced5b40ffca02)) +* fixing unity skipping profiler frames becuase unity is buggy ([f452ac4](https://github.com/James-Frowen/Mirage.Profiler/commit/f452ac4a1eb45bf4713d1769895ec431c24550ba)) +* init array with non-null elements ([b3c3276](https://github.com/James-Frowen/Mirage.Profiler/commit/b3c32761b0e6a62ff4180fde276131709d1956d6)) +* making example clients auto reconnect ([cbf27b7](https://github.com/James-Frowen/Mirage.Profiler/commit/cbf27b7abdb0ee955b77c9d7f977241b1ad3e7bc)) +* making header scroll Horizontally ([5eac0f7](https://github.com/James-Frowen/Mirage.Profiler/commit/5eac0f71a8569c580bc03587d63b9fea418be326)) +* making message info fields serializable ([81fb20d](https://github.com/James-Frowen/Mirage.Profiler/commit/81fb20da066d271fb72c56a763ccd0fe106cbc1a)) +* naming debug name shorter ([36f2d6a](https://github.com/James-Frowen/Mirage.Profiler/commit/36f2d6a5c76e6391ba16d44d8f09d44625be9d11)) +* removing debug logs ([0bb90ef](https://github.com/James-Frowen/Mirage.Profiler/commit/0bb90ef9dc674e5596ef79994259f96fd378f2d7)) +* removing prefix from summary labels ([3841a9e](https://github.com/James-Frowen/Mirage.Profiler/commit/3841a9e3c65ee7432a4d2020ed03a4f7557f14d6)) +* removing verbose log ([0cfd3bf](https://github.com/James-Frowen/Mirage.Profiler/commit/0cfd3bf4d9364871da49dcbf9a084179e67f4a20)) +* scroll bar for table ([af7c83b](https://github.com/James-Frowen/Mirage.Profiler/commit/af7c83b13fb13aff81f7fc1648eb48597849525b)) +* setting max connections in example to 1000 ([94d06ea](https://github.com/James-Frowen/Mirage.Profiler/commit/94d06ea9723cadf1214b0a92ece59f2788389305)) +* stoping sort mode going back to none ([7745700](https://github.com/James-Frowen/Mirage.Profiler/commit/77457001775bc6f6889c7c8f4f86bacdadbd90e1)) +* updating mirage for fix ([e367c4a](https://github.com/James-Frowen/Mirage.Profiler/commit/e367c4a3c60e065effc80d4896998d5ef6c310c9)) + + +### Features + +* adding basic column sort ([39d4519](https://github.com/James-Frowen/Mirage.Profiler/commit/39d4519ce8a2fe086189bf12cdb34ce3e1820fe2)) +* adding object name column ([239e069](https://github.com/James-Frowen/Mirage.Profiler/commit/239e069dd0aecc080413325eb98edf7ccc3b1eb1)) +* adding option to group messages by type ([2e5fc27](https://github.com/James-Frowen/Mirage.Profiler/commit/2e5fc276bacc93f45c444a3b637d0d716bc1db1b)) +* adding option to run example outside of editor ([5a75b65](https://github.com/James-Frowen/Mirage.Profiler/commit/5a75b65b0f3f3075d21c2cdd0d821655bf2a47e3)) +* adding rpc name to message info ([d90d842](https://github.com/James-Frowen/Mirage.Profiler/commit/d90d842bc57defe10b7af8b1b2b6c2bd70566df1)) +* adding rpc name to table ([63722e2](https://github.com/James-Frowen/Mirage.Profiler/commit/63722e29458a522d10afa96d6a75831a5d084495)) +* adding shooting to example ([6a86354](https://github.com/James-Frowen/Mirage.Profiler/commit/6a86354895f2effe3689b4638f195d8536107a19)) +* adding sorting for groups ([2dec9a5](https://github.com/James-Frowen/Mirage.Profiler/commit/2dec9a5bfef76c34dff68a4aa904590c0924dc86)) +* expandable groups for message types ([001de86](https://github.com/James-Frowen/Mirage.Profiler/commit/001de86db446769d12880b35e64147bfda84f755)) +* first prerelease ([7fbd8ce](https://github.com/James-Frowen/Mirage.Profiler/commit/7fbd8ceb9223321abc514a3178d7703fe92f9497)) +* first release ([55b2b39](https://github.com/James-Frowen/Mirage.Profiler/commit/55b2b395e10da952101ae101f2cf2ab1acefe664)) +* only showing rpc short name, full name in tooltip ([9f71ae7](https://github.com/James-Frowen/Mirage.Profiler/commit/9f71ae78a546b0c8543d4295e8c2944a3ec458bd)) +* putting table header above scrollview ([a7d52ff](https://github.com/James-Frowen/Mirage.Profiler/commit/a7d52fff785b0f625a8af5abd920cc06d0a38053)) +* returning saved message instead of ones from counter ([6e894fa](https://github.com/James-Frowen/Mirage.Profiler/commit/6e894faec6701346f738925057cf360554e74860)) +* saving group expanded in save data ([70e4da9](https://github.com/James-Frowen/Mirage.Profiler/commit/70e4da92c1d8e35518eaa4656ff87d5276843a62)) +* saving message for frames ([131257a](https://github.com/James-Frowen/Mirage.Profiler/commit/131257aa7c603da085e10c8d5103a6776c7a8a38)) +* using sort from save data ([6bded42](https://github.com/James-Frowen/Mirage.Profiler/commit/6bded42b36bc8f7767cce355de220157c630093f)) +* working save data for message table ([0ab9197](https://github.com/James-Frowen/Mirage.Profiler/commit/0ab9197870fd581f68a1b405f3572c7b04c9f39e)) + + +### Performance Improvements + +* replacing FindObjectOfType with reference given in setup ([71e6712](https://github.com/James-Frowen/Mirage.Profiler/commit/71e671247dd5394d806ca1017b91aa2faa68eea8)) + +# [1.0.0-beta.24](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-08-07) + + +### Bug Fixes + +* making header scroll Horizontally ([7ba9d26](https://github.com/James-Frowen/Mirage.Profiler/commit/7ba9d2667afcf32269c979f3df4769e3e86a3d6c)) + + +### Features + +* adding rpc name to message info ([52a7bb4](https://github.com/James-Frowen/Mirage.Profiler/commit/52a7bb4927e009eec5839e30c94bee1345e4a4b9)) +* adding rpc name to table ([fd1e762](https://github.com/James-Frowen/Mirage.Profiler/commit/fd1e762a22e9ce5ec10f92105613f8f11f5aad6d)) +* only showing rpc short name, full name in tooltip ([e346a6f](https://github.com/James-Frowen/Mirage.Profiler/commit/e346a6f7d403113057fd067e89cb470e594fd4c3)) + +# [1.0.0-beta.23](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2022-08-07) + + +### Bug Fixes + +* fixing sort arrow not updated ([bf8cd9a](https://github.com/James-Frowen/Mirage.Profiler/commit/bf8cd9adeec12ca2898918e40c611e040e58013e)) + +# [1.0.0-beta.22](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2022-08-07) + + +### Features + +* saving group expanded in save data ([557538c](https://github.com/James-Frowen/Mirage.Profiler/commit/557538c6cf9d06b456def4e34c0b8add6683bd7b)) + +# [1.0.0-beta.21](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-08-07) + + +### Bug Fixes + +* fixing index out of range on first frame ([b1a4a6b](https://github.com/James-Frowen/Mirage.Profiler/commit/b1a4a6b7ca21154d32758fcb577ccd8c22c55d7e)) +* fixing player count sample being skipped ([04d7341](https://github.com/James-Frowen/Mirage.Profiler/commit/04d7341d0e3cbf7a91208a0b5f0df567644d7030)) +* setting max connections in example to 1000 ([94dc143](https://github.com/James-Frowen/Mirage.Profiler/commit/94dc14329c3c1799f85c210f11ece1879bb6fa47)) + + +### Features + +* adding object name column ([d3de7e3](https://github.com/James-Frowen/Mirage.Profiler/commit/d3de7e334530068cc7776fb000afbaaf21dd30b4)) + + +### Performance Improvements + +* replacing FindObjectOfType with reference given in setup ([df9141d](https://github.com/James-Frowen/Mirage.Profiler/commit/df9141df18139a1020222c60402c4fedd3259a38)) + +# [1.0.0-beta.20](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-08-06) + + +### Bug Fixes + +* fixing example where field was not being used ([1e6f605](https://github.com/James-Frowen/Mirage.Profiler/commit/1e6f605e8cd9953daf6f9482c72dabe069c7b300)) + +# [1.0.0-beta.19](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-08-06) + + +### Bug Fixes + +* removing verbose log ([fe0541a](https://github.com/James-Frowen/Mirage.Profiler/commit/fe0541a7859eadd5ce390c6449dd83694c058d08)) + +# [1.0.0-beta.18](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-08-06) + + +### Bug Fixes + +* fixing crash when closing unity ([eacc82c](https://github.com/James-Frowen/Mirage.Profiler/commit/eacc82ca37b4bce169ed03ae2336474af1936760)) +* fixing unity skipping profiler frames becuase unity is buggy ([4e23dff](https://github.com/James-Frowen/Mirage.Profiler/commit/4e23dffc07ed2d7f48dd9a0d4257806c93ba7c3f)) + +# [1.0.0-beta.17](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-08-06) + + +### Bug Fixes + +* removing debug logs ([3c0d019](https://github.com/James-Frowen/Mirage.Profiler/commit/3c0d01905c1c3b659a4e5453c79d63a3ba506bfe)) + +# [1.0.0-beta.16](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-08-06) + + +### Bug Fixes + +* clearing byte count at end of frame ([d185ad4](https://github.com/James-Frowen/Mirage.Profiler/commit/d185ad43c9d716aa44bbb715b3eed89b16d19706)) +* enabling example bullet on server ([bc58f72](https://github.com/James-Frowen/Mirage.Profiler/commit/bc58f72ff2946b1f4a96821d36e3dfc88fed0f82)) +* fixing client spawn in example ([348e98b](https://github.com/James-Frowen/Mirage.Profiler/commit/348e98b4de4c36be9c118cfa6242827126422cd9)) +* fixing example auto connect ([65968de](https://github.com/James-Frowen/Mirage.Profiler/commit/65968ded4aa7ea2fd0c04739cb0e272709ff7d67)) +* fixing frame index for saved messages ([1204a1f](https://github.com/James-Frowen/Mirage.Profiler/commit/1204a1f4f32d497a260a4720937edde67d6cd9ed)) +* fixing profier behaviour ([bc91dc7](https://github.com/James-Frowen/Mirage.Profiler/commit/bc91dc78b71d9893adb48dac991433631fb7a34f)) +* fixing ProfilerCounter ([9a7f62a](https://github.com/James-Frowen/Mirage.Profiler/commit/9a7f62a4d4ce2ff42bfb1cd0ad0b712ac7b46ac7)) +* init array with non-null elements ([f69c268](https://github.com/James-Frowen/Mirage.Profiler/commit/f69c2684de2b242fe337b051d274d84b48577ebc)) +* making example clients auto reconnect ([8ca5eee](https://github.com/James-Frowen/Mirage.Profiler/commit/8ca5eeeb102e54e12a33490c878fd35156cb6ff0)) +* making message info fields serializable ([4cbc905](https://github.com/James-Frowen/Mirage.Profiler/commit/4cbc905e513a62ee17ddf660d524363464e080c8)) + + +### Features + +* adding option to run example outside of editor ([5de8073](https://github.com/James-Frowen/Mirage.Profiler/commit/5de80731e41513564ccf20ba67fb29eb4e01adf1)) +* adding shooting to example ([543374a](https://github.com/James-Frowen/Mirage.Profiler/commit/543374a94c0a65362fcabaf0ca190d49163e372d)) +* returning saved message instead of ones from counter ([541ec66](https://github.com/James-Frowen/Mirage.Profiler/commit/541ec663cda04fb2b10c73822a6e28bd221ac6b7)) +* saving message for frames ([519f256](https://github.com/James-Frowen/Mirage.Profiler/commit/519f25695ad0ca7b113a65de14c7feb93c42d4f0)) +* working save data for message table ([ffaaef9](https://github.com/James-Frowen/Mirage.Profiler/commit/ffaaef97e4ee05751be419e642f61b923857486f)) + +# [1.0.0-beta.15](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-08-05) + + +### Bug Fixes + +* stoping sort mode going back to none ([5c85668](https://github.com/James-Frowen/Mirage.Profiler/commit/5c856680631869769e41206c72fb024e90e74cd9)) + + +### Features + +* using sort from save data ([cdc65ad](https://github.com/James-Frowen/Mirage.Profiler/commit/cdc65ad3d72791e74d51d76df700eb3993a4576d)) + +# [1.0.0-beta.14](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-08-03) + + +### Bug Fixes + +* adding note about maybe missing NetworkProfilerBehaviour ([5120029](https://github.com/James-Frowen/Mirage.Profiler/commit/5120029c3d30f5a141d0a86e28501dc52a6d7a7d)) + +# [1.0.0-beta.13](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-08-03) + + +### Bug Fixes + +* changing order to be int.max ([31cbd2f](https://github.com/James-Frowen/Mirage.Profiler/commit/31cbd2ff5b9b9a476d9c9562a19c7d3aec894eb1)) + +# [1.0.0-beta.12](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-07-28) + + +### Bug Fixes + +* fixing groups not un-expanding ([17c27c2](https://github.com/James-Frowen/Mirage.Profiler/commit/17c27c24a22f40a9e240e9f0a68933ad531bd192)) + +# [1.0.0-beta.11](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-07-28) + + +### Features + +* putting table header above scrollview ([6d52a00](https://github.com/James-Frowen/Mirage.Profiler/commit/6d52a004e8859d8930063b4610f24512d3016113)) + +# [1.0.0-beta.10](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2022-07-28) + + +### Features + +* adding sorting for groups ([bd655e8](https://github.com/James-Frowen/Mirage.Profiler/commit/bd655e89338f1f03b32f600288be6dd06edc6a8f)) + +# [1.0.0-beta.9](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-07-27) + + +### Features + +* adding basic column sort ([1ce56a8](https://github.com/James-Frowen/Mirage.Profiler/commit/1ce56a878444597bf4946bf573264c9ebd156581)) + +# [1.0.0-beta.8](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2022-07-26) + + +### Bug Fixes + +* disabling debug message by default ([ad1e082](https://github.com/James-Frowen/Mirage.Profiler/commit/ad1e08243d1f4e443468b32682eb44ede8c3ffa4)) +* removing prefix from summary labels ([6836ff5](https://github.com/James-Frowen/Mirage.Profiler/commit/6836ff547c7f2340baca8a68064c7556ef0ccfe6)) + +# [1.0.0-beta.7](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2022-07-26) + + +### Features + +* expandable groups for message types ([20f949c](https://github.com/James-Frowen/Mirage.Profiler/commit/20f949ceee10951cf4215451afbbea33d3f0d63f)) + +# [1.0.0-beta.6](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2022-07-25) + + +### Bug Fixes + +* fixing define to hide debug toggle ([5798c5c](https://github.com/James-Frowen/Mirage.Profiler/commit/5798c5c0f13c5614c8ce507736820ac6bfbfa04a)) + +# [1.0.0-beta.5](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-07-25) + + +### Features + +* adding option to group messages by type ([9392ebb](https://github.com/James-Frowen/Mirage.Profiler/commit/9392ebb6d324db1cc4fb09f28909acde371ba198)) + +# [1.0.0-beta.4](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-07-23) + + +### Bug Fixes + +* naming debug name shorter ([1a2ad87](https://github.com/James-Frowen/Mirage.Profiler/commit/1a2ad8765b1cfbd9a4033da6de7a18e1c38d3632)) + +# [1.0.0-beta.3](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-07-23) + + +### Bug Fixes + +* scroll bar for table ([d7b697f](https://github.com/James-Frowen/Mirage.Profiler/commit/d7b697f1556300a22773f4f9e04718c7d228203e)) + +# [1.0.0-beta.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2022-07-23) + + +### Bug Fixes + +* updating mirage for fix ([69ded5e](https://github.com/James-Frowen/Mirage.Profiler/commit/69ded5e7ac44130226362da61bddde2f275d0b98)) + +# 1.0.0-beta.1 (2022-07-23) + + +### Features + +* first prerelease ([e253142](https://github.com/James-Frowen/Mirage.Profiler/commit/e25314230a8e322e351912ac9f960f6f29821be5)) diff --git a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta new file mode 100644 index 000000000..72774e7f1 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1b2c5211880da6c4f83e37f1222441e1 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor.meta b/Assets/FishNet/Runtime/Profiler/Editor.meta new file mode 100644 index 000000000..fd9ad5f22 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e9eb58b4bf960c1439443c3160ce8371 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs new file mode 100644 index 000000000..b40114ddf --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Reflection; + +[assembly: AssemblyVersion("1.2.2")] diff --git a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta new file mode 100644 index 000000000..b483b9c10 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6efabd9b23eecd0459622d955c6a2b4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs b/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs new file mode 100644 index 000000000..6ca8f3f18 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs @@ -0,0 +1,7 @@ +namespace Mirage.NetworkProfiler.ModuleGUI +{ + internal interface ICountRecorderProvider + { + CountRecorder GetCountRecorder(); + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta new file mode 100644 index 000000000..9aaffa630 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7ff307d04db0b64690d8c9692e40d8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages.meta new file mode 100644 index 000000000..31bc0e207 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 667ec5fd9bee70844a2b458410782b0a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs new file mode 100644 index 000000000..3703a1ce0 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; +using Mirage.NetworkProfiler.ModuleGUI.UITable; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal sealed class Columns : IEnumerable + { + private const int EXPAND_WIDTH = 25; + private const int FULL_NAME_WIDTH = 300; + private const int NAME_WIDTH = 150; + private const int OTHER_WIDTH = 100; + + private readonly ColumnInfo[] _columns; + + public readonly ColumnInfo Expand; + public readonly ColumnInfo FullName; + public readonly ColumnInfo TotalBytes; + public readonly ColumnInfo Count; + public readonly ColumnInfo BytesPerMessage; + public readonly ColumnInfo NetId; + public readonly ColumnInfo ObjectName; + public readonly ColumnInfo RpcName; + + public Columns() + { + Expand = new ColumnInfo("+", EXPAND_WIDTH, x => ""); + + FullName = new ColumnInfo("Message", FULL_NAME_WIDTH, x => x.Name); + FullName.AddSort(m => m.Name, m => m.Name); + + TotalBytes = new ColumnInfo("Total Bytes", OTHER_WIDTH, x => x.TotalBytes.ToString()); + TotalBytes.AddSort(m => m.TotalBytes, m => m.TotalBytes); + + Count = new ColumnInfo("Count", OTHER_WIDTH, x => x.Count.ToString()); + Count.AddSort(m => m.TotalCount, m => m.Count); + + BytesPerMessage = new ColumnInfo("Bytes", OTHER_WIDTH, x => x.Bytes.ToString()); + BytesPerMessage.AddSort(null, m => m.Bytes); + + NetId = new ColumnInfo("Net id", OTHER_WIDTH, x => x.NetId.HasValue ? x.NetId.ToString() : ""); + NetId.AddSort(null, m => m.NetId.GetValueOrDefault()); + + ObjectName = new ColumnInfo("GameObject Name", NAME_WIDTH, x => x.ObjectName); + ObjectName.AddSort(null, m => m.ObjectName); + + RpcName = new ColumnInfo("RPC Name (hover for full name)", FULL_NAME_WIDTH, x => RpcShortName(x.RpcName)); + RpcName.AddSort(null, m => m.RpcName); + // full name in tooltip + RpcName.AddToolTip(m => m.RpcName); + + _columns = new ColumnInfo[] { + + Expand, + FullName, + TotalBytes, + Count, + BytesPerMessage, + NetId, + ObjectName, + RpcName, + }; + } + + private string RpcShortName(string fullName) + { + if (string.IsNullOrEmpty(fullName)) + return string.Empty; + + const char separator = '.'; + + if (fullName.Contains(separator)) + { + var split = fullName.Split(separator); + var count = split.Length; + if (count >= 2) + { + return $"{split[count - 2]}.{split[count - 1]}"; + } + } + + return fullName; + } + + + public IEnumerator GetEnumerator() => ((IEnumerable)_columns).GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => _columns.GetEnumerator(); + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta new file mode 100644 index 000000000..f838ed023 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36dff191a3209c444844bbdc74f60cd4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs new file mode 100644 index 000000000..3784aaac3 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs @@ -0,0 +1,16 @@ +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal struct CounterNames + { + public readonly string Count; + public readonly string Bytes; + public readonly string PerSecond; + + public CounterNames(string count, string bytes, string perSecond) + { + Count = count; + Bytes = bytes; + PerSecond = perSecond; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta new file mode 100644 index 000000000..3e8299b61 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2422d6a68fe533e4c9da13ae30767fcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs new file mode 100644 index 000000000..ed8f12c01 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs @@ -0,0 +1,10 @@ +using Mirage.NetworkProfiler.ModuleGUI.UITable; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal class DrawnMessage + { + public MessageInfo Info; + public Row Row; + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta new file mode 100644 index 000000000..2caa2fc0e --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df1ae3a59995b1a43b6b76e16d2b8f3a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs new file mode 100644 index 000000000..bd3319390 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using Mirage.NetworkProfiler.ModuleGUI.UITable; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal class Group + { + public readonly List Rows = new List(); + public readonly string Name; + public readonly List Messages = new List(); + + private readonly Table _table; + private readonly Columns _columns; + + public Row Head; + + public int TotalBytes { get; private set; } + public int TotalCount { get; private set; } + public int Order { get; private set; } + + public bool Expanded { get; private set; } + + public Group(string name, Table table, Columns columns) + { + Name = name; + _table = table; + _columns = columns; + // start at max, then take min each time message is added + Order = int.MaxValue; + } + + public void AddMessage(MessageInfo msg) + { + Messages.Add(new DrawnMessage { Info = msg }); + TotalBytes += msg.TotalBytes; + TotalCount += msg.Count; + Order = Math.Min(Order, msg.Order); + } + + public void ToggleExpand() + { + Expand(!Expanded); + } + + public void Expand(bool expanded) + { + Expanded = expanded; + // create rows if needed + LazyCreateRows(); + foreach (var row in Rows) + { + row.VisualElement.style.display = expanded ? DisplayStyle.Flex : DisplayStyle.None; + } + + // head can be null if ungrouped + Head?.SetText(_columns.Expand, Expanded ? "-" : "+"); + } + + public void LazyCreateRows() + { + // not visible, do nothing till row is expanded + if (!Expanded) + return; + // already created + if (Rows.Count > 0) + return; + + DrawMessages(); + } + + + /// Messages to add to table + /// list to add rows to once created, Can be null + private void DrawMessages() + { + var previous = Head; + var backgroundColor = GetBackgroundColor(); + + foreach (var drawn in Messages) + { + var row = _table.AddRow(previous); + Rows.Add(row); + + // set previous to be new row, so that message are added in order after previous + previous = row; + + drawn.Row = row; + var info = drawn.Info; + DrawMessage(row, info); + + // set color of labels not whole row, otherwise color will be outside of table as well + foreach (var ele in row.GetChildren()) + ele.style.backgroundColor = backgroundColor; + } + } + + private void DrawMessage(Row row, MessageInfo info) + { + foreach (var column in _columns) + { + row.SetText(column, column.TextGetter.Invoke(info)); + if (column.HasToolTip) + { + var label = row.GetLabel(column); + label.tooltip = column.ToolTipGetter.Invoke(info); + } + } + } + + private static Color GetBackgroundColor() + { + // pick color that is lighter/darker than default editor background + // todo check if there is a way to get the real color, or do we have to use `isProSkin`? + return EditorGUIUtility.isProSkin + ? (Color)new Color32(56, 56, 56, 255) / 0.8f + : (Color)new Color32(194, 194, 194, 255) * .8f; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta new file mode 100644 index 000000000..dcc56b888 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d73a0b136989084c8caed7ae1349219 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs new file mode 100644 index 000000000..97eb3081c --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Mirage.NetworkProfiler.ModuleGUI.UITable; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal struct GroupSorter + { + private readonly Dictionary _grouped; + private readonly Func _sortGroupFunc; + private readonly Func _sortMessageFunc; + + private readonly SortMode _sortMode; + + public GroupSorter(Dictionary grouped, ColumnInfo sortHeader, SortMode sortMode) + { + _grouped = grouped; + _sortMode = sortMode; + + // if header or sort is null, use default + _sortGroupFunc = sortHeader?.SortGroup ?? DefaultGroupSort; + _sortMessageFunc = sortHeader?.SortMessages ?? DefaultMessageSort; + } + + public void Sort() + { + var groups = new List(_grouped.Values); + + // sort all groups and their messages + groups.Sort(CompareGroupSortMode); + foreach (var group in groups) + { + group.Messages.Sort(CompareDrawnSortMode); + } + + // apply sort to table + foreach (var group in groups) + { + // use BringToFront so that each new element is placed after the last one, bring them all to their correct position + + // head might be null if messages are ungrouped + group.Head?.VisualElement.BringToFront(); + foreach (var msg in group.Messages) + { + // row might be null before it is drawn for first time + msg.Row?.VisualElement.BringToFront(); + } + } + } + + private int CompareGroupSortMode(Group x, Group y) + { + var sort = _sortGroupFunc.Invoke(x, y); + return CheckSortMode(sort); + } + + private int CompareDrawnSortMode(DrawnMessage x, DrawnMessage y) + { + var sort = _sortMessageFunc.Invoke(x.Info, y.Info); + return CheckSortMode(sort); + } + + private int CheckSortMode(int sort) + { + // flip order if Descending + if (_sortMode == SortMode.Descending) + return -sort; + + return sort; + } + + public static int Compare(Group x, Group y, Func func) where T : IComparable + { + var xValue = func.Invoke(x); + var yValue = func.Invoke(y); + return xValue.CompareTo(yValue); + } + public static int Compare(MessageInfo x, MessageInfo y, Func func) where T : IComparable + { + var xValue = func.Invoke(x); + var yValue = func.Invoke(y); + return xValue.CompareTo(yValue); + } + + public static int DefaultGroupSort(Group x, Group y) + { + return x.Order.CompareTo(y.Order); + } + public static int DefaultMessageSort(MessageInfo x, MessageInfo y) + { + return x.Order.CompareTo(y.Order); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta new file mode 100644 index 000000000..ecc245ec3 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b13bef8f87b23684bae6fc2453c090b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs new file mode 100644 index 000000000..e53fcc42d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using Mirage.NetworkProfiler.ModuleGUI.UITable; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal class MessageView + { + private readonly Columns _columns; + private readonly Table _table; + + /// + /// cache list used to gather messages + /// + private readonly List _messages = new List(); + private readonly Dictionary _grouped = new Dictionary(); + + public event Action OnGroupExpanded; + + public MessageView(Columns columns, TableSorter sorter, VisualElement parent) + { + _columns = columns; + _table = new Table(columns, sorter); + parent.Add(_table.VisualElement); + } + + public void Draw(IEnumerable frames, bool groupMessages) + { + CollectMessages(frames); + GroupMessages(groupMessages); + DrawGroups(groupMessages); + + var expandColumn = _columns.Expand; + var defaultWidth = expandColumn.Width; + var width = groupMessages ? defaultWidth : 0; + _table.ChangeWidth(expandColumn, width, true); + } + + private void CollectMessages(IEnumerable frames) + { + _messages.Clear(); + foreach (var frame in frames) + { + _messages.AddRange(frame.Messages); + } + } + + private void GroupMessages(bool asGroups) + { + _grouped.Clear(); + + foreach (var message in _messages) + { + string name; + if (asGroups) + name = message.Name; + else + name = "all_messages"; + + if (!_grouped.TryGetValue(name, out var group)) + { + group = new Group(name, _table, _columns); + _grouped[name] = group; + } + + group.AddMessage(message); + } + } + + private void DrawGroups(bool withHeader) + { + foreach (var group in _grouped.Values) + { + if (withHeader) + { + DrawGroupHeader(group); + } + else + { + group.Expand(true); + } + } + } + + private void DrawGroupHeader(Group group) + { + // draw header + var head = _table.AddRow(); + head.SetText(_columns.Expand, group.Expanded ? "-" : "+"); + head.SetText(_columns.FullName, group.Name); + head.SetText(_columns.TotalBytes, group.TotalBytes); + head.SetText(_columns.Count, group.TotalCount); + group.Head = head; + + var expand = head.GetLabel(_columns.Expand); + expand.AddManipulator(new Clickable((evt) => + { + group.ToggleExpand(); + OnGroupExpanded?.Invoke(group, group.Expanded); + })); + + // will lazy create message if expanded + group.Expand(group.Expanded); + } + + public void Sort(ColumnInfo sortHeader, SortMode sortMode) + { + var sorter = new GroupSorter(_grouped, sortHeader, sortMode); + sorter.Sort(); + + if (sortHeader != null) + { + // also set table names, + _table.SetSortHeader(sortHeader, sortMode); + } + } + + public void Clear() + { + _table.Clear(); + } + + public VisualElement AddEmptyRow() + { + var row = _table.AddEmptyRow(); + return row.VisualElement; + } + + public void ExpandMany(List expanded) + { + foreach (var group in _grouped.Values) + { + if (expanded.Contains(group.Name)) + { + group.Expand(true); + } + } + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta new file mode 100644 index 000000000..6bfc49b55 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f417eeb8a30cca4eb1a9301a73dbf10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs new file mode 100644 index 000000000..d8e193874 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs @@ -0,0 +1,280 @@ +using System; +using System.Collections.Generic; +using Mirage.NetworkProfiler.ModuleGUI.UITable; +//using Mirage.RemoteCalls; +using Unity.Profiling; +using Unity.Profiling.Editor; +using UnityEditor; +using UnityEditorInternal; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + internal sealed class MessageViewController : ProfilerModuleViewController + { + private readonly CounterNames _names; + private readonly Columns _columns = new Columns(); + private Label _countLabel; + private Label _bytesLabel; + private Label _perSecondLabel; + private VisualElement _toggleBox; + private Toggle _debugToggle; + private Toggle _groupMsgToggle; + private MessageView _messageView; + private readonly SavedData _savedData; + + public MessageViewController(ProfilerWindow profilerWindow, CounterNames names, SavedData savedData) + : base(profilerWindow) + { + _names = names; + _savedData = savedData; + } + + protected override VisualElement CreateView() + { + // unity doesn't catch errors here so we have to wrap in try/catch + try + { + return CreateViewInternal(); + } + catch (Exception ex) + { + Debug.LogException(ex); + return null; + } + } + + protected override void Dispose(bool disposing) + { + if (!disposing) + return; + + // Unsubscribe from the Profiler window event that we previously subscribed to. + ProfilerWindow.SelectedFrameIndexChanged -= FrameIndexChanged; + + base.Dispose(disposing); + } + + private VisualElement CreateViewInternal() + { + var root = new VisualElement(); + root.style.flexDirection = new StyleEnum(FlexDirection.Row); + root.style.height = Length.Percent(100); + root.style.overflow = Overflow.Hidden; + + var summary = new VisualElement(); + _countLabel = AddLabelWithPadding(summary); + _bytesLabel = AddLabelWithPadding(summary); + _perSecondLabel = AddLabelWithPadding(summary); + _perSecondLabel.tooltip = Names.PER_SECOND_TOOLTIP; + root.Add(summary); + summary.style.height = Length.Percent(100); + summary.style.width = 180; + summary.style.minWidth = 180; + summary.style.maxWidth = 180; + summary.style.borderRightColor = Color.white * .4f;//dark grey + summary.style.borderRightWidth = 3; + + _toggleBox = new VisualElement(); + _toggleBox.style.position = Position.Absolute; + _toggleBox.style.bottom = 5; + _toggleBox.style.left = 5; + _toggleBox.style.unityTextAlign = TextAnchor.LowerLeft; + summary.Add(_toggleBox); + + _groupMsgToggle = new Toggle + { + text = "Group Messages", + tooltip = "Groups Message by type", + value = _savedData.GroupMessages, + }; + _groupMsgToggle.RegisterValueChangedCallback(GroupToggled); + _toggleBox.Add(_groupMsgToggle); + + // todo allow selection of multiple frames + //var frameSlider = new MinMaxSlider(); + //frameSlider.highLimit = 300; + //frameSlider.lowLimit = 1; + //frameSlider.value = Vector2.one; + //frameSlider.RegisterValueChangedCallback(_ => Debug.Log(frameSlider.value)); + //_toggleBox.Add(frameSlider); + + _debugToggle = new Toggle + { + text = "Show Fake Messages", + tooltip = "Adds fakes message to table to debug layout of table", + value = false + }; + _debugToggle.RegisterValueChangedCallback(_ => ReloadData()); + _toggleBox.Add(_debugToggle); +#if MIRAGE_PROFILER_DEBUG + _debugToggle.style.display = DisplayStyle.Flex; +#else + _debugToggle.style.display = DisplayStyle.None; +#endif + + + var sorter = new TableSorter(this); + _messageView = new MessageView(_columns, sorter, root); + _messageView.OnGroupExpanded += OnGroupExpanded; + + // Populate the label with the current data for the selected frame. + ReloadData(); + + // Be notified when the selected frame index in the Profiler Window changes, so we can update the label. + ProfilerWindow.SelectedFrameIndexChanged += FrameIndexChanged; + + return root; + } + + private void GroupToggled(ChangeEvent evt) + { + _savedData.GroupMessages = evt.newValue; + ReloadData(); + } + + private void OnGroupExpanded(Group group, bool expanded) + { + if (expanded) + _savedData.Expanded.Add(group.Name); + else + _savedData.Expanded.Remove(group.Name); + } + + private void FrameIndexChanged(long selectedFrameIndex) => ReloadData(); + + private static Label AddLabelWithPadding(VisualElement parent) + { + var label = new Label() { style = { paddingTop = 8, paddingLeft = 8 } }; + parent.Add(label); + return label; + } + + internal void Sort(SortHeader header) + { + _savedData.SetSortHeader(header); + SortFromSaveData(); + } + + private void SortFromSaveData() + { + var (sortHeader, sortMode) = _savedData.GetSortHeader(_columns); + _messageView.Sort(sortHeader, sortMode); + } + + + private void ReloadData() + { + SetSummary(_countLabel, _names.Count); + SetSummary(_bytesLabel, _names.Bytes); + SetSummary(_perSecondLabel, _names.PerSecond); + + ReloadMessages(); + } + + private void SetSummary(Label label, string counterName) + { + var frame = (int)ProfilerWindow.selectedFrameIndex; + var category = ProfilerCategory.Network.Name; + var value = ProfilerDriver.GetFormattedCounterValue(frame, category, counterName); + + // replace prefix + var display = counterName.Replace("Received", "").Replace("Sent", "").Trim(); + label.text = $"{display}: {value}"; + } + + private void ReloadMessages() + { + const int EditorID = -1; + + _messageView.Clear(); + + var frameIndex = (int)ProfilerWindow.selectedFrameIndex; + // Debug.Log($"ReloadMessages [selected {(int)ProfilerWindow.selectedFrameIndex}]"); + + + if (ProfilerDriver.connectedProfiler != EditorID) + { + AddErrorLabel("Can't read message from player"); + return; + } + + if (!TryGetMessages(frameIndex, out var messages)) + { + AddErrorLabel("Can not load messages! (Message list only visible in play mode)\nIMPORTANT: make sure NetworkProfilerBehaviour is setup in starting scene"); + return; + } + + if (messages.Count == 0) + { + AddInfoLabel("No Messages"); + return; + } + + var frame = new Frame[1] { + new Frame{ Messages = messages }, + }; + _messageView.Draw(frame, _groupMsgToggle.value); + _messageView.ExpandMany(_savedData.Expanded); + SortFromSaveData(); + } + + private bool TryGetMessages(int frameIndex, out List messages) + { + if (_debugToggle.value) + { + messages = GenerateDebugMessages(); + return true; + } + + if (frameIndex == -1) + { + messages = null; + return false; + } + + messages = _savedData.Frames.GetFrame(frameIndex).Messages; + return true; + } + + private static List GenerateDebugMessages() + { + var messages = new List(); + var order = 0; +// for (var i = 0; i < 5; i++) +// { +// messages.Add(NewInfo(order++, new RpcMessage { NetId = (uint)i }, 20 + i, 5)); +// messages.Add(NewInfo(order++, new SpawnMessage { NetId = (uint)i }, 80 + i, 1)); +// messages.Add(NewInfo(order++, new SpawnMessage { NetId = (uint)i }, 60 + i, 4)); +// messages.Add(NewInfo(order++, new NetworkPingMessage { }, 4, 1)); + +// static MessageInfo NewInfo(int order, object msg, int bytes, int count) +// { +//#if MIRAGE_DIAGNOSTIC_INSTANCE +// return new MessageInfo(new NetworkDiagnostics.MessageInfo(null, msg, bytes, count), provider, order); +//#else +// return new MessageInfo(new NetworkDiagnostics.MessageInfo(msg, bytes, count), new NetworkInfoProvider(null), order); +//#endif +// } +// } + + return messages; + } + + private void AddErrorLabel(string message) + { + var parent = _messageView.AddEmptyRow(); + var ele = AddLabelWithPadding(parent); + ele.style.color = Color.red; + ele.text = message; + } + + private void AddInfoLabel(string message) + { + var parent = _messageView.AddEmptyRow(); + var ele = AddLabelWithPadding(parent); + ele.text = message; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta new file mode 100644 index 000000000..6a3c59a76 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b210a69331a49414ca5f6436163f61d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs new file mode 100644 index 000000000..db0caccc1 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs @@ -0,0 +1,27 @@ +using Mirage.NetworkProfiler.ModuleGUI.UITable; +using UnityEngine; + +namespace Mirage.NetworkProfiler.ModuleGUI.Messages +{ + + internal class TableSorter : ITableSorter + { + private readonly MessageViewController _controller; + + public TableSorter(MessageViewController controller) + { + _controller = controller; + } + + public void Sort(Table table, SortHeader header) + { + if (table.ContainsEmptyRows) + { + Debug.LogWarning("Can't sort when there are empty rows"); + return; + } + + _controller.Sort(header); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta new file mode 100644 index 000000000..6c4c19a03 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 658b759dbe63e9c44a14d785a15c862e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef new file mode 100644 index 000000000..dae99d112 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef @@ -0,0 +1,20 @@ +{ + "name": "Mirage.Profiler.Editor", + "rootNamespace": "", + "references": [ + "GUID:b46779583a009f04ba9f5f31d0e7e6ac", + "GUID:6ff9f1c8e2ed4034baf80c43db7a3b6a", + "GUID:30817c1a0e6d646d99c048fc403f5979" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta new file mode 100644 index 000000000..b37075530 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ff97fe2e55c0fd44c91fb1242f9bff3e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs b/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs new file mode 100644 index 000000000..ea8c4ba43 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs @@ -0,0 +1,12 @@ +namespace Mirage.NetworkProfiler.ModuleGUI +{ + internal static class ModuleNames + { + // change this based on netcode lib + private const string PREFIX = "FishNet"; + + public const string SERVER = PREFIX + " Server"; + public const string SENT = PREFIX + " Sent"; + public const string RECEIVED = PREFIX + " Received"; + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta new file mode 100644 index 000000000..eeee9a1a1 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a65943c66af2cb4cb0433f5f3bd73b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs b/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs new file mode 100644 index 000000000..33b6f862a --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs @@ -0,0 +1,35 @@ +using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Unity.Profiling.Editor; + +namespace Mirage.NetworkProfiler.ModuleGUI +{ + [System.Serializable] + [ProfilerModuleMetadata(ModuleNames.RECEIVED)] + public class ReceivedModule : ProfilerModule, ICountRecorderProvider + { + private static readonly ProfilerCounterDescriptor[] counters = new ProfilerCounterDescriptor[] + { + new ProfilerCounterDescriptor(Names.RECEIVED_COUNT, Counters.Category), + new ProfilerCounterDescriptor(Names.RECEIVED_BYTES, Counters.Category), + new ProfilerCounterDescriptor(Names.RECEIVED_PER_SECOND, Counters.Category), + }; + + public ReceivedModule() : base(counters) { } + + public override ProfilerModuleViewController CreateDetailsViewController() + { + var names = new CounterNames( + Names.RECEIVED_COUNT, + Names.RECEIVED_BYTES, + Names.RECEIVED_PER_SECOND + ); + + return new MessageViewController(ProfilerWindow, names, SaveDataLoader.ReceiveData); + } + + CountRecorder ICountRecorderProvider.GetCountRecorder() + { + return NetworkProfilerRecorder._receivedCounter; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta new file mode 100644 index 000000000..e5f993026 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 677abdcefedd3144b9784f7a09a647da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs b/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs new file mode 100644 index 000000000..bb1217c15 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Mirage.NetworkProfiler.ModuleGUI.UITable; +using UnityEditor; +using UnityEngine; + +namespace Mirage.NetworkProfiler.ModuleGUI +{ + [Serializable] + internal class SavedData + { + /// + /// Message from each frame so they can survive domain reload + /// + public Frames Frames; + + /// + /// Active sort header + /// + public string SortHeader; + + public SortMode SortMode; + + /// + /// Which Message groups are expanded + /// + public List Expanded; + + public bool GroupMessages = true; + + public SavedData() + { + Frames = new Frames(); + + Expanded = new List(); + } + + public (ColumnInfo, SortMode) GetSortHeader(Columns columns) + { + foreach (var c in columns) + { + if (SortHeader == c.Header) + { + return (c, SortMode); + } + } + + return (null, SortMode.None); + } + + public void SetSortHeader(SortHeader header) + { + if (header == null) + { + SortHeader = ""; + } + else + { + SortHeader = header.Info.Header; + SortMode = header.SortMode; + } + } + + public void Clear() + { + foreach (var frame in Frames) + { + frame.Bytes = 0; + frame.Messages.Clear(); + } + } + } + + internal class SaveDataLoader + { + private SavedData _receiveData; + private SavedData _sentData; + private static SaveDataLoader instance; + private static bool isQuitting; + + // private so only we can create one + private SaveDataLoader() + { + NetworkProfilerRecorder.AfterSample += AfterSample; + EditorApplication.quitting += Quitting; + } + + private void Quitting() + { + Console.WriteLine("[Mirage.Profiler] quitting"); + // save and clear references when quitting, + // this is needed because finialize is called after unity dll unloads so causes crash + SaveBoth(); + _receiveData = null; + _sentData = null; + isQuitting = true; + } + + ~SaveDataLoader() + { + NetworkProfilerRecorder.AfterSample -= AfterSample; + + // dont save after quitting, unity might unload their dll and cause crash + if (isQuitting) + return; + + SaveBoth(); + } + + private void SaveBoth() + { + if (_receiveData != null) + Save(GetFullPath("Receive"), _receiveData); + + if (_sentData != null) + Save(GetFullPath("Sent"), _sentData); + } + + private static void AfterSample(int tick) + { + SetFrame(tick, ReceiveData, NetworkProfilerRecorder._receivedCounter); + SetFrame(tick, SentData, NetworkProfilerRecorder._sentCounter); + } + + private static void SetFrame(int tick, SavedData data, CountRecorder counter) + { + var saveFrame = data.Frames.GetFrame(tick); + + // clear old data + saveFrame.Bytes = 0; + saveFrame.Messages.Clear(); + + if (counter == null) + return; + + var counterFrame = counter._frames.GetFrame(tick); + + saveFrame.Bytes = counterFrame.Bytes; + saveFrame.Messages.AddRange(counterFrame.Messages); + } + + public static SavedData ReceiveData + { + get + { + // dont load on quit, it might cause crash if unity dll unloads while savedata is save/loading + if (isQuitting) + return null; + + if (instance == null) + instance = new SaveDataLoader(); + + if (instance._receiveData == null) + { + instance._receiveData = Load(GetFullPath("Receive")); + } + return instance._receiveData; + } + } + + public static SavedData SentData + { + get + { + // dont load on quit, it might cause crash if unity dll unloads while savedata is save/loading + if (isQuitting) + return null; + + if (instance == null) + instance = new SaveDataLoader(); + + if (instance._sentData == null) + { + instance._sentData = Load(GetFullPath("Sent")); + } + return instance._sentData; + } + } + + public static string GetFullPath(string name) + { + var userSettingsFolder = Path.GetFullPath("UserSettings"); + if (string.IsNullOrEmpty(name)) + throw new ArgumentNullException(nameof(name)); + + return Path.Join(userSettingsFolder, "Mirage.Profiler", $"{name}.json"); + } + + public static void Save(string path, SavedData data) + { + Console.WriteLine($"[Mirage.Profiler] Save {path}"); + CheckDir(path); + + var text = JsonUtility.ToJson(data); + File.WriteAllText(path, text); + } + + public static SavedData Load(string path) + { + Console.WriteLine($"[Mirage.Profiler] Load {path}"); + CheckDir(path); + + if (File.Exists(path)) + { + var text = File.ReadAllText(path); + var data = JsonUtility.FromJson(text); + Validate(data); + return data; + } + else + { + return new SavedData(); + } + } + + private static void Validate(SavedData data) + { + data.Frames.ValidateSize(); + } + + private static void CheckDir(string path) + { + // check dir exists + var dir = Path.GetDirectoryName(path); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta new file mode 100644 index 000000000..0198a6cde --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e3608e18fbb66346bc8d15f628ad4f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs b/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs new file mode 100644 index 000000000..4cf2203ef --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs @@ -0,0 +1,35 @@ +using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Unity.Profiling.Editor; + +namespace Mirage.NetworkProfiler.ModuleGUI +{ + [System.Serializable] + [ProfilerModuleMetadata(ModuleNames.SENT)] + public class SentModule : ProfilerModule, ICountRecorderProvider + { + private static readonly ProfilerCounterDescriptor[] counters = new ProfilerCounterDescriptor[] + { + new ProfilerCounterDescriptor(Names.SENT_COUNT, Counters.Category), + new ProfilerCounterDescriptor(Names.SENT_BYTES, Counters.Category), + new ProfilerCounterDescriptor(Names.SENT_PER_SECOND, Counters.Category), + }; + + public SentModule() : base(counters) { } + + public override ProfilerModuleViewController CreateDetailsViewController() + { + var names = new CounterNames( + Names.SENT_COUNT, + Names.SENT_BYTES, + Names.SENT_PER_SECOND + ); + + return new MessageViewController(ProfilerWindow, names, SaveDataLoader.SentData); + } + + CountRecorder ICountRecorderProvider.GetCountRecorder() + { + return NetworkProfilerRecorder._sentCounter; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta new file mode 100644 index 000000000..7dae7f048 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5447799e8b54b3044b4fac717c450b46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs b/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs new file mode 100644 index 000000000..029f5950d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs @@ -0,0 +1,108 @@ +using Unity.Profiling; +using Unity.Profiling.Editor; +using UnityEditor; +using UnityEditorInternal; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI +{ + [System.Serializable] + [ProfilerModuleMetadata(ModuleNames.SERVER)] + public class ServerModule : ProfilerModule + { + private static readonly ProfilerCounterDescriptor[] counters = new ProfilerCounterDescriptor[] + { + new ProfilerCounterDescriptor(Names.PLAYER_COUNT, Counters.Category), + new ProfilerCounterDescriptor(Names.AUTHENTICATED_COUNT, Counters.Category), + new ProfilerCounterDescriptor(Names.CHARACTER_COUNT, Counters.Category), + new ProfilerCounterDescriptor(Names.OBJECT_COUNT, Counters.Category), + }; + + public ServerModule() : base(counters) { } + + public override ProfilerModuleViewController CreateDetailsViewController() + { + return new ServerViewController(ProfilerWindow); + } + } + + public abstract class BaseViewController : ProfilerModuleViewController + { + public BaseViewController(ProfilerWindow profilerWindow) : base(profilerWindow) { } + + protected static Label AddLabelWithPadding(VisualElement parent) + { + var label = new Label() { style = { paddingTop = 8, paddingLeft = 8 } }; + parent.Add(label); + return label; + } + + + protected void SetText(Label label, string name) + { + var frame = (int)ProfilerWindow.selectedFrameIndex; + var category = ProfilerCategory.Network.Name; + var value = ProfilerDriver.GetFormattedCounterValue(frame, category, name); + + label.text = $"{name}: {value}"; + } + } + + public sealed class ServerViewController : BaseViewController + { + private Label PlayerLabel; + private Label AuthenticatedLabel; + private Label CharacterLabel; + private Label ObjectLabel; + + public ServerViewController(ProfilerWindow profilerWindow) : base(profilerWindow) { } + + protected override VisualElement CreateView() + { + var root = new VisualElement(); + + PlayerLabel = AddLabelWithPadding(root); + AuthenticatedLabel = AddLabelWithPadding(root); + CharacterLabel = AddLabelWithPadding(root); + ObjectLabel = AddLabelWithPadding(root); + + PlayerLabel.tooltip = Names.PLAYER_COUNT_TOOLTIP; + AuthenticatedLabel.tooltip = Names.AUTHENTICATED_COUNT_TOOLTIP; + CharacterLabel.tooltip = Names.CHARACTER_COUNT_TOOLTIP; + ObjectLabel.tooltip = Names.OBJECT_COUNT_TOOLTIP; + + // Populate the label with the current data for the selected frame. + ReloadData(); + + // Be notified when the selected frame index in the Profiler Window changes, so we can update the label. + ProfilerWindow.SelectedFrameIndexChanged += OnSelectedFrameIndexChanged; + + return root; + } + + private void OnSelectedFrameIndexChanged(long selectedFrameIndex) + { + // Update the label with the current data for the newly selected frame. + ReloadData(); + } + + protected override void Dispose(bool disposing) + { + if (!disposing) + return; + + // Unsubscribe from the Profiler window event that we previously subscribed to. + ProfilerWindow.SelectedFrameIndexChanged -= OnSelectedFrameIndexChanged; + + base.Dispose(disposing); + } + + private void ReloadData() + { + SetText(PlayerLabel, Names.PLAYER_COUNT); + SetText(AuthenticatedLabel, Names.AUTHENTICATED_COUNT); + SetText(CharacterLabel, Names.CHARACTER_COUNT); + SetText(ObjectLabel, Names.OBJECT_COUNT); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta new file mode 100644 index 000000000..01d46e394 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8113ff8f56cc644bb23d2da87f23eab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table.meta new file mode 100644 index 000000000..2dcf6c597 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc264da8a8fc533418223d921f2f00c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs new file mode 100644 index 000000000..40841949a --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs @@ -0,0 +1,66 @@ +using System; +using Mirage.NetworkProfiler.ModuleGUI.Messages; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class ColumnInfo + { + public string Header { get; private set; } + public int Width { get; private set; } + + public bool AllowSort { get; private set; } + public Func SortGroup { get; private set; } + public Func SortMessages { get; private set; } + + public Func TextGetter { get; private set; } + + public bool HasToolTip { get; private set; } + public Func ToolTipGetter { get; private set; } + + public ColumnInfo(string header, int width, Func textGetter) + { + Header = header; + Width = width; + TextGetter = textGetter; + } + + /// + /// Enables sorting for column. If sort functions are null they will use default sort from + /// + /// + /// + /// + public void AddSort(Func sortGroup, Func sortMessages) + { + AllowSort = true; + SortGroup = sortGroup ?? GroupSorter.DefaultGroupSort; + SortMessages = sortMessages ?? GroupSorter.DefaultMessageSort; + } + + /// + /// Enables sorting for column. If sort functions are null they will use default sort from + /// Uses member getting to sort via that member + /// + /// + /// + /// + public void AddSort(Func groupGetter, Func messageGetter) where T : IComparable + { + Func sortGroup = groupGetter != null + ? (x, y) => GroupSorter.Compare(x, y, groupGetter) + : null; + + Func sortMessages = messageGetter != null + ? (x, y) => GroupSorter.Compare(x, y, messageGetter) + : null; + + AddSort(sortGroup, sortMessages); + } + + public void AddToolTip(Func getter) + { + HasToolTip = true; + ToolTipGetter = getter; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta new file mode 100644 index 000000000..fa911940f --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b017b2728f784842bc8f62460ab9fbe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs new file mode 100644 index 000000000..b5b492a10 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class EmptyRow : Row + { + public EmptyRow(Table table, Row previous = null) : base(table, previous) { } + + public override Label GetLabel(ColumnInfo column) + { + throw new NotSupportedException("Empty row does not have any columns"); + } + + public override IEnumerable GetChildren() + { + return Enumerable.Empty(); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta new file mode 100644 index 000000000..b04d5eda2 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8129d33c5f799524fa10e84110131e69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs new file mode 100644 index 000000000..a549ccb1f --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs @@ -0,0 +1,7 @@ +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal interface ITableSorter + { + void Sort(Table table, SortHeader header); + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta new file mode 100644 index 000000000..ed3d524e5 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05c177a4f382419409a2f55de20e046c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs new file mode 100644 index 000000000..c4c98c50c --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class LabelRow : Row + { + private readonly Dictionary _elements = new Dictionary(); + + public LabelRow(Table table, Row previous = null) : base(table, previous) + { + foreach (var header in table.HeaderInfo) + { + var label = CreateLabel(header); + VisualElement.Add(label); + _elements[header] = label; + } + } + + protected virtual Label CreateLabel(ColumnInfo column) + { + var label = new Label(); + SetLabelStyle(column, label); + return label; + } + + protected static void SetLabelStyle(ColumnInfo column, Label label) + { + var style = label.style; + style.width = column.Width; + + style.paddingLeft = 5; + style.paddingRight = 5; + style.paddingTop = 5; + style.paddingBottom = 5; + style.borderRightColor = Color.white * .4f; + style.borderBottomColor = Color.white * .4f; + style.borderBottomWidth = 1; + style.borderRightWidth = 2; + + style.overflow = Overflow.Hidden; + style.textOverflow = TextOverflow.Ellipsis; + } + + public override Label GetLabel(ColumnInfo column) + { + return _elements[column]; + } + + public override IEnumerable GetChildren() + { + return _elements.Values; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta new file mode 100644 index 000000000..7cc1ace4d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e463bd968d1bb0e4cbae5efd09ed24fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs new file mode 100644 index 000000000..f5a0965cd --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal abstract class Row + { + public Table Table { get; } + public VisualElement VisualElement { get; } + + public Row(Table table, Row previous = null) + { + Table = table; + + VisualElement = new VisualElement(); + VisualElement.style.flexDirection = FlexDirection.Row; + + var parent = table.ScrollView; + if (previous != null) + { + var index = parent.IndexOf(previous.VisualElement); + // insert after previous + parent.Insert(index + 1, VisualElement); + } + else + { + // just add at end + parent.Add(VisualElement); + } + } + + public abstract Label GetLabel(ColumnInfo column); + public abstract IEnumerable GetChildren(); + + public void SetText(ColumnInfo column, object obj) + { + SetText(column, obj.ToString()); + } + public void SetText(ColumnInfo column, string text) + { + var label = GetLabel(column); + label.text = text; + label.tooltip = text; + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta new file mode 100644 index 000000000..98b930f5b --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac8d50f233b70db42a649ca6b7d69010 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs new file mode 100644 index 000000000..0e95c641e --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs @@ -0,0 +1,63 @@ +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class SortHeader : Label + { + public const string ARROW_UP = "\u2191"; + public const string ARROW_DOWN = "\u2193"; + + public SortMode SortMode; + + private readonly SortHeaderRow _row; + + private string _nameWithoutSort; + public string NameWithoutSort + { + get + { + // this get should be called before any modifications are made + // so lazy property should be safe here + if (_nameWithoutSort == null) + _nameWithoutSort = text; + + return _nameWithoutSort; + } + } + + public ColumnInfo Info { get; internal set; } + + public SortHeader(SortHeaderRow row) : base() + { + _row = row; + this.AddManipulator(new Clickable(OnClick)); + } + + private void OnClick(EventBase evt) + { + // just flip between Accending and Descending, no going back to none + if (SortMode == SortMode.Accending) + SortMode = SortMode.Descending; + else + SortMode = SortMode.Accending; + + _row.ApplySort(this); + } + + public void UpdateName() + { + switch (SortMode) + { + case SortMode.None: + text = NameWithoutSort; + break; + case SortMode.Accending: + text = ARROW_UP + NameWithoutSort; + break; + case SortMode.Descending: + text = ARROW_DOWN + NameWithoutSort; + break; + } + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta new file mode 100644 index 000000000..913308b1d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab266974aca81aa4abbaefba1e934073 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs new file mode 100644 index 000000000..4e0d99f00 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs @@ -0,0 +1,54 @@ +using System; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class SortHeaderRow : LabelRow + { + private readonly ITableSorter _sorter; + private SortHeader _currentSort; + + public SortHeaderRow(Table table, ITableSorter sorter) : base(table, null) + { + _sorter = sorter ?? throw new ArgumentNullException(nameof(sorter)); + } + + protected override Label CreateLabel(ColumnInfo column) + { + var label = column.AllowSort + ? new SortHeader(this) + : new Label(); + + SetLabelStyle(column, label); + return label; + } + + /// + /// Update names of header based on sort + /// + /// + public void SetSortHeader(SortHeader sortHeader) + { + // not null or current + if (_currentSort != null && _currentSort != sortHeader) + { + _currentSort.SortMode = SortMode.None; + _currentSort.UpdateName(); + } + + _currentSort = sortHeader; + _currentSort.UpdateName(); + } + + /// + /// Updates names and applies sort to table + /// + /// + public void ApplySort(SortHeader sortHeader) + { + SetSortHeader(sortHeader); + + _sorter.Sort(Table, sortHeader); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta new file mode 100644 index 000000000..70290d53f --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b4301d9972553c4ab486e9b8915f784 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs new file mode 100644 index 000000000..2c768e524 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs @@ -0,0 +1,9 @@ +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal enum SortMode + { + None, + Accending, + Descending, + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta new file mode 100644 index 000000000..8f77f1cd6 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0d80f37bc0b1a44cbad7667bba04c79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs b/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs new file mode 100644 index 000000000..fdd6a47af --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs @@ -0,0 +1,113 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Mirage.NetworkProfiler.ModuleGUI.UITable +{ + internal class Table + { + public readonly VisualElement VisualElement; + public readonly ScrollView ScrollView; + + public readonly SortHeaderRow Header; + public readonly List Rows = new List(); + public readonly IReadOnlyList HeaderInfo; + + public bool ContainsEmptyRows { get; private set; } + + public Table(IEnumerable columns, ITableSorter sorter) + { + // create readonly list from given Enumerable + HeaderInfo = new List(columns); + + // create table root and scroll view + // root can be Horizontal scroll + // Horizontal will also move header, but Vertical keeps header at top + VisualElement = new ScrollView(ScrollViewMode.Horizontal); + // seperate root for contents, so that Horizontal from scroll isn't applied + var root = new VisualElement(); + VisualElement.Add(root); + // using VerticalAndHorizontal fixes header being squashed, not sure why, or if it'll cause future problems + ScrollView = new ScrollView(ScrollViewMode.VerticalAndHorizontal); + + // add header to table root + // header will initialize labels, but we need to set text + Header = new SortHeaderRow(this, sorter); + + // add header and scroll to root + root.Add(Header.VisualElement); + root.Add(ScrollView); + + // add headers + foreach (var c in columns) + { + var ele = Header.GetLabel(c); + ele.text = c.Header; + + if (c.AllowSort) + { + var sortHeader = (SortHeader)ele; + sortHeader.Info = c; + } + + // make header element thicker + var eleStyle = ele.style; + eleStyle.unityFontStyleAndWeight = FontStyle.Bold; + eleStyle.borderBottomWidth = 3; + eleStyle.borderRightWidth = 3; + } + } + + public Row AddRow(Row previous = null) + { + var row = new LabelRow(this, previous); + Rows.Add(row); + return row; + } + + public Row AddEmptyRow(Row previous = null) + { + var row = new EmptyRow(this, previous); + ContainsEmptyRows = true; + Rows.Add(row); + return row; + } + + public void ChangeWidth(ColumnInfo column, int newWidth, bool setVisibility) + { + foreach (var row in Rows) + { + if (row is EmptyRow) + continue; + + var label = row.GetLabel(column); + var style = label.style; + style.width = newWidth; + + if (setVisibility) + style.display = newWidth > 0 ? DisplayStyle.Flex : DisplayStyle.None; + } + } + + /// + /// Removes all rows expect header + /// + public void Clear() + { + ScrollView.Clear(); + Rows.Clear(); + Rows.Add(Header); + ContainsEmptyRows = false; + } + + /// + /// Updates names of sort header + /// + public void SetSortHeader(ColumnInfo info, SortMode mode) + { + var sortBy = (SortHeader)Header.GetLabel(info); + sortBy.SortMode = mode; + Header.SetSortHeader(sortBy); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta new file mode 100644 index 000000000..46d81dd7d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a7346de93910944c965b68a39d93082 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/LICENSE b/Assets/FishNet/Runtime/Profiler/LICENSE new file mode 100644 index 000000000..8a221041c --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 James Frowen + +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/FishNet/Runtime/Profiler/LICENSE.meta b/Assets/FishNet/Runtime/Profiler/LICENSE.meta new file mode 100644 index 000000000..1f8ec2aad --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d4452ce1fed4a2641879ef852c413104 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Readme.txt b/Assets/FishNet/Runtime/Profiler/Readme.txt new file mode 100644 index 000000000..3b74699e3 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Readme.txt @@ -0,0 +1 @@ +See full readme here https://github.com/James-Frowen/Mirage.Profiler diff --git a/Assets/FishNet/Runtime/Profiler/Readme.txt.meta b/Assets/FishNet/Runtime/Profiler/Readme.txt.meta new file mode 100644 index 000000000..4b2b13539 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Readme.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc3de9d50be43ed438d71e49f728567c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime.meta b/Assets/FishNet/Runtime/Profiler/Runtime.meta new file mode 100644 index 000000000..a4b1f389d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82fa6b4931bac2f41b95862e74371e17 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs new file mode 100644 index 000000000..12e8b14f5 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("1.2.2")] + +[assembly: InternalsVisibleTo("Mirage.Profiler.Editor")] diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta new file mode 100644 index 000000000..613f9c2a2 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0ddded0f98d71546aeae6e4c52aef54 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs b/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs new file mode 100644 index 000000000..8bd5b2b39 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs @@ -0,0 +1,86 @@ +using System.Collections.Generic; +using Unity.Profiling; +using UnityEngine; + +namespace Mirage.NetworkProfiler +{ + internal class CountRecorder + { + private readonly ProfilerCounter _profilerCount; + private readonly ProfilerCounter _profilerBytes; + private readonly ProfilerCounter _profilerPerSecond; + private readonly object _instance; + //private readonly INetworkInfoProvider _provider; + internal readonly Frames _frames; + private int _count; + private int _bytes; + private int _perSecond; + private readonly Queue<(float time, int bytes)> _perSecondQueue = new Queue<(float time, int bytes)>(); + private int _frameIndex = -1; + + public CountRecorder(object instance, /*INetworkInfoProvider provider,*/ ProfilerCounter profilerCount, ProfilerCounter profilerBytes, ProfilerCounter profilerPerSecond) + { + //_provider = provider; + _instance = instance; + _profilerCount = profilerCount; + _profilerBytes = profilerBytes; + _profilerPerSecond = profilerPerSecond; + _frames = new Frames(); + } + + public void OnMessage(/*NetworkDiagnostics.MessageInfo obj*/) + { +// // using the profiler-window branch of mirage to allow NetworkDiagnostics to say which server/client is sent the event +//#if MIRAGE_DIAGNOSTIC_INSTANCE +// if (obj.instance != _instance) +// return; +//#endif + +// // dont record anything if frame index is -1 +// // this normally means the profiler has not been activated yet +// if (_frameIndex == -1) +// return; + +// _count += obj.count; +// _bytes += obj.bytes * obj.count; + +// var frame = _frames.GetFrame(_frameIndex); +// frame.Messages.Add(new MessageInfo(obj, _provider, frame.Messages.Count)); +// frame.Bytes++; + } + + public void EndFrame(int frameIndex) + { + CaclulatePerSecond(Time.time, _bytes); + _profilerCount.Sample(_count); + _profilerBytes.Sample(_bytes); + _count = 0; + _bytes = 0; + + // +1 so that we set next frame + // otherwise we clear the frame that the savedata wants to grab + _frameIndex = frameIndex + 1; + var frame = _frames.GetFrame(_frameIndex); + frame.Messages.Clear(); + frame.Bytes = 0; + } + + private void CaclulatePerSecond(float now, int bytes) + { + // add new values to sum + _perSecond += bytes; + _perSecondQueue.Enqueue((now, bytes)); + + // remove old bytes from sum + var removeTime = now - 1; + while (_perSecondQueue.Peek().time < removeTime) + { + var removed = _perSecondQueue.Dequeue(); + _perSecond -= removed.bytes; + } + + // record sample after adding/removing value + _profilerPerSecond.Sample(_perSecond); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta new file mode 100644 index 000000000..dd5874983 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16575ee3be2c5e046af4438787d215f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs b/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs new file mode 100644 index 000000000..8590b6f8c --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs @@ -0,0 +1,24 @@ +using Unity.Profiling; + +namespace Mirage.NetworkProfiler +{ + internal static class Counters + { + public static readonly ProfilerCategory Category = ProfilerCategory.Network; + private const ProfilerMarkerDataUnit COUNT = ProfilerMarkerDataUnit.Count; + private const ProfilerMarkerDataUnit BYTES = ProfilerMarkerDataUnit.Bytes; + + public static readonly ProfilerCounter AllPlayersCount = new ProfilerCounter(Category, Names.PLAYER_COUNT, COUNT); + public static readonly ProfilerCounter AuthenticatedPlayersCount = new ProfilerCounter(Category, Names.AUTHENTICATED_COUNT, COUNT); + public static readonly ProfilerCounter CharacterCount = new ProfilerCounter(Category, Names.CHARACTER_COUNT, COUNT); + public static readonly ProfilerCounter ObjectCount = new ProfilerCounter(Category, Names.OBJECT_COUNT, COUNT); + + public static readonly ProfilerCounter SentCount = new ProfilerCounter(Category, Names.SENT_COUNT, COUNT); + public static readonly ProfilerCounter SentBytes = new ProfilerCounter(Category, Names.SENT_BYTES, BYTES); + public static readonly ProfilerCounter SentPerSecond = new ProfilerCounter(Category, Names.SENT_PER_SECOND, BYTES); + + public static readonly ProfilerCounter ReceiveCount = new ProfilerCounter(Category, Names.RECEIVED_COUNT, COUNT); + public static readonly ProfilerCounter ReceiveBytes = new ProfilerCounter(Category, Names.RECEIVED_BYTES, BYTES); + public static readonly ProfilerCounter ReceivePerSecond = new ProfilerCounter(Category, Names.RECEIVED_PER_SECOND, BYTES); + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta new file mode 100644 index 000000000..325bf4506 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40d8d596129601f4d90f0664cb2557c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs b/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs new file mode 100644 index 000000000..57ebd30da --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Mirage.NetworkProfiler +{ + [System.Serializable] + public class Frames : IEnumerable + { + [SerializeField] + private Frame[] _frames; + + public Frames() + { + _frames = new Frame[NetworkProfilerRecorder.FRAME_COUNT]; + for (var i = 0; i < _frames.Length; i++) + _frames[i] = new Frame(); + } + + public Frame GetFrame(int frameIndex) + { + return _frames[frameIndex % _frames.Length]; + } + + public IEnumerator GetEnumerator() => ((IEnumerable)_frames).GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)_frames).GetEnumerator(); + + internal void ValidateSize() + { + if (_frames.Length != NetworkProfilerRecorder.FRAME_COUNT) + { + Array.Resize(ref _frames, NetworkProfilerRecorder.FRAME_COUNT); + } + } + } + + [System.Serializable] + public class Frame + { + public List Messages = new List(); + public int Bytes; + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta new file mode 100644 index 000000000..cbe424201 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b59754fd175ff2345a6788891dddbfcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs b/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs new file mode 100644 index 000000000..4fd70d49c --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace Mirage.NetworkProfiler +{ + [System.Serializable] + public class MessageInfo + { + /// + /// Order message was sent/received in frame + /// + [SerializeField] private int _order; + [SerializeField] private int _bytes; + [SerializeField] private int _count; + [SerializeField] private string _messageName; + // unity can't serialize nullable so store as 2 fields + [SerializeField] private bool _hasNetId; + [SerializeField] private uint _netId; + [SerializeField] private string _objectName; + [SerializeField] private string _rpcName; + + public int Order => _order; + public string Name => _messageName; + public int Bytes => _bytes; + public int Count => _count; + public int TotalBytes => Bytes * Count; + public uint? NetId => _hasNetId ? _netId : default; + public string ObjectName => _objectName; + public string RpcName => _rpcName; + + public MessageInfo(/*NetworkDiagnostics.MessageInfo msg, INetworkInfoProvider provider, int order*/) + { + //_order = order; + //_bytes = msg.bytes; + //_count = msg.count; + //_messageName = msg.message.GetType().FullName; + //var id = provider.GetNetId(msg); + //_hasNetId = id.HasValue; + //_netId = id.GetValueOrDefault(); + //var obj = provider.GetNetworkIdentity(id); + //_objectName = obj != null ? obj.name : null; + //_rpcName = provider.GetRpcName(msg); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta new file mode 100644 index 000000000..2d173f0d9 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 668dc7c434784214794807fcfecfe185 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef new file mode 100644 index 000000000..34407c0d2 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef @@ -0,0 +1,17 @@ +{ + "name": "Mirage.Profiler", + "rootNamespace": "", + "references": [ + "GUID:b46779583a009f04ba9f5f31d0e7e6ac", + "GUID:30817c1a0e6d646d99c048fc403f5979" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta new file mode 100644 index 000000000..80dab7c3d --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6ff9f1c8e2ed4034baf80c43db7a3b6a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs b/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs new file mode 100644 index 000000000..be0627e1e --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs @@ -0,0 +1,25 @@ +namespace Mirage.NetworkProfiler +{ + public static class Names + { + public const string PLAYER_COUNT = "All Players Count"; + public const string PLAYER_COUNT_TOOLTIP = "Number of players connected to the server"; + public const string AUTHENTICATED_COUNT = "Authenticated Players Count"; + public const string AUTHENTICATED_COUNT_TOOLTIP = "Number of Authenticated players connected to the server, This should be same as total players most of the time"; + public const string CHARACTER_COUNT = "Character Count"; + public const string CHARACTER_COUNT_TOOLTIP = "Number of players with spawned GameObjects"; + + public const string OBJECT_COUNT = "Object Count"; + public const string OBJECT_COUNT_TOOLTIP = "Number of NetworkIdentities spawned on the server"; + + public const string SENT_COUNT = "Sent Messages"; + public const string SENT_BYTES = "Sent Bytes"; + public const string SENT_PER_SECOND = "Sent Per Second"; + + public const string RECEIVED_COUNT = "Received Messages"; + public const string RECEIVED_BYTES = "Received Bytes"; + public const string RECEIVED_PER_SECOND = "Received Per Second"; + + public const string PER_SECOND_TOOLTIP = "Sum of Bytes over the previous second"; + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta new file mode 100644 index 000000000..3e12e8598 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05fd6c7133d9b2e42a8f282465a445d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs new file mode 100644 index 000000000..2d291be5e --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs @@ -0,0 +1,74 @@ +//using Mirage.RemoteCalls; + +//namespace Mirage.NetworkProfiler +//{ +// /// +// /// Returns information about NetworkMessage +// /// +// public interface INetworkInfoProvider +// { +// uint? GetNetId(NetworkDiagnostics.MessageInfo info); +// NetworkIdentity GetNetworkIdentity(uint? netId); +// string GetRpcName(NetworkDiagnostics.MessageInfo info); +// } + +// public class NetworkInfoProvider : INetworkInfoProvider +// { +// private readonly NetworkWorld _world; + +// public NetworkInfoProvider(NetworkWorld world) +// { +// _world = world; +// } + +// public uint? GetNetId(NetworkDiagnostics.MessageInfo info) +// { +// switch (info.message) +// { +// case RpcMessage msg: return msg.NetId; +// case RpcWithReplyMessage msg: return msg.NetId; +// case SpawnMessage msg: return msg.NetId; +// case RemoveAuthorityMessage msg: return msg.NetId; +// case ObjectDestroyMessage msg: return msg.NetId; +// case ObjectHideMessage msg: return msg.NetId; +// case UpdateVarsMessage msg: return msg.NetId; +// default: return default; +// } +// } + +// public NetworkIdentity GetNetworkIdentity(uint? netId) +// { +// if (!netId.HasValue) +// return null; + +// if (_world == null) +// return null; + +// return _world.TryGetIdentity(netId.Value, out var identity) +// ? identity +// : null; +// } + +// public string GetRpcName(NetworkDiagnostics.MessageInfo info) +// { +// switch (info.message) +// { +// case RpcMessage msg: +// return GetRpcName(msg.NetId, msg.FunctionIndex); +// case RpcWithReplyMessage msg: +// return GetRpcName(msg.NetId, msg.FunctionIndex); +// default: return string.Empty; +// } +// } + +// private string GetRpcName(uint netId, int functionIndex) +// { +// var identity = GetNetworkIdentity(netId); +// if (identity == null) +// return string.Empty; + +// var rpc = identity.RemoteCallCollection.GetAbsolute(functionIndex); +// return rpc.Name; +// } +// } +//} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta new file mode 100644 index 000000000..ea174bf95 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8192a6dbec7e3b446bea79c4b0f172be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs new file mode 100644 index 000000000..027b50975 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs @@ -0,0 +1,174 @@ +//using Mirage.Logging; +using UnityEngine; +using System.Linq; + + +#if UNITY_EDITOR +using UnityEditorInternal; +#endif + +namespace Mirage.NetworkProfiler +{ + [DefaultExecutionOrder(int.MaxValue)] // last + public class NetworkProfilerRecorder : MonoBehaviour + { + //private static readonly ILogger logger = LogFactory.GetLogger(); + + // singleton because unity only has 1 profiler + public static NetworkProfilerRecorder Instance { get; private set; } + + //public NetworkServer Server; + //public NetworkClient Client; + + /// + /// instance being used for profiler + /// + private static object instance; + + internal static CountRecorder _sentCounter; + internal static CountRecorder _receivedCounter; + internal const int FRAME_COUNT = 300; // todo find a way to get real frame count + + public delegate void FrameUpdate(int tick); + public static event FrameUpdate AfterSample; + + private int _lastProcessedFrame = -1; + + private void Start() + { +#if UNITY_EDITOR + _lastProcessedFrame = ProfilerDriver.lastFrameIndex; +#endif + + Debug.Assert(Instance == null); + Instance = this; + DontDestroyOnLoad(this); + + //if (Server != null) + //{ + // Server.Started.AddListener(ServerStarted); + // Server.Stopped.AddListener(ServerStopped); + //} + + //if (Client != null) + //{ + // Client.Started.AddListener(ClientStarted); + // Client.Disconnected.AddListener(ClientStopped); + //} + } + + private void OnDestroy() + { + //if (_receivedCounter != null) + // NetworkDiagnostics.InMessageEvent -= _receivedCounter.OnMessage; + //if (_sentCounter != null) + // NetworkDiagnostics.OutMessageEvent -= _sentCounter.OnMessage; + + Debug.Assert(Instance == this); + Instance = null; + } + + private void ServerStarted() + { + //if (instance != null) + //{ + // logger.LogWarning($"Already started profiler for different Instance:{instance}"); + // return; + //} + //instance = Server; + + //var provider = new NetworkInfoProvider(Server.World); + //_sentCounter = new CountRecorder(Server, provider, Counters.SentCount, Counters.SentBytes, Counters.SentPerSecond); + //_receivedCounter = new CountRecorder(Server, provider, Counters.ReceiveCount, Counters.ReceiveBytes, Counters.ReceivePerSecond); + //NetworkDiagnostics.InMessageEvent += _receivedCounter.OnMessage; + //NetworkDiagnostics.OutMessageEvent += _sentCounter.OnMessage; + } + + private void ClientStarted() + { + //if (instance != null) + //{ + // logger.LogWarning($"Already started profiler for different Instance:{instance}"); + // return; + //} + //instance = Client; + + //var provider = new NetworkInfoProvider(Client.World); + //_sentCounter = new CountRecorder(Client, provider, Counters.SentCount, Counters.SentBytes, Counters.SentPerSecond); + //_receivedCounter = new CountRecorder(Client, provider, Counters.ReceiveCount, Counters.ReceiveBytes, Counters.ReceivePerSecond); + //NetworkDiagnostics.InMessageEvent += _receivedCounter.OnMessage; + //NetworkDiagnostics.OutMessageEvent += _sentCounter.OnMessage; + } + + private void ServerStopped() + { + //if (instance == (object)Server) + // instance = null; + } + + private void ClientStopped(/*ClientStoppedReason _*/) + { + //if (instance == (object)Client) + // instance = null; + + //_receivedCounter = null; + //_sentCounter = null; + } + + private void LateUpdate() + { +#if UNITY_EDITOR + if (!ProfilerDriver.enabled) + return; + + // once a frame, ever frame, no matter what lastFrameIndex is + SampleCounts(); + + // unity sometimes skips a profiler frame, because unity + // so we have to check if that happens and then sample the missing frame + while (_lastProcessedFrame < ProfilerDriver.lastFrameIndex) + { + _lastProcessedFrame++; + + //Debug.Log($"Sample: [LateUpdate, enabled { ProfilerDriver.enabled}, first {ProfilerDriver.firstFrameIndex}, last {ProfilerDriver.lastFrameIndex}, lastProcessed {lastProcessedFrame}]"); + + var lastFrame = _lastProcessedFrame; + // not sure why frame is offset, but +2 fixes it + SampleMessages(lastFrame + 2); + } +#else + // in player, just use ProfilerCounter (frameCount only used by messages) + SampleCounts(); + SampleMessages(0); +#endif + } + + /// + /// call this every frame to sample number of players and objects + /// + private void SampleCounts() + { + //if (instance == (object)Server) + //{ + // Counters.AllPlayersCount.Sample(Server.AllPlayers.Count); + // Counters.AuthenticatedPlayersCount.Sample(Server.AuthenticatedPlayers.Count); + // Counters.CharacterCount.Sample(Server.AuthenticatedPlayers.Count(x => x.Identity != null)); + // Counters.ObjectCount.Sample(Server.World.SpawnedIdentities.Count); + //} + } + + /// + /// call this when ProfilerDriver shows it is next frame + /// + /// + private void SampleMessages(int frame) + { + if (instance == null) + return; + + _sentCounter.EndFrame(frame); + _receivedCounter.EndFrame(frame); + AfterSample?.Invoke(frame); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta new file mode 100644 index 000000000..83dd31721 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc5b42cbfc38b1c4d86fd25905b19e29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/package.json b/Assets/FishNet/Runtime/Profiler/package.json new file mode 100644 index 000000000..57e54d9d0 --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.fishnet.fishnet-profiler", + "displayName": "FishNet Profiler", + "version": "1.0.0", + "unity": "2022.3", + "description": "Network profiler for FishNet", + "author": "FishNet", + "dependencies": { + "com.unity.profiling.core": "1.0.2" + }, + "samples": [] +} diff --git a/Assets/FishNet/Runtime/Profiler/package.json.meta b/Assets/FishNet/Runtime/Profiler/package.json.meta new file mode 100644 index 000000000..bb32fde1b --- /dev/null +++ b/Assets/FishNet/Runtime/Profiler/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2c236d885d1e08b41870190b5e9f0d37 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FishNet.sln b/FishNet.sln index 89338b6ce..7813bf63c 100644 --- a/FishNet.sln +++ b/FishNet.sln @@ -1,60 +1,143 @@  -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Runtime", "FishNet.Runtime.csproj", "{69D0C159-BAB4-689B-687E-9E213DFB5A44}" +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Runtime", "FishNet.Runtime.csproj", "{59c1d069-b4ba-9b68-687e-9e213dfb5a44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameKit.Utilities", "GameKit.Utilities.csproj", "{13113C11-58E9-2A2E-DF1A-460F73B189CE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEditor.UI", "UnityEditor.UI.csproj", "{6ff9d838-069f-4b49-5a35-f70072bbf0bf}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Demos", "FishNet.Demos.csproj", "{136A7A12-C446-BC06-2B59-E13B4B55C391}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Demos", "FishNet.Demos.csproj", "{127a6a13-46c4-06bc-2b59-e13b4b55c391}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{5ED35FB8-7A21-7C15-DB72-386947C92520}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.TestTools.CodeCoverage.Editor", "Unity.TestTools.CodeCoverage.Editor.csproj", "{2fefaaf8-b5d9-71e6-28d0-ea11b956c5ab}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameKit.Dependencies", "GameKit.Dependencies.csproj", "{6D29C1FC-6376-8F6B-216E-88C8C2471B53}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Codegen.Cecil", "FishNet.Codegen.Cecil.csproj", "{537888d1-cf8a-a5f4-08f5-be1b0604d38e}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.FishNet.Codegen", "Unity.FishNet.Codegen.csproj", "{486584D8-1B68-74D0-B2EE-6A18C8D7352A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEditor.TestRunner", "UnityEditor.TestRunner.csproj", "{75207961-aee3-5a76-7646-e1380f658e8a}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asset-store-tools-editor", "asset-store-tools-editor.csproj", "{B5A117C4-B458-5028-BA98-4F8E4154A101}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEngine.TestRunner", "UnityEngine.TestRunner.csproj", "{9cb64bdf-5b52-b4fa-5298-d7fd83a65e4b}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishNet.Codegen.Cecil", "FishNet.Codegen.Cecil.csproj", "{D1887853-8ACF-F4A5-08F5-BE1B0604D38E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEngine.UI", "UnityEngine.UI.csproj", "{9aa0345b-376b-0323-106e-cc6cb6d71a2d}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Rider.Editor", "Unity.Rider.Editor.csproj", "{a319fe15-1ae6-fe2a-0a9f-052921a7f1a8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edgegap", "Edgegap.csproj", "{1ad87cc8-ed38-0ca8-9bc0-9e4d761874cc}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.FishNet.Codegen", "Unity.FishNet.Codegen.csproj", "{d8846548-681b-d074-b2ee-6a18c8d7352a}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.VisualStudio.Editor", "Unity.VisualStudio.Editor.csproj", "{531f45d2-6b02-0890-bdab-1a1cfec120fe}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Settings.Editor", "Unity.Settings.Editor.csproj", "{3c2e65d1-71a9-dcce-9ff0-e462821b8936}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.TestTools.CodeCoverage.Editor.OpenCover.Model", "Unity.TestTools.CodeCoverage.Editor.OpenCover.Model.csproj", "{cb069737-b94e-9a1c-359c-e91e2cc14ccf}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.SysrootPackage.Editor", "Unity.SysrootPackage.Editor.csproj", "{d1b151e9-55af-d0be-5c48-e60322e8547e}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Profiling.Core", "Unity.Profiling.Core.csproj", "{11c38925-f5ac-1a7b-d4ea-7d1dbe8333b9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameKit.Utilities", "GameKit.Utilities.csproj", "{113c1113-e958-2e2a-df1a-460f73b189ce}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Performance.Profile-Analyzer.Editor", "Unity.Performance.Profile-Analyzer.Editor.csproj", "{892dd2ad-d637-2009-2a24-a9e22d565f04}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.VSCode.Editor", "Unity.VSCode.Editor.csproj", "{054be889-cbbb-67ac-ee1c-c274bed62ef9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.EditorCoroutines.Editor", "Unity.EditorCoroutines.Editor.csproj", "{2f4a3448-cdaf-4526-5f2b-e6251050fa57}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameKit.Dependencies", "GameKit.Dependencies.csproj", "{fcc1296d-7663-6b8f-216e-88c8c2471b53}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.TestTools.CodeCoverage.Editor.OpenCover.Mono.Reflection", "Unity.TestTools.CodeCoverage.Editor.OpenCover.Mono.Reflection.csproj", "{e9f11526-f647-3906-4076-b9d63956a2f2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Sysroot.Linux_x86_64", "Unity.Sysroot.Linux_x86_64.csproj", "{e3bb3ef4-4fde-ed23-c68f-bde7736f97e7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Toolchain.Win-x86_64-Linux-x86_64", "Unity.Toolchain.Win-x86_64-Linux-x86_64.csproj", "{dcbe98c1-58fc-f809-893a-f5d2f6943897}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{b85fd35e-217a-157c-db72-386947c92520}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEngine.UI.Tests", "UnityEngine.UI.Tests.csproj", "{67278720-21fb-059d-f163-359f038172c3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEditor.UI.EditorTests", "UnityEditor.UI.EditorTests.csproj", "{ce465a3d-fd6c-d3ce-4d58-f60566f39213}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Toolchain.Win-x86_64-Linux-x86_64.EditorTests", "Unity.Toolchain.Win-x86_64-Linux-x86_64.EditorTests.csproj", "{96d65cec-822f-7bc1-485f-2689af7c678a}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Sysroot.Linux_x86_64.EditorTests", "Unity.Sysroot.Linux_x86_64.EditorTests.csproj", "{24a55edd-b57b-5260-7140-c808091ae8c0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.TestTools.CodeCoverage.Editor.Compatibility", "Unity.TestTools.CodeCoverage.Editor.Compatibility.csproj", "{d4aff916-632e-ee01-58e3-a5fe1c465dbf}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Settings.Tests", "Unity.Settings.Tests.csproj", "{bf826988-d794-8d15-17c3-30e002b58d3c}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Performance.Profile-Analyzer.EditorTests", "Unity.Performance.Profile-Analyzer.EditorTests.csproj", "{cb503895-a385-b47b-b7f5-142e6fa90c8e}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Sysroot.EditorTests", "Unity.Sysroot.EditorTests.csproj", "{669fd055-17cb-6645-809a-9f6916f3ff2e}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {69D0C159-BAB4-689B-687E-9E213DFB5A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69D0C159-BAB4-689B-687E-9E213DFB5A44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69D0C159-BAB4-689B-687E-9E213DFB5A44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69D0C159-BAB4-689B-687E-9E213DFB5A44}.Release|Any CPU.Build.0 = Release|Any CPU - {13113C11-58E9-2A2E-DF1A-460F73B189CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13113C11-58E9-2A2E-DF1A-460F73B189CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13113C11-58E9-2A2E-DF1A-460F73B189CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13113C11-58E9-2A2E-DF1A-460F73B189CE}.Release|Any CPU.Build.0 = Release|Any CPU - {136A7A12-C446-BC06-2B59-E13B4B55C391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {136A7A12-C446-BC06-2B59-E13B4B55C391}.Debug|Any CPU.Build.0 = Debug|Any CPU - {136A7A12-C446-BC06-2B59-E13B4B55C391}.Release|Any CPU.ActiveCfg = Release|Any CPU - {136A7A12-C446-BC06-2B59-E13B4B55C391}.Release|Any CPU.Build.0 = Release|Any CPU - {5ED35FB8-7A21-7C15-DB72-386947C92520}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5ED35FB8-7A21-7C15-DB72-386947C92520}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5ED35FB8-7A21-7C15-DB72-386947C92520}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5ED35FB8-7A21-7C15-DB72-386947C92520}.Release|Any CPU.Build.0 = Release|Any CPU - {6D29C1FC-6376-8F6B-216E-88C8C2471B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D29C1FC-6376-8F6B-216E-88C8C2471B53}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D29C1FC-6376-8F6B-216E-88C8C2471B53}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D29C1FC-6376-8F6B-216E-88C8C2471B53}.Release|Any CPU.Build.0 = Release|Any CPU - {486584D8-1B68-74D0-B2EE-6A18C8D7352A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {486584D8-1B68-74D0-B2EE-6A18C8D7352A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {486584D8-1B68-74D0-B2EE-6A18C8D7352A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {486584D8-1B68-74D0-B2EE-6A18C8D7352A}.Release|Any CPU.Build.0 = Release|Any CPU - {B5A117C4-B458-5028-BA98-4F8E4154A101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5A117C4-B458-5028-BA98-4F8E4154A101}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5A117C4-B458-5028-BA98-4F8E4154A101}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5A117C4-B458-5028-BA98-4F8E4154A101}.Release|Any CPU.Build.0 = Release|Any CPU - {D1887853-8ACF-F4A5-08F5-BE1B0604D38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1887853-8ACF-F4A5-08F5-BE1B0604D38E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1887853-8ACF-F4A5-08F5-BE1B0604D38E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1887853-8ACF-F4A5-08F5-BE1B0604D38E}.Release|Any CPU.Build.0 = Release|Any CPU + {59c1d069-b4ba-9b68-687e-9e213dfb5a44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59c1d069-b4ba-9b68-687e-9e213dfb5a44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ff9d838-069f-4b49-5a35-f70072bbf0bf}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ff9d838-069f-4b49-5a35-f70072bbf0bf}.Debug|Any CPU.Build.0 = Debug|Any CPU + {127a6a13-46c4-06bc-2b59-e13b4b55c391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {127a6a13-46c4-06bc-2b59-e13b4b55c391}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2fefaaf8-b5d9-71e6-28d0-ea11b956c5ab}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2fefaaf8-b5d9-71e6-28d0-ea11b956c5ab}.Debug|Any CPU.Build.0 = Debug|Any CPU + {537888d1-cf8a-a5f4-08f5-be1b0604d38e}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {537888d1-cf8a-a5f4-08f5-be1b0604d38e}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75207961-aee3-5a76-7646-e1380f658e8a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75207961-aee3-5a76-7646-e1380f658e8a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9cb64bdf-5b52-b4fa-5298-d7fd83a65e4b}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9cb64bdf-5b52-b4fa-5298-d7fd83a65e4b}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9aa0345b-376b-0323-106e-cc6cb6d71a2d}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9aa0345b-376b-0323-106e-cc6cb6d71a2d}.Debug|Any CPU.Build.0 = Debug|Any CPU + {a319fe15-1ae6-fe2a-0a9f-052921a7f1a8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {a319fe15-1ae6-fe2a-0a9f-052921a7f1a8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1ad87cc8-ed38-0ca8-9bc0-9e4d761874cc}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1ad87cc8-ed38-0ca8-9bc0-9e4d761874cc}.Debug|Any CPU.Build.0 = Debug|Any CPU + {d8846548-681b-d074-b2ee-6a18c8d7352a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {d8846548-681b-d074-b2ee-6a18c8d7352a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {531f45d2-6b02-0890-bdab-1a1cfec120fe}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {531f45d2-6b02-0890-bdab-1a1cfec120fe}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3c2e65d1-71a9-dcce-9ff0-e462821b8936}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3c2e65d1-71a9-dcce-9ff0-e462821b8936}.Debug|Any CPU.Build.0 = Debug|Any CPU + {cb069737-b94e-9a1c-359c-e91e2cc14ccf}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {cb069737-b94e-9a1c-359c-e91e2cc14ccf}.Debug|Any CPU.Build.0 = Debug|Any CPU + {d1b151e9-55af-d0be-5c48-e60322e8547e}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {d1b151e9-55af-d0be-5c48-e60322e8547e}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11c38925-f5ac-1a7b-d4ea-7d1dbe8333b9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11c38925-f5ac-1a7b-d4ea-7d1dbe8333b9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {113c1113-e958-2e2a-df1a-460f73b189ce}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {113c1113-e958-2e2a-df1a-460f73b189ce}.Debug|Any CPU.Build.0 = Debug|Any CPU + {892dd2ad-d637-2009-2a24-a9e22d565f04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {892dd2ad-d637-2009-2a24-a9e22d565f04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {054be889-cbbb-67ac-ee1c-c274bed62ef9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {054be889-cbbb-67ac-ee1c-c274bed62ef9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2f4a3448-cdaf-4526-5f2b-e6251050fa57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2f4a3448-cdaf-4526-5f2b-e6251050fa57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {fcc1296d-7663-6b8f-216e-88c8c2471b53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {fcc1296d-7663-6b8f-216e-88c8c2471b53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {e9f11526-f647-3906-4076-b9d63956a2f2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {e9f11526-f647-3906-4076-b9d63956a2f2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {e3bb3ef4-4fde-ed23-c68f-bde7736f97e7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {e3bb3ef4-4fde-ed23-c68f-bde7736f97e7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {dcbe98c1-58fc-f809-893a-f5d2f6943897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {dcbe98c1-58fc-f809-893a-f5d2f6943897}.Debug|Any CPU.Build.0 = Debug|Any CPU + {b85fd35e-217a-157c-db72-386947c92520}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {b85fd35e-217a-157c-db72-386947c92520}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67278720-21fb-059d-f163-359f038172c3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67278720-21fb-059d-f163-359f038172c3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ce465a3d-fd6c-d3ce-4d58-f60566f39213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ce465a3d-fd6c-d3ce-4d58-f60566f39213}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96d65cec-822f-7bc1-485f-2689af7c678a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96d65cec-822f-7bc1-485f-2689af7c678a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24a55edd-b57b-5260-7140-c808091ae8c0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24a55edd-b57b-5260-7140-c808091ae8c0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {d4aff916-632e-ee01-58e3-a5fe1c465dbf}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {d4aff916-632e-ee01-58e3-a5fe1c465dbf}.Debug|Any CPU.Build.0 = Debug|Any CPU + {bf826988-d794-8d15-17c3-30e002b58d3c}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {bf826988-d794-8d15-17c3-30e002b58d3c}.Debug|Any CPU.Build.0 = Debug|Any CPU + {cb503895-a385-b47b-b7f5-142e6fa90c8e}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {cb503895-a385-b47b-b7f5-142e6fa90c8e}.Debug|Any CPU.Build.0 = Debug|Any CPU + {669fd055-17cb-6645-809a-9f6916f3ff2e}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {669fd055-17cb-6645-809a-9f6916f3ff2e}.Debug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From b6adb699d93899bb384ddf41b4885b047fa4c7da Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Sun, 29 Jun 2025 22:08:14 -0400 Subject: [PATCH 03/14] Update the profiler modules --- Assets/FishNet/Runtime/Editor/Profiling.meta | 3 + .../Profiling}/ICountRecorderProvider.cs | 4 +- .../Profiling}/ICountRecorderProvider.cs.meta | 0 .../Editor => Editor/Profiling}/Messages.meta | 0 .../Profiling}/Messages/Columns.cs | 28 +- .../Profiling}/Messages/Columns.cs.meta | 0 .../Profiling}/Messages/CounterNames.cs | 2 +- .../Profiling}/Messages/CounterNames.cs.meta | 0 .../Editor/Profiling/Messages/DrawnMessage.cs | 11 + .../Profiling}/Messages/DrawnMessage.cs.meta | 0 .../Profiling}/Messages/Group.cs | 9 +- .../Profiling}/Messages/Group.cs.meta | 0 .../Profiling}/Messages/GroupSorter.cs | 11 +- .../Profiling}/Messages/GroupSorter.cs.meta | 0 .../Profiling}/Messages/MessageView.cs | 9 +- .../Profiling}/Messages/MessageView.cs.meta | 0 .../Messages/MessageViewController.cs | 11 +- .../Messages/MessageViewController.cs.meta | 0 .../Profiling}/Messages/TableSorter.cs | 4 +- .../Profiling}/Messages/TableSorter.cs.meta | 0 .../Profiling}/ModuleNames.cs | 2 +- .../Profiling}/ModuleNames.cs.meta | 0 .../Profiling}/ReceivedModule.cs | 5 +- .../Profiling}/ReceivedModule.cs.meta | 0 .../Editor => Editor/Profiling}/SavedData.cs | 7 +- .../Profiling}/SavedData.cs.meta | 0 .../Editor => Editor/Profiling}/SentModule.cs | 5 +- .../Profiling}/SentModule.cs.meta | 0 .../Profiling}/ServerModule.cs | 3 +- .../Profiling}/ServerModule.cs.meta | 0 .../Editor => Editor/Profiling}/Table.meta | 0 .../Profiling}/Table/ColumnInfo.cs | 21 +- .../Profiling}/Table/ColumnInfo.cs.meta | 0 .../Profiling}/Table/EmptyRow.cs | 2 +- .../Profiling}/Table/EmptyRow.cs.meta | 0 .../Profiling}/Table/ITableSorter.cs | 2 +- .../Profiling}/Table/ITableSorter.cs.meta | 0 .../Profiling}/Table/LabelRow.cs | 2 +- .../Profiling}/Table/LabelRow.cs.meta | 0 .../Editor => Editor/Profiling}/Table/Row.cs | 2 +- .../Profiling}/Table/Row.cs.meta | 0 .../Profiling}/Table/SortHeader.cs | 2 +- .../Profiling}/Table/SortHeader.cs.meta | 0 .../Profiling}/Table/SortHeaderRow.cs | 2 +- .../Profiling}/Table/SortHeaderRow.cs.meta | 0 .../Profiling}/Table/SortMode.cs | 2 +- .../Profiling}/Table/SortMode.cs.meta | 0 .../Profiling}/Table/Table.cs | 2 +- .../Profiling}/Table/Table.cs.meta | 0 Assets/FishNet/Runtime/FishNet.Runtime.asmdef | 4 +- .../Runtime/Managing/Client/ClientManager.cs | 6 + .../Managing/Client/Object/ClientObjects.cs | 15 + Assets/FishNet/Runtime/Profiler/CHANGELOG.md | 339 ------------------ .../Runtime/Profiler/CHANGELOG.md.meta | 7 - Assets/FishNet/Runtime/Profiler/Editor.meta | 8 - .../Runtime/Profiler/Editor/AssemblyInfo.cs | 3 - .../Profiler/Editor/AssemblyInfo.cs.meta | 11 - .../Profiler/Editor/Messages/DrawnMessage.cs | 10 - .../Editor/Mirage.Profiler.Editor.asmdef | 20 -- .../Editor/Mirage.Profiler.Editor.asmdef.meta | 7 - Assets/FishNet/Runtime/Profiler/LICENSE | 21 -- Assets/FishNet/Runtime/Profiler/LICENSE.meta | 7 - Assets/FishNet/Runtime/Profiler/Readme.txt | 1 - .../FishNet/Runtime/Profiler/Readme.txt.meta | 7 - Assets/FishNet/Runtime/Profiler/Runtime.meta | 8 - .../Runtime/Profiler/Runtime/AssemblyInfo.cs | 6 - .../Profiler/Runtime/AssemblyInfo.cs.meta | 11 - .../Runtime/Profiler/Runtime/MessageInfo.cs | 44 --- .../Profiler/Runtime/Mirage.Profiler.asmdef | 17 - .../Runtime/Mirage.Profiler.asmdef.meta | 7 - .../Profiler/Runtime/NetworkInfoProvider.cs | 74 ---- Assets/FishNet/Runtime/Profiler/package.json | 12 - .../Runtime/Profiler/package.json.meta | 7 - .../Runtime/Transporting/EventStructures.cs | 20 ++ .../Performance/Profiling.meta} | 0 .../Performance/Profiling}/CountRecorder.cs | 35 +- .../Profiling}/CountRecorder.cs.meta | 0 .../Performance/Profiling}/Counters.cs | 3 +- .../Performance/Profiling}/Counters.cs.meta | 0 .../Performance/Profiling}/Frame.cs | 4 +- .../Performance/Profiling}/Frame.cs.meta | 0 .../Performance/Profiling}/Names.cs | 4 +- .../Performance/Profiling}/Names.cs.meta | 0 .../Profiling}/NetworkProfilerRecorder.cs | 105 +++--- .../NetworkProfilerRecorder.cs.meta | 0 .../Performance/Profiling/PacketInfo.cs | 39 ++ .../Performance/Profiling/PacketInfo.cs.meta} | 0 .../Profiling/PacketInfoProvider.cs | 72 ++++ .../Profiling/PacketInfoProvider.cs.meta} | 0 89 files changed, 324 insertions(+), 761 deletions(-) create mode 100644 Assets/FishNet/Runtime/Editor/Profiling.meta rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ICountRecorderProvider.cs (52%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ICountRecorderProvider.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/Columns.cs (73%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/Columns.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/CounterNames.cs (86%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/CounterNames.cs.meta (100%) create mode 100644 Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/DrawnMessage.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/Group.cs (93%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/Group.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/GroupSorter.cs (86%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/GroupSorter.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/MessageView.cs (93%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/MessageView.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/MessageViewController.cs (96%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/MessageViewController.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/TableSorter.cs (84%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Messages/TableSorter.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ModuleNames.cs (87%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ModuleNames.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ReceivedModule.cs (89%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ReceivedModule.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/SavedData.cs (97%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/SavedData.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/SentModule.cs (88%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/SentModule.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ServerModule.cs (97%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/ServerModule.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/ColumnInfo.cs (72%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/ColumnInfo.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/EmptyRow.cs (91%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/EmptyRow.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/ITableSorter.cs (65%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/ITableSorter.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/LabelRow.cs (96%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/LabelRow.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/Row.cs (96%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/Row.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortHeader.cs (97%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortHeader.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortHeaderRow.cs (96%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortHeaderRow.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortMode.cs (63%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/SortMode.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/Table.cs (98%) rename Assets/FishNet/Runtime/{Profiler/Editor => Editor/Profiling}/Table/Table.cs.meta (100%) delete mode 100644 Assets/FishNet/Runtime/Profiler/CHANGELOG.md delete mode 100644 Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef delete mode 100644 Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/LICENSE delete mode 100644 Assets/FishNet/Runtime/Profiler/LICENSE.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Readme.txt delete mode 100644 Assets/FishNet/Runtime/Profiler/Readme.txt.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta delete mode 100644 Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs delete mode 100644 Assets/FishNet/Runtime/Profiler/package.json delete mode 100644 Assets/FishNet/Runtime/Profiler/package.json.meta rename Assets/FishNet/Runtime/{Profiler.meta => Utility/Performance/Profiling.meta} (100%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/CountRecorder.cs (74%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/CountRecorder.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Counters.cs (95%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Counters.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Frame.cs (90%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Frame.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Names.cs (94%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/Names.cs.meta (100%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/NetworkProfilerRecorder.cs (64%) rename Assets/FishNet/Runtime/{Profiler/Runtime => Utility/Performance/Profiling}/NetworkProfilerRecorder.cs.meta (100%) create mode 100644 Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs rename Assets/FishNet/Runtime/{Profiler/Runtime/MessageInfo.cs.meta => Utility/Performance/Profiling/PacketInfo.cs.meta} (100%) create mode 100644 Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs rename Assets/FishNet/Runtime/{Profiler/Runtime/NetworkInfoProvider.cs.meta => Utility/Performance/Profiling/PacketInfoProvider.cs.meta} (100%) diff --git a/Assets/FishNet/Runtime/Editor/Profiling.meta b/Assets/FishNet/Runtime/Editor/Profiling.meta new file mode 100644 index 000000000..1723d1eef --- /dev/null +++ b/Assets/FishNet/Runtime/Editor/Profiling.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bac8d138d5b64f5196d9bc91fcab4110 +timeCreated: 1751232406 \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs b/Assets/FishNet/Runtime/Editor/Profiling/ICountRecorderProvider.cs similarity index 52% rename from Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs rename to Assets/FishNet/Runtime/Editor/Profiling/ICountRecorderProvider.cs index 6ca8f3f18..303337459 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/ICountRecorderProvider.cs @@ -1,4 +1,6 @@ -namespace Mirage.NetworkProfiler.ModuleGUI +using FishNet.Utility.Performance.Profiling; + +namespace Fishnet.NetworkProfiler.ModuleGUI { internal interface ICountRecorderProvider { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/ICountRecorderProvider.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/ICountRecorderProvider.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/ICountRecorderProvider.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs similarity index 73% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs index 3703a1ce0..7b32bdd5a 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs @@ -1,8 +1,8 @@ using System.Collections; using System.Collections.Generic; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal sealed class Columns : IEnumerable { @@ -18,16 +18,16 @@ internal sealed class Columns : IEnumerable public readonly ColumnInfo TotalBytes; public readonly ColumnInfo Count; public readonly ColumnInfo BytesPerMessage; - public readonly ColumnInfo NetId; + //public readonly ColumnInfo NetId; public readonly ColumnInfo ObjectName; - public readonly ColumnInfo RpcName; + //public readonly ColumnInfo RpcName; public Columns() { Expand = new ColumnInfo("+", EXPAND_WIDTH, x => ""); - FullName = new ColumnInfo("Message", FULL_NAME_WIDTH, x => x.Name); - FullName.AddSort(m => m.Name, m => m.Name); + FullName = new ColumnInfo("Packet Type", FULL_NAME_WIDTH, x => x.PacketIdName); + FullName.AddSort(m => m.Name, m => m.PacketIdName); TotalBytes = new ColumnInfo("Total Bytes", OTHER_WIDTH, x => x.TotalBytes.ToString()); TotalBytes.AddSort(m => m.TotalBytes, m => m.TotalBytes); @@ -38,16 +38,16 @@ public Columns() BytesPerMessage = new ColumnInfo("Bytes", OTHER_WIDTH, x => x.Bytes.ToString()); BytesPerMessage.AddSort(null, m => m.Bytes); - NetId = new ColumnInfo("Net id", OTHER_WIDTH, x => x.NetId.HasValue ? x.NetId.ToString() : ""); - NetId.AddSort(null, m => m.NetId.GetValueOrDefault()); + // NetId = new ColumnInfo("Net id", OTHER_WIDTH, x => x.NetId.HasValue ? x.NetId.ToString() : ""); + // NetId.AddSort(null, m => m.NetId.GetValueOrDefault()); ObjectName = new ColumnInfo("GameObject Name", NAME_WIDTH, x => x.ObjectName); ObjectName.AddSort(null, m => m.ObjectName); - RpcName = new ColumnInfo("RPC Name (hover for full name)", FULL_NAME_WIDTH, x => RpcShortName(x.RpcName)); - RpcName.AddSort(null, m => m.RpcName); - // full name in tooltip - RpcName.AddToolTip(m => m.RpcName); + // RpcName = new ColumnInfo("RPC Name (hover for full name)", FULL_NAME_WIDTH, x => RpcShortName(x.RpcName)); + // RpcName.AddSort(null, m => m.RpcName); + // // full name in tooltip + // RpcName.AddToolTip(m => m.RpcName); _columns = new ColumnInfo[] { @@ -56,9 +56,9 @@ public Columns() TotalBytes, Count, BytesPerMessage, - NetId, + //NetId, ObjectName, - RpcName, + // RpcName, }; } diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/Columns.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/CounterNames.cs similarity index 86% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/CounterNames.cs index 3784aaac3..32d92c8ae 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/CounterNames.cs @@ -1,4 +1,4 @@ -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal struct CounterNames { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/CounterNames.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/CounterNames.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/CounterNames.cs.meta diff --git a/Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs new file mode 100644 index 000000000..4c3626831 --- /dev/null +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs @@ -0,0 +1,11 @@ +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; + +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages +{ + internal class DrawnMessage + { + public PacketInfo Info; + public Row Row; + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/DrawnMessage.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Group.cs similarity index 93% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/Group.cs index bd3319390..d8d51c366 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Group.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal class Group { @@ -33,7 +34,7 @@ public Group(string name, Table table, Columns columns) Order = int.MaxValue; } - public void AddMessage(MessageInfo msg) + public void AddMessage(PacketInfo msg) { Messages.Add(new DrawnMessage { Info = msg }); TotalBytes += msg.TotalBytes; @@ -98,7 +99,7 @@ private void DrawMessages() } } - private void DrawMessage(Row row, MessageInfo info) + private void DrawMessage(Row row, PacketInfo info) { foreach (var column in _columns) { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Group.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/Group.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/Group.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/GroupSorter.cs similarity index 86% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/GroupSorter.cs index 97eb3081c..bd5dcc783 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/GroupSorter.cs @@ -1,14 +1,15 @@ using System; using System.Collections.Generic; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal struct GroupSorter { private readonly Dictionary _grouped; private readonly Func _sortGroupFunc; - private readonly Func _sortMessageFunc; + private readonly Func _sortMessageFunc; private readonly SortMode _sortMode; @@ -75,7 +76,7 @@ public static int Compare(Group x, Group y, Func func) where T : IC var yValue = func.Invoke(y); return xValue.CompareTo(yValue); } - public static int Compare(MessageInfo x, MessageInfo y, Func func) where T : IComparable + public static int Compare(PacketInfo x, PacketInfo y, Func func) where T : IComparable { var xValue = func.Invoke(x); var yValue = func.Invoke(y); @@ -86,7 +87,7 @@ public static int DefaultGroupSort(Group x, Group y) { return x.Order.CompareTo(y.Order); } - public static int DefaultMessageSort(MessageInfo x, MessageInfo y) + public static int DefaultMessageSort(PacketInfo x, PacketInfo y) { return x.Order.CompareTo(y.Order); } diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/GroupSorter.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/GroupSorter.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/GroupSorter.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageView.cs similarity index 93% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageView.cs index e53fcc42d..d9826c2c1 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageView.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal class MessageView { @@ -13,7 +14,7 @@ internal class MessageView /// /// cache list used to gather messages /// - private readonly List _messages = new List(); + private readonly List _messages = new List(); private readonly Dictionary _grouped = new Dictionary(); public event Action OnGroupExpanded; @@ -54,7 +55,7 @@ private void GroupMessages(bool asGroups) { string name; if (asGroups) - name = message.Name; + name = message.PacketIdName; else name = "all_messages"; diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageView.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageView.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageView.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageViewController.cs similarity index 96% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageViewController.cs index d8e193874..5f4676b1c 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageViewController.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; //using Mirage.RemoteCalls; using Unity.Profiling; using Unity.Profiling.Editor; @@ -9,7 +10,7 @@ using UnityEngine; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal sealed class MessageViewController : ProfilerModuleViewController { @@ -220,7 +221,7 @@ private void ReloadMessages() SortFromSaveData(); } - private bool TryGetMessages(int frameIndex, out List messages) + private bool TryGetMessages(int frameIndex, out List messages) { if (_debugToggle.value) { @@ -238,9 +239,9 @@ private bool TryGetMessages(int frameIndex, out List messages) return true; } - private static List GenerateDebugMessages() + private static List GenerateDebugMessages() { - var messages = new List(); + var messages = new List(); var order = 0; // for (var i = 0; i < 5; i++) // { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageViewController.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/MessageViewController.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/MessageViewController.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/TableSorter.cs similarity index 84% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/TableSorter.cs index db0caccc1..80da5485b 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/TableSorter.cs @@ -1,7 +1,7 @@ -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; using UnityEngine; -namespace Mirage.NetworkProfiler.ModuleGUI.Messages +namespace Fishnet.NetworkProfiler.ModuleGUI.Messages { internal class TableSorter : ITableSorter diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Messages/TableSorter.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Messages/TableSorter.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Messages/TableSorter.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs b/Assets/FishNet/Runtime/Editor/Profiling/ModuleNames.cs similarity index 87% rename from Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs rename to Assets/FishNet/Runtime/Editor/Profiling/ModuleNames.cs index ea8c4ba43..ad149b36c 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/ModuleNames.cs @@ -1,4 +1,4 @@ -namespace Mirage.NetworkProfiler.ModuleGUI +namespace Fishnet.NetworkProfiler.ModuleGUI { internal static class ModuleNames { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/ModuleNames.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/ModuleNames.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/ModuleNames.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs b/Assets/FishNet/Runtime/Editor/Profiling/ReceivedModule.cs similarity index 89% rename from Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs rename to Assets/FishNet/Runtime/Editor/Profiling/ReceivedModule.cs index 33b6f862a..fb6e2623c 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/ReceivedModule.cs @@ -1,7 +1,8 @@ -using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Fishnet.NetworkProfiler.ModuleGUI.Messages; +using FishNet.Utility.Performance.Profiling; using Unity.Profiling.Editor; -namespace Mirage.NetworkProfiler.ModuleGUI +namespace Fishnet.NetworkProfiler.ModuleGUI { [System.Serializable] [ProfilerModuleMetadata(ModuleNames.RECEIVED)] diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/ReceivedModule.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/ReceivedModule.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/ReceivedModule.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs b/Assets/FishNet/Runtime/Editor/Profiling/SavedData.cs similarity index 97% rename from Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs rename to Assets/FishNet/Runtime/Editor/Profiling/SavedData.cs index bb1217c15..f9183d0d6 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/SavedData.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; using System.IO; -using Mirage.NetworkProfiler.ModuleGUI.Messages; -using Mirage.NetworkProfiler.ModuleGUI.UITable; +using Fishnet.NetworkProfiler.ModuleGUI.Messages; +using Fishnet.NetworkProfiler.ModuleGUI.UITable; +using FishNet.Utility.Performance.Profiling; using UnityEditor; using UnityEngine; -namespace Mirage.NetworkProfiler.ModuleGUI +namespace Fishnet.NetworkProfiler.ModuleGUI { [Serializable] internal class SavedData diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/SavedData.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/SavedData.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/SavedData.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs b/Assets/FishNet/Runtime/Editor/Profiling/SentModule.cs similarity index 88% rename from Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs rename to Assets/FishNet/Runtime/Editor/Profiling/SentModule.cs index 4cf2203ef..35807f2ce 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/SentModule.cs @@ -1,7 +1,8 @@ -using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Fishnet.NetworkProfiler.ModuleGUI.Messages; +using FishNet.Utility.Performance.Profiling; using Unity.Profiling.Editor; -namespace Mirage.NetworkProfiler.ModuleGUI +namespace Fishnet.NetworkProfiler.ModuleGUI { [System.Serializable] [ProfilerModuleMetadata(ModuleNames.SENT)] diff --git a/Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/SentModule.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/SentModule.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/SentModule.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs b/Assets/FishNet/Runtime/Editor/Profiling/ServerModule.cs similarity index 97% rename from Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs rename to Assets/FishNet/Runtime/Editor/Profiling/ServerModule.cs index 029f5950d..7924d1653 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/ServerModule.cs @@ -1,10 +1,11 @@ +using FishNet.Utility.Performance.Profiling; using Unity.Profiling; using Unity.Profiling.Editor; using UnityEditor; using UnityEditorInternal; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI +namespace Fishnet.NetworkProfiler.ModuleGUI { [System.Serializable] [ProfilerModuleMetadata(ModuleNames.SERVER)] diff --git a/Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/ServerModule.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/ServerModule.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/ServerModule.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/ColumnInfo.cs similarity index 72% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/ColumnInfo.cs index 40841949a..bca7c911a 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/ColumnInfo.cs @@ -1,7 +1,8 @@ using System; -using Mirage.NetworkProfiler.ModuleGUI.Messages; +using Fishnet.NetworkProfiler.ModuleGUI.Messages; +using FishNet.Utility.Performance.Profiling; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class ColumnInfo { @@ -10,14 +11,14 @@ internal class ColumnInfo public bool AllowSort { get; private set; } public Func SortGroup { get; private set; } - public Func SortMessages { get; private set; } + public Func SortMessages { get; private set; } - public Func TextGetter { get; private set; } + public Func TextGetter { get; private set; } public bool HasToolTip { get; private set; } - public Func ToolTipGetter { get; private set; } + public Func ToolTipGetter { get; private set; } - public ColumnInfo(string header, int width, Func textGetter) + public ColumnInfo(string header, int width, Func textGetter) { Header = header; Width = width; @@ -30,7 +31,7 @@ public ColumnInfo(string header, int width, Func textGetter /// /// /// - public void AddSort(Func sortGroup, Func sortMessages) + public void AddSort(Func sortGroup, Func sortMessages) { AllowSort = true; SortGroup = sortGroup ?? GroupSorter.DefaultGroupSort; @@ -44,20 +45,20 @@ public void AddSort(Func sortGroup, Func /// /// - public void AddSort(Func groupGetter, Func messageGetter) where T : IComparable + public void AddSort(Func groupGetter, Func messageGetter) where T : IComparable { Func sortGroup = groupGetter != null ? (x, y) => GroupSorter.Compare(x, y, groupGetter) : null; - Func sortMessages = messageGetter != null + Func sortMessages = messageGetter != null ? (x, y) => GroupSorter.Compare(x, y, messageGetter) : null; AddSort(sortGroup, sortMessages); } - public void AddToolTip(Func getter) + public void AddToolTip(Func getter) { HasToolTip = true; ToolTipGetter = getter; diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/ColumnInfo.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/ColumnInfo.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/ColumnInfo.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/EmptyRow.cs similarity index 91% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/EmptyRow.cs index b5b492a10..d199e5b72 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/EmptyRow.cs @@ -3,7 +3,7 @@ using System.Linq; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class EmptyRow : Row { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/EmptyRow.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/EmptyRow.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/EmptyRow.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/ITableSorter.cs similarity index 65% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/ITableSorter.cs index a549ccb1f..1aa026870 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/ITableSorter.cs @@ -1,4 +1,4 @@ -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal interface ITableSorter { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/ITableSorter.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/ITableSorter.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/ITableSorter.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/LabelRow.cs similarity index 96% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/LabelRow.cs index c4c98c50c..3bb73e42d 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/LabelRow.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class LabelRow : Row { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/LabelRow.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/LabelRow.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/LabelRow.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/Row.cs similarity index 96% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/Row.cs index f5a0965cd..12a26579a 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/Row.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal abstract class Row { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/Row.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/Row.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/Row.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeader.cs similarity index 97% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeader.cs index 0e95c641e..8f6e7dbb3 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeader.cs @@ -1,6 +1,6 @@ using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class SortHeader : Label { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeader.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeader.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeader.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeaderRow.cs similarity index 96% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeaderRow.cs index 4e0d99f00..23329ad07 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeaderRow.cs @@ -1,7 +1,7 @@ using System; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class SortHeaderRow : LabelRow { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeaderRow.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortHeaderRow.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortHeaderRow.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortMode.cs similarity index 63% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortMode.cs index 2c768e524..40ebabf95 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortMode.cs @@ -1,4 +1,4 @@ -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal enum SortMode { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/SortMode.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/SortMode.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/SortMode.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs b/Assets/FishNet/Runtime/Editor/Profiling/Table/Table.cs similarity index 98% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs rename to Assets/FishNet/Runtime/Editor/Profiling/Table/Table.cs index fdd6a47af..3da599ce1 100644 --- a/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Table/Table.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEngine.UIElements; -namespace Mirage.NetworkProfiler.ModuleGUI.UITable +namespace Fishnet.NetworkProfiler.ModuleGUI.UITable { internal class Table { diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta b/Assets/FishNet/Runtime/Editor/Profiling/Table/Table.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Editor/Table/Table.cs.meta rename to Assets/FishNet/Runtime/Editor/Profiling/Table/Table.cs.meta diff --git a/Assets/FishNet/Runtime/FishNet.Runtime.asmdef b/Assets/FishNet/Runtime/FishNet.Runtime.asmdef index 73a8b851e..898636b60 100644 --- a/Assets/FishNet/Runtime/FishNet.Runtime.asmdef +++ b/Assets/FishNet/Runtime/FishNet.Runtime.asmdef @@ -1,8 +1,10 @@ { "name": "FishNet.Runtime", + "rootNamespace": "", "references": [ "GUID:894a6cc6ed5cd2645bb542978cbed6a9", - "GUID:17013b2a21298c14ea4808251346a38a" + "GUID:17013b2a21298c14ea4808251346a38a", + "GUID:b46779583a009f04ba9f5f31d0e7e6ac" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index cdd172db1..f95fd5730 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -46,6 +46,10 @@ public sealed partial class ClientManager : MonoBehaviour /// public event Action OnConnectedClients; /// + /// Called when the client processes a packet. + /// + public event Action OnPacketRead; + /// /// True if the client connection is connected to the server. /// public bool Started { get; private set; } @@ -152,6 +156,7 @@ internal void InitializeOnce_Internal(NetworkManager manager) NetworkManager = manager; Objects = new ClientObjects(manager); Objects.SubscribeToSceneLoaded(true); + Objects.OnPacketRead += (args) => OnPacketRead?.Invoke(args); /* Unsubscribe before subscribing. * Shouldn't be an issue but better safe than sorry. */ SubscribeToEvents(false); @@ -400,6 +405,7 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal reader.Initialize(NetworkManager.TransportManager.ProcessIntermediateIncoming(fullMessage, true), NetworkManager, dataSource); else reader.Initialize(fullMessage, NetworkManager, dataSource); + OnPacketRead?.Invoke(new PacketProcessingArgs(null, PacketId.Split, expectedMessages*1500)); } //Not split. else diff --git a/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs b/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs index bc0a96d64..d43e3b933 100644 --- a/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs +++ b/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs @@ -32,6 +32,11 @@ public partial class ClientObjects : ManagedObjects /// NetworkObjects which are currently active on the local client. /// internal List LocalClientSpawned = new List(); + + /// + /// Called when the client processes a packet. + /// + public event Action OnPacketRead; #endregion #region Private. @@ -335,6 +340,7 @@ internal void ParseSyncType(PooledReader reader, bool isSyncObject, Channel chan * when another packet starts is by including the length. */ if (dataLength > 0) nb.OnSyncType(reader, dataLength, isSyncObject); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (PacketId)packetId, dataLength)); } else { @@ -369,7 +375,10 @@ internal void ParseReconcileRpc(PooledReader reader, Channel channel) int dataLength = Packets.GetPacketLength((ushort)PacketId.Reconcile, reader, channel); if (nb != null) + { nb.OnReconcileRpc(null, reader, channel); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.Reconcile, dataLength)); + } else SkipDataLength((ushort)PacketId.ObserversRpc, reader, dataLength); } @@ -385,7 +394,10 @@ internal void ParseObserversRpc(PooledReader reader, Channel channel) int dataLength = Packets.GetPacketLength((ushort)PacketId.ObserversRpc, reader, channel); if (nb != null) + { nb.OnObserversRpc(null, reader, channel); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.ObserversRpc, dataLength)); + } else SkipDataLength((ushort)PacketId.ObserversRpc, reader, dataLength); } @@ -400,7 +412,10 @@ internal void ParseTargetRpc(PooledReader reader, Channel channel) int dataLength = Packets.GetPacketLength((ushort)PacketId.TargetRpc, reader, channel); if (nb != null) + { nb.OnTargetRpc(null, reader, channel); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.TargetRpc, dataLength)); + } else SkipDataLength((ushort)PacketId.TargetRpc, reader, dataLength); } diff --git a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md deleted file mode 100644 index 43c4f1331..000000000 --- a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md +++ /dev/null @@ -1,339 +0,0 @@ -## [1.2.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.2.1...v1.2.2) (2024-08-21) - - -### Bug Fixes - -* setting new mirage version in package ([23db36c](https://github.com/James-Frowen/Mirage.Profiler/commit/23db36cf3a55aaeb29a5695a8fc5f6a57326afc3)) - -## [1.2.1](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.2.0...v1.2.1) (2024-08-21) - - -### Bug Fixes - -* fixing recorder not taking reference to client ([21693d1](https://github.com/James-Frowen/Mirage.Profiler/commit/21693d10fbec7cd5acf86cd7e77592af77939c43)) -* stopping message name from overflowing ([3a151c1](https://github.com/James-Frowen/Mirage.Profiler/commit/3a151c1d2c68872bedc1f9602dab0a69fdcf56ec)) - -# [1.2.0](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.1.0...v1.2.0) (2022-09-23) - - -### Features - -* adding support for counter in built player ([fdcf4bb](https://github.com/James-Frowen/Mirage.Profiler/commit/fdcf4bbb65044c4bc7c3ea0ecef39e81a9db3940)) - -# [1.1.0](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.4...v1.1.0) (2022-09-08) - - -### Bug Fixes - -* fixes null ref when sort header is null ([d233036](https://github.com/James-Frowen/Mirage.Profiler/commit/d233036255497a8c49f61a657ed61022ed671020)), closes [#4](https://github.com/James-Frowen/Mirage.Profiler/issues/4) -* fixing header being squashed if vertical scroll is full ([ad29f2e](https://github.com/James-Frowen/Mirage.Profiler/commit/ad29f2ee756793d15f2701b6d06fccac7d78b950)) -* fixing null ref when group message is false ([004ba4e](https://github.com/James-Frowen/Mirage.Profiler/commit/004ba4e26ea9ff0dfeacba3e7f6440a85497ddc3)), closes [#6](https://github.com/James-Frowen/Mirage.Profiler/issues/6) -* stopping exception if rpc name does not contain dot ([#3](https://github.com/James-Frowen/Mirage.Profiler/issues/3)) ([324a374](https://github.com/James-Frowen/Mirage.Profiler/commit/324a374800b784595cf752f5d3943efe9ff91c6d)) - - -### Features - -* adding group message to save data ([3061381](https://github.com/James-Frowen/Mirage.Profiler/commit/306138196805e949e68a8b7517f2c846506b32ad)) - -## [1.0.4](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.3...v1.0.4) (2022-08-08) - - -### Bug Fixes - -* movng files into package ([0ab735c](https://github.com/James-Frowen/Mirage.Profiler/commit/0ab735c63dffe35eff2f841ef6f5079cf334150a)) - -## [1.0.3](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.2...v1.0.3) (2022-08-08) - - -### Bug Fixes - -* fixing version not being added by CI ([b340957](https://github.com/James-Frowen/Mirage.Profiler/commit/b34095760942b57dc2a160d2c247a6f9b591ad38)) - -## [1.0.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.1...v1.0.2) (2022-08-07) - - -### Bug Fixes - -* adding runtime folder to fix package layout ([0ed3a93](https://github.com/James-Frowen/Mirage.Profiler/commit/0ed3a935b570a6770f8db6b1c38615d34cce2207)) - -## [1.0.1](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0...v1.0.1) (2022-08-07) - - -### Bug Fixes - -* fixing error when rpc name is empty ([5660db0](https://github.com/James-Frowen/Mirage.Profiler/commit/5660db058c522b0eaf39651ec5b33f9a444849c4)) - -# 1.0.0 (2022-08-07) - - -### Bug Fixes - -* adding note about maybe missing NetworkProfilerBehaviour ([91b2420](https://github.com/James-Frowen/Mirage.Profiler/commit/91b242030cf64cc7a80bd0b5e8f3e38317e6a246)) -* changing order to be int.max ([4c40e61](https://github.com/James-Frowen/Mirage.Profiler/commit/4c40e61bc23884dff13de35db84dd8ed4abc0724)) -* clearing byte count at end of frame ([f2270a8](https://github.com/James-Frowen/Mirage.Profiler/commit/f2270a8960543a8bfd70fbc2a8fc628e788a1a43)) -* disabling debug message by default ([7f16136](https://github.com/James-Frowen/Mirage.Profiler/commit/7f161365b0f54d32e34773b3eb5645046b12bed4)) -* enabling example bullet on server ([ea15bf6](https://github.com/James-Frowen/Mirage.Profiler/commit/ea15bf6301b736a328f51edadf5f127cdf704729)) -* fixing client spawn in example ([5ff2c0a](https://github.com/James-Frowen/Mirage.Profiler/commit/5ff2c0ae7ed0a3c89baff1aed7316761d7342338)) -* fixing crash when closing unity ([cf2513a](https://github.com/James-Frowen/Mirage.Profiler/commit/cf2513ac150fc67533d6c41e9e44ec894d81ca0e)) -* fixing define to hide debug toggle ([8d22bf7](https://github.com/James-Frowen/Mirage.Profiler/commit/8d22bf7cd6ccf32b0af0866235587c136d09072b)) -* fixing example auto connect ([6b5163e](https://github.com/James-Frowen/Mirage.Profiler/commit/6b5163e9577e0b8304d78a5ec87df7650f63fe9d)) -* fixing example where field was not being used ([4417cdc](https://github.com/James-Frowen/Mirage.Profiler/commit/4417cdcf0504723ba25e8e342c1c91757fd11743)) -* fixing frame index for saved messages ([49d9e70](https://github.com/James-Frowen/Mirage.Profiler/commit/49d9e705b7db99e05b3089eed502553369752522)) -* fixing groups not un-expanding ([196feae](https://github.com/James-Frowen/Mirage.Profiler/commit/196feae6e7e49f54478f575c7c3668160b01e0e3)) -* fixing index out of range on first frame ([036f104](https://github.com/James-Frowen/Mirage.Profiler/commit/036f10487e469c4cf39fe6b431c2f22499157b6d)) -* fixing player count sample being skipped ([740b4f8](https://github.com/James-Frowen/Mirage.Profiler/commit/740b4f8816dfd783e7465856f0380c7fc8b9b2f2)) -* fixing profier behaviour ([53f0614](https://github.com/James-Frowen/Mirage.Profiler/commit/53f06143befb02caa8c415a05fb10d53bf484906)) -* fixing ProfilerCounter ([81344fe](https://github.com/James-Frowen/Mirage.Profiler/commit/81344fe871224a773d014b9bb76f028ff4aba21d)) -* fixing sort arrow not updated ([3ced312](https://github.com/James-Frowen/Mirage.Profiler/commit/3ced312f20f5c24657bd635fc93ced5b40ffca02)) -* fixing unity skipping profiler frames becuase unity is buggy ([f452ac4](https://github.com/James-Frowen/Mirage.Profiler/commit/f452ac4a1eb45bf4713d1769895ec431c24550ba)) -* init array with non-null elements ([b3c3276](https://github.com/James-Frowen/Mirage.Profiler/commit/b3c32761b0e6a62ff4180fde276131709d1956d6)) -* making example clients auto reconnect ([cbf27b7](https://github.com/James-Frowen/Mirage.Profiler/commit/cbf27b7abdb0ee955b77c9d7f977241b1ad3e7bc)) -* making header scroll Horizontally ([5eac0f7](https://github.com/James-Frowen/Mirage.Profiler/commit/5eac0f71a8569c580bc03587d63b9fea418be326)) -* making message info fields serializable ([81fb20d](https://github.com/James-Frowen/Mirage.Profiler/commit/81fb20da066d271fb72c56a763ccd0fe106cbc1a)) -* naming debug name shorter ([36f2d6a](https://github.com/James-Frowen/Mirage.Profiler/commit/36f2d6a5c76e6391ba16d44d8f09d44625be9d11)) -* removing debug logs ([0bb90ef](https://github.com/James-Frowen/Mirage.Profiler/commit/0bb90ef9dc674e5596ef79994259f96fd378f2d7)) -* removing prefix from summary labels ([3841a9e](https://github.com/James-Frowen/Mirage.Profiler/commit/3841a9e3c65ee7432a4d2020ed03a4f7557f14d6)) -* removing verbose log ([0cfd3bf](https://github.com/James-Frowen/Mirage.Profiler/commit/0cfd3bf4d9364871da49dcbf9a084179e67f4a20)) -* scroll bar for table ([af7c83b](https://github.com/James-Frowen/Mirage.Profiler/commit/af7c83b13fb13aff81f7fc1648eb48597849525b)) -* setting max connections in example to 1000 ([94d06ea](https://github.com/James-Frowen/Mirage.Profiler/commit/94d06ea9723cadf1214b0a92ece59f2788389305)) -* stoping sort mode going back to none ([7745700](https://github.com/James-Frowen/Mirage.Profiler/commit/77457001775bc6f6889c7c8f4f86bacdadbd90e1)) -* updating mirage for fix ([e367c4a](https://github.com/James-Frowen/Mirage.Profiler/commit/e367c4a3c60e065effc80d4896998d5ef6c310c9)) - - -### Features - -* adding basic column sort ([39d4519](https://github.com/James-Frowen/Mirage.Profiler/commit/39d4519ce8a2fe086189bf12cdb34ce3e1820fe2)) -* adding object name column ([239e069](https://github.com/James-Frowen/Mirage.Profiler/commit/239e069dd0aecc080413325eb98edf7ccc3b1eb1)) -* adding option to group messages by type ([2e5fc27](https://github.com/James-Frowen/Mirage.Profiler/commit/2e5fc276bacc93f45c444a3b637d0d716bc1db1b)) -* adding option to run example outside of editor ([5a75b65](https://github.com/James-Frowen/Mirage.Profiler/commit/5a75b65b0f3f3075d21c2cdd0d821655bf2a47e3)) -* adding rpc name to message info ([d90d842](https://github.com/James-Frowen/Mirage.Profiler/commit/d90d842bc57defe10b7af8b1b2b6c2bd70566df1)) -* adding rpc name to table ([63722e2](https://github.com/James-Frowen/Mirage.Profiler/commit/63722e29458a522d10afa96d6a75831a5d084495)) -* adding shooting to example ([6a86354](https://github.com/James-Frowen/Mirage.Profiler/commit/6a86354895f2effe3689b4638f195d8536107a19)) -* adding sorting for groups ([2dec9a5](https://github.com/James-Frowen/Mirage.Profiler/commit/2dec9a5bfef76c34dff68a4aa904590c0924dc86)) -* expandable groups for message types ([001de86](https://github.com/James-Frowen/Mirage.Profiler/commit/001de86db446769d12880b35e64147bfda84f755)) -* first prerelease ([7fbd8ce](https://github.com/James-Frowen/Mirage.Profiler/commit/7fbd8ceb9223321abc514a3178d7703fe92f9497)) -* first release ([55b2b39](https://github.com/James-Frowen/Mirage.Profiler/commit/55b2b395e10da952101ae101f2cf2ab1acefe664)) -* only showing rpc short name, full name in tooltip ([9f71ae7](https://github.com/James-Frowen/Mirage.Profiler/commit/9f71ae78a546b0c8543d4295e8c2944a3ec458bd)) -* putting table header above scrollview ([a7d52ff](https://github.com/James-Frowen/Mirage.Profiler/commit/a7d52fff785b0f625a8af5abd920cc06d0a38053)) -* returning saved message instead of ones from counter ([6e894fa](https://github.com/James-Frowen/Mirage.Profiler/commit/6e894faec6701346f738925057cf360554e74860)) -* saving group expanded in save data ([70e4da9](https://github.com/James-Frowen/Mirage.Profiler/commit/70e4da92c1d8e35518eaa4656ff87d5276843a62)) -* saving message for frames ([131257a](https://github.com/James-Frowen/Mirage.Profiler/commit/131257aa7c603da085e10c8d5103a6776c7a8a38)) -* using sort from save data ([6bded42](https://github.com/James-Frowen/Mirage.Profiler/commit/6bded42b36bc8f7767cce355de220157c630093f)) -* working save data for message table ([0ab9197](https://github.com/James-Frowen/Mirage.Profiler/commit/0ab9197870fd581f68a1b405f3572c7b04c9f39e)) - - -### Performance Improvements - -* replacing FindObjectOfType with reference given in setup ([71e6712](https://github.com/James-Frowen/Mirage.Profiler/commit/71e671247dd5394d806ca1017b91aa2faa68eea8)) - -# [1.0.0-beta.24](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-08-07) - - -### Bug Fixes - -* making header scroll Horizontally ([7ba9d26](https://github.com/James-Frowen/Mirage.Profiler/commit/7ba9d2667afcf32269c979f3df4769e3e86a3d6c)) - - -### Features - -* adding rpc name to message info ([52a7bb4](https://github.com/James-Frowen/Mirage.Profiler/commit/52a7bb4927e009eec5839e30c94bee1345e4a4b9)) -* adding rpc name to table ([fd1e762](https://github.com/James-Frowen/Mirage.Profiler/commit/fd1e762a22e9ce5ec10f92105613f8f11f5aad6d)) -* only showing rpc short name, full name in tooltip ([e346a6f](https://github.com/James-Frowen/Mirage.Profiler/commit/e346a6f7d403113057fd067e89cb470e594fd4c3)) - -# [1.0.0-beta.23](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2022-08-07) - - -### Bug Fixes - -* fixing sort arrow not updated ([bf8cd9a](https://github.com/James-Frowen/Mirage.Profiler/commit/bf8cd9adeec12ca2898918e40c611e040e58013e)) - -# [1.0.0-beta.22](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2022-08-07) - - -### Features - -* saving group expanded in save data ([557538c](https://github.com/James-Frowen/Mirage.Profiler/commit/557538c6cf9d06b456def4e34c0b8add6683bd7b)) - -# [1.0.0-beta.21](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-08-07) - - -### Bug Fixes - -* fixing index out of range on first frame ([b1a4a6b](https://github.com/James-Frowen/Mirage.Profiler/commit/b1a4a6b7ca21154d32758fcb577ccd8c22c55d7e)) -* fixing player count sample being skipped ([04d7341](https://github.com/James-Frowen/Mirage.Profiler/commit/04d7341d0e3cbf7a91208a0b5f0df567644d7030)) -* setting max connections in example to 1000 ([94dc143](https://github.com/James-Frowen/Mirage.Profiler/commit/94dc14329c3c1799f85c210f11ece1879bb6fa47)) - - -### Features - -* adding object name column ([d3de7e3](https://github.com/James-Frowen/Mirage.Profiler/commit/d3de7e334530068cc7776fb000afbaaf21dd30b4)) - - -### Performance Improvements - -* replacing FindObjectOfType with reference given in setup ([df9141d](https://github.com/James-Frowen/Mirage.Profiler/commit/df9141df18139a1020222c60402c4fedd3259a38)) - -# [1.0.0-beta.20](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-08-06) - - -### Bug Fixes - -* fixing example where field was not being used ([1e6f605](https://github.com/James-Frowen/Mirage.Profiler/commit/1e6f605e8cd9953daf6f9482c72dabe069c7b300)) - -# [1.0.0-beta.19](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-08-06) - - -### Bug Fixes - -* removing verbose log ([fe0541a](https://github.com/James-Frowen/Mirage.Profiler/commit/fe0541a7859eadd5ce390c6449dd83694c058d08)) - -# [1.0.0-beta.18](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-08-06) - - -### Bug Fixes - -* fixing crash when closing unity ([eacc82c](https://github.com/James-Frowen/Mirage.Profiler/commit/eacc82ca37b4bce169ed03ae2336474af1936760)) -* fixing unity skipping profiler frames becuase unity is buggy ([4e23dff](https://github.com/James-Frowen/Mirage.Profiler/commit/4e23dffc07ed2d7f48dd9a0d4257806c93ba7c3f)) - -# [1.0.0-beta.17](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-08-06) - - -### Bug Fixes - -* removing debug logs ([3c0d019](https://github.com/James-Frowen/Mirage.Profiler/commit/3c0d01905c1c3b659a4e5453c79d63a3ba506bfe)) - -# [1.0.0-beta.16](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-08-06) - - -### Bug Fixes - -* clearing byte count at end of frame ([d185ad4](https://github.com/James-Frowen/Mirage.Profiler/commit/d185ad43c9d716aa44bbb715b3eed89b16d19706)) -* enabling example bullet on server ([bc58f72](https://github.com/James-Frowen/Mirage.Profiler/commit/bc58f72ff2946b1f4a96821d36e3dfc88fed0f82)) -* fixing client spawn in example ([348e98b](https://github.com/James-Frowen/Mirage.Profiler/commit/348e98b4de4c36be9c118cfa6242827126422cd9)) -* fixing example auto connect ([65968de](https://github.com/James-Frowen/Mirage.Profiler/commit/65968ded4aa7ea2fd0c04739cb0e272709ff7d67)) -* fixing frame index for saved messages ([1204a1f](https://github.com/James-Frowen/Mirage.Profiler/commit/1204a1f4f32d497a260a4720937edde67d6cd9ed)) -* fixing profier behaviour ([bc91dc7](https://github.com/James-Frowen/Mirage.Profiler/commit/bc91dc78b71d9893adb48dac991433631fb7a34f)) -* fixing ProfilerCounter ([9a7f62a](https://github.com/James-Frowen/Mirage.Profiler/commit/9a7f62a4d4ce2ff42bfb1cd0ad0b712ac7b46ac7)) -* init array with non-null elements ([f69c268](https://github.com/James-Frowen/Mirage.Profiler/commit/f69c2684de2b242fe337b051d274d84b48577ebc)) -* making example clients auto reconnect ([8ca5eee](https://github.com/James-Frowen/Mirage.Profiler/commit/8ca5eeeb102e54e12a33490c878fd35156cb6ff0)) -* making message info fields serializable ([4cbc905](https://github.com/James-Frowen/Mirage.Profiler/commit/4cbc905e513a62ee17ddf660d524363464e080c8)) - - -### Features - -* adding option to run example outside of editor ([5de8073](https://github.com/James-Frowen/Mirage.Profiler/commit/5de80731e41513564ccf20ba67fb29eb4e01adf1)) -* adding shooting to example ([543374a](https://github.com/James-Frowen/Mirage.Profiler/commit/543374a94c0a65362fcabaf0ca190d49163e372d)) -* returning saved message instead of ones from counter ([541ec66](https://github.com/James-Frowen/Mirage.Profiler/commit/541ec663cda04fb2b10c73822a6e28bd221ac6b7)) -* saving message for frames ([519f256](https://github.com/James-Frowen/Mirage.Profiler/commit/519f25695ad0ca7b113a65de14c7feb93c42d4f0)) -* working save data for message table ([ffaaef9](https://github.com/James-Frowen/Mirage.Profiler/commit/ffaaef97e4ee05751be419e642f61b923857486f)) - -# [1.0.0-beta.15](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-08-05) - - -### Bug Fixes - -* stoping sort mode going back to none ([5c85668](https://github.com/James-Frowen/Mirage.Profiler/commit/5c856680631869769e41206c72fb024e90e74cd9)) - - -### Features - -* using sort from save data ([cdc65ad](https://github.com/James-Frowen/Mirage.Profiler/commit/cdc65ad3d72791e74d51d76df700eb3993a4576d)) - -# [1.0.0-beta.14](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-08-03) - - -### Bug Fixes - -* adding note about maybe missing NetworkProfilerBehaviour ([5120029](https://github.com/James-Frowen/Mirage.Profiler/commit/5120029c3d30f5a141d0a86e28501dc52a6d7a7d)) - -# [1.0.0-beta.13](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-08-03) - - -### Bug Fixes - -* changing order to be int.max ([31cbd2f](https://github.com/James-Frowen/Mirage.Profiler/commit/31cbd2ff5b9b9a476d9c9562a19c7d3aec894eb1)) - -# [1.0.0-beta.12](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-07-28) - - -### Bug Fixes - -* fixing groups not un-expanding ([17c27c2](https://github.com/James-Frowen/Mirage.Profiler/commit/17c27c24a22f40a9e240e9f0a68933ad531bd192)) - -# [1.0.0-beta.11](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-07-28) - - -### Features - -* putting table header above scrollview ([6d52a00](https://github.com/James-Frowen/Mirage.Profiler/commit/6d52a004e8859d8930063b4610f24512d3016113)) - -# [1.0.0-beta.10](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2022-07-28) - - -### Features - -* adding sorting for groups ([bd655e8](https://github.com/James-Frowen/Mirage.Profiler/commit/bd655e89338f1f03b32f600288be6dd06edc6a8f)) - -# [1.0.0-beta.9](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-07-27) - - -### Features - -* adding basic column sort ([1ce56a8](https://github.com/James-Frowen/Mirage.Profiler/commit/1ce56a878444597bf4946bf573264c9ebd156581)) - -# [1.0.0-beta.8](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2022-07-26) - - -### Bug Fixes - -* disabling debug message by default ([ad1e082](https://github.com/James-Frowen/Mirage.Profiler/commit/ad1e08243d1f4e443468b32682eb44ede8c3ffa4)) -* removing prefix from summary labels ([6836ff5](https://github.com/James-Frowen/Mirage.Profiler/commit/6836ff547c7f2340baca8a68064c7556ef0ccfe6)) - -# [1.0.0-beta.7](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2022-07-26) - - -### Features - -* expandable groups for message types ([20f949c](https://github.com/James-Frowen/Mirage.Profiler/commit/20f949ceee10951cf4215451afbbea33d3f0d63f)) - -# [1.0.0-beta.6](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2022-07-25) - - -### Bug Fixes - -* fixing define to hide debug toggle ([5798c5c](https://github.com/James-Frowen/Mirage.Profiler/commit/5798c5c0f13c5614c8ce507736820ac6bfbfa04a)) - -# [1.0.0-beta.5](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-07-25) - - -### Features - -* adding option to group messages by type ([9392ebb](https://github.com/James-Frowen/Mirage.Profiler/commit/9392ebb6d324db1cc4fb09f28909acde371ba198)) - -# [1.0.0-beta.4](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-07-23) - - -### Bug Fixes - -* naming debug name shorter ([1a2ad87](https://github.com/James-Frowen/Mirage.Profiler/commit/1a2ad8765b1cfbd9a4033da6de7a18e1c38d3632)) - -# [1.0.0-beta.3](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-07-23) - - -### Bug Fixes - -* scroll bar for table ([d7b697f](https://github.com/James-Frowen/Mirage.Profiler/commit/d7b697f1556300a22773f4f9e04718c7d228203e)) - -# [1.0.0-beta.2](https://github.com/James-Frowen/Mirage.Profiler/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2022-07-23) - - -### Bug Fixes - -* updating mirage for fix ([69ded5e](https://github.com/James-Frowen/Mirage.Profiler/commit/69ded5e7ac44130226362da61bddde2f275d0b98)) - -# 1.0.0-beta.1 (2022-07-23) - - -### Features - -* first prerelease ([e253142](https://github.com/James-Frowen/Mirage.Profiler/commit/e25314230a8e322e351912ac9f960f6f29821be5)) diff --git a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta b/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta deleted file mode 100644 index 72774e7f1..000000000 --- a/Assets/FishNet/Runtime/Profiler/CHANGELOG.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1b2c5211880da6c4f83e37f1222441e1 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor.meta b/Assets/FishNet/Runtime/Profiler/Editor.meta deleted file mode 100644 index fd9ad5f22..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e9eb58b4bf960c1439443c3160ce8371 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs deleted file mode 100644 index b40114ddf..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyVersion("1.2.2")] diff --git a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta deleted file mode 100644 index b483b9c10..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor/AssemblyInfo.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6efabd9b23eecd0459622d955c6a2b4e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs b/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs deleted file mode 100644 index ed8f12c01..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor/Messages/DrawnMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Mirage.NetworkProfiler.ModuleGUI.UITable; - -namespace Mirage.NetworkProfiler.ModuleGUI.Messages -{ - internal class DrawnMessage - { - public MessageInfo Info; - public Row Row; - } -} diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef deleted file mode 100644 index dae99d112..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Mirage.Profiler.Editor", - "rootNamespace": "", - "references": [ - "GUID:b46779583a009f04ba9f5f31d0e7e6ac", - "GUID:6ff9f1c8e2ed4034baf80c43db7a3b6a", - "GUID:30817c1a0e6d646d99c048fc403f5979" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta b/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta deleted file mode 100644 index b37075530..000000000 --- a/Assets/FishNet/Runtime/Profiler/Editor/Mirage.Profiler.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ff97fe2e55c0fd44c91fb1242f9bff3e -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/LICENSE b/Assets/FishNet/Runtime/Profiler/LICENSE deleted file mode 100644 index 8a221041c..000000000 --- a/Assets/FishNet/Runtime/Profiler/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 James Frowen - -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/FishNet/Runtime/Profiler/LICENSE.meta b/Assets/FishNet/Runtime/Profiler/LICENSE.meta deleted file mode 100644 index 1f8ec2aad..000000000 --- a/Assets/FishNet/Runtime/Profiler/LICENSE.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d4452ce1fed4a2641879ef852c413104 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Readme.txt b/Assets/FishNet/Runtime/Profiler/Readme.txt deleted file mode 100644 index 3b74699e3..000000000 --- a/Assets/FishNet/Runtime/Profiler/Readme.txt +++ /dev/null @@ -1 +0,0 @@ -See full readme here https://github.com/James-Frowen/Mirage.Profiler diff --git a/Assets/FishNet/Runtime/Profiler/Readme.txt.meta b/Assets/FishNet/Runtime/Profiler/Readme.txt.meta deleted file mode 100644 index 4b2b13539..000000000 --- a/Assets/FishNet/Runtime/Profiler/Readme.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cc3de9d50be43ed438d71e49f728567c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime.meta b/Assets/FishNet/Runtime/Profiler/Runtime.meta deleted file mode 100644 index a4b1f389d..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 82fa6b4931bac2f41b95862e74371e17 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs deleted file mode 100644 index 12e8b14f5..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyVersion("1.2.2")] - -[assembly: InternalsVisibleTo("Mirage.Profiler.Editor")] diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta b/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta deleted file mode 100644 index 613f9c2a2..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/AssemblyInfo.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b0ddded0f98d71546aeae6e4c52aef54 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs b/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs deleted file mode 100644 index 4fd70d49c..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; - -namespace Mirage.NetworkProfiler -{ - [System.Serializable] - public class MessageInfo - { - /// - /// Order message was sent/received in frame - /// - [SerializeField] private int _order; - [SerializeField] private int _bytes; - [SerializeField] private int _count; - [SerializeField] private string _messageName; - // unity can't serialize nullable so store as 2 fields - [SerializeField] private bool _hasNetId; - [SerializeField] private uint _netId; - [SerializeField] private string _objectName; - [SerializeField] private string _rpcName; - - public int Order => _order; - public string Name => _messageName; - public int Bytes => _bytes; - public int Count => _count; - public int TotalBytes => Bytes * Count; - public uint? NetId => _hasNetId ? _netId : default; - public string ObjectName => _objectName; - public string RpcName => _rpcName; - - public MessageInfo(/*NetworkDiagnostics.MessageInfo msg, INetworkInfoProvider provider, int order*/) - { - //_order = order; - //_bytes = msg.bytes; - //_count = msg.count; - //_messageName = msg.message.GetType().FullName; - //var id = provider.GetNetId(msg); - //_hasNetId = id.HasValue; - //_netId = id.GetValueOrDefault(); - //var obj = provider.GetNetworkIdentity(id); - //_objectName = obj != null ? obj.name : null; - //_rpcName = provider.GetRpcName(msg); - } - } -} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef deleted file mode 100644 index 34407c0d2..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "Mirage.Profiler", - "rootNamespace": "", - "references": [ - "GUID:b46779583a009f04ba9f5f31d0e7e6ac", - "GUID:30817c1a0e6d646d99c048fc403f5979" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta b/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta deleted file mode 100644 index 80dab7c3d..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/Mirage.Profiler.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6ff9f1c8e2ed4034baf80c43db7a3b6a -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs b/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs deleted file mode 100644 index 2d291be5e..000000000 --- a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs +++ /dev/null @@ -1,74 +0,0 @@ -//using Mirage.RemoteCalls; - -//namespace Mirage.NetworkProfiler -//{ -// /// -// /// Returns information about NetworkMessage -// /// -// public interface INetworkInfoProvider -// { -// uint? GetNetId(NetworkDiagnostics.MessageInfo info); -// NetworkIdentity GetNetworkIdentity(uint? netId); -// string GetRpcName(NetworkDiagnostics.MessageInfo info); -// } - -// public class NetworkInfoProvider : INetworkInfoProvider -// { -// private readonly NetworkWorld _world; - -// public NetworkInfoProvider(NetworkWorld world) -// { -// _world = world; -// } - -// public uint? GetNetId(NetworkDiagnostics.MessageInfo info) -// { -// switch (info.message) -// { -// case RpcMessage msg: return msg.NetId; -// case RpcWithReplyMessage msg: return msg.NetId; -// case SpawnMessage msg: return msg.NetId; -// case RemoveAuthorityMessage msg: return msg.NetId; -// case ObjectDestroyMessage msg: return msg.NetId; -// case ObjectHideMessage msg: return msg.NetId; -// case UpdateVarsMessage msg: return msg.NetId; -// default: return default; -// } -// } - -// public NetworkIdentity GetNetworkIdentity(uint? netId) -// { -// if (!netId.HasValue) -// return null; - -// if (_world == null) -// return null; - -// return _world.TryGetIdentity(netId.Value, out var identity) -// ? identity -// : null; -// } - -// public string GetRpcName(NetworkDiagnostics.MessageInfo info) -// { -// switch (info.message) -// { -// case RpcMessage msg: -// return GetRpcName(msg.NetId, msg.FunctionIndex); -// case RpcWithReplyMessage msg: -// return GetRpcName(msg.NetId, msg.FunctionIndex); -// default: return string.Empty; -// } -// } - -// private string GetRpcName(uint netId, int functionIndex) -// { -// var identity = GetNetworkIdentity(netId); -// if (identity == null) -// return string.Empty; - -// var rpc = identity.RemoteCallCollection.GetAbsolute(functionIndex); -// return rpc.Name; -// } -// } -//} diff --git a/Assets/FishNet/Runtime/Profiler/package.json b/Assets/FishNet/Runtime/Profiler/package.json deleted file mode 100644 index 57e54d9d0..000000000 --- a/Assets/FishNet/Runtime/Profiler/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "com.fishnet.fishnet-profiler", - "displayName": "FishNet Profiler", - "version": "1.0.0", - "unity": "2022.3", - "description": "Network profiler for FishNet", - "author": "FishNet", - "dependencies": { - "com.unity.profiling.core": "1.0.2" - }, - "samples": [] -} diff --git a/Assets/FishNet/Runtime/Profiler/package.json.meta b/Assets/FishNet/Runtime/Profiler/package.json.meta deleted file mode 100644 index bb32fde1b..000000000 --- a/Assets/FishNet/Runtime/Profiler/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 2c236d885d1e08b41870190b5e9f0d37 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FishNet/Runtime/Transporting/EventStructures.cs b/Assets/FishNet/Runtime/Transporting/EventStructures.cs index bbbfc83ed..707d6f081 100644 --- a/Assets/FishNet/Runtime/Transporting/EventStructures.cs +++ b/Assets/FishNet/Runtime/Transporting/EventStructures.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using FishNet.Object; namespace FishNet.Transporting { @@ -95,6 +96,25 @@ public ClientReceivedDataArgs(ArraySegment data, Channel channel, int tran TransportIndex = transportIndex; } } + + /// + /// Container about data received on the local client. + /// + public struct PacketProcessingArgs + { + public NetworkBehaviour NetworkBehaviour; + + public PacketId PacketId; + + public int DataLength; + + public PacketProcessingArgs(NetworkBehaviour nb, PacketId packetId, int dataLength) + { + NetworkBehaviour = nb; + PacketId = packetId; + DataLength = dataLength; + } + } diff --git a/Assets/FishNet/Runtime/Profiler.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling.meta diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs similarity index 74% rename from Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs index 8bd5b2b39..ea72798e3 100644 --- a/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; +using FishNet.Transporting; using Unity.Profiling; using UnityEngine; -namespace Mirage.NetworkProfiler +namespace FishNet.Utility.Performance.Profiling { internal class CountRecorder { @@ -28,25 +29,27 @@ public CountRecorder(object instance, /*INetworkInfoProvider provider,*/ Profile _frames = new Frames(); } - public void OnMessage(/*NetworkDiagnostics.MessageInfo obj*/) + public void OnMessage(PacketProcessingArgs args) { -// // using the profiler-window branch of mirage to allow NetworkDiagnostics to say which server/client is sent the event -//#if MIRAGE_DIAGNOSTIC_INSTANCE -// if (obj.instance != _instance) -// return; -//#endif -// // dont record anything if frame index is -1 -// // this normally means the profiler has not been activated yet -// if (_frameIndex == -1) -// return; + // dont record anything if frame index is -1 + // this normally means the profiler has not been activated yet + if (_frameIndex == -1) + return; -// _count += obj.count; -// _bytes += obj.bytes * obj.count; + _count ++; + _bytes += args.DataLength; -// var frame = _frames.GetFrame(_frameIndex); -// frame.Messages.Add(new MessageInfo(obj, _provider, frame.Messages.Count)); -// frame.Bytes++; + var frame = _frames.GetFrame(_frameIndex); + frame.Messages.Add( + new PacketInfo( + new PacketInfoProvider(), + args.NetworkBehaviour?.name, + args.PacketId, + args.DataLength, + 1, + frame.Messages.Count)); + frame.Bytes+= args.DataLength; } public void EndFrame(int frameIndex) diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/CountRecorder.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Counters.cs similarity index 95% rename from Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Counters.cs index 8590b6f8c..aecffbd05 100644 --- a/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Counters.cs @@ -1,6 +1,7 @@ +using Fishnet.NetworkProfiler; using Unity.Profiling; -namespace Mirage.NetworkProfiler +namespace FishNet.Utility.Performance.Profiling { internal static class Counters { diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Counters.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/Counters.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Counters.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Frame.cs similarity index 90% rename from Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Frame.cs index 57ebd30da..da0be4c95 100644 --- a/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Frame.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Mirage.NetworkProfiler +namespace FishNet.Utility.Performance.Profiling { [System.Serializable] public class Frames : IEnumerable @@ -38,7 +38,7 @@ internal void ValidateSize() [System.Serializable] public class Frame { - public List Messages = new List(); + public List Messages = new List(); public int Bytes; } } diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Frame.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/Frame.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Frame.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Names.cs similarity index 94% rename from Assets/FishNet/Runtime/Profiler/Runtime/Names.cs rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Names.cs index be0627e1e..6f849d910 100644 --- a/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Names.cs @@ -1,4 +1,4 @@ -namespace Mirage.NetworkProfiler +namespace FishNet.Utility.Performance.Profiling { public static class Names { @@ -10,7 +10,7 @@ public static class Names public const string CHARACTER_COUNT_TOOLTIP = "Number of players with spawned GameObjects"; public const string OBJECT_COUNT = "Object Count"; - public const string OBJECT_COUNT_TOOLTIP = "Number of NetworkIdentities spawned on the server"; + public const string OBJECT_COUNT_TOOLTIP = "Number of NetworkObjects spawned"; public const string SENT_COUNT = "Sent Messages"; public const string SENT_BYTES = "Sent Bytes"; diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/Names.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/Names.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/Names.cs.meta diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/NetworkProfilerRecorder.cs similarity index 64% rename from Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/NetworkProfilerRecorder.cs index 027b50975..7e4768b1b 100644 --- a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/NetworkProfilerRecorder.cs @@ -1,29 +1,24 @@ -//using Mirage.Logging; -using UnityEngine; +using UnityEngine; using System.Linq; +using FishNet.Managing.Client; +using FishNet.Managing.Server; +using FishNet.Transporting; #if UNITY_EDITOR using UnityEditorInternal; #endif -namespace Mirage.NetworkProfiler +namespace FishNet.Utility.Performance.Profiling { [DefaultExecutionOrder(int.MaxValue)] // last public class NetworkProfilerRecorder : MonoBehaviour { - //private static readonly ILogger logger = LogFactory.GetLogger(); - // singleton because unity only has 1 profiler public static NetworkProfilerRecorder Instance { get; private set; } - //public NetworkServer Server; - //public NetworkClient Client; - - /// - /// instance being used for profiler - /// - private static object instance; + public ClientManager Client; + public ServerManager Server; internal static CountRecorder _sentCounter; internal static CountRecorder _receivedCounter; @@ -44,17 +39,20 @@ private void Start() Instance = this; DontDestroyOnLoad(this); - //if (Server != null) - //{ - // Server.Started.AddListener(ServerStarted); - // Server.Stopped.AddListener(ServerStopped); - //} + // if (Server != null) + // { + // Server.; + // Server.Stopped.AddListener(ServerStopped); + // } + if (Client == null) + { + Client = InstanceFinder.ClientManager; + } - //if (Client != null) - //{ - // Client.Started.AddListener(ClientStarted); - // Client.Disconnected.AddListener(ClientStopped); - //} + if (Client != null) + { + Client.OnClientConnectionState += ClientConnectionStateChanged; + } } private void OnDestroy() @@ -84,19 +82,24 @@ private void ServerStarted() //NetworkDiagnostics.OutMessageEvent += _sentCounter.OnMessage; } - private void ClientStarted() + private void ClientConnectionStateChanged(ClientConnectionStateArgs args) { - //if (instance != null) - //{ - // logger.LogWarning($"Already started profiler for different Instance:{instance}"); - // return; - //} - //instance = Client; + switch (args.ConnectionState) + { + case LocalConnectionState.Started: + ClientStarted(); + break; + case LocalConnectionState.Stopped: + ClientStopped(); + break; + } + } - //var provider = new NetworkInfoProvider(Client.World); - //_sentCounter = new CountRecorder(Client, provider, Counters.SentCount, Counters.SentBytes, Counters.SentPerSecond); - //_receivedCounter = new CountRecorder(Client, provider, Counters.ReceiveCount, Counters.ReceiveBytes, Counters.ReceivePerSecond); - //NetworkDiagnostics.InMessageEvent += _receivedCounter.OnMessage; + private void ClientStarted() + { + _sentCounter = new CountRecorder(Client, Counters.ReceiveCount, Counters.ReceiveBytes, Counters.ReceivePerSecond); + _receivedCounter = new CountRecorder(Client, Counters.ReceiveCount, Counters.ReceiveBytes, Counters.ReceivePerSecond); + Client.OnPacketRead += _receivedCounter.OnMessage; //NetworkDiagnostics.OutMessageEvent += _sentCounter.OnMessage; } @@ -108,11 +111,8 @@ private void ServerStopped() private void ClientStopped(/*ClientStoppedReason _*/) { - //if (instance == (object)Client) - // instance = null; - - //_receivedCounter = null; - //_sentCounter = null; + _receivedCounter = null; + _sentCounter = null; } private void LateUpdate() @@ -148,13 +148,15 @@ private void LateUpdate() /// private void SampleCounts() { - //if (instance == (object)Server) - //{ - // Counters.AllPlayersCount.Sample(Server.AllPlayers.Count); - // Counters.AuthenticatedPlayersCount.Sample(Server.AuthenticatedPlayers.Count); - // Counters.CharacterCount.Sample(Server.AuthenticatedPlayers.Count(x => x.Identity != null)); - // Counters.ObjectCount.Sample(Server.World.SpawnedIdentities.Count); - //} + if (Client != null) + { + Counters.AllPlayersCount.Sample(Client.Clients.Count); + Counters.ObjectCount.Sample(Client.Objects.Spawned.Count); + } else if (Server != null) + { + Counters.AllPlayersCount.Sample(Server.Clients.Count); + Counters.ObjectCount.Sample(Server.Objects.Spawned.Count); + } } /// @@ -163,11 +165,16 @@ private void SampleCounts() /// private void SampleMessages(int frame) { - if (instance == null) - return; - _sentCounter.EndFrame(frame); - _receivedCounter.EndFrame(frame); + if (_sentCounter != null) + { + _sentCounter.EndFrame(frame); + } + + if (_receivedCounter != null) + { + _receivedCounter.EndFrame(frame); + } AfterSample?.Invoke(frame); } } diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/NetworkProfilerRecorder.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/NetworkProfilerRecorder.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/NetworkProfilerRecorder.cs.meta diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs new file mode 100644 index 000000000..d354d9561 --- /dev/null +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs @@ -0,0 +1,39 @@ +using FishNet.Transporting; +using UnityEngine; + +namespace FishNet.Utility.Performance.Profiling +{ + [System.Serializable] + public class PacketInfo + { + /// + /// Order message was sent/received in frame + /// + [SerializeField] private int _order; + [SerializeField] private int _length; + [SerializeField] private int _count; + [SerializeField] private int _packetId; + [SerializeField] private string _objectName; + [SerializeField] private string _rpcName; + + public int Order => _order; + public int Bytes => _length; + public int Count => _count; + public int TotalBytes => Bytes * Count; + public string ObjectName => _objectName; + public string PacketIdName => ((PacketId)_packetId).ToString(); + public string RpcName => _rpcName; + + public PacketInfo(IPacketInfoProvider provider, string objectName, PacketId packetId, int length, int count, int order) + { + _order = order; + _length = length; + _count = count; + _packetId = (int)packetId; + _objectName = objectName; + // var obj = provider.GetNetworkIdentity(id); + // _objectName = obj != null ? obj.name : null; + // _rpcName = provider.GetRpcName(msg); + } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/MessageInfo.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs.meta diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs new file mode 100644 index 000000000..480fdba09 --- /dev/null +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs @@ -0,0 +1,72 @@ +namespace FishNet.Utility.Performance.Profiling +{ + /// + /// Returns information about NetworkMessage + /// + public interface IPacketInfoProvider + { + // uint? GetNetId(NetworkDiagnostics.MessageInfo info); + // NetworkIdentity GetNetworkIdentity(uint? netId); + // string GetRpcName(NetworkDiagnostics.MessageInfo info); + } + + public class PacketInfoProvider : IPacketInfoProvider + { + // private readonly NetworkWorld _world; + // + // public PacketInfoProvider(NetworkWorld world) + // { + // _world = world; + // } + // + // public uint? GetNetId(NetworkDiagnostics.MessageInfo info) + // { + // switch (info.message) + // { + // case RpcMessage msg: return msg.NetId; + // case RpcWithReplyMessage msg: return msg.NetId; + // case SpawnMessage msg: return msg.NetId; + // case RemoveAuthorityMessage msg: return msg.NetId; + // case ObjectDestroyMessage msg: return msg.NetId; + // case ObjectHideMessage msg: return msg.NetId; + // case UpdateVarsMessage msg: return msg.NetId; + // default: return default; + // } + // } + // + // public NetworkIdentity GetNetworkIdentity(uint? netId) + // { + // if (!netId.HasValue) + // return null; + // + // if (_world == null) + // return null; + // + // return _world.TryGetIdentity(netId.Value, out var identity) + // ? identity + // : null; + // } + // + // public string GetRpcName(NetworkDiagnostics.MessageInfo info) + // { + // switch (info.message) + // { + // case RpcMessage msg: + // return GetRpcName(msg.NetId, msg.FunctionIndex); + // case RpcWithReplyMessage msg: + // return GetRpcName(msg.NetId, msg.FunctionIndex); + // default: return string.Empty; + // } + // } + // + // private string GetRpcName(uint netId, int functionIndex) + // { + // var identity = GetNetworkIdentity(netId); + // if (identity == null) + // return string.Empty; + // + // var rpc = identity.RemoteCallCollection.GetAbsolute(functionIndex); + // return rpc.Name; + // } + } +} diff --git a/Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs.meta similarity index 100% rename from Assets/FishNet/Runtime/Profiler/Runtime/NetworkInfoProvider.cs.meta rename to Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs.meta From ed5e7dc71f874cbf3dc9ec602330b4ed48033e02 Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Sun, 29 Jun 2025 23:33:51 -0400 Subject: [PATCH 04/14] Hack in property names lulz --- .../Editor/Profiling/Messages/Columns.cs | 14 +-- .../Runtime/Managing/Client/ClientManager.cs | 2 +- .../Managing/Client/Object/ClientObjects.cs | 8 +- .../Runtime/Object/NetworkBehaviour.RPCs.cs | 13 +++ Assets/FishNet/Runtime/Serializing/Reader.cs | 14 +++ .../Runtime/Transporting/EventStructures.cs | 5 +- .../Performance/Profiling/CountRecorder.cs | 6 +- .../Performance/Profiling/PacketInfo.cs | 12 +-- .../Profiling/PacketInfoProvider.cs | 95 ++++++++++++++++--- 9 files changed, 134 insertions(+), 35 deletions(-) diff --git a/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs index 7b32bdd5a..4ab5c088e 100644 --- a/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs @@ -8,7 +8,7 @@ internal sealed class Columns : IEnumerable { private const int EXPAND_WIDTH = 25; private const int FULL_NAME_WIDTH = 300; - private const int NAME_WIDTH = 150; + private const int NAME_WIDTH = 450; private const int OTHER_WIDTH = 100; private readonly ColumnInfo[] _columns; @@ -20,7 +20,7 @@ internal sealed class Columns : IEnumerable public readonly ColumnInfo BytesPerMessage; //public readonly ColumnInfo NetId; public readonly ColumnInfo ObjectName; - //public readonly ColumnInfo RpcName; + public readonly ColumnInfo PropertyName; public Columns() { @@ -44,10 +44,10 @@ public Columns() ObjectName = new ColumnInfo("GameObject Name", NAME_WIDTH, x => x.ObjectName); ObjectName.AddSort(null, m => m.ObjectName); - // RpcName = new ColumnInfo("RPC Name (hover for full name)", FULL_NAME_WIDTH, x => RpcShortName(x.RpcName)); - // RpcName.AddSort(null, m => m.RpcName); - // // full name in tooltip - // RpcName.AddToolTip(m => m.RpcName); + PropertyName = new ColumnInfo("Prop Name (hover for full name)", FULL_NAME_WIDTH, x => RpcShortName(x.RpcName)); + PropertyName.AddSort(null, m => m.RpcName); + // full name in tooltip + PropertyName.AddToolTip(m => m.RpcName); _columns = new ColumnInfo[] { @@ -58,7 +58,7 @@ public Columns() BytesPerMessage, //NetId, ObjectName, - // RpcName, + PropertyName, }; } diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index f95fd5730..94a710b21 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -405,7 +405,7 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal reader.Initialize(NetworkManager.TransportManager.ProcessIntermediateIncoming(fullMessage, true), NetworkManager, dataSource); else reader.Initialize(fullMessage, NetworkManager, dataSource); - OnPacketRead?.Invoke(new PacketProcessingArgs(null, PacketId.Split, expectedMessages*1500)); + OnPacketRead?.Invoke(new PacketProcessingArgs(null, -1, PacketId.Split, expectedMessages*1500)); } //Not split. else diff --git a/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs b/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs index d43e3b933..cdc8a6da9 100644 --- a/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs +++ b/Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs @@ -333,6 +333,7 @@ internal void ParseSyncType(PooledReader reader, bool isSyncObject, Channel chan if (nb != null) { + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (int)reader.PeekByte(), (PacketId)packetId, dataLength)); /* Length of data to be read for syncvars. * This is important because syncvars are never * a set length and data must be read through completion. @@ -340,7 +341,6 @@ internal void ParseSyncType(PooledReader reader, bool isSyncObject, Channel chan * when another packet starts is by including the length. */ if (dataLength > 0) nb.OnSyncType(reader, dataLength, isSyncObject); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (PacketId)packetId, dataLength)); } else { @@ -376,8 +376,8 @@ internal void ParseReconcileRpc(PooledReader reader, Channel channel) if (nb != null) { + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (int)nb.PeekRpcHash(reader), PacketId.Reconcile, dataLength)); nb.OnReconcileRpc(null, reader, channel); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.Reconcile, dataLength)); } else SkipDataLength((ushort)PacketId.ObserversRpc, reader, dataLength); @@ -395,8 +395,8 @@ internal void ParseObserversRpc(PooledReader reader, Channel channel) if (nb != null) { + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (int)nb.PeekRpcHash(reader), PacketId.ObserversRpc, dataLength)); nb.OnObserversRpc(null, reader, channel); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.ObserversRpc, dataLength)); } else SkipDataLength((ushort)PacketId.ObserversRpc, reader, dataLength); @@ -413,8 +413,8 @@ internal void ParseTargetRpc(PooledReader reader, Channel channel) if (nb != null) { + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, (int)nb.PeekRpcHash(reader), PacketId.TargetRpc, dataLength)); nb.OnTargetRpc(null, reader, channel); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, PacketId.TargetRpc, dataLength)); } else SkipDataLength((ushort)PacketId.TargetRpc, reader, dataLength); diff --git a/Assets/FishNet/Runtime/Object/NetworkBehaviour.RPCs.cs b/Assets/FishNet/Runtime/Object/NetworkBehaviour.RPCs.cs index 733292579..88d81f46e 100644 --- a/Assets/FishNet/Runtime/Object/NetworkBehaviour.RPCs.cs +++ b/Assets/FishNet/Runtime/Object/NetworkBehaviour.RPCs.cs @@ -165,6 +165,19 @@ public void ClearBuffedRpcs() bRpc.Writer.Store(); _bufferedRpcs.Clear(); } + + /// + /// Reads a RPC hash. + /// + /// + /// + internal uint PeekRpcHash(PooledReader reader) + { + if (_rpcHashSize == 1) + return reader.PeekByte(); + else + return reader.PeekUInt16(); + } /// /// Reads a RPC hash. diff --git a/Assets/FishNet/Runtime/Serializing/Reader.cs b/Assets/FishNet/Runtime/Serializing/Reader.cs index 077d83acd..131e18dd1 100644 --- a/Assets/FishNet/Runtime/Serializing/Reader.cs +++ b/Assets/FishNet/Runtime/Serializing/Reader.cs @@ -266,6 +266,20 @@ internal byte PeekByte() { return _buffer[Position]; } + + /// + /// Returns the next uint16 to be read. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal ushort PeekUInt16() + { + ushort result = 0; + result |= _buffer[Position]; + result |= (ushort)(_buffer[Position+1] << 8); + + return result; + } /// /// Skips a number of bytes in the reader. diff --git a/Assets/FishNet/Runtime/Transporting/EventStructures.cs b/Assets/FishNet/Runtime/Transporting/EventStructures.cs index 707d6f081..cab273f0f 100644 --- a/Assets/FishNet/Runtime/Transporting/EventStructures.cs +++ b/Assets/FishNet/Runtime/Transporting/EventStructures.cs @@ -108,11 +108,14 @@ public struct PacketProcessingArgs public int DataLength; - public PacketProcessingArgs(NetworkBehaviour nb, PacketId packetId, int dataLength) + public int PropertyHash; + + public PacketProcessingArgs(NetworkBehaviour nb, int propertyHash, PacketId packetId, int dataLength) { NetworkBehaviour = nb; PacketId = packetId; DataLength = dataLength; + PropertyHash = propertyHash; } } diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs index ea72798e3..2e3954e45 100644 --- a/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/CountRecorder.cs @@ -43,11 +43,7 @@ public void OnMessage(PacketProcessingArgs args) var frame = _frames.GetFrame(_frameIndex); frame.Messages.Add( new PacketInfo( - new PacketInfoProvider(), - args.NetworkBehaviour?.name, - args.PacketId, - args.DataLength, - 1, + args, frame.Messages.Count)); frame.Bytes+= args.DataLength; } diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs index d354d9561..00ec94468 100644 --- a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs @@ -24,16 +24,16 @@ public class PacketInfo public string PacketIdName => ((PacketId)_packetId).ToString(); public string RpcName => _rpcName; - public PacketInfo(IPacketInfoProvider provider, string objectName, PacketId packetId, int length, int count, int order) + public PacketInfo(PacketProcessingArgs args, int order) { _order = order; - _length = length; - _count = count; - _packetId = (int)packetId; - _objectName = objectName; + _length = args.DataLength; + _count = 1; + _packetId = (int)args.PacketId; + _objectName = args.NetworkBehaviour.name; // var obj = provider.GetNetworkIdentity(id); // _objectName = obj != null ? obj.name : null; - // _rpcName = provider.GetRpcName(msg); + _rpcName = PacketInfoProvider.GetPropertyName(args.NetworkBehaviour, args.PropertyHash, args.PacketId); } } } diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs index 480fdba09..fd3a27a5c 100644 --- a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs @@ -1,16 +1,12 @@ -namespace FishNet.Utility.Performance.Profiling +using FishNet.Object; +using FishNet.Object.Prediction; +using FishNet.Object.Synchronizing; +using FishNet.Transporting; + +namespace FishNet.Utility.Performance.Profiling { - /// - /// Returns information about NetworkMessage - /// - public interface IPacketInfoProvider - { - // uint? GetNetId(NetworkDiagnostics.MessageInfo info); - // NetworkIdentity GetNetworkIdentity(uint? netId); - // string GetRpcName(NetworkDiagnostics.MessageInfo info); - } - public class PacketInfoProvider : IPacketInfoProvider + public static class PacketInfoProvider { // private readonly NetworkWorld _world; // @@ -68,5 +64,82 @@ public class PacketInfoProvider : IPacketInfoProvider // var rpc = identity.RemoteCallCollection.GetAbsolute(functionIndex); // return rpc.Name; // } + + public static string GetPropertyName(NetworkBehaviour nb, int propertyHash, PacketId packetId) + { + string res = ""; + switch (packetId) + { + case PacketId.SyncObject: + case PacketId.SyncVar: + int syncTypeCount = 0; + bool foundSyncType = false; + foreach (var fieldInfo in nb.GetType().GetFields()) + { + foreach (var customAttribute in fieldInfo.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == typeof(SyncVarAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(SyncObjectAttribute).FullName) + { + if (syncTypeCount == propertyHash) + { + res = fieldInfo.Name; + foundSyncType = true; + break; + } + syncTypeCount++; + } + } + + if (foundSyncType) + { + break; + } + } + break; + case PacketId.Reconcile: + case PacketId.ObserversRpc: + case PacketId.TargetRpc: + int rpcCount = 0; + bool foundRpc = false; + // Iterate the replicates first, that's what the codegen does + foreach (var fieldInfo in nb.GetType().GetMethods()) + { + foreach (var customAttribute in fieldInfo.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == typeof(ReplicateAttribute).FullName) + { + rpcCount++; + } + } + } + foreach (var methodInfo in nb.GetType().GetMethods()) + { + foreach (var customAttribute in methodInfo.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == typeof(ObserversRpcAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(TargetRpcAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(ReconcileAttribute).FullName) + { + if (rpcCount == propertyHash) + { + res = methodInfo.Name; + foundRpc = true; + break; + } + rpcCount++; + } + } + + if (foundRpc) + { + break; + } + } + break; + } + + return res; + } } } From ab4fee0c5cc1579d83aab3a3a8d2129b9af5f13c Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Sun, 29 Jun 2025 23:50:51 -0400 Subject: [PATCH 05/14] Tweak sizes --- Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs index 4ab5c088e..9b64d381b 100644 --- a/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs +++ b/Assets/FishNet/Runtime/Editor/Profiling/Messages/Columns.cs @@ -7,6 +7,7 @@ namespace Fishnet.NetworkProfiler.ModuleGUI.Messages internal sealed class Columns : IEnumerable { private const int EXPAND_WIDTH = 25; + private const int SHORT_NAME_WIDTH = 75; private const int FULL_NAME_WIDTH = 300; private const int NAME_WIDTH = 450; private const int OTHER_WIDTH = 100; @@ -26,7 +27,7 @@ public Columns() { Expand = new ColumnInfo("+", EXPAND_WIDTH, x => ""); - FullName = new ColumnInfo("Packet Type", FULL_NAME_WIDTH, x => x.PacketIdName); + FullName = new ColumnInfo("Packet Type", SHORT_NAME_WIDTH, x => x.PacketIdName); FullName.AddSort(m => m.Name, m => m.PacketIdName); TotalBytes = new ColumnInfo("Total Bytes", OTHER_WIDTH, x => x.TotalBytes.ToString()); From 32601175d3bf09cd4eef15c92e9e2f7ffc353c1e Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Mon, 30 Jun 2025 00:09:59 -0400 Subject: [PATCH 06/14] Cache the type names --- .../Profiling/PacketInfoProvider.cs | 150 +++++++----------- 1 file changed, 56 insertions(+), 94 deletions(-) diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs index fd3a27a5c..95d4820a8 100644 --- a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfoProvider.cs @@ -1,4 +1,6 @@ -using FishNet.Object; +using System; +using System.Collections.Generic; +using FishNet.Object; using FishNet.Object.Prediction; using FishNet.Object.Synchronizing; using FishNet.Transporting; @@ -8,62 +10,8 @@ namespace FishNet.Utility.Performance.Profiling public static class PacketInfoProvider { - // private readonly NetworkWorld _world; - // - // public PacketInfoProvider(NetworkWorld world) - // { - // _world = world; - // } - // - // public uint? GetNetId(NetworkDiagnostics.MessageInfo info) - // { - // switch (info.message) - // { - // case RpcMessage msg: return msg.NetId; - // case RpcWithReplyMessage msg: return msg.NetId; - // case SpawnMessage msg: return msg.NetId; - // case RemoveAuthorityMessage msg: return msg.NetId; - // case ObjectDestroyMessage msg: return msg.NetId; - // case ObjectHideMessage msg: return msg.NetId; - // case UpdateVarsMessage msg: return msg.NetId; - // default: return default; - // } - // } - // - // public NetworkIdentity GetNetworkIdentity(uint? netId) - // { - // if (!netId.HasValue) - // return null; - // - // if (_world == null) - // return null; - // - // return _world.TryGetIdentity(netId.Value, out var identity) - // ? identity - // : null; - // } - // - // public string GetRpcName(NetworkDiagnostics.MessageInfo info) - // { - // switch (info.message) - // { - // case RpcMessage msg: - // return GetRpcName(msg.NetId, msg.FunctionIndex); - // case RpcWithReplyMessage msg: - // return GetRpcName(msg.NetId, msg.FunctionIndex); - // default: return string.Empty; - // } - // } - // - // private string GetRpcName(uint netId, int functionIndex) - // { - // var identity = GetNetworkIdentity(netId); - // if (identity == null) - // return string.Empty; - // - // var rpc = identity.RemoteCallCollection.GetAbsolute(functionIndex); - // return rpc.Name; - // } + private static Dictionary> SyncTypeNamesCache = new(); + private static Dictionary> RpcNamesCache = new(); public static string GetPropertyName(NetworkBehaviour nb, int propertyHash, PacketId packetId) { @@ -72,69 +20,83 @@ public static string GetPropertyName(NetworkBehaviour nb, int propertyHash, Pack { case PacketId.SyncObject: case PacketId.SyncVar: - int syncTypeCount = 0; - bool foundSyncType = false; - foreach (var fieldInfo in nb.GetType().GetFields()) + if (SyncTypeNamesCache.TryGetValue(nb.GetType(), out var syncTypeNames)) { - foreach (var customAttribute in fieldInfo.CustomAttributes) + if (propertyHash < syncTypeNames.Count) { - if (customAttribute.AttributeType.FullName == typeof(SyncVarAttribute).FullName || - customAttribute.AttributeType.FullName == typeof(SyncObjectAttribute).FullName) + res = syncTypeNames[propertyHash]; + } + } + else + { + List typeNamesList = new(); + int syncTypeCount = 0; + foreach (var fieldInfo in nb.GetType().GetFields()) + { + foreach (var customAttribute in fieldInfo.CustomAttributes) { - if (syncTypeCount == propertyHash) + if (customAttribute.AttributeType.FullName == typeof(SyncVarAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(SyncObjectAttribute).FullName) { - res = fieldInfo.Name; - foundSyncType = true; - break; + if (syncTypeCount == propertyHash) + { + res = fieldInfo.Name; + } + syncTypeCount++; + typeNamesList.Add(fieldInfo.Name); } - syncTypeCount++; } } - if (foundSyncType) - { - break; - } + SyncTypeNamesCache[nb.GetType()] = typeNamesList; } break; case PacketId.Reconcile: case PacketId.ObserversRpc: case PacketId.TargetRpc: - int rpcCount = 0; - bool foundRpc = false; - // Iterate the replicates first, that's what the codegen does - foreach (var fieldInfo in nb.GetType().GetMethods()) + if (RpcNamesCache.TryGetValue(nb.GetType(), out var rpcNames)) { - foreach (var customAttribute in fieldInfo.CustomAttributes) + if (propertyHash < rpcNames.Count) { - if (customAttribute.AttributeType.FullName == typeof(ReplicateAttribute).FullName) - { - rpcCount++; - } + res = rpcNames[propertyHash]; } } - foreach (var methodInfo in nb.GetType().GetMethods()) + else { - foreach (var customAttribute in methodInfo.CustomAttributes) + List rpcNamesList = new(); + int rpcCount = 0; + // Iterate the replicates first, that's what the codegen does + foreach (var methodInfo in nb.GetType().GetMethods()) { - if (customAttribute.AttributeType.FullName == typeof(ObserversRpcAttribute).FullName || - customAttribute.AttributeType.FullName == typeof(TargetRpcAttribute).FullName || - customAttribute.AttributeType.FullName == typeof(ReconcileAttribute).FullName) + foreach (var customAttribute in methodInfo.CustomAttributes) { - if (rpcCount == propertyHash) + if (customAttribute.AttributeType.FullName == typeof(ReplicateAttribute).FullName) { - res = methodInfo.Name; - foundRpc = true; - break; + rpcNamesList.Add(methodInfo.Name); + rpcCount++; } - rpcCount++; } } - - if (foundRpc) + foreach (var methodInfo in nb.GetType().GetMethods()) { - break; + foreach (var customAttribute in methodInfo.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == typeof(ObserversRpcAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(TargetRpcAttribute).FullName || + customAttribute.AttributeType.FullName == typeof(ReconcileAttribute).FullName) + { + if (rpcCount == propertyHash) + { + res = methodInfo.Name; + break; + } + rpcCount++; + rpcNamesList.Add(methodInfo.Name); + } + } } + + RpcNamesCache[nb.GetType()] = rpcNamesList; } break; } From e2fe351d4da8f5c591d8453d0f1ac454fa458a3d Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Mon, 30 Jun 2025 00:27:33 -0400 Subject: [PATCH 07/14] Bump version --- Assets/FishNet/VERSION.txt | 2 +- Assets/FishNet/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/FishNet/VERSION.txt b/Assets/FishNet/VERSION.txt index 03d4bc90f..4dcb6e64e 100644 --- a/Assets/FishNet/VERSION.txt +++ b/Assets/FishNet/VERSION.txt @@ -1 +1 @@ -3.11.18 \ No newline at end of file +3.11.19 \ No newline at end of file diff --git a/Assets/FishNet/package.json b/Assets/FishNet/package.json index c86b860a2..830b13cb2 100644 --- a/Assets/FishNet/package.json +++ b/Assets/FishNet/package.json @@ -1,6 +1,6 @@ { "name": "com.firstgeargames.fishnet", - "version": "3.11.18", + "version": "3.11.19", "displayName": "FishNet: Networking Evolved", "description": "A feature-rich Unity networking solution aimed towards reliability, ease of use, efficiency, and flexibility.", "unity": "2021.3", From 13a16bb2c8099b617b27d1cffc471bc78925a1b1 Mon Sep 17 00:00:00 2001 From: zack-pahdo Date: Mon, 7 Jul 2025 16:53:14 -0400 Subject: [PATCH 08/14] Update ClientManager.cs --- Assets/FishNet/Runtime/Managing/Client/ClientManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index 94a710b21..c3388d711 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -104,7 +104,7 @@ public void SetRemoteServerTimeout(RemoteTimeoutType timeoutType, ushort duratio [SerializeField] private bool _changeFrameRate = true; /// - /// + /// /// [Tooltip("Maximum frame rate the client may run at. When as host this value runs at whichever is higher between client and server.")] [Range(1, NetworkManager.MAXIMUM_FRAMERATE)] @@ -405,7 +405,9 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal reader.Initialize(NetworkManager.TransportManager.ProcessIntermediateIncoming(fullMessage, true), NetworkManager, dataSource); else reader.Initialize(fullMessage, NetworkManager, dataSource); - OnPacketRead?.Invoke(new PacketProcessingArgs(null, -1, PacketId.Split, expectedMessages*1500)); + + NetworkBehaviour nb = reader.ReadNetworkBehaviour(); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, -1, PacketId.Split, expectedMessages*1500)); } //Not split. else From ae602e4cc5a487d55baec60cc57a90487fdb7f2c Mon Sep 17 00:00:00 2001 From: zack-pahdo Date: Mon, 7 Jul 2025 17:05:18 -0400 Subject: [PATCH 09/14] Update ClientManager.cs --- Assets/FishNet/Runtime/Managing/Client/ClientManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index c3388d711..c69c5dc01 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -406,8 +406,7 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal else reader.Initialize(fullMessage, NetworkManager, dataSource); - NetworkBehaviour nb = reader.ReadNetworkBehaviour(); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, -1, PacketId.Split, expectedMessages*1500)); + OnPacketRead?.Invoke(new PacketProcessingArgs(reader.ReadNetworkBehaviour(), -1, PacketId.Split, expectedMessages*1500)); } //Not split. else From ab88c9dc01131323d457d3d76fe46214c426ca51 Mon Sep 17 00:00:00 2001 From: zack-pahdo Date: Tue, 8 Jul 2025 08:32:53 -0400 Subject: [PATCH 10/14] Revert "Update ClientManager.cs" This reverts commit ae602e4cc5a487d55baec60cc57a90487fdb7f2c. --- Assets/FishNet/Runtime/Managing/Client/ClientManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index c69c5dc01..c3388d711 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -406,7 +406,8 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal else reader.Initialize(fullMessage, NetworkManager, dataSource); - OnPacketRead?.Invoke(new PacketProcessingArgs(reader.ReadNetworkBehaviour(), -1, PacketId.Split, expectedMessages*1500)); + NetworkBehaviour nb = reader.ReadNetworkBehaviour(); + OnPacketRead?.Invoke(new PacketProcessingArgs(nb, -1, PacketId.Split, expectedMessages*1500)); } //Not split. else From 374725f70aea1dbef8b137b497bd7cb7005bab05 Mon Sep 17 00:00:00 2001 From: zack-pahdo Date: Tue, 8 Jul 2025 08:32:58 -0400 Subject: [PATCH 11/14] Revert "Update ClientManager.cs" This reverts commit 13a16bb2c8099b617b27d1cffc471bc78925a1b1. --- Assets/FishNet/Runtime/Managing/Client/ClientManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs index c3388d711..94a710b21 100644 --- a/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs +++ b/Assets/FishNet/Runtime/Managing/Client/ClientManager.cs @@ -104,7 +104,7 @@ public void SetRemoteServerTimeout(RemoteTimeoutType timeoutType, ushort duratio [SerializeField] private bool _changeFrameRate = true; /// - /// + /// /// [Tooltip("Maximum frame rate the client may run at. When as host this value runs at whichever is higher between client and server.")] [Range(1, NetworkManager.MAXIMUM_FRAMERATE)] @@ -405,9 +405,7 @@ internal void ParseReader(PooledReader reader, Channel channel, bool print = fal reader.Initialize(NetworkManager.TransportManager.ProcessIntermediateIncoming(fullMessage, true), NetworkManager, dataSource); else reader.Initialize(fullMessage, NetworkManager, dataSource); - - NetworkBehaviour nb = reader.ReadNetworkBehaviour(); - OnPacketRead?.Invoke(new PacketProcessingArgs(nb, -1, PacketId.Split, expectedMessages*1500)); + OnPacketRead?.Invoke(new PacketProcessingArgs(null, -1, PacketId.Split, expectedMessages*1500)); } //Not split. else From af51ddc35ae5087d22b22096b855148490dbc829 Mon Sep 17 00:00:00 2001 From: zack-pahdo Date: Tue, 8 Jul 2025 09:46:59 -0400 Subject: [PATCH 12/14] Fix NPE on profile from startup --- .../Utility/Performance/Profiling/PacketInfo.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs index 00ec94468..ec95a08a7 100644 --- a/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs +++ b/Assets/FishNet/Runtime/Utility/Performance/Profiling/PacketInfo.cs @@ -30,10 +30,13 @@ public PacketInfo(PacketProcessingArgs args, int order) _length = args.DataLength; _count = 1; _packetId = (int)args.PacketId; - _objectName = args.NetworkBehaviour.name; - // var obj = provider.GetNetworkIdentity(id); - // _objectName = obj != null ? obj.name : null; - _rpcName = PacketInfoProvider.GetPropertyName(args.NetworkBehaviour, args.PropertyHash, args.PacketId); + if (args.NetworkBehaviour != null) + { + _objectName = args.NetworkBehaviour.name; + // var obj = provider.GetNetworkIdentity(id); + // _objectName = obj != null ? obj.name : null; + _rpcName = PacketInfoProvider.GetPropertyName(args.NetworkBehaviour, args.PropertyHash, args.PacketId); + } } } } From 289f3edfb810368af95f553a4229af2dbcd2b455 Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Thu, 14 Aug 2025 14:26:56 -0400 Subject: [PATCH 13/14] Add profiling markers to the network iteration buffers --- Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs b/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs index a26c86dbc..e2ff249af 100644 --- a/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs +++ b/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs @@ -1008,6 +1008,7 @@ private void TryIterateData(bool incoming) { if (incoming) { + UnityEngine.Profiling.Profiler.BeginSample("Fishnet Iterate Incoming"); /* It's not possible for data to come in * more than once per frame but there could * be new data going out each tick, since @@ -1022,11 +1023,14 @@ private void TryIterateData(bool incoming) _networkManager.TransportManager.IterateIncoming(true); _networkManager.TransportManager.IterateIncoming(false); + UnityEngine.Profiling.Profiler.EndSample(); } else { + UnityEngine.Profiling.Profiler.BeginSample("Fishnet Iterate Outgoing"); _networkManager.TransportManager.IterateOutgoing(true); _networkManager.TransportManager.IterateOutgoing(false); + UnityEngine.Profiling.Profiler.EndSample(); } } From de60b0d23dbffd835e43fb8c232f51f499c5db8f Mon Sep 17 00:00:00 2001 From: Narindra Peaks Date: Thu, 14 Aug 2025 16:31:54 -0400 Subject: [PATCH 14/14] Tweak the iteration marker --- Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs b/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs index e2ff249af..868fe8b05 100644 --- a/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs +++ b/Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs @@ -1008,7 +1008,6 @@ private void TryIterateData(bool incoming) { if (incoming) { - UnityEngine.Profiling.Profiler.BeginSample("Fishnet Iterate Incoming"); /* It's not possible for data to come in * more than once per frame but there could * be new data going out each tick, since @@ -1021,6 +1020,7 @@ private void TryIterateData(bool incoming) return; _lastIncomingIterationFrame = frameCount; + UnityEngine.Profiling.Profiler.BeginSample("Fishnet Iterate Incoming"); _networkManager.TransportManager.IterateIncoming(true); _networkManager.TransportManager.IterateIncoming(false); UnityEngine.Profiling.Profiler.EndSample();