void Connection::prepSend(Protocol proto, const sf::Packet& rData, sf::Packet& data) { data << static_cast<int32_t>(proto); data << ++m_lastSendRecieve[proto].first; data.append(rData.getData(), rData.getDataSize()); }
void NetPlayClient::Send(sf::Packet& packet) { ENetPacket* epac = enet_packet_create(packet.getData(), packet.getDataSize(), ENET_PACKET_FLAG_RELIABLE); enet_peer_send(m_server, 0, epac); }
void Manager::broadcast(const sf::Packet &packet) { assert(_host); ENetPacket *netPacket = enet_packet_create(packet.getData(), packet.getDataSize(), 0); enet_host_broadcast(_host, 0, netPacket); }
void Manager::send(const Client &client, const sf::Packet &packet) { assert(client.getPeer()); ENetPacket *netPacket = enet_packet_create(packet.getData(), packet.getDataSize(), 0); enet_peer_send(client.getPeer(), 0, netPacket); }
void NetPlayServer::Send(ENetPeer* socket, const sf::Packet& packet) { ENetPacket* epac = enet_packet_create(packet.getData(), packet.getDataSize(), ENET_PACKET_FLAG_RELIABLE); enet_peer_send(socket, 0, epac); }