summaryrefslogtreecommitdiff
path: root/Source/Core/Common/ENetUtil.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2022-10-09 02:25:28 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2022-10-09 02:25:28 +0200
commit66684a392f15344845368e880cfbe421f6e9af38 (patch)
treeb115e562655ea88fa564f010c41a5b0c2f03b579 /Source/Core/Common/ENetUtil.cpp
parent5f3e8e0f05f0027e9c5c5d8f0d53ec58d32bc507 (diff)
Deduplicate NetPlayServer::Send() and NetPlayClient::Send() into ENetUtil::SendPacket().
Diffstat (limited to 'Source/Core/Common/ENetUtil.cpp')
-rw-r--r--Source/Core/Common/ENetUtil.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/ENetUtil.cpp b/Source/Core/Common/ENetUtil.cpp
index 646e7f5439..e450ee65d1 100644
--- a/Source/Core/Common/ENetUtil.cpp
+++ b/Source/Core/Common/ENetUtil.cpp
@@ -35,4 +35,11 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event)
}
return 0;
}
+
+void SendPacket(ENetPeer* socket, const sf::Packet& packet, u8 channel_id)
+{
+ ENetPacket* epac =
+ enet_packet_create(packet.getData(), packet.getDataSize(), ENET_PACKET_FLAG_RELIABLE);
+ enet_peer_send(socket, channel_id, epac);
+}
} // namespace ENetUtil