| 141 | } |
| 142 | |
| 143 | void 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 | |
| 174 | void SimDataBlockEvent::unpack(NetConnection *cptr, BitStream *bstream) |
| 175 | { |
nothing calls this directly
no test coverage detected