From 67daff1452c65bb36640b5e6826c6e9153870ee6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 17 Jun 2019 19:45:47 +0200 Subject: [PATCH] Display list of broadcasting clients. --- profiler/src/main.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 2b058c3e..7287863e 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -26,6 +26,7 @@ #define STBI_ONLY_PNG #include "stb_image.h" +#include "../../common/TracyProtocol.hpp" #include "../../server/tracy_flat_hash_map.hpp" #include "../../server/tracy_pdqsort.h" #include "../../server/TracyBadVersion.hpp" @@ -458,6 +459,33 @@ int main( int argc, char** argv ) tracy::BadVersion( badVer ); } + if( !clients.empty() ) + { + ImGui::Separator(); + ImGui::TextUnformatted( "Available clients:" ); + ImGui::Separator(); + ImGui::Columns( 2 ); + for( auto& v : clients ) + { + const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion; + bool sel = false; + ImGuiSelectableFlags flags = ImGuiSelectableFlags_SpanAllColumns; + if( badProto ) flags |= ImGuiSelectableFlags_Disabled; + ImGui::Selectable( v.second.address.c_str(), &sel, flags ); + ImGui::NextColumn(); + if( badProto ) + { + tracy::TextDisabledUnformatted( v.second.procName.c_str() ); + } + else + { + ImGui::TextUnformatted( v.second.procName.c_str() ); + } + ImGui::NextColumn(); + } + ImGui::EndColumns(); + } + ImGui::End(); } else