mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Mostly rebuild CServer structure. * Partially rebuild CNetworkStringTable structure. * Partially rebuild CNetworkStringTableContainer structure. * Removed redundant patterns which are now covered in the data structure.
80 lines
2.5 KiB
C++
80 lines
2.5 KiB
C++
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
||
//
|
||
// Purpose:
|
||
//
|
||
// $NoKeywords: $
|
||
//===========================================================================//
|
||
#include "core/stdafx.h"
|
||
#include "engine/networkstringtable.h"
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose:
|
||
// Input : i -
|
||
// Output : CNetworkStringTableItem
|
||
//-----------------------------------------------------------------------------
|
||
//CNetworkStringTableItem* CNetworkStringTable::GetItem(int i)
|
||
//{
|
||
// if (i >= 0)
|
||
// {
|
||
// return &m_pItems->Element(i);
|
||
// }
|
||
//
|
||
// Assert(m_pItemsClientSide);
|
||
// return &m_pItemsClientSide->Element(-i);
|
||
//}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Returns the table identifier
|
||
// Output : TABLEID
|
||
//-----------------------------------------------------------------------------
|
||
TABLEID CNetworkStringTable::GetTableId(void) const
|
||
{
|
||
return m_id;
|
||
}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Returns the max size of the table
|
||
// Output : int
|
||
//-----------------------------------------------------------------------------
|
||
int CNetworkStringTable::GetMaxStrings(void) const
|
||
{
|
||
return m_nMaxEntries;
|
||
}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Returns a table, by name
|
||
// Output : const char
|
||
//-----------------------------------------------------------------------------
|
||
const char* CNetworkStringTable::GetTableName(void) const
|
||
{
|
||
return m_pszTableName;
|
||
}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Returns the number of bits needed to encode an entry index
|
||
// Output : int
|
||
//-----------------------------------------------------------------------------
|
||
int CNetworkStringTable::GetEntryBits(void) const
|
||
{
|
||
return m_nEntryBits;
|
||
}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Sets the tick count
|
||
//-----------------------------------------------------------------------------
|
||
void CNetworkStringTable::SetTick(int tick_count)
|
||
{
|
||
assert(tick_count >= m_nTickCount);
|
||
m_nTickCount = tick_count;
|
||
}
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Locks the string table
|
||
//-----------------------------------------------------------------------------
|
||
bool CNetworkStringTable::Lock(bool bLock)
|
||
{
|
||
bool bState = m_bLocked;
|
||
m_bLocked = bLock;
|
||
return bState;
|
||
}
|