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

Method ProcessUserMessages

engine/Poseidon/Network/NetTransportNet.cpp:1569–1646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1567 msg->setSendTimeout(SEND_TIMEOUT);
1568 msg->setData((unsigned8*)buffer, bufferSize);
1569 msg->send();
1570 }
1571 msgID = (DWORD)msg->id;
1572#ifdef NET_LOG_CLIENT_SEND
1573 NetLog("Channel(%u): NetClient::SendMsg: len=%3d, flags=%x, msgID=%x, hdr=%08x%08x", channel->getChannelId(),
1574 bufferSize, (unsigned)flags, msgID, ((unsigned*)msg->getData())[0], ((unsigned*)msg->getData())[1]);
1575#endif
1576 leaveSnd();
1577 return true;
1578}
1579
1580bool NetClient::SendRawMagic(int magic, BYTE* buffer, int bufferSize)
1581{
1582 enterSnd();
1583 NetPeer* peer = getClientPeer();
1584 bool ok = SendRawMagicPacket(peer, channel, rawMagicSerial, magic, buffer, bufferSize);
1585 leaveSnd();
1586 return ok;
1587}
1588
1589void NetClient::GetSendQueueInfo(int& nMsg, int& nBytes, int& nMsgG, int& nBytesG)
1590{
1591 nMsg = nBytes = nMsgG = nBytesG = 0;
1592}
1593
1594bool NetClient::GetConnectionInfo(int& latencyMS, int& throughputBPS)
1595{
1596 enterSnd();
1597 if (!channel)
1598 {
1599 leaveSnd();
1600 return false;
1601 }
1602 latencyMS = (int)(channel->getLatency() / 1000);
1603 throughputBPS = (int)channel->getOutputBandWidth();
1604 ;
1605#ifdef NET_LOG_INFO
1606 if (latencyMS != oldLatency || throughputBPS != oldThroughput)
1607 {
1608 NetLog("Channel(%u): NetClient::GetConnectionInfo: %d ms,%d B/s", channel->getChannelId(), latencyMS,
1609 throughputBPS);
1610 oldLatency = latencyMS;
1611 oldThroughput = throughputBPS;
1612 printAge = true;
1613 }
1614#endif
1615 leaveSnd();
1616 return true;
1617}
1618
1619template <class Type>
1620Type LoadValue(const ParamEntry& cfg, const char* name, const Type& defVal)
1621{
1622 const ParamEntry* entry = cfg.FindEntry(name);
1623 if (!entry)
1624 {
1625 return defVal;
1626 }

Callers 2

ReceiveUserMessagesMethod · 0.80
ReceiveUserMessagesMethod · 0.80

Calls 15

vonIsDataPacketFunction · 0.85
getServerPeerFunction · 0.85
getChannelIdMethod · 0.80
getLengthMethod · 0.80
getSerialMethod · 0.80
getFlagsMethod · 0.80
onDataPacketMethod · 0.80
updateMethod · 0.80
getPeerIdMethod · 0.80
getChannelMethod · 0.80
serverMethod · 0.80
getDataMethod · 0.45

Tested by

no test coverage detected