summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/ENet.cpp2
-rw-r--r--Source/Core/Common/ENet.h3
-rw-r--r--Source/Core/Common/TraversalClient.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/Common/ENet.cpp b/Source/Core/Common/ENet.cpp
index b694eba042..6e27036175 100644
--- a/Source/Core/Common/ENet.cpp
+++ b/Source/Core/Common/ENet.cpp
@@ -31,7 +31,7 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event)
// wakeup packet received
if (host->receivedDataLength == 1 && host->receivedData[0] == 0)
{
- event->type = (ENetEventType)42;
+ event->type = SKIPPABLE_EVENT;
return 1;
}
return 0;
diff --git a/Source/Core/Common/ENet.h b/Source/Core/Common/ENet.h
index f1791ca41d..920a7d5fbd 100644
--- a/Source/Core/Common/ENet.h
+++ b/Source/Core/Common/ENet.h
@@ -21,4 +21,7 @@ using ENetHostPtr = std::unique_ptr<ENetHost, ENetHostDeleter>;
void WakeupThread(ENetHost* host);
int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event);
bool SendPacket(ENetPeer* socket, const sf::Packet& packet, u8 channel_id);
+
+// used for traversal packets and wake-up packets
+constexpr ENetEventType SKIPPABLE_EVENT = ENetEventType(42);
} // namespace Common::ENet
diff --git a/Source/Core/Common/TraversalClient.cpp b/Source/Core/Common/TraversalClient.cpp
index e384c1cca8..50278a37e9 100644
--- a/Source/Core/Common/TraversalClient.cpp
+++ b/Source/Core/Common/TraversalClient.cpp
@@ -299,7 +299,7 @@ int ENET_CALLBACK TraversalClient::InterceptCallback(ENetHost* host, ENetEvent*
&host->receivedAddress) ||
(host->receivedDataLength == 1 && host->receivedData[0] == 0))
{
- event->type = (ENetEventType)42;
+ event->type = Common::ENet::SKIPPABLE_EVENT;
return 1;
}
return 0;