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

Method unpackUpdate

Engine/source/afx/afxEffectron.cpp:457–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455//~~~~~~~~~~~~~~~~~~~~//
456
457void afxEffectron::unpackUpdate(NetConnection * conn, BitStream * stream)
458{
459 Parent::unpackUpdate(conn, stream);
460
461 bool initial_update = false;
462 bool zoned_in = true;
463 bool do_sync_event = false;
464 U8 new_marks_mask = 0;
465 U8 new_state = INACTIVE_STATE;
466 F32 new_elapsed = 0;
467
468 // InitialUpdate Only
469 if (stream->readFlag())
470 {
471 initial_update = true;
472
473 // extra sent
474 if (stream->readFlag())
475 {
476 // cleanup?
477 if (stream->readFlag()) // is ghost_idx
478 {
479 S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount);
480 mExtra = dynamic_cast<SimObject*>(conn->resolveGhost(ghost_idx));
481 }
482 else
483 {
484 if (stream->readFlag()) // has scope_id
485 {
486 // JTF NOTE: U16 extra_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS);
487 stream->readInt(NetObject::SCOPE_ID_BITS);
488 }
489 }
490 }
491
492 stream->read(&time_factor);
493
494 // if client is marked as fully zoned in
495 if ((zoned_in = stream->readFlag()) == true)
496 {
497 unpack_constraint_info(conn, stream);
498 init_constraints();
499 }
500 }
501
502 // StateEvent or SyncEvent
503 // this state data is sent for both state-events and
504 // sync-events
505 if (stream->readFlag())
506 {
507 stream->read(&new_marks_mask);
508 stream->read(&new_state);
509 stream->read(&new_elapsed);
510
511 marks_mask = new_marks_mask;
512 }
513
514 // SyncEvent

Callers

nothing calls this directly

Calls 5

readFlagMethod · 0.80
readRangedU32Method · 0.80
resolveGhostMethod · 0.80
readIntMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected