本文整理汇总了C++中NetConnection::MarkReliableAsReceived方法的典型用法代码示例。如果您正苦于以下问题:C++ NetConnection::MarkReliableAsReceived方法的具体用法?C++ NetConnection::MarkReliableAsReceived怎么用?C++ NetConnection::MarkReliableAsReceived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetConnection
的用法示例。
在下文中一共展示了NetConnection::MarkReliableAsReceived方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AckCallback
void AckCallback(net_sender_t& from, NetMessage* msg) {
DevConsole::ConsolePrintf("%s", RGBA(0, 0, 255, 255), "Received ack");
NetConnection* connection = from.connection;
if (connection == nullptr) {
return;
}
size_t byteAt = 0;
unsigned char* messageData = msg->GetBuffer();
uint8_t numAcks = *(uint8_t*)(messageData + byteAt);
byteAt += sizeof(uint8_t);
for (int ack = 0; ack < numAcks; ack++) {
uint16_t ackID = *(uint16_t*)(messageData + byteAt);
byteAt += sizeof(uint16_t);
ReliableTracker *tracker = connection->FindAndRemoveTracker(ackID);
if (tracker != nullptr) {
for (uint16_t reliable_id : tracker->m_reliableIDs) {
connection->MarkReliableAsReceived(reliable_id);
}
}
}
}