@@ -1561,65 +1561,54 @@ void CClientState::CheckUpdatingSteamResources()
15611561 }
15621562}
15631563
1564-
15651564// -----------------------------------------------------------------------------
15661565// Purpose: At a certain rate, this function will verify any unverified
15671566// file CRCs with the server.
15681567// -----------------------------------------------------------------------------
15691568void CClientState::CheckFileCRCsWithServer ()
15701569{
1571- // ! !FIXME! Stubbed this. Several reasons:
1572- // !
1573- // ! 1.) Removed the CRC functionality (because it was broken when we switched to use MD5's for hashes of
1574- // ! loose files, but the server only has CRC's of some files in the VPK headers.). Currently the only
1575- // ! supported pure server mode is "trusted source."
1576- // ! 2.) Sending MD5's of VPK's is a bit too restrictive for most use cases. For example, if a client
1577- // ! has an extra VPK for custom content, the server doesn't know what to do with it. Or if we
1578- // ! release an optional update, the VPK's might legitimately differ.
1579- // !
1580- // ! Rich has pointed out that we really need pure server client work to be something that the client
1581- // ! cannot easily bypass. Currently that is the case. But I need to ship the SteamPipe conversion now.
1582- // ! We can revisit pure server security after that has shipped.
1583- //
1584- // VPROF_( "CheckFileCRCsWithServer", 1, VPROF_BUDGETGROUP_OTHER_NETWORKING, false, BUDGETFLAG_CLIENT );
1585- // const float flBatchInterval = 1.0f / 5.0f;
1586- // const int nBatchSize = 5;
1587- //
1588- // // Don't do this yet..
1589- // if ( !m_bCheckCRCsWithServer )
1590- // return;
1591- //
1592- // if ( m_nSignonState != SIGNONSTATE_FULL )
1593- // return;
1594- //
1595- // // Only send a batch every so often.
1596- // float flCurTime = Plat_FloatTime();
1597- // if ( (flCurTime - m_flLastCRCBatchTime) < flBatchInterval )
1598- // return;
1599- //
1600- // m_flLastCRCBatchTime = flCurTime;
1601- //
1602- // CUnverifiedFileHash rgUnverifiedFiles[nBatchSize];
1603- // int count = g_pFileSystem->GetUnverifiedFileHashes( rgUnverifiedFiles, ARRAYSIZE( rgUnverifiedFiles ) );
1604- // if ( count == 0 )
1605- // return;
1606- //
1607- // // Send the messages to the server.
1608- // for ( int i=0; i < count; i++ )
1609- // {
1610- // CLC_FileCRCCheck crcCheck;
1611- // V_strncpy( crcCheck.m_szPathID, rgUnverifiedFiles[i].m_PathID, sizeof( crcCheck.m_szPathID ) );
1612- // V_strncpy( crcCheck.m_szFilename, rgUnverifiedFiles[i].m_Filename, sizeof( crcCheck.m_szFilename ) );
1613- // crcCheck.m_nFileFraction = rgUnverifiedFiles[i].m_nFileFraction;
1614- // crcCheck.m_MD5 = rgUnverifiedFiles[i].m_FileHash.m_md5contents;
1615- // crcCheck.m_CRCIOs = rgUnverifiedFiles[i].m_FileHash.m_crcIOSequence;
1616- // crcCheck.m_eFileHashType = rgUnverifiedFiles[i].m_FileHash.m_eFileHashType;
1617- // crcCheck.m_cbFileLen = rgUnverifiedFiles[i].m_FileHash.m_cbFileLen;
1618- // crcCheck.m_nPackFileNumber = rgUnverifiedFiles[i].m_FileHash.m_nPackFileNumber;
1619- // crcCheck.m_PackFileID = rgUnverifiedFiles[i].m_FileHash.m_PackFileID;
1620- //
1621- // m_NetChannel->SendNetMsg( crcCheck );
1622- // }
1570+ // See comment in filetracker.cpp to see why we can't send hashes for TF.
1571+ #if 0
1572+ VPROF_("CheckFileCRCsWithServer", 1, VPROF_BUDGETGROUP_OTHER_NETWORKING, false, BUDGETFLAG_CLIENT);
1573+ const float flBatchInterval = 1.0f / 5.0f;
1574+ const int nBatchSize = 5;
1575+
1576+ // Don't do this yet..
1577+ if (!m_bCheckCRCsWithServer)
1578+ return;
1579+
1580+ if (m_nSignonState != SIGNONSTATE_FULL)
1581+ return;
1582+
1583+ // Only send a batch every so often.
1584+ float flCurTime = Plat_FloatTime();
1585+ if ((flCurTime - m_flLastCRCBatchTime) < flBatchInterval)
1586+ return;
1587+
1588+ m_flLastCRCBatchTime = flCurTime;
1589+
1590+ CUnverifiedFileHash rgUnverifiedFiles[nBatchSize];
1591+ int count = g_pFileSystem->GetUnverifiedFileHashes(rgUnverifiedFiles, ARRAYSIZE(rgUnverifiedFiles));
1592+ if (count == 0)
1593+ return;
1594+
1595+ // Send the messages to the server.
1596+ for (int i = 0; i < count; i++)
1597+ {
1598+ CLC_FileCRCCheck crcCheck;
1599+ V_strncpy( crcCheck.m_szPathID, rgUnverifiedFiles[i].m_PathID, sizeof( crcCheck.m_szPathID ) );
1600+ V_strncpy( crcCheck.m_szFilename, rgUnverifiedFiles[i].m_Filename, sizeof( crcCheck.m_szFilename ) );
1601+ crcCheck.m_nFileFraction = rgUnverifiedFiles[i].m_nFileFraction;
1602+ crcCheck.m_MD5 = rgUnverifiedFiles[i].m_FileHash.m_md5contents;
1603+ crcCheck.m_CRCIOs = rgUnverifiedFiles[i].m_FileHash.m_crcIOSequence;
1604+ crcCheck.m_eFileHashType = rgUnverifiedFiles[i].m_FileHash.m_eFileHashType;
1605+ crcCheck.m_cbFileLen = rgUnverifiedFiles[i].m_FileHash.m_cbFileLen;
1606+ crcCheck.m_nPackFileNumber = rgUnverifiedFiles[i].m_FileHash.m_nPackFileNumber;
1607+ crcCheck.m_PackFileID = rgUnverifiedFiles[i].m_FileHash.m_PackFileID;
1608+
1609+ m_NetChannel->SendNetMsg(crcCheck);
1610+ }
1611+ #endif
16231612}
16241613
16251614
0 commit comments