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

Method writeUpdate

source/game/StarServerClientContext.cpp:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184ByteArray ServerClientContext::writeUpdate() {
185 RecursiveMutexLocker locker(m_mutex);
186
187 ByteArray rpcUpdate = m_rpc.send();
188
189 ByteArray shipChunksUpdate;
190 if (!m_shipChunksUpdate.empty())
191 shipChunksUpdate = DataStreamBuffer::serialize(take(m_shipChunksUpdate));
192
193 ByteArray netGroupUpdate;
194 tie(netGroupUpdate, m_netVersion) = m_netGroup.writeNetState(m_netVersion, m_netRules);
195
196 if (rpcUpdate.empty() && shipChunksUpdate.empty() && netGroupUpdate.empty())
197 return {};
198
199 DataStreamBuffer ds;
200 ds.write(rpcUpdate);
201 ds.write(shipChunksUpdate);
202 ds.write(netGroupUpdate);
203
204 return ds.takeData();
205}
206
207void ServerClientContext::setSystemWorld(SystemWorldServerThreadPtr systemWorldThread) {
208 RecursiveMutexLocker locker(m_mutex);

Callers

nothing calls this directly

Calls 6

takeFunction · 0.85
sendMethod · 0.45
emptyMethod · 0.45
writeNetStateMethod · 0.45
writeMethod · 0.45
takeDataMethod · 0.45

Tested by

no test coverage detected