update to rmmi
This commit is contained in:
parent
a678b62763
commit
c81a04a778
@ -38,7 +38,7 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
|
|||||||
auto* zox_ngc_event_provider_i = PLUG_RESOLVE_INSTANCE(ZoxNGCEventProviderI);
|
auto* zox_ngc_event_provider_i = PLUG_RESOLVE_INSTANCE(ZoxNGCEventProviderI);
|
||||||
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
|
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
|
||||||
auto* tcm = PLUG_RESOLVE_INSTANCE(ToxContactModel2);
|
auto* tcm = PLUG_RESOLVE_INSTANCE(ToxContactModel2);
|
||||||
auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModel);
|
auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModelI);
|
||||||
|
|
||||||
// static store, could be anywhere tho
|
// static store, could be anywhere tho
|
||||||
// construct with fetched dependencies
|
// construct with fetched dependencies
|
||||||
|
@ -21,7 +21,7 @@ void ZoxNGCHistorySync::subscribeToEvents(void) {
|
|||||||
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN);
|
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoxNGCHistorySync::ZoxNGCHistorySync(ToxEventProviderI& tep, ZoxNGCEventProviderI& zngcepi, ToxI& t, Contact3Registry& cr, ToxContactModel2& tcm, RegistryMessageModel& rmm)
|
ZoxNGCHistorySync::ZoxNGCHistorySync(ToxEventProviderI& tep, ZoxNGCEventProviderI& zngcepi, ToxI& t, Contact3Registry& cr, ToxContactModel2& tcm, RegistryMessageModelI& rmm)
|
||||||
: _tep(tep), _zngcepi(zngcepi), _t(t), _cr(cr), _tcm(tcm), _rmm(rmm), _rng(std::random_device{}())
|
: _tep(tep), _zngcepi(zngcepi), _t(t), _cr(cr), _tcm(tcm), _rmm(rmm), _rng(std::random_device{}())
|
||||||
{
|
{
|
||||||
subscribeToEvents();
|
subscribeToEvents();
|
||||||
@ -259,7 +259,7 @@ bool ZoxNGCHistorySync::onEvent(const Events::ZoxNGC_ngch_request& e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// const -> dont create (this is a request for existing messages)
|
// const -> dont create (this is a request for existing messages)
|
||||||
auto* reg_ptr = static_cast<const RegistryMessageModel&>(_rmm).get(request_sender);
|
auto* reg_ptr = static_cast<const RegistryMessageModelI&>(_rmm).get(request_sender);
|
||||||
if (reg_ptr == nullptr) {
|
if (reg_ptr == nullptr) {
|
||||||
std::cerr << "ZNGCHS error: group without reg\n";
|
std::cerr << "ZNGCHS error: group without reg\n";
|
||||||
return true;
|
return true;
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
// fwd
|
// fwd
|
||||||
struct ToxI;
|
struct ToxI;
|
||||||
struct ContactModelI;
|
struct ContactModelI;
|
||||||
class RegistryMessageModel;
|
|
||||||
class ToxContactModel2;
|
class ToxContactModel2;
|
||||||
|
|
||||||
// zoff ngc history sync (draft1?)
|
// zoff ngc history sync (draft1?)
|
||||||
@ -25,7 +24,7 @@ class ZoxNGCHistorySync : public ToxEventI, public ZoxNGCEventI {
|
|||||||
ToxI& _t;
|
ToxI& _t;
|
||||||
Contact3Registry& _cr;
|
Contact3Registry& _cr;
|
||||||
ToxContactModel2& _tcm;
|
ToxContactModel2& _tcm;
|
||||||
RegistryMessageModel& _rmm;
|
RegistryMessageModelI& _rmm;
|
||||||
|
|
||||||
// how far apart the 2 timestamps can be, before they are considered different messages
|
// how far apart the 2 timestamps can be, before they are considered different messages
|
||||||
const int64_t _max_age_difference_ms {130*60*1000}; // TODO: make this larger?
|
const int64_t _max_age_difference_ms {130*60*1000}; // TODO: make this larger?
|
||||||
@ -67,7 +66,7 @@ class ZoxNGCHistorySync : public ToxEventI, public ZoxNGCEventI {
|
|||||||
void subscribeToEvents(void); // private
|
void subscribeToEvents(void); // private
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ZoxNGCHistorySync(ToxEventProviderI& tep, ZoxNGCEventProviderI& zngcepi, ToxI& t, Contact3Registry& cr, ToxContactModel2& tcm, RegistryMessageModel& rmm);
|
ZoxNGCHistorySync(ToxEventProviderI& tep, ZoxNGCEventProviderI& zngcepi, ToxI& t, Contact3Registry& cr, ToxContactModel2& tcm, RegistryMessageModelI& rmm);
|
||||||
|
|
||||||
float tick(float delta);
|
float tick(float delta);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user