本文整理汇总了C++中Package::getEventID方法的典型用法代码示例。如果您正苦于以下问题:C++ Package::getEventID方法的具体用法?C++ Package::getEventID怎么用?C++ Package::getEventID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::getEventID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in_ping_ACK
void Server::in_ping_ACK(Packet* p)
{
sf::Uint8 sortingId;
*p >> sortingId;
Package* pack = connection.getPacketNR(sortingId);
if (pack == 0)
{
cout << "Recieved ACK on a non-used package slot?" << endl;
return;
}
//ping doesnt use event ID so it should be empty
if (pack->getEventID() != NET_EVENT_ID::EMPTY)
{
cout << "Recieved ACK on WRONG package slot?" << endl;
return;
}
unsigned int oldStamp = pack->getTimeStamp();
unsigned int temp = clock();
oldStamp = temp - oldStamp;
cout << "Ping Confirmed. RTT: " << oldStamp << endl;
connection.successfulPing = true;
connection.clearPacketNR(sortingId);
}