i(dot)imgur(dot)com/3j6VdgD.png
31317 netvars in 254 different tables. And they're all stored in an easily accessible interface.
Code:
m_NetVars["Table"]["Netvar"]
I am down for suggestions and/or a friendly competition between other people if they'd like. The implementation is left down to the user, most of the code is easily found.
Code:
std::unordered_map<std::string, std::unordered_map<std::string, size_t>> NetVars;
size_t store_props(const char* chGroupName, RecvTable* pTable)
{
size_t iOffset = 0;
for (auto i = 0; i < pTable->m_nProps; ++i)
{
auto pCurrentProp = &pTable->m_pProps[i];
auto pCurrentChild = pCurrentProp->m_pDataTable;
if (pCurrentChild != nullptr && pCurrentChild->m_nProps > 0)
{
auto iPropOffset = store_props(chGroupName, pCurrentChild);
if (iPropOffset != 0)
iOffset += static_cast<size_t>(pCurrentProp->m_Offset) + iPropOffset;
}
if ((NetVars[chGroupName][pCurrentProp->m_pVarName] <= 0) && (
pCurrentProp->GetType() == DPT_Float
|| pCurrentProp->GetType() == DPT_Int
|| pCurrentProp->GetType() == DPT_String
|| pCurrentProp->GetType() == DPT_Vector
|| pCurrentProp->GetType() == DPT_VectorXY))
{
NetVars[chGroupName][pCurrentProp->m_pVarName] = static_cast<size_t>(pCurrentProp->m_Offset) + iOffset;
}
}
return iOffset;
}
void dump_props()
{
C_ClientPropData* pClientData = G::interfaces.client->get_all_classes();
for (auto pData = pClientData; pData != nullptr; pData = pData->m_pNext)
{
store_props(pData->m_pRecvTable->m_pNetTableName, pData->m_pRecvTable);
}
}
Credits/Shoutouts: SENATOR and phage