mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
Initial commit: wowee native WoW 3.3.5a client
This commit is contained in:
commit
ce6cb8f38e
147 changed files with 32347 additions and 0 deletions
32
include/network/socket.hpp
Normal file
32
include/network/socket.hpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace wowee {
|
||||
namespace network {
|
||||
|
||||
class Packet;
|
||||
|
||||
class Socket {
|
||||
public:
|
||||
virtual ~Socket() = default;
|
||||
|
||||
virtual bool connect(const std::string& host, uint16_t port) = 0;
|
||||
virtual void disconnect() = 0;
|
||||
virtual bool isConnected() const = 0;
|
||||
|
||||
virtual void send(const Packet& packet) = 0;
|
||||
virtual void update() = 0;
|
||||
|
||||
using PacketCallback = std::function<void(const Packet&)>;
|
||||
void setPacketCallback(PacketCallback callback) { packetCallback = callback; }
|
||||
|
||||
protected:
|
||||
PacketCallback packetCallback;
|
||||
};
|
||||
|
||||
} // namespace network
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue