From 94444e2afb5ea48ca4dfc7a103f2a309374e8564 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 13 Jul 2022 00:53:15 +0200 Subject: [PATCH] Display compatible Tracy versions for bad protocols. --- profiler/src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 610b408f..332bfa27 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -39,6 +39,7 @@ #include "../../server/TracyImGui.hpp" #include "../../server/TracyMouse.hpp" #include "../../server/TracyPrint.hpp" +#include "../../server/TracyProtoHistory.hpp" #include "../../server/TracyStorage.hpp" #include "../../server/TracyVersion.hpp" #include "../../server/TracyView.hpp" @@ -918,7 +919,21 @@ static void DrawContents() { tracy::TextColoredUnformatted( 0xFF0000FF, "Incompatible protocol!" ); ImGui::SameLine(); + auto ph = tracy::ProtocolHistory; ImGui::TextDisabled( "(used: %i, required: %i)", v.second.protocolVersion, tracy::ProtocolVersion ); + while( ph->protocol && ph->protocol != v.second.protocolVersion ) ph++; + if( ph->protocol ) + { + if( ph->maxVer ) + { + ImGui::TextDisabled( "Compatible Tracy versions: %i.%i.%i to %i.%i.%i", ph->minVer >> 16, ( ph->minVer >> 8 ) & 0xFF, ph->minVer & 0xFF, ph->maxVer >> 16, ( ph->maxVer >> 8 ) & 0xFF, ph->maxVer & 0xFF ); + } + else + { + ImGui::TextDisabled( "Compatible Tracy version: %i.%i.%i", ph->minVer >> 16, ( ph->minVer >> 8 ) & 0xFF, ph->minVer & 0xFF ); + } + } + ImGui::Separator(); } tracy::TextFocused( "IP:", v.second.address.c_str() ); tracy::TextFocused( "Port:", portstr );