MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / packUpdate

Method packUpdate

Engine/source/T3D/gameBase/gameBase.cpp:570–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570U32 GameBase::packUpdate( NetConnection *connection, U32 mask, BitStream *stream )
571{
572 U32 retMask = Parent::packUpdate( connection, mask, stream );
573
574 if ( stream->writeFlag( mask & ScaleMask ) )
575 {
576 // Only write one bit if the scale is one.
577 if ( stream->writeFlag( mObjScale != Point3F::One ) )
578 mathWrite( *stream, mObjScale );
579 }
580
581 if ( stream->writeFlag( ( mask & DataBlockMask ) && mDataBlock != NULL ) )
582 {
583 stream->writeRangedU32( mDataBlock->getId(),
584 DataBlockObjectIdFirst,
585 DataBlockObjectIdLast );
586 if ( stream->writeFlag( mNetFlags.test( NetOrdered ) ) )
587 stream->writeInt( mOrderGUID, 16 );
588 }
589
590#ifdef TORQUE_DEBUG_NET_MOVES
591 stream->write(mLastMoveId);
592 stream->writeFlag(mIsAiControlled);
593#endif
594
595#ifdef TORQUE_AFX_ENABLED
596 if (stream->writeFlag(mask & ScopeIdMask))
597 {
598 if (stream->writeFlag(mScope_refs > 0))
599 stream->writeInt(mScope_id, SCOPE_ID_BITS);
600 }
601#endif
602 return retMask;
603}
604
605void GameBase::unpackUpdate(NetConnection *con, BitStream *stream)
606{

Callers

nothing calls this directly

Calls 7

mathWriteFunction · 0.85
writeRangedU32Method · 0.80
writeIntMethod · 0.80
getIdMethod · 0.65
writeFlagMethod · 0.45
testMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected