//-----------------------------------------------------------------------------
struct IA_USER {
IA_USER()
- : lastSendAlive(0),
+ : user(NULL),
+ lastSendAlive(0),
rnd(random()),
port(0),
protoVer(0),
FREEMB freeMbShowType;
};
//-----------------------------------------------------------------------------
+class AUTH_IA;
+//-----------------------------------------------------------------------------
+class DEL_USER_NOTIFIER: public NOTIFIER_BASE<USER_PTR> {
+public:
+ DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {}
+ virtual ~DEL_USER_NOTIFIER() {}
+
+ void Notify(const USER_PTR & user);
+private:
+ AUTH_IA & auth;
+};
+//-----------------------------------------------------------------------------
class AUTH_IA :public AUTH {
+friend class DEL_USER_NOTIFIER;
public:
AUTH_IA();
virtual ~AUTH_IA();
uint32_t enabledDirs;
- class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
- public:
- DEL_USER_NONIFIER(AUTH_IA & a) : auth(a) {}
- virtual ~DEL_USER_NONIFIER() {}
-
- void Notify(const USER_PTR & user)
- {
- auth.DelUser(user);
- }
-
- private:
- AUTH_IA & auth;
- } onDelUserNotifier;
+ DEL_USER_NOTIFIER onDelUserNotifier;
class UnauthorizeUser : std::unary_function<const std::pair<uint32_t, IA_USER> &, void> {
public:
};
//-----------------------------------------------------------------------------
+inline
+void DEL_USER_NOTIFIER::Notify(const USER_PTR & user)
+{
+ auth.DelUser(user);
+}
#endif