Display compatible Tracy versions for bad protocols.

This commit is contained in:
Bartosz Taudul 2022-07-13 00:53:15 +02:00
parent b70321fe6a
commit 94444e2afb
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -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 );