| 78 | } |
| 79 | |
| 80 | void ClientContext::readUpdate(ByteArray data, NetCompatibilityRules rules) { |
| 81 | if (data.empty()) |
| 82 | return; |
| 83 | |
| 84 | DataStreamBuffer ds(std::move(data)); |
| 85 | ds.setStreamCompatibilityVersion(rules); |
| 86 | |
| 87 | m_rpc->receive(ds.read<ByteArray>()); |
| 88 | |
| 89 | auto shipUpdates = ds.read<ByteArray>(); |
| 90 | if (!shipUpdates.empty()) |
| 91 | m_newShipUpdates.merge(DataStreamBuffer::deserialize<WorldChunks>(std::move(shipUpdates)), true); |
| 92 | |
| 93 | m_netGroup.readNetState(ds.read<ByteArray>(), 0.0f, rules); |
| 94 | } |
| 95 | |
| 96 | ByteArray ClientContext::writeUpdate(NetCompatibilityRules) { |
| 97 | return m_rpc->send(); |
nothing calls this directly
no test coverage detected