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

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