MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / writePacket

Method writePacket

source/network/ODPacket.cpp:246–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void ODPacket::writePacket(int32_t timestamp, std::ofstream& os)
247{
248 int32_t bufferSize = mPacket.getDataSize();
249 const char* buffer = static_cast<const char*>(mPacket.getData());
250 os.write(reinterpret_cast<const char*>(&timestamp), sizeof(int32_t));
251 os.write(reinterpret_cast<const char*>(&bufferSize), sizeof(int32_t));
252 os.write(buffer, bufferSize);
253}
254
255int32_t ODPacket::readPacket(std::ifstream& is)
256{

Callers 1

recvMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected