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

Method SendMsgRaw

engine/Poseidon/Network/NetworkMsgContext.cpp:1482–1511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1480
1481 return SendMsgRaw(to, rawMsg, dwFlags, level);
1482}
1483
1484DWORD NetworkComponent::SendMsgRaw(int to, NetworkMessageRaw& rawMsg, NetMsgFlags dwFlags, int diagLevel)
1485{
1486 StatRawMsgSent(to, rawMsg.GetSize());
1487
1488 static Poseidon::Foundation::CRCCalculator calculator;
1489 int crc = calculator.CRC(rawMsg.GetData(), rawMsg.GetSize());
1490 rawMsg.Put(crc, NCTNone);
1491
1492 GDebugger.PauseCheckingAlive();
1493
1494 DWORD msgID = 0xFFFFFFFF;
1495 bool result = DXSendMsg(to, rawMsg, msgID, dwFlags);
1496
1497 int size = rawMsg.GetSize();
1498
1499 GDebugger.ResumeCheckingAlive();
1500
1501 if (diagLevel >= 2)
1502 {
1503 DiagLogF(" result = %x, message ID = %x, size = %d", result, msgID, size);
1504 }
1505 if (!result)
1506 {
1507 const PlayerIdentity* ident = FindIdentity(to);
1508 LOG_ERROR(Network, "Message not sent - error {:x}, message ID = {:x}, to {} ({})", result, msgID, to,
1509 ident ? (const char*)ident->name : "<no>");
1510 return 0xFFFFFFFF;
1511 }
1512 return msgID;
1513}
1514

Callers

nothing calls this directly

Calls 8

DiagLogFFunction · 0.85
FindIdentityFunction · 0.85
CRCMethod · 0.80
PauseCheckingAliveMethod · 0.80
ResumeCheckingAliveMethod · 0.80
GetSizeMethod · 0.45
GetDataMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected