midway through refactor, ft done (?)

This commit is contained in:
2023-01-12 22:48:51 +01:00
parent 2031ef94b6
commit 89f9610730
5 changed files with 258 additions and 178 deletions

View File

@@ -2,7 +2,7 @@
#include "./ngc_hs1.h"
#include "ngc_ext_common.hpp"
#include "../tox_ngc_ext/ngc_ext.hpp"
#include "ngc_ft1.h"
#include <cstdint>
@@ -51,10 +51,10 @@ struct NGC_HS1 {
};
struct Group {
std::map<_PeerKey, Peer> peers;
std::map<NGC_EXT::PeerKey, Peer> peers;
struct FileTransfers {
_PeerKey msg_peer;
NGC_EXT::PeerKey msg_peer;
uint32_t msg_id;
float time_since_ft_activity {0.f};
std::vector<uint8_t> recv_buffer; // message gets dumped into here
@@ -64,13 +64,13 @@ struct NGC_HS1 {
std::map<std::pair<uint32_t, uint8_t>, FileTransfers> transfers;
struct Sending {
_PeerKey msg_peer;
NGC_EXT::PeerKey msg_peer;
uint32_t msg_id;
};
std::map<std::pair<uint32_t, uint8_t>, Sending> sending;
};
std::map<_GroupKey, Group> history;
std::map<NGC_EXT::GroupKey, Group> history;
};
void _handle_HS1_REQUEST_LAST_IDS(
@@ -81,7 +81,8 @@ void _handle_HS1_REQUEST_LAST_IDS(
uint32_t peer_number,
const uint8_t *data,
size_t length
size_t length,
void* user_data
);
void _handle_HS1_RESPONSE_LAST_IDS(
@@ -92,7 +93,8 @@ void _handle_HS1_RESPONSE_LAST_IDS(
uint32_t peer_number,
const uint8_t *data,
size_t length
size_t length,
void* user_data
);
void _handle_HS1_ft_request_message(