TcpServer's OnMessage is now an vector called OnMessageFunctions, each plugin will occupy an index in this vector
Readded receive_data method to VoidNetClient.hpp Minor fixes
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
|
||||
#include "Defs.hpp"
|
||||
#include "TcpClient.hpp"
|
||||
#include "Handshake.hpp"
|
||||
|
||||
#include <functional>
|
||||
|
||||
@ -38,7 +39,7 @@ public:
|
||||
|
||||
const TcpClient &GetClientByID(uint16 id);
|
||||
|
||||
std::function<void(const NetworkMessage &message)> OnMessage; // this is going to be used for plugins
|
||||
std::vector<std::function<void(const NetworkMessage &message)>> OnMessageFunctions; // this is going to be used for plugins
|
||||
|
||||
private:
|
||||
static void process_client_messages(TcpServer *server, TcpClient &client);
|
||||
|
||||
@ -30,9 +30,10 @@ struct VoidNetClientAPI
|
||||
static void Receive();
|
||||
|
||||
private:
|
||||
static void receive_data();
|
||||
|
||||
static TcpClient client;
|
||||
static uint16 id;
|
||||
static bool receive;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user