serialize packet to file -- note lack of error checking must write to a binary file if we use plain "pack"
| 349 | // serialize packet to file -- note lack of error checking |
| 350 | // must write to a binary file if we use plain "pack" |
| 351 | void PingPacket::writeToFile(std::ostream& out) const { |
| 352 | if (!out) { return; } |
| 353 | |
| 354 | char buffer[PingPacket::PacketSize]; |
| 355 | void* buf = buffer; |
| 356 | buf = nboPackUInt16(buf, PingPacket::PacketSize - 4); |
| 357 | buf = nboPackUInt16(buf, MsgPingCodeReply); |
| 358 | buf = pack(buf, getServerVersion()); |
| 359 | out.write(buffer, sizeof(buffer)); |
| 360 | } |
| 361 | |
| 362 | // de serialize packet from file |
| 363 | // must read from a binary file if we use plain "unpack" |
nothing calls this directly
no test coverage detected