mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 05:23:51 +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
31
include/network/tcp_socket.hpp
Normal file
31
include/network/tcp_socket.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include "network/socket.hpp"
|
||||
#include <sys/socket.h>
|
||||
|
||||
namespace wowee {
|
||||
namespace network {
|
||||
|
||||
class TCPSocket : public Socket {
|
||||
public:
|
||||
TCPSocket();
|
||||
~TCPSocket() override;
|
||||
|
||||
bool connect(const std::string& host, uint16_t port) override;
|
||||
void disconnect() override;
|
||||
bool isConnected() const override { return connected; }
|
||||
|
||||
void send(const Packet& packet) override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void tryParsePackets();
|
||||
size_t getExpectedPacketSize(uint8_t opcode);
|
||||
|
||||
int sockfd = -1;
|
||||
bool connected = false;
|
||||
std::vector<uint8_t> receiveBuffer;
|
||||
};
|
||||
|
||||
} // namespace network
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue