adde contributing.md

This commit is contained in:
Ryzerth
2021-04-25 19:44:41 +02:00
parent 8c428be885
commit 1c18310f37
4 changed files with 142 additions and 7 deletions

View File

@ -18,19 +18,19 @@ SDRPP_MOD_INFO {
#define DISCORD_APP_ID "834590435708108860"
class PresenceModule : public ModuleManager::Instance {
class DiscordIntegrationModule : public ModuleManager::Instance {
public:
PresenceModule(std::string name) {
DiscordIntegrationModule(std::string name) {
this->name = name;
// Change to timer start later on
workerRunning = true;
workerThread = std::thread(&PresenceModule::worker, this);
workerThread = std::thread(&DiscordIntegrationModule::worker, this);
startPresence();
}
~PresenceModule() {
~DiscordIntegrationModule() {
// Change to timer stop later on
workerRunning = false;
if (workerThread.joinable()) { workerThread.join(); }
@ -39,7 +39,7 @@ public:
void enable() {
// Change to timer start later on
workerRunning = true;
workerThread = std::thread(&PresenceModule::worker, this);
workerThread = std::thread(&DiscordIntegrationModule::worker, this);
enabled = true;
}
@ -148,11 +148,11 @@ MOD_EXPORT void _INIT_() {
}
MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {
return new PresenceModule(name);
return new DiscordIntegrationModule(name);
}
MOD_EXPORT void _DELETE_INSTANCE_(void* instance) {
delete (PresenceModule*)instance;
delete (DiscordIntegrationModule*)instance;
}
MOD_EXPORT void _END_() {