|
@@ -7,10 +7,30 @@
|
|
|
#include <sstream>
|
|
|
#include <string>
|
|
|
#include <utility>
|
|
|
+#include <boost/lexical_cast.hpp>
|
|
|
+#include <boost/chrono.hpp>
|
|
|
+#include <boost/date_time/posix_time/posix_time.hpp>
|
|
|
+
|
|
|
|
|
|
using namespace bsoncxx::builder::basic;
|
|
|
using namespace chrono;
|
|
|
mongocxx::instance g_instance{};
|
|
|
+std::int64_t getstrfromstamp(std::string strtime)
|
|
|
+{
|
|
|
+ __int64 igettime = 0;
|
|
|
+ boost::replace_all(strtime, " ", "T");
|
|
|
+ boost::replace_all(strtime, "-", "");
|
|
|
+ boost::replace_all(strtime, ":", "");
|
|
|
+ strtime += "000";
|
|
|
+
|
|
|
+ boost::posix_time::ptime ssp = boost::posix_time::from_iso_string(strtime);
|
|
|
+ boost::posix_time::time_duration time_from_epoch = boost::posix_time::microsec_clock::universal_time() - boost::posix_time::microsec_clock::local_time();
|
|
|
+ boost::posix_time::ptime epoch(boost::gregorian::date(1970, boost::gregorian::Jan, 1));
|
|
|
+ boost::posix_time::time_duration time_epoch = ssp - epoch;
|
|
|
+ igettime = time_epoch.total_milliseconds() + time_from_epoch.total_milliseconds() / 360000 * 360000;
|
|
|
+
|
|
|
+ return igettime;
|
|
|
+}
|
|
|
|
|
|
HttpSocket::HttpSocket()
|
|
|
{
|
|
@@ -357,7 +377,8 @@ void HttpSocket::getgamehistory(__int64 itimefrom, __int64 itimeto, __int32 ifir
|
|
|
recorddoc.append(kvp("account", straccount.c_str()));
|
|
|
recorddoc.append(kvp("currency", strcurrency.c_str()));
|
|
|
recorddoc.append(kvp("scoretype", 1));
|
|
|
- recorddoc.append(kvp("inserttime", funclib::gettimestamp()));
|
|
|
+ std::int64_t icreateime = getstrfromstamp(strroundData);
|
|
|
+ recorddoc.append(kvp("inserttime", icreateime));
|
|
|
m_pgameprizelog->insert_one(recorddoc.view());
|
|
|
}
|
|
|
}
|