|
@@ -97,10 +97,11 @@ void HttpSocket::stopmsg()
|
|
|
|
|
|
void HttpSocket::init()
|
|
|
{
|
|
|
-
|
|
|
+ staticdata tstaticdata;
|
|
|
try
|
|
|
{
|
|
|
- makegamelist(m_staticdata);
|
|
|
+ makegamelist(tstaticdata);
|
|
|
+ m_updatestatic("staticdata", tstaticdata);
|
|
|
}
|
|
|
catch (const std::exception&)
|
|
|
{
|
|
@@ -220,6 +221,13 @@ bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+void HttpSocket::updatemsg(std::string strtype, boost::any getdata)
|
|
|
+{
|
|
|
+ if (strtype == "staticdata")
|
|
|
+ {
|
|
|
+ m_staticdata = boost::any_cast<staticdata>(getdata);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
void HttpSocket::makegamelist(staticdata& tstaticdata)
|
|
|
{
|
|
@@ -2213,14 +2221,7 @@ std::string HttpSocket::playgameinfo(std::map<std::string, std::string> getdata)
|
|
|
{
|
|
|
itemp64 = tempinfo["inserttime"].get_int64();
|
|
|
}
|
|
|
-
|
|
|
- std::string inserttime{};
|
|
|
- if (itemp64 >= 0)
|
|
|
- {
|
|
|
- inserttime = funclib::gettimefromstamp(itemp64);
|
|
|
- }
|
|
|
-
|
|
|
- gameinfodoc.AddMember("inserttime", rapidjson::Value(inserttime.c_str(), gallocator), gallocator);
|
|
|
+ gameinfodoc.AddMember("inserttime", itemp64, gallocator);
|
|
|
|
|
|
rapidjson::Value element(rapidjson::kObjectType);
|
|
|
element.CopyFrom(gameinfodoc, allocator);
|