MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / insertReceived

Method insertReceived

engine/Poseidon/Network/NetTransportNet.cpp:1648–1675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1646
1647float NetClient::GetLastMsgAge()
1648{
1649 enterSnd();
1650 float result = 1.0;
1651 if (channel)
1652 {
1653 unsigned64 last = channel->getLastMessageArrival();
1654 unsigned64 now = getSystemTime();
1655 if (now < last)
1656 {
1657 LOG_DEBUG(Network, "Negative time delta in NetClient::GetLastMsgAge: now = {:8x}{:08x}, last = {:8x}{:08x}",
1658 (unsigned)(now >> 32), (unsigned)(now & 0xffffffff), (unsigned)(last >> 32),
1659 (unsigned)(last & 0xffffffff));
1660 result = 0;
1661 }
1662 else
1663 {
1664 unsigned64 delta = now - last;
1665 if (delta > 200000000)
1666 {
1667 RptF("Overflow in NetClient::GetLastMsgAge: now = %8x%08x, last = %8x%08x, delta = %.0f",
1668 (unsigned)(now >> 32), (unsigned)(now & 0xffffffff), (unsigned)(last >> 32),
1669 (unsigned)(last & 0xffffffff), (double)(1.e-6f * delta));
1670 }
1671 result = 1.e-6f * (unsigned)delta;
1672 }
1673 }
1674 leaveSnd();
1675 return result;
1676}
1677
1678float NetClient::GetLastMsgAgeReported()

Callers 2

serverReceiveFunction · 0.80
clientReceiveFunction · 0.80

Calls 1

getSerialMethod · 0.80

Tested by

no test coverage detected