39 :
InternalPacket(0, nReceiver), mSendTime(fSendTime), mRequestTime(fRequestTime) {
57 void *
operator new(
size_t nSize) {
58 return PoolMemAlloc(
static_cast<int>(nSize),
"TimeResponsePkt", 0);
66 void operator delete(
void *pBlock) {
94 return "TimeResponsePkt";
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
InternalPacket(unsigned char nFlags=0, int nReceiver=kUnset)
Construct a packet from an unset sender.
Definition internalpacket.h:33
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
const char * GetName() const override
Report this packet's class name.
Definition timeresponsepkt.h:93
static Message * New()
Produce a default-constructed packet on the heap.
float GetRequestTime() const
Definition timeresponsepkt.h:125
int Type() override
Report this packet's registered identity.
Definition timeresponsepkt.h:84
float GetSendTime() const
Definition timeresponsepkt.h:130
void restoreGuts(BinStream &stream) override
Read what saveGuts() wrote.
Message * Clone() override
Produce a heap copy of this packet.
Definition timeresponsepkt.h:75
TimeResponsePkt(int nReceiver, float fSendTime, float fRequestTime)
Construct a packet for one peer, with no delivery flag.
Definition timeresponsepkt.h:38
void PrintExtra(PrnStream &stream) const override
Write the sender, the receiver, and the two times as req: and send:.
void saveGuts(BinStream &stream) const override
Write mRequestTime and then mSendTime.
TimeResponsePkt()=default
Construct a packet with the times left unset.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
int g_nTimeResponsePktType
Identity that TimeResponsePkt::Type() reports.