From bfb2d8d8e5a278d96bca7bdaf3630990c64dc964 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Mon, 10 Mar 2025 20:42:06 +0100 Subject: [PATCH] contact4 --- external/solanaceae_bridge | 2 +- external/solanaceae_contact | 2 +- external/solanaceae_crdtnotes | 2 +- external/solanaceae_ircclient | 2 +- external/solanaceae_llama-cpp-web | 2 +- external/solanaceae_message3 | 2 +- external/solanaceae_message_fragment_store | 2 +- external/solanaceae_message_serializer | 2 +- external/solanaceae_ngc_ft1 | 2 +- external/solanaceae_object_store | 2 +- external/solanaceae_tox | 2 +- external/solanaceae_tox_p2prng | 2 +- external/solanaceae_tox_upnp | 2 +- external/solanaceae_toxic_games | 2 +- external/solanaceae_zox | 2 +- external/totato | 2 +- plugins/dice_tool.cpp | 23 ++++++++++++---------- plugins/dice_tool.hpp | 6 +++--- plugins/plugin_dice_tool.cpp | 7 +++++-- plugins/plugin_transfer_auto_accept.cpp | 3 ++- 20 files changed, 39 insertions(+), 32 deletions(-) diff --git a/external/solanaceae_bridge b/external/solanaceae_bridge index c5bf212..dd462b4 160000 --- a/external/solanaceae_bridge +++ b/external/solanaceae_bridge @@ -1 +1 @@ -Subproject commit c5bf212ab98492779392518ea4bc8c958ee45e46 +Subproject commit dd462b450e357fdccdd721d5b8d0d325622b33e3 diff --git a/external/solanaceae_contact b/external/solanaceae_contact index e2917c4..99d9633 160000 --- a/external/solanaceae_contact +++ b/external/solanaceae_contact @@ -1 +1 @@ -Subproject commit e2917c497c91f91f8febcd1f43e462fad8359305 +Subproject commit 99d9633ff109321e78cf2817d3b8631d364a2483 diff --git a/external/solanaceae_crdtnotes b/external/solanaceae_crdtnotes index 31c3ed4..e7096ee 160000 --- a/external/solanaceae_crdtnotes +++ b/external/solanaceae_crdtnotes @@ -1 +1 @@ -Subproject commit 31c3ed4688de6f80bb160ce5d3168ac6b57cf318 +Subproject commit e7096ee20f8318550ef3fcfacab1170d27cae6ba diff --git a/external/solanaceae_ircclient b/external/solanaceae_ircclient index 3657634..5ebeeef 160000 --- a/external/solanaceae_ircclient +++ b/external/solanaceae_ircclient @@ -1 +1 @@ -Subproject commit 3657634be5864620177504b5961308071991c43d +Subproject commit 5ebeeef3c281460737132fffead5899cd3291edd diff --git a/external/solanaceae_llama-cpp-web b/external/solanaceae_llama-cpp-web index 31855cd..7e1b424 160000 --- a/external/solanaceae_llama-cpp-web +++ b/external/solanaceae_llama-cpp-web @@ -1 +1 @@ -Subproject commit 31855cd1b13c7c70480b9df35060fd6f5254798a +Subproject commit 7e1b424adb49e4267a138244030572c6f034dcee diff --git a/external/solanaceae_message3 b/external/solanaceae_message3 index e55fb46..2a3828b 160000 --- a/external/solanaceae_message3 +++ b/external/solanaceae_message3 @@ -1 +1 @@ -Subproject commit e55fb46027f16a1bc078f797ae9fcc7609d15659 +Subproject commit 2a3828b30d7ec5fb9e7c8a8a82d1be66e040ea74 diff --git a/external/solanaceae_message_fragment_store b/external/solanaceae_message_fragment_store index 50db703..8603a22 160000 --- a/external/solanaceae_message_fragment_store +++ b/external/solanaceae_message_fragment_store @@ -1 +1 @@ -Subproject commit 50db703d78ceaaef43c82e2e4198500d23e1de7e +Subproject commit 8603a22cbb4e074e4c4fad513c68a88a4dc58104 diff --git a/external/solanaceae_message_serializer b/external/solanaceae_message_serializer index b1becb2..c284e07 160000 --- a/external/solanaceae_message_serializer +++ b/external/solanaceae_message_serializer @@ -1 +1 @@ -Subproject commit b1becb2128224fe63b7dff2218ecc66e9b92bc5b +Subproject commit c284e0779e69618f0524acba67849801cbb5a5d7 diff --git a/external/solanaceae_ngc_ft1 b/external/solanaceae_ngc_ft1 index 7a54552..246587e 160000 --- a/external/solanaceae_ngc_ft1 +++ b/external/solanaceae_ngc_ft1 @@ -1 +1 @@ -Subproject commit 7a54552bd2756cb8e034f22ac8238edc20740302 +Subproject commit 246587e30d29489f35e23855432c784998ca94f4 diff --git a/external/solanaceae_object_store b/external/solanaceae_object_store index e5b3546..241a0c0 160000 --- a/external/solanaceae_object_store +++ b/external/solanaceae_object_store @@ -1 +1 @@ -Subproject commit e5b3546292c906da4680f838c235e3464476917b +Subproject commit 241a0c0906f75555218a04b99259b51b0c0c25a4 diff --git a/external/solanaceae_tox b/external/solanaceae_tox index dd7eb27..24bbf2a 160000 --- a/external/solanaceae_tox +++ b/external/solanaceae_tox @@ -1 +1 @@ -Subproject commit dd7eb2702f3844085f3cd8495db1e1a087afd724 +Subproject commit 24bbf2a3381de3e2a7c06c035eb0b19467c2a6b5 diff --git a/external/solanaceae_tox_p2prng b/external/solanaceae_tox_p2prng index dd6551e..7397a0d 160000 --- a/external/solanaceae_tox_p2prng +++ b/external/solanaceae_tox_p2prng @@ -1 +1 @@ -Subproject commit dd6551ed27591cc8e3eabea2064798fb934eae8f +Subproject commit 7397a0d02b190887d2e45e3eb2c225af72e46dd3 diff --git a/external/solanaceae_tox_upnp b/external/solanaceae_tox_upnp index c3580d2..4df49c5 160000 --- a/external/solanaceae_tox_upnp +++ b/external/solanaceae_tox_upnp @@ -1 +1 @@ -Subproject commit c3580d2c6f4f92f10258343b5c391d7c577ee56d +Subproject commit 4df49c5be9309b952f327335e2480329f1eb2d0c diff --git a/external/solanaceae_toxic_games b/external/solanaceae_toxic_games index 5450233..7b7b3f4 160000 --- a/external/solanaceae_toxic_games +++ b/external/solanaceae_toxic_games @@ -1 +1 @@ -Subproject commit 5450233eb70715a31027b43b07c137252762d93a +Subproject commit 7b7b3f4a9402d7ee7a599d1f4289a706a4633373 diff --git a/external/solanaceae_zox b/external/solanaceae_zox index 2f0dba1..399c27c 160000 --- a/external/solanaceae_zox +++ b/external/solanaceae_zox @@ -1 +1 @@ -Subproject commit 2f0dba1044fc3578ea8e8954417f50d0df5970c1 +Subproject commit 399c27cc2b9b2e441c6a0183de774fb6d3a07ae6 diff --git a/external/totato b/external/totato index e77e57f..9e42508 160000 --- a/external/totato +++ b/external/totato @@ -1 +1 @@ -Subproject commit e77e57fa78e7cf0c4301855c14b3a125348abfbd +Subproject commit 9e42508428b8f10c1aa27e7441529a0b0517f735 diff --git a/plugins/dice_tool.cpp b/plugins/dice_tool.cpp index 36403bf..5217dd2 100644 --- a/plugins/dice_tool.cpp +++ b/plugins/dice_tool.cpp @@ -1,15 +1,18 @@ #include "./dice_tool.hpp" +#include #include #include #include +#include +#include #include #include -DiceTool::DiceTool(P2PRNGI& p2prng, Contact3Registry& cr) : _p2prng(p2prng), _cr(cr) { +DiceTool::DiceTool(P2PRNGI& p2prng, ContactStore4I& cs) : _p2prng(p2prng), _cs(cs) { p2prng.subscribe(this, P2PRNG_Event::init); p2prng.subscribe(this, P2PRNG_Event::hmac); p2prng.subscribe(this, P2PRNG_Event::secret); @@ -29,7 +32,7 @@ float DiceTool::render(float) { static uint16_t g_sides {6}; ImGui::InputScalar("##sides", ImGuiDataType_U16, &g_sides); - static entt::dense_set peers; + static entt::dense_set peers; if (ImGui::CollapsingHeader("peers")) { ImGui::Indent(); @@ -43,7 +46,7 @@ float DiceTool::render(float) { continue; } - Contact3Handle c {_cr, *it}; + ContactHandle4 c = _cs.contactHandle(*it); const char* str_ptr = ""; if (const auto* name_ptr = c.try_get(); name_ptr != nullptr && !name_ptr->name.empty()) { @@ -61,8 +64,8 @@ float DiceTool::render(float) { ImGui::OpenPopup("peer selector"); } if (ImGui::BeginPopup("peer selector")) { - for (const auto& [cv] : _cr.view().each()) { - Contact3Handle c {_cr, cv}; + for (const auto& [cv] : _cs.registry().view().each()) { + ContactHandle4 c = _cs.contactHandle(cv); if (peers.contains(c)) { continue; @@ -75,8 +78,8 @@ float DiceTool::render(float) { if (c.all_of()) { if (ImGui::BeginMenu(str_ptr)) { - for (const Contact3 child_cv : c.get().subs) { - Contact3Handle child_c {_cr, child_cv}; + for (const Contact4 child_cv : c.get().subs) { + ContactHandle4 child_c = _cs.contactHandle(child_cv); if (peers.contains(child_c)) { continue; @@ -113,10 +116,10 @@ float DiceTool::render(float) { } if (ImGui::Button("roll")) { - //std::vector c_vec{peers.cbegin(), peers.cend()}; - std::vector c_vec; + //std::vector c_vec{peers.cbegin(), peers.cend()}; + std::vector c_vec; for (const auto cv : peers) { - c_vec.emplace_back(_cr, cv); + c_vec.emplace_back(_cs.contactHandle(cv)); } std::vector is {'D', 'I', 'C', 'E'}; diff --git a/plugins/dice_tool.hpp b/plugins/dice_tool.hpp index c7f79af..5439760 100644 --- a/plugins/dice_tool.hpp +++ b/plugins/dice_tool.hpp @@ -1,13 +1,13 @@ #pragma once #include -#include +#include #include class DiceTool : public P2PRNGEventI { P2PRNGI& _p2prng; - Contact3Registry& _cr; + ContactStore4I& _cs; struct Rolls { std::vector id; @@ -23,7 +23,7 @@ class DiceTool : public P2PRNGEventI { std::vector _rolls; public: - DiceTool(P2PRNGI& p2prng, Contact3Registry& cr); + DiceTool(P2PRNGI& p2prng, ContactStore4I& cs); ~DiceTool(void); float render(float time_delta); diff --git a/plugins/plugin_dice_tool.cpp b/plugins/plugin_dice_tool.cpp index 87b77fc..d2f9408 100644 --- a/plugins/plugin_dice_tool.cpp +++ b/plugins/plugin_dice_tool.cpp @@ -1,6 +1,9 @@ #include +#include + #include "./dice_tool.hpp" + #include #include @@ -33,11 +36,11 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api) try { auto* p2prng_i = PLUG_RESOLVE_INSTANCE(P2PRNGI); - auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1"); + auto* cs = PLUG_RESOLVE_INSTANCE(ContactStore4I); // static store, could be anywhere tho // construct with fetched dependencies - g_dt = std::make_unique(*p2prng_i, *cr); + g_dt = std::make_unique(*p2prng_i, *cs); auto* imguic = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiContext, ImGui::GetVersion()); auto* imguimemaf = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiMemAllocFunc, ImGui::GetVersion()); diff --git a/plugins/plugin_transfer_auto_accept.cpp b/plugins/plugin_transfer_auto_accept.cpp index c868c3c..1ec02c4 100644 --- a/plugins/plugin_transfer_auto_accept.cpp +++ b/plugins/plugin_transfer_auto_accept.cpp @@ -1,8 +1,9 @@ #include -#include "./transfer_auto_accept.hpp" #include +#include "./transfer_auto_accept.hpp" + #include #include