45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#ifndef __SubscriptionManager_h__
|
|
#define __SubscriptionManager_h__
|
|
|
|
#include "Command.h"
|
|
#include "MString.h"
|
|
#include "SessionFilter.h"
|
|
#include "Subscription.h"
|
|
#include "SubscriptionHandler.h"
|
|
#include "TCPSession.h"
|
|
#include "ZString.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace core
|
|
{
|
|
|
|
//*AUTHOR -> Dies when player disconnects
|
|
//*ANYONE -> Does not die when player disconnects
|
|
//*SUBSCRIPTION -> Does not die when player disconnects
|
|
//*OWNER -> Does die and transfers Ownership before he does
|
|
|
|
class SubscriptionHandlerFactory;
|
|
|
|
class SubscriptionManager : public Command
|
|
{
|
|
|
|
public:
|
|
int add(Subscription &subscription);
|
|
int removeSessionSubscriptions(TCPSession &session);
|
|
int processCommand(coreutils::ZString &request, TCPSession &session) override;
|
|
bool onClearSubscription(std::string temp, std::string key);
|
|
SubscriptionHandlerFactory *factory = NULL;
|
|
|
|
private:
|
|
Subscription *subscription;
|
|
std::map<std::string, Subscription *> subscriptions;
|
|
Subscription *newSubscription;
|
|
std::mutex lock;
|
|
coreutils::MString *invitee;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|