MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / readUpdate

Method readUpdate

source/game/StarClientContext.cpp:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void 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
96ByteArray ClientContext::writeUpdate(NetCompatibilityRules) {
97 return m_rpc->send();

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.45
receiveMethod · 0.45
mergeMethod · 0.45
readNetStateMethod · 0.45

Tested by

no test coverage detected