本文整理汇总了C++中BitStream::WriteAlignedBytesSafe方法的典型用法代码示例。如果您正苦于以下问题:C++ BitStream::WriteAlignedBytesSafe方法的具体用法?C++ BitStream::WriteAlignedBytesSafe怎么用?C++ BitStream::WriteAlignedBytesSafe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitStream
的用法示例。
在下文中一共展示了BitStream::WriteAlignedBytesSafe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SyncToClient
//--------------------------------------------------------------------------
void EntityS::SyncToClient()
{
if(m_pkAgent)
{
if(m_kSyncDirty.Size())
{
BitStream kStream;
kStream.Reset();
kStream << VeUInt8(ID_CLIENT_ENTITY_UPDATE);
kStream << (const VeChar8*)m_kName;
VE_ASSERT(m_kSyncDirty.Size() <= VE_UINT16_MAX);
kStream << VeUInt16(m_kSyncDirty.Size());
m_kSyncDirty.BeginIterator();
while(!m_kSyncDirty.IsEnd())
{
PropertySValue* pkValue = m_kSyncDirty.GetIterNode()->m_tContent;
m_kSyncDirty.Next();
VE_ASSERT(pkValue);
kStream << pkValue->GetField();
VE_ASSERT(pkValue->GetSize() <= 0xff);
kStream.WriteAlignedBytesSafe((const VeChar8*)pkValue->GetClientData(), pkValue->GetClientSize(), VE_UINT8_MAX);
}
m_kSyncDirty.Clear();
m_pkAgent->SendPacket(kStream);
}
}
}
示例2: SyncAllToClient
//--------------------------------------------------------------------------
void EntityS::SyncAllToClient()
{
if(m_pkAgent)
{
BitStream kStream;
kStream.Reset();
kStream << VeUInt8(ID_CLIENT_ENTITY_UPDATE);
kStream << (const VeChar8*)m_kName;
VE_ASSERT(m_kSyncChildren.Size() <= VE_UINT16_MAX);
kStream << VeUInt16(m_kSyncChildren.Size());
for(VeUInt32 i(0); i < m_kSyncChildren.Size(); ++i)
{
PropertySValue* pkValue = m_kSyncChildren[i];
kStream << pkValue->GetField();
VE_ASSERT(pkValue->GetSize() <= 0xff);
kStream.WriteAlignedBytesSafe((const VeChar8*)pkValue->GetClientData(), pkValue->GetClientSize(), VE_UINT8_MAX);
}
m_pkAgent->SendPacket(kStream);
}
}