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

Method unpackUpdate

Engine/source/T3D/gameBase/gameBase.cpp:605–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605void GameBase::unpackUpdate(NetConnection *con, BitStream *stream)
606{
607 Parent::unpackUpdate( con, stream );
608
609 // ScaleMask
610 if ( stream->readFlag() )
611 {
612 if ( stream->readFlag() )
613 {
614 VectorF scale;
615 mathRead( *stream, &scale );
616 setScale( scale );
617 }
618 else
619 setScale( Point3F::One );
620 }
621
622 // DataBlockMask
623 if ( stream->readFlag() )
624 {
625 GameBaseData *dptr = 0;
626 SimObjectId id = stream->readRangedU32( DataBlockObjectIdFirst,
627 DataBlockObjectIdLast );
628 if ( stream->readFlag() )
629 mOrderGUID = stream->readInt( 16 );
630
631 if ( !Sim::findObject( id, dptr ) || !setDataBlock( dptr ) )
632 con->setLastError( "Invalid packet GameBase::unpackUpdate()" );
633 }
634
635#ifdef TORQUE_DEBUG_NET_MOVES
636 stream->read(&mLastMoveId);
637 mTicksSinceLastMove = 0;
638 mIsAiControlled = stream->readFlag();
639#endif
640#ifdef TORQUE_AFX_ENABLED
641 if (stream->readFlag())
642 {
643 mScope_id = (stream->readFlag()) ? (U16) stream->readInt(SCOPE_ID_BITS) : 0;
644 mScope_refs = 0;
645 }
646#endif
647}
648
649void GameBase::onMount( SceneObject *obj, S32 node )
650{

Callers

nothing calls this directly

Calls 7

mathReadFunction · 0.85
readFlagMethod · 0.80
readRangedU32Method · 0.80
readIntMethod · 0.80
findObjectFunction · 0.50
setLastErrorMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected