- m_db->Execute("UPDATE tblLocalIdentity SET InsertingPuzzle='true' WHERE LocalIdentityID="+idstring+";");\r
- m_db->Execute("INSERT INTO tblIntroductionPuzzleInserts(UUID,Type,MimeType,LocalIdentityID,PuzzleData,PuzzleSolution) VALUES('"+xml.GetUUID()+"','captcha','image/bmp',"+idstring+",'"+encodedpuzzle+"','"+solutionstring+"');");\r
+ xml.SetType("captcha");\r
+ std::string uuidstr=uuid.toString();\r
+ StringFunctions::UpperCase(uuidstr,uuidstr);\r
+ xml.SetUUID(uuidstr+"@"+keypart);\r
+ xml.SetPuzzleData(encodedpuzzle);\r
+ xml.SetMimeType("image/bmp");\r
+\r
+ xmldata=xml.GetXML();\r
+ StringFunctions::Convert(xmldata.size(),xmldatasizestr);\r
+\r
+ message.SetName("ClientPut");\r
+ message["URI"]=privatekey+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y-%m-%d")+"|IntroductionPuzzle|"+indexstr+".xml";\r
+ message["Identifier"]=m_fcpuniquename+"|"+idstring+"|"+indexstr+"|"+xml.GetUUID()+"|"+message["URI"];\r
+ message["UploadFrom"]="direct";\r
+ message["DataLength"]=xmldatasizestr;\r
+ m_fcp->SendMessage(message);\r
+ m_fcp->SendRaw(xmldata.c_str(),xmldata.size());\r
+\r
+ // insert to USK\r
+ message.Reset();\r
+ message.SetName("ClientPutComplexDir");\r
+ message["URI"]="USK"+privatekey.substr(3)+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y.%m.%d")+"|IntroductionPuzzle/0/";\r
+ message["Identifier"]=m_fcpuniquename+"USK|"+message["URI"];\r
+ message["DefaultName"]="IntroductionPuzzle.xml";\r
+ message["Files.0.Name"]="IntroductionPuzzle.xml";\r
+ message["Files.0.UplaodFrom"]="direct";\r
+ message["Files.0.DataLength"]=xmldatasizestr;\r
+ m_fcp->SendMessage(message);\r
+ m_fcp->SendRaw(xmldata.c_str(),xmldata.size());\r
+\r
+ m_db->Execute("INSERT INTO tblIntroductionPuzzleInserts(UUID,Type,MimeType,LocalIdentityID,PuzzleData,PuzzleSolution) VALUES('"+xml.GetUUID()+"','captcha','image/bmp',"+idstring+",'"+encodedpuzzle+"','"+solutionstring+"');");\r
+\r
+ m_inserting.push_back(localidentityid);\r
+\r
+ m_log->debug("IntroductionPuzzleInserter::StartInsert started insert for id "+idstring);\r
+ }\r
+ else\r
+ {\r
+ m_log->warning("IntroductionPuzzleInserter::StartInsert already inserted 50 puzzles for "+idstring);\r
+ }\r