本文整理汇总了C++中PacketReader::packet_type方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketReader::packet_type方法的具体用法?C++ PacketReader::packet_type怎么用?C++ PacketReader::packet_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader::packet_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ServerNetwork::process_packet(const IPAddress& address, PacketReader& reader) {
switch (reader.packet_type()) {
case ACK_PACKET:
process_ack(address, reader);
break;
case WEAPON_DISCHARGED_PACKET:
m_server.weapon_discharged(address, reader);
break;
case PLAYER_HIT_PACKET:
m_server.player_hit(address, reader);
break;
case MESSAGE_PACKET:
m_server.message(address, reader);
break;
case GATE_UPDATE_PACKET:
m_server.gate_update(address, reader);
break;
case JOIN_PACKET:
m_server.join(address, reader);
break;
case INFO_client_PACKET:
m_server.info(address, reader);
break;
case LEAVE_PACKET:
m_server.leave(address, reader);
break;
case PLAYER_ANIMATION_PACKET:
m_server.player_animation(address, reader);
break;
case NAME_CHANGE_PACKET:
m_server.name_change(address, reader);
break;
case TEAM_CHANGE_PACKET:
m_server.team_change(address, reader);
break;
case REGISTER_SERVER_metaserver_PACKET:
m_server.register_server_packet(address, reader);
break;
case MAP_INFO_PACKET:
m_server.map_info_packet(address, reader);
break;
case HOLE_PUNCH_PACKET:
m_server.hole_punch_packet(address, reader);
break;
case PLAYER_DIED_PACKET:
m_server.player_died(address, reader);
break;
case PLAYER_JUMPED_PACKET:
m_server.player_jumped(address, reader);
break;
case PLAYER_TO_SERVER_UPDATE_PACKET:
m_server.player_to_server_update(address, reader);
break;
}
}