From c81a04a778428fc289bdd03bba7f707cf8cf00b7 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sun, 6 Oct 2024 11:39:26 +0200 Subject: [PATCH] update to rmmi --- plugins/plugin_zox_ngc_hs.cpp | 2 +- src/solanaceae/zox/ngc_hs.cpp | 4 ++-- src/solanaceae/zox/ngc_hs.hpp | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/plugin_zox_ngc_hs.cpp b/plugins/plugin_zox_ngc_hs.cpp index 420c13a..3e38c37 100644 --- a/plugins/plugin_zox_ngc_hs.cpp +++ b/plugins/plugin_zox_ngc_hs.cpp @@ -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* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1"); auto* tcm = PLUG_RESOLVE_INSTANCE(ToxContactModel2); - auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModel); + auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModelI); // static store, could be anywhere tho // construct with fetched dependencies diff --git a/src/solanaceae/zox/ngc_hs.cpp b/src/solanaceae/zox/ngc_hs.cpp index e7bb477..737ce29 100644 --- a/src/solanaceae/zox/ngc_hs.cpp +++ b/src/solanaceae/zox/ngc_hs.cpp @@ -21,7 +21,7 @@ void ZoxNGCHistorySync::subscribeToEvents(void) { _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{}()) { subscribeToEvents(); @@ -259,7 +259,7 @@ bool ZoxNGCHistorySync::onEvent(const Events::ZoxNGC_ngch_request& e) { } // const -> dont create (this is a request for existing messages) - auto* reg_ptr = static_cast(_rmm).get(request_sender); + auto* reg_ptr = static_cast(_rmm).get(request_sender); if (reg_ptr == nullptr) { std::cerr << "ZNGCHS error: group without reg\n"; return true; diff --git a/src/solanaceae/zox/ngc_hs.hpp b/src/solanaceae/zox/ngc_hs.hpp index 57ee957..2d53d0a 100644 --- a/src/solanaceae/zox/ngc_hs.hpp +++ b/src/solanaceae/zox/ngc_hs.hpp @@ -13,7 +13,6 @@ // fwd struct ToxI; struct ContactModelI; -class RegistryMessageModel; class ToxContactModel2; // zoff ngc history sync (draft1?) @@ -25,7 +24,7 @@ class ZoxNGCHistorySync : public ToxEventI, public ZoxNGCEventI { ToxI& _t; Contact3Registry& _cr; ToxContactModel2& _tcm; - RegistryMessageModel& _rmm; + RegistryMessageModelI& _rmm; // 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? @@ -67,7 +66,7 @@ class ZoxNGCHistorySync : public ToxEventI, public ZoxNGCEventI { void subscribeToEvents(void); // private 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);