Class ClientConnector

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< ClientConnector >

Class Documentation

class simulator::networking::ClientConnector : public std::enable_shared_from_this<ClientConnector>

Public Types

typedef std::function<void(std::shared_ptr<core::networking::Packet> packet)> PacketHandler
typedef std::function<void()> NewConnectionHandler
typedef std::function<void()> DisconnectHandler

Public Functions

ClientConnector(std::shared_ptr<Application> application, boost::asio::io_context &context, uint8_t securityLevel, const uint32_t defaultKeys[])
~ClientConnector()
void ConnectTo(const std::string &host, uint16_t port, uint8_t connectType)
void SetConnectInfo(const std::string &host, uint16_t port, uint8_t connectType)
void Connect()
void Close()
void Shutdown()
std::weak_ptr<core::networking::PacketManager> GetPacketManager()
void SetConnectionFailedHandler(NewConnectionHandler handler)
void SetDisconnectHandler(DisconnectHandler handler)
void RegisterHandler(uint8_t header, PacketHandler handler)
void CallConnectionFailedHandler()
void CallDisconnectHandler()
void CallPacketHandler(std::shared_ptr<core::networking::Packet> packet)
void SendMovementPacket()
void Send(const std::shared_ptr<core::networking::Packet> &packet)
std::shared_ptr<Application> GetApplication()
std::shared_ptr<core::networking::CryptationBase> GetCryptation()
uint8_t GetSecurityLevel()