updates and move zox plugs to their repo

This commit is contained in:
Green Sky 2024-02-04 12:49:04 +01:00
parent a533eae7ba
commit 931c9386c2
No known key found for this signature in database
7 changed files with 4 additions and 152 deletions

@ -1 +1 @@
Subproject commit eba657c484613d0102d62cddcc7f492d154a0b95 Subproject commit 4dc877ef68a4e100f067c6696ed9e4169e4d70b6

@ -1 +1 @@
Subproject commit 17ffaee013d97412eab2395cb9555ca3213c5302 Subproject commit 82cfb6d4920a2d6eb19e3f3560b20ec281a5fa81

@ -1 +1 @@
Subproject commit 6a48ace06f296b1a113890d80ffa5c19f2f4f58c Subproject commit d948897c3e0713b53d2aebea1fb7b2950109c662

2
external/totato vendored

@ -1 +1 @@
Subproject commit 8b3af55834517bddce3ff9944b21c0195a7c67d9 Subproject commit 949929f490db78ccbbc41f3f851b96d379fbe67e

View File

@ -15,30 +15,6 @@ target_link_libraries(plugin_ngcft1 PUBLIC
######################################## ########################################
add_library(plugin_zox_ngc SHARED
./plugin_zox_ngc.cpp
)
set_property(TARGET plugin_zox_ngc PROPERTY C_VISIBILITY_PRESET hidden)
target_link_libraries(plugin_zox_ngc PUBLIC
solanaceae_plugin
solanaceae_zox
)
########################################
add_library(plugin_zox_ngc_hs SHARED
./plugin_zox_ngc_hs.cpp
)
set_property(TARGET plugin_zox_ngc_hs PROPERTY C_VISIBILITY_PRESET hidden)
target_link_libraries(plugin_zox_ngc_hs PUBLIC
solanaceae_plugin
solanaceae_zox
)
########################################
add_library(plugin_transfer_auto_accept SHARED add_library(plugin_transfer_auto_accept SHARED
./plugin_transfer_auto_accept.cpp ./plugin_transfer_auto_accept.cpp
./transfer_auto_accept.hpp ./transfer_auto_accept.hpp

View File

@ -1,59 +0,0 @@
#include <solanaceae/plugin/solana_plugin_v1.h>
#include <solanaceae/zox/ngc.hpp>
#include <memory>
#include <limits>
#include <iostream>
static std::unique_ptr<ZoxNGCEventProvider> g_zngc = nullptr;
constexpr const char* plugin_name = "ZoxNGC";
extern "C" {
SOLANA_PLUGIN_EXPORT const char* solana_plugin_get_name(void) {
return plugin_name;
}
SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_get_version(void) {
return SOLANA_PLUGIN_VERSION;
}
SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api) {
std::cout << "PLUGIN " << plugin_name << " START()\n";
if (solana_api == nullptr) {
return 1;
}
try {
auto* tox_event_provider_i = PLUG_RESOLVE_INSTANCE(ToxEventProviderI);
// static store, could be anywhere tho
// construct with fetched dependencies
g_zngc = std::make_unique<ZoxNGCEventProvider>(*tox_event_provider_i);
// register types
PLUG_PROVIDE_INSTANCE(ZoxNGCEventProviderI, plugin_name, g_zngc.get());
} catch (const ResolveException& e) {
std::cerr << "PLUGIN " << plugin_name << " " << e.what << "\n";
return 2;
}
return 0;
}
SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void) {
std::cout << "PLUGIN " << plugin_name << " STOP()\n";
g_zngc.reset();
}
SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta) {
(void)delta;
return std::numeric_limits<float>::max();
}
} // extern C

View File

@ -1,65 +0,0 @@
#include <solanaceae/plugin/solana_plugin_v1.h>
#include <solanaceae/zox/ngc.hpp>
#include <solanaceae/zox/ngc_hs.hpp>
#include <solanaceae/toxcore/tox_interface.hpp>
#include <solanaceae/tox_contacts/tox_contact_model2.hpp>
#include <memory>
#include <iostream>
static std::unique_ptr<ZoxNGCHistorySync> g_zngchs = nullptr;
constexpr const char* plugin_name = "ZoxNGCHistorySync";
extern "C" {
SOLANA_PLUGIN_EXPORT const char* solana_plugin_get_name(void) {
return plugin_name;
}
SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_get_version(void) {
return SOLANA_PLUGIN_VERSION;
}
SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api) {
std::cout << "PLUGIN " << plugin_name << " START()\n";
if (solana_api == nullptr) {
return 1;
}
try {
auto* tox_i = PLUG_RESOLVE_INSTANCE(ToxI);
auto* tox_event_provider_i = PLUG_RESOLVE_INSTANCE(ToxEventProviderI);
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);
// static store, could be anywhere tho
// construct with fetched dependencies
g_zngchs = std::make_unique<ZoxNGCHistorySync>(*tox_event_provider_i, *zox_ngc_event_provider_i, *tox_i, *cr, *tcm, *rmm);
// register types
PLUG_PROVIDE_INSTANCE(ZoxNGCHistorySync, plugin_name, g_zngchs.get());
} catch (const ResolveException& e) {
std::cerr << "PLUGIN " << plugin_name << " " << e.what << "\n";
return 2;
}
return 0;
}
SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void) {
std::cout << "PLUGIN " << plugin_name << " STOP()\n";
g_zngchs.reset();
}
SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta) {
return g_zngchs->tick(delta);
}
} // extern C