Browse Source

Merge branch 'master' of http://110.40.64.236:3000/qingjie/webapi333

qingjie 2 months ago
parent
commit
e33b17910d
2 changed files with 11 additions and 3 deletions
  1. 10 2
      webapi/webapi/HttpSocket.cpp
  2. 1 1
      webapi/webapi/HttpSocket.h

+ 10 - 2
webapi/webapi/HttpSocket.cpp

@@ -97,10 +97,11 @@ void HttpSocket::stopmsg()
 
 
 void HttpSocket::init()
 void HttpSocket::init()
 {
 {
-
+	staticdata tstaticdata;
 	try
 	try
 	{
 	{
-		makegamelist(m_staticdata);
+		makegamelist(tstaticdata);
+		m_updatestatic("staticdata", tstaticdata);
 	}
 	}
 	catch (const std::exception&)
 	catch (const std::exception&)
 	{
 	{
@@ -220,6 +221,13 @@ bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<
 	return true;
 	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)
 void HttpSocket::makegamelist(staticdata& tstaticdata)
 {
 {

+ 1 - 1
webapi/webapi/HttpSocket.h

@@ -84,7 +84,7 @@ public:
 	void makegamelist(staticdata& tstaticdata);
 	void makegamelist(staticdata& tstaticdata);
 	void init();
 	void init();
 	bool postmsg(std::function<void(std::string&)> funhttpmsg, std::map<std::string, std::string> getdata);
 	bool postmsg(std::function<void(std::string&)> funhttpmsg, std::map<std::string, std::string> getdata);
-	void updatemsg(std::string strtype, boost::any getdata) {};
+	void updatemsg(std::string strtype, boost::any getdata);
 
 
 protected:
 protected:
 	//»ñµÃÓÎÏ·Áбí
 	//»ñµÃÓÎÏ·Áбí