本文整理汇总了C++中CNetMsg::WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C++ CNetMsg::WriteByte方法的具体用法?C++ CNetMsg::WriteByte怎么用?C++ CNetMsg::WriteByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNetMsg
的用法示例。
在下文中一共展示了CNetMsg::WriteByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect_client
void CServer::connect_client(RakNet::Packet* packet)
{
TPeer peer;
//Get an open slot
peer.m_scID = this->m_qSlots.top();
this->m_qSlots.pop();
//Get the address
peer.m_Addr = packet->systemAddress;
peer.m_Guid = packet->guid;
//Add to list
this->m_vClients.push_back(peer);
std::sort(this->m_vClients.begin(), this->m_vClients.end(), TPeerAltOrder());
RakNet::TimeMS timeOut = LOST_TIME;
m_pRak->SetTimeoutTime(timeOut, RakNet::UNASSIGNED_SYSTEM_ADDRESS);
//Send Client Their ID
{
CNetMsg msg = CNetMsg(NM_CLIENT_ID);
msg.WriteByte(peer.m_scID);
this->send_msg(msg, peer, HIGH_PRIORITY, RELIABLE_ORDERED);
}
#if DB_NET_MSG_CNT
printf("S : Connected With Client #%i at \t%s\n", peer.m_scID, peer.m_Addr.ToString());
#endif
}