Servercore Changes
This commit is contained in:
1 parent
9a39b6224c
commit
3a75e920d9
6 files changed
+40
-48
No files matched your search
+14
-15
@@ -17,11 +17,9 @@ namespace core
|
||||
}
|
||||
bool SubscriptionManager::onClearSubscription(std::string temp, std::string key)
|
||||
{
|
||||
temp = key;
|
||||
// temp = key;
|
||||
temp = "";
|
||||
key = "";
|
||||
// delete subscription;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,9 +39,9 @@ namespace core
|
||||
temp = "";
|
||||
}
|
||||
countSubscribed += subscription->unsubscribe(session);
|
||||
if (subscription->owner == session.alias)
|
||||
if (subscription->subscriptionOwners == session.alias)
|
||||
{
|
||||
if (subscription->will == "*DIE") //--> This happens if the owner of the subscription sets it, or if not enough people in Vector -->//
|
||||
if (subscription->selectionOfOwnerForSubscription == "*DIE") //--> This happens if the owner of the subscription sets it, or if not enough people in Vector -->//
|
||||
{
|
||||
onClearSubscription(temp, key);
|
||||
}
|
||||
@@ -60,11 +58,11 @@ namespace core
|
||||
|
||||
for (auto subscribed = subscription->subscribers.begin(); subscribed < subscription->subscribers.end(); subscribed++)
|
||||
{
|
||||
if (*subscribed == &session)
|
||||
if ((*subscribed)->alias == session.alias)
|
||||
{
|
||||
subscription->subscribers.erase(subscribed++);
|
||||
}
|
||||
subscription->subscriptionOwner((*subscribed)->alias, "*NEXT");
|
||||
subscription->subscriptionOwner(session.alias, "*NEXT");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,14 +93,16 @@ namespace core
|
||||
{
|
||||
handler = factory->getSubscriptionHandler(request[4].str());
|
||||
}
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << request[1].str() << ":" << request[2].str();
|
||||
// coreutils::Log(coreutils::LOG_DEBUG_1) << request[1].str() << ":" << session.alias << ":" << request[2].str() << ":" << request[3].str() << ":" << request[4].str() << ":" << request[5].str() << ":" << request[6].str();
|
||||
if (request[2].str() == "*OWNER")
|
||||
{
|
||||
|
||||
newSubscription = new Subscription(request[1].str(), session.alias, request[2].str(), request[3].str(), handler, request[5].str(), request[6].str());
|
||||
subscriptions.insert(std::make_pair(request[1].str(), newSubscription));
|
||||
subscription->subscriptionOwner(session.alias, request[5].str());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (request[0].equals("catalog"))
|
||||
@@ -119,13 +119,12 @@ namespace core
|
||||
{
|
||||
std::stringstream out;
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << request[2];
|
||||
invitee = (coreutils::MString *)&request[2];
|
||||
|
||||
// invitee = (coreutils::MString *)&request[2];
|
||||
|
||||
// TCPSession *tempSession = session.server.getSessionByAlias(invitee);
|
||||
// std::stringstream temp;
|
||||
// temp << "invite:" << request[1] << ":" << invitee;
|
||||
// tempSession->write(temp.str());
|
||||
TCPSession *tempSession = session.server.getSessionByAlias(invitee);
|
||||
std::stringstream temp;
|
||||
temp << "invite:" << request[1] << ":" << invitee;
|
||||
tempSession->write(temp.str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user