| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
|
| 8 |
#include <SFML/Network/Packet.hpp> |
| 9 |
#include <enet/enet.h> |
| 10 |
|
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
|
| 13 |
namespace Common::ENet |
| 14 |
{ |
| 15 |
struct ENetHostDeleter |
| 16 |
{ |
| 17 |
void operator()(ENetHost* host) const noexcept { enet_host_destroy(host); } |
| 18 |
}; |
| 19 |
using ENetHostPtr = std::unique_ptr<ENetHost, ENetHostDeleter>; |
| 20 |
|
| 21 |
void WakeupThread(ENetHost* host); |
| 22 |
int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event); |
| 23 |
bool SendPacket(ENetPeer* socket, const sf::Packet& packet, u8 channel_id); |
| 24 |
|
| 25 |
|
| 26 |
constexpr int SKIPPABLE_EVENT = 42; |
| 27 |
} |