Removed Message Queue
Sending and receiving is now in one thread (gotta make them separate)
Created a very crude Plugin System
Renamed AllAndMe to AllAndServer
This commit is contained in:
TheDoctor
2019-10-15 16:27:16 +01:00
parent 32473472e4
commit c50d40341f
48 changed files with 321 additions and 334 deletions

View File

@ -4,8 +4,9 @@
#include <atomic>
#include <queue>
#include <TcpListener.hpp>
#include <TcpConnection.hpp>
#include <VoidNet/TcpListener.hpp>
#include <HLAPI/TcpConnection.hpp>
#include <HLAPI/Plugin/PluginManager.hpp>
namespace std::net
{
@ -30,14 +31,15 @@ namespace std::net
void AddClient(std::shared_ptr<TcpConnection> &c);
void SetMaxConnections(uint32_t max_connections);
void HandlePluginMessage(const NetworkMessage& message);
uint32_t GetAvailableID();
private:
void HandleReceiveMsgAndConns();
void HandleSend();
void HandleMessage(const NetworkMessage &msg);
void HandleReceiveMsgAndConnsThreaded();
void HandleSendThreaded();
private:
std::vector<std::shared_ptr<TcpConnection>> m_list;
@ -54,6 +56,8 @@ namespace std::net
std::shared_ptr<TcpListener> m_listenerPtr;
std::shared_ptr<PluginManager> m_pluginManager;
std::vector<pollfd> poll_fds;
};
}