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

Method netLoad

source/core/StarNetElementContainers.hpp:169–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168template <typename BaseMap>
169void NetElementMapWrapper<BaseMap>::netLoad(DataStream& ds, NetCompatibilityRules rules) {
170 if (!checkWithRules(rules)) return;
171 m_changeData.clear();
172 m_changeDataLastVersion = m_netVersion ? m_netVersion->current() : 0;
173 m_pendingChangeData.clear();
174 BaseMap::clear();
175
176 addChangeData(ClearChange());
177
178 uint64_t count = ds.readVlqU();
179 for (uint64_t i = 0; i < count; ++i) {
180 auto change = readChange(ds);
181 addChangeData(change);
182 applyChange(std::move(change));
183 }
184
185 m_updated = true;
186}
187
188template <typename BaseMap>
189bool NetElementMapWrapper<BaseMap>::shouldWriteNetDelta(uint64_t fromVersion, NetCompatibilityRules rules) const {

Callers

nothing calls this directly

Calls 4

ClearChangeClass · 0.85
readVlqUMethod · 0.80
clearMethod · 0.45
currentMethod · 0.45

Tested by

no test coverage detected