Skip to content

Commit

Permalink
Add protocol -> version mapping table.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfpld committed Jul 12, 2022
1 parent 0624c59 commit b70321f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions profiler/build/win32/Tracy.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
<ClCompile Include="..\..\..\server\TracyMmap.cpp" />
<ClCompile Include="..\..\..\server\TracyMouse.cpp" />
<ClCompile Include="..\..\..\server\TracyPrint.cpp" />
<ClCompile Include="..\..\..\server\TracyProtoHistory.cpp" />
<ClCompile Include="..\..\..\server\TracySourceContents.cpp" />
<ClCompile Include="..\..\..\server\TracySourceTokenizer.cpp" />
<ClCompile Include="..\..\..\server\TracySourceView.cpp" />
Expand Down Expand Up @@ -244,6 +245,7 @@
<ClInclude Include="..\..\..\server\TracyMouse.hpp" />
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp" />
<ClInclude Include="..\..\..\server\TracyPrint.hpp" />
<ClInclude Include="..\..\..\server\TracyProtoHistory.hpp" />
<ClInclude Include="..\..\..\server\TracyShortPtr.hpp" />
<ClInclude Include="..\..\..\server\TracySlab.hpp" />
<ClInclude Include="..\..\..\server\TracySort.hpp" />
Expand Down
6 changes: 6 additions & 0 deletions profiler/build/win32/Tracy.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@
<ClCompile Include="..\..\..\server\TracyView_Ranges.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyProtoHistory.cpp">
<Filter>server</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\common\tracy_lz4.hpp">
Expand Down Expand Up @@ -656,6 +659,9 @@
<ClInclude Include="..\..\..\server\tracy_xxhash.h">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyProtoHistory.hpp">
<Filter>server</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Natvis Include="DebugVis.natvis" />
Expand Down
26 changes: 26 additions & 0 deletions server/TracyProtoHistory.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "TracyFileHeader.hpp"
#include "TracyProtoHistory.hpp"

namespace tracy
{

constexpr ProtocolHistory_t ProtocolHistoryArr[] = {
{ 57, FileVersion( 0, 8, 2 ) },
{ 56, FileVersion( 0, 8, 1 ) },
{ 55, FileVersion( 0, 8, 0 ) },
{ 46, FileVersion( 0, 7, 6 ), FileVersion( 0, 7, 8 ) },
{ 44, FileVersion( 0, 7, 5 ) },
{ 42, FileVersion( 0, 7, 3 ), FileVersion( 0, 7, 4 ) },
{ 40, FileVersion( 0, 7, 1 ), FileVersion( 0, 7, 2 ) },
{ 35, FileVersion( 0, 7, 0 ) },
{ 25, FileVersion( 0, 6, 2 ), FileVersion( 0, 6, 3 ) },
{ 24, FileVersion( 0, 6, 1 ) },
{ 23, FileVersion( 0, 6, 0 ) },
{ 14, FileVersion( 0, 5, 0 ) },
{ 1, FileVersion( 0, 4, 1 ) },
{}
};

const ProtocolHistory_t* ProtocolHistory = ProtocolHistoryArr;

}
20 changes: 20 additions & 0 deletions server/TracyProtoHistory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef __TRACYPROTOHISTORY_HPP__
#define __TRACYPROTOHISTORY_HPP__

#include <stdint.h>

namespace tracy
{

struct ProtocolHistory_t
{
uint32_t protocol;
uint32_t minVer;
uint32_t maxVer;
};

extern const ProtocolHistory_t* ProtocolHistory;

}

#endif

0 comments on commit b70321f

Please sign in to comment.