summaryrefslogblamecommitdiffstats
path: root/src/NetworkClient.hpp
blob: bde5fdf94bcc2f9d62345e27ccebaac92cb41cf2 (plain) (tree)
1
2
3
4
5
6
7
8

            
                 
                

                 
                 
 


                                     
 
                     
                                     
                              
                                  
                                                                    


                            
       
                                                                                      
                         
  
#pragma once

#include <memory>
#include <queue>
#include <string>
#include <chrono>
#include <thread>

class Network;
struct Packet;
enum ConnectionState : unsigned char;

class NetworkClient {
    std::unique_ptr<Network> network;
	ConnectionState state;
    int compressionThreshold = -1;
    std::chrono::steady_clock::time_point timeOfLastKeepAlivePacket;
	std::thread thread;
	bool isRunning=true;
	void ExecNs();
public:
	NetworkClient(std::string address, unsigned short port, std::string username);
	~NetworkClient();
};