本文整理汇总了C++中nlmisc::CBitMemStream::serialAndLog1方法的典型用法代码示例。如果您正苦于以下问题:C++ CBitMemStream::serialAndLog1方法的具体用法?C++ CBitMemStream::serialAndLog1怎么用?C++ CBitMemStream::serialAndLog1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::CBitMemStream
的用法示例。
在下文中一共展示了CBitMemStream::serialAndLog1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pack
/* Pack an action to a bit stream. Set transmitTimestamp=true for server-->client,
* false for client-->server. If true, set the current gamecycle.
*/
void CActionFactory::pack (CAction *action, NLMISC::CBitMemStream &message, NLMISC::TGameCycle /* currentCycle */ )
{
//H_BEFORE(FactoryPack);
//sint32 val = message.getPosInBit ();
//
if (action->Code < 4)
{
// short code (0 1 2 3)
bool shortcode = true;
uint32 code = action->Code;
message.serialAndLog1 (shortcode);
message.serialAndLog2 (code, 2);
}
else
{
bool shortcode = false;
message.serialAndLog1 (shortcode);
message.serialAndLog1 (action->Code);
}
action->pack (message);
//H_AFTER(FactoryPack);
//OLIV: nlassertex (message.getPosInBit () - val == (sint32)CActionFactory::getInstance()->size (action), ("CActionFactory::pack () : action %d packed %u bits, should be %u, size() is wrong", action->Code, message.getPosInBit () - val, CActionFactory::getInstance()->size (action)));
// nlinfo ("ac:%p pack one action in message %d %hu %u %d", action, action->Code, (uint16)(action->CLEntityId), val, message.getPosInBit()-val);
}