Implemented DonateStrategy.
This commit is contained in:
parent
25faeabd61
commit
7e17f77c11
8 changed files with 88 additions and 37 deletions
|
@ -43,7 +43,9 @@ public:
|
|||
DonateStrategy(const char *agent, IStrategyListener *listener);
|
||||
|
||||
public:
|
||||
bool isActive() const override;
|
||||
inline bool isActive() const override { return m_active; }
|
||||
inline void resume() override {}
|
||||
|
||||
void connect() override;
|
||||
void submit(const JobResult &result) override;
|
||||
|
||||
|
@ -53,10 +55,15 @@ protected:
|
|||
void onLoginSuccess(Client *client) override;
|
||||
|
||||
private:
|
||||
void idle();
|
||||
void stop();
|
||||
|
||||
static void onTimer(uv_timer_t *handle);
|
||||
|
||||
bool m_active;
|
||||
Client *m_client;
|
||||
const int m_donateTime;
|
||||
const int m_idleTime;
|
||||
IStrategyListener *m_listener;
|
||||
uv_timer_t m_timer;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue