|
|
@@ -1365,73 +1365,6 @@ namespace Chromium {
|
|
|
return usercode;
|
|
|
}
|
|
|
|
|
|
- bool CModTools::CheckTradeRecord() {
|
|
|
- std::list<int> timeList;
|
|
|
-
|
|
|
- using namespace Upload;
|
|
|
- UploadService_ClientBase* pClient = new UploadService_ClientBase(m_pEntity);
|
|
|
- auto rc = pClient->Connect();
|
|
|
- if (rc != Error_Succeed)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("connect to Upload entity fail: %d", rc);
|
|
|
- pClient->SafeDelete();
|
|
|
- pClient = NULL;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- UploadService_UploadDateList_Req req = {};
|
|
|
- UploadService_UploadDateList_Ans ans = {};
|
|
|
-
|
|
|
- rc = (*pClient)(EntityResource::getLink().upgradeLink())->UploadDateList(req, ans, 10000);
|
|
|
-
|
|
|
- if (rc != Error_Succeed)
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get CreateProcessRunAs fail from FreeRDPWrap: %d", rc);
|
|
|
- else
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("UploadDateList succeed from Upload");
|
|
|
- for (int i = 0; i < ans.uploadDateStr.GetCount(); ++i)
|
|
|
- {
|
|
|
- CSimpleStringA str = (CSimpleStringA)ans.uploadDateStr[i];
|
|
|
- int t = StandardToStamp(ans.uploadDateStr[i], true);
|
|
|
- timeList.emplace_back(t);
|
|
|
- }
|
|
|
- }
|
|
|
- pClient->GetFunction()->CloseSession();
|
|
|
- pClient = NULL;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // 比较时间戳 登记时间 <= 列表时间 < 今天 返回true
|
|
|
- time_t now = time(0);
|
|
|
- localtime(&now);
|
|
|
- now -= now % (3600 * 24);
|
|
|
- now -= 3600 * 8; //处理东八区问题
|
|
|
- CSmartPointer<IConfigInfo> spConfig;
|
|
|
- m_pEntity->GetFunction()->OpenConfig(Config_Run, spConfig);
|
|
|
- CSimpleStringA strLastRecordTime = "";
|
|
|
- ErrorCodeEnum errorRead = Error_Succeed;
|
|
|
- errorRead = spConfig->ReadConfigValue("Record", "LastRecordTime", strLastRecordTime);
|
|
|
- if (errorRead != Error_Succeed)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Read Record LastRecordTime -> Failed! Maybe LastRecordTime not exist!");
|
|
|
- strLastRecordTime = "";
|
|
|
- }
|
|
|
-
|
|
|
- int timestamp_lastRecordTime = now;
|
|
|
- if (!strLastRecordTime.IsNullOrEmpty())
|
|
|
- {
|
|
|
- timestamp_lastRecordTime = StandardToStamp(strLastRecordTime, false);
|
|
|
- }
|
|
|
- for (std::list<int>::iterator it = timeList.begin(); it != timeList.end(); ++it)
|
|
|
- {
|
|
|
- if (timestamp_lastRecordTime <= *it && *it < now)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("CheckTradeRecord lastRecordTime=%d, time_list=%d, now=%d", timestamp_lastRecordTime, *it, now);
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
void CModTools::InitBrowserUseMode()
|
|
|
{
|