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

Method pack

Engine/source/sim/netGhost.cpp:66–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 { delete object; }
65
66 void pack(NetConnection *ps, BitStream *bstream)
67 {
68 bstream->writeInt(ghostIndex, NetConnection::GhostIdBitSize);
69
70 NetObject *obj = (NetObject *) Sim::findObject(objectId);
71 if(bstream->writeFlag(obj != NULL))
72 {
73 S32 classId = obj->getClassId(ps->getNetClassGroup());
74 bstream->writeClassId(classId, NetClassTypeObject, ps->getNetClassGroup());
75#ifdef TORQUE_NET_STATS
76 U32 beginSize = bstream->getBitPosition();
77#endif
78 U32 retMask = obj->packUpdate(ps, 0xFFFFFFFF, bstream);
79 if ( retMask != 0 ) obj->setMaskBits( retMask );
80
81#ifdef TORQUE_NET_STATS
82 obj->getClassRep()->updateNetStatPack(0xFFFFFFFF, bstream->getBitPosition() - beginSize);
83#endif
84 }
85 }
86 void write(NetConnection *ps, BitStream *bstream)
87 {
88 bstream->writeInt(ghostIndex, NetConnection::GhostIdBitSize);

Callers

nothing calls this directly

Calls 11

writeIntMethod · 0.80
getNetClassGroupMethod · 0.80
writeClassIdMethod · 0.80
getBitPositionMethod · 0.80
updateNetStatPackMethod · 0.80
getClassRepMethod · 0.80
findObjectFunction · 0.50
writeFlagMethod · 0.45
getClassIdMethod · 0.45
packUpdateMethod · 0.45
setMaskBitsMethod · 0.45

Tested by

no test coverage detected