| 658 | } |
| 659 | |
| 660 | bool ToolUser::NetItem::writeNetDelta(DataStream& ds, uint64_t fromVersion, NetCompatibilityRules rules) const { |
| 661 | if (!checkWithRules(rules)) return false; |
| 662 | bool deltaWritten = false; |
| 663 | const_cast<NetItem*>(this)->updateItemDescriptor(); |
| 664 | m_buffer.clear(); |
| 665 | if (m_itemDescriptor.writeNetDelta(m_buffer, fromVersion, rules)) { |
| 666 | deltaWritten = true; |
| 667 | ds.write<uint8_t>(1); |
| 668 | ds.writeBytes(m_buffer.data()); |
| 669 | if (auto netItem = as<NetElement>(m_item.get())) { |
| 670 | ds.write<uint8_t>(2); |
| 671 | netItem->netStore(ds, rules); |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | if (auto netItem = as<NetElement>(m_item.get())) { |
| 676 | m_buffer.clear(); |
| 677 | if (netItem->writeNetDelta(m_buffer, fromVersion, rules)) { |
| 678 | deltaWritten = true; |
| 679 | ds.write<uint8_t>(3); |
| 680 | ds.writeBytes(m_buffer.data()); |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | if (deltaWritten) |
| 685 | ds.write<uint8_t>(0); |
| 686 | return deltaWritten; |
| 687 | } |
| 688 | |
| 689 | void ToolUser::NetItem::readNetDelta(DataStream& ds, float interpolationTime, NetCompatibilityRules rules) { |
| 690 | if (!checkWithRules(rules)) return; |
nothing calls this directly
no test coverage detected