X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Ffreenet%2Fintroductionpuzzleinserter.h;h=e376dbf208cb5461be1beeb24aeabf519e8a73d3;hb=59a5414ec47a2932a7802fcd1d98c4d80166564f;hp=af66a5027f24f5e9b565863783d1cd8fe1baa4b5;hpb=d8f51eac91f86a1e00a05a5058a8fa9eb8732464;p=fms.git diff --git a/include/freenet/introductionpuzzleinserter.h b/include/freenet/introductionpuzzleinserter.h index af66a50..e376dbf 100644 --- a/include/freenet/introductionpuzzleinserter.h +++ b/include/freenet/introductionpuzzleinserter.h @@ -1,38 +1,28 @@ #ifndef _introductionpuzzle_inserter_ #define _introductionpuzzle_inserter_ -#include "../idatabase.h" -#include "../ilogger.h" -#include "../datetime.h" -#include "ifreenetregistrable.h" -#include "ifcpconnected.h" -#include "ifcpmessagehandler.h" -#include "iperiodicprocessor.h" +#include "iindexinserter.h" -class IntroductionPuzzleInserter:public IFreenetRegistrable,public IFCPConnected,public IFCPMessageHandler,public IPeriodicProcessor,public IDatabase,public ILogger +#include +#include + +class IntroductionPuzzleInserter:public IIndexInserter { public: - IntroductionPuzzleInserter(); - IntroductionPuzzleInserter(FCPv2 *fcp); - - void FCPConnected(); - void FCPDisconnected(); - - const bool HandleMessage(FCPMessage &message); - - void Process(); - - void RegisterWithThread(FreenetMasterThread *thread); + IntroductionPuzzleInserter(SQLite3DB::DB *db); + IntroductionPuzzleInserter(SQLite3DB::DB *db, FCPv2::Connection *fcp); private: void Initialize(); void CheckForNeededInsert(); - void StartInsert(const long localidentityid); + const bool StartInsert(const long &localidentityid); void GenerateCaptcha(std::string &encodeddata, std::string &solution); - const bool HandlePutSuccessful(FCPMessage &message); - const bool HandlePutFailed(FCPMessage &message); + const bool HandlePutSuccessful(FCPv2::Message &message); + const bool HandlePutFailed(FCPv2::Message &message); - DateTime m_lastchecked; + Poco::DateTime m_lastchecked; + int m_maxpuzzleinserts; + std::map m_lastinserted; };