Servercore Changes

This commit is contained in:
Matt Arant committed 2023-10-06 18:31:22 +00:00
1 parent 9a39b6224c
commit 3a75e920d9
6 files changed
+40 -48

No files matched your search

+13 -16
View File
@@ -1,5 +1,6 @@
#include "Subscription.h"
#include "Log.h"
#include "MString.h"
#include "TCPSession.h"
#include "TCPSocket.h"
#include <algorithm>
@@ -8,15 +9,18 @@ namespace core
{
Subscription::Subscription(std::string id, std::string mode)
: id(id), mode(mode), owner(NULL), handler(NULL) {}
: id(id), mode(mode), owner(""), handler(NULL) {}
Subscription::Subscription(std::string id, coreutils::MString *alias, std::string mode)
Subscription::Subscription(std::string id, coreutils::MString alias, std::string mode)
: id(id), mode(mode), owner(alias), handler(NULL) {}
Subscription::Subscription(std::string id, coreutils::MString *alias, std::string ownership, std::string mode, SubscriptionHandler *handler, std::string will, std::string timer)
Subscription::Subscription(std::string id, coreutils::MString alias, std::string ownership, std::string mode, SubscriptionHandler *handler, std::string will, std::string timer)
: id(id), ownership(ownership), mode(mode), owner(alias), handler(handler), will(will), timer(timer)
{
// coreutils::Log(coreutils::LOG_DEBUG_3) << "Subscription '" << id << "' with handler '" << handler->name << "'";
coreutils::Log(coreutils::LOG_DEBUG_3) << owner;
coreutils::Log(coreutils::LOG_DEBUG_3) << will;
subscriptionOwner(owner, will);
}
Subscription::~Subscription()
@@ -57,19 +61,12 @@ namespace core
}
return 0;
}
bool Subscription::subscriptionOwner(coreutils::MString *alias, std::string ownerSelection)
bool Subscription::subscriptionOwner(coreutils::MString alias, std::string ownerSelection)
{
if (owner != NULL)
{
owner = alias;
will == ownerSelection;
coreutils::Log(coreutils::LOG_DEBUG_1) << "Owner of Subscription: " << *(std::string *)owner;
}
else
{
coreutils::Log(coreutils::LOG_DEBUG_1) << "There is no owner to this subscription";
}
subscriptionOwners = alias;
selectionOfOwnerForSubscription = ownerSelection;
coreutils::Log(coreutils::LOG_DEBUG_1) << "Owner of Subscription: " << subscriptionOwners;
coreutils::Log(coreutils::LOG_DEBUG_1) << "Will of Subscription: " << selectionOfOwnerForSubscription;
return true;
}