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

Method pack

Engine/source/T3D/gameBase/gameConnectionEvents.cpp:143–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void SimDataBlockEvent::pack(NetConnection *conn, BitStream *bstream)
144{
145#ifdef AFX_CAP_DATABLOCK_CACHE
146 ((GameConnection *)conn)->tempDisableStringBuffering(bstream);
147#endif
148 SimDataBlock* obj;
149 Sim::findObject(id,obj);
150 GameConnection *gc = (GameConnection *) conn;
151 if(bstream->writeFlag(gc->getDataBlockModifiedKey() < obj->getModifiedKey()))
152 {
153 if(obj->getModifiedKey() > gc->getMaxDataBlockModifiedKey())
154 gc->setMaxDataBlockModifiedKey(obj->getModifiedKey());
155
156 AssertFatal(obj,
157 "SimDataBlockEvent:: Data blocks cannot be deleted");
158 bstream->writeInt(id - DataBlockObjectIdFirst,DataBlockObjectIdBitSize);
159
160 S32 classId = obj->getClassId(conn->getNetClassGroup());
161 bstream->writeClassId(classId, NetClassTypeDataBlock, conn->getNetClassGroup());
162 bstream->writeInt(mIndex, DataBlockObjectIdBitSize);
163 bstream->writeInt(mTotal, DataBlockObjectIdBitSize + 1);
164 obj->packData(bstream);
165#ifdef TORQUE_DEBUG_NET
166 bstream->writeInt(classId ^ DebugChecksum, 32);
167#endif
168 }
169#ifdef AFX_CAP_DATABLOCK_CACHE
170 ((GameConnection *)conn)->restoreStringBuffering(bstream);
171#endif
172}
173
174void SimDataBlockEvent::unpack(NetConnection *cptr, BitStream *bstream)
175{

Callers

nothing calls this directly

Calls 15

getModifiedKeyMethod · 0.80
writeIntMethod · 0.80
getNetClassGroupMethod · 0.80
writeClassIdMethod · 0.80
packNetStringHandleUMethod · 0.80
getSfxDescriptionMethod · 0.80
writeSignedFloatMethod · 0.80

Tested by

no test coverage detected