game преди 1 месец
родител
ревизия
89abfe7a6a

BIN
webapi/dll/httplib.dll


BIN
webapi/dll/httplibd.dll


BIN
webapi/mgdb/lib/httplib.lib


BIN
webapi/mgdb/lib/httplibd.lib


+ 330 - 12
webapi/webapi/HttpSocket.cpp

@@ -24,6 +24,7 @@ bool comparegamelist(const rapidjson::Value& a, const rapidjson::Value& b)
 }
 
 
+std::uint32_t HttpSocket::m_gucurid = 0;
 HttpSocket::HttpSocket()
 {
 	m_random = std::default_random_engine(time(NULL));
@@ -80,9 +81,15 @@ HttpSocket::HttpSocket()
 	*m_pvipconfigure = (*m_pvipuserdb)["vipconfigure"];
 	*m_pgamelist = (*m_platform)["gamelist"];
 
+	m_strshahead = "X-REQUEST-SIGN";
+	m_strshaheadcontent = "6e4c91001979851a97c2b5360f044ff67b48e186d6ecd4394532851bffdeeae9";
+	m_ucurid = m_gucurid++;
+
+	m_psendhttp = weblib::httpini();
+
 	//获取gamelist
 	funcmsg fun1 = std::bind(&HttpSocket::getgamelist, this, std::placeholders::_1);
-	m_callmsg.insert(make_pair("/api/game/gamelist", fun1));
+	m_callmsg.insert(make_pair("api/game/gamelist", fun1));
 }
 
 HttpSocket::~HttpSocket()
@@ -92,6 +99,7 @@ HttpSocket::~HttpSocket()
 
 void HttpSocket::stopmsg()
 {
+	weblib::delhttp(m_psendhttp);
 }
 
 
@@ -111,7 +119,7 @@ void HttpSocket::init()
 
 
 
-bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<std::string, std::string> getdata)
+bool HttpSocket::postmsg(std::function<void(std::string&, int)> funhttpmsg, std::map<std::string, std::string> getdata)
 {
 	try
 	{
@@ -185,12 +193,17 @@ bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<
 			{
 				strtojson = getalluserplayscoreinfo(getdata);
 			}
+			//登录真人视讯
+			else if (itype == HTTPLOGINREEL)
+			{
+				reelplay(getdata, funhttpmsg);
+			}
 			else
 			{
 				return false;
 			}
 
-			funhttpmsg(strtojson);
+			funhttpmsg(strtojson, 200);
 			return true;
 		}
 		else
@@ -212,7 +225,8 @@ bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<
 					}
 				}
 			}
-			funhttpmsg(strtojson);
+
+			funhttpmsg(strtojson, 200);
 			return true;
 		}
 	}
@@ -221,7 +235,8 @@ bool HttpSocket::postmsg(std::function<void(std::string&)> funhttpmsg, std::map<
 	}
 
 	std::string strerror{ "{\"error\":1}" };
-	funhttpmsg(strerror);
+	int iret = -1;
+	funhttpmsg(strerror, iret);
 	return true;
 }
 
@@ -920,7 +935,7 @@ std::string HttpSocket::regaccount(std::map<std::string, std::string> getdata)
 }
 
 //玩家更新分数
-std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getdata, std::function<void(std::string&)>& dofun)
+std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun)
 {
 	userscore tuserscore;
 	getvaluedata(getdata, tuserscore);
@@ -1414,7 +1429,7 @@ std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getda
 }
 
 //把玩家踢出游戏
-std::string HttpSocket::adminhituser(std::map<std::string, std::string> getdata, std::function<void(std::string&)>& dofun)
+std::string HttpSocket::adminhituser(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun)
 {
 	kickuser tkickuser;
 	getvaluedata(getdata, tkickuser);
@@ -1521,7 +1536,7 @@ std::string HttpSocket::adminhituser(std::map<std::string, std::string> getdata,
 		thttpinfo.strtarget = "webapi/deluser";
 		thttpinfo.strjson = funclib::doctojson(docgame);
 
-		m_gamemsg(thttpinfo, std::move([this, iuserid, iserverid, icontextid, dofun = std::move(dofun)](std::string strdata)mutable
+		m_gamemsg(thttpinfo, std::move([this, iuserid, iserverid, icontextid, dofun = std::move(dofun)](std::string &strdata, int iret)mutable
 		{
 			//踢出成功
 			std::string strtojson = funclib::rettojson(-1, "ok");
@@ -1531,13 +1546,13 @@ std::string HttpSocket::adminhituser(std::map<std::string, std::string> getdata,
 				std::function<void()> tfun = [this, iuserid, iserverid, icontextid, dofun = std::move(dofun), strtojson]() mutable{
 					auto finduserview = make_document(kvp("userid", iuserid), kvp("serverid", iserverid), kvp("contextid", icontextid));
 					m_pplayuseronline->delete_one(finduserview.view());
-					dofun(strtojson);
+					dofun(strtojson, 200);
 				};
 				m_postmsg(std::move(tfun));
 				return;
 			}
 
-			dofun(strtojson);
+			dofun(strtojson, 200);
 		}));
 
 		return {};
@@ -2157,11 +2172,11 @@ std::string HttpSocket::playgameinfo(std::map<std::string, std::string> getdata)
 
 	userspreadid = finduser->view()["spreaderid"].get_int64();
 
-	/*if (iadminuserid != userspreadid)
+	if (iadminuserid != userspreadid)
 	{
 		strret = funclib::rettojson(Err_Player_LackInfo, "the account does not belong to you");
 		return strret;
-	}*/
+	}
 
 	auto vipuser = m_pvipuser->find_one(bsoncxx::builder::stream::document{} << "userid" << iadminuserid << bsoncxx::builder::stream::finalize);
 	if (!vipuser)
@@ -3247,4 +3262,307 @@ std::string HttpSocket::getalluserplayscoreinfo(std::map<std::string, std::strin
 
 	//NEWLOG(INFO, "msglog") << strret;
 	return strret;
+}
+
+std::string HttpSocket::reelplay(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun)
+{
+	reelplayuser treelplayuser;
+	getvaluedata(getdata, treelplayuser);
+
+	std::string strret;
+
+	m_writelog("--------------------reelplay-------------------------");
+
+	bool bret = treelplayuser.datavalue();
+	if (!bret)
+	{
+		strret = funclib::rettojson(Err_ParamError, "param erro");
+		return strret;
+	}
+
+	std::int32_t iareaid{ 0 };
+	std::int64_t ispreaderid{ 0 };
+	//验证代理是否存在
+	auto findagentview = make_document(kvp("account", treelplayuser.strextension1.c_str()), kvp("cert", treelplayuser.strcert.c_str()));
+	auto vipuser = m_pvipuser->find_one(findagentview.view());
+	if (!vipuser || !vipuser->view()["userid"] || !vipuser->view()["areaid"] || !vipuser->view()["apitype"])
+	{
+		strret = funclib::errotojson(Err_No_Agent);
+		return strret;
+	}
+
+	iareaid = vipuser->view()["areaid"].get_int32();
+	ispreaderid = vipuser->view()["areaid"].get_int32();
+
+	std::int32_t userstate = 1;
+	if (vipuser && vipuser->view()["state"])
+	{
+		userstate = vipuser->view()["state"].get_int32();
+	}
+
+	if (userstate != 0)
+	{
+		strret = funclib::rettojson(Err_OutOfState_Agent, "agent statue error");
+		return strret;
+	}
+
+	std::int32_t iapitype = vipuser->view()["apitype"].get_int32();
+	if (iapitype != 2)
+	{
+		strret = funclib::rettojson(Err_OutOfState_Agent, "agent type error");
+		return strret;
+	}
+
+	auto findwebuser = make_document(kvp("account", treelplayuser.struseracc.c_str()));
+	auto findneuserdata = m_pcoll->find_one(findwebuser.view());
+	if (!findneuserdata)
+	{
+		//用户账号存在
+		strret = funclib::errotojson(Err_No_Player);
+		return strret;
+	}
+
+	std::int64_t iscore{ 0 };
+	if (findneuserdata && findneuserdata->view()["score"])
+	{
+		iscore = findneuserdata->view()["score"].get_int64();
+	}
+	std::string struseracc = treelplayuser.struseracc;
+
+	createreeluser(struseracc, iscore, dofun);
+
+	return {};
+}
+
+void HttpSocket::sendreelmsg(std::string stronly, std::string strtarget, std::string strjson, std::function<void(std::string, int)>&& dofun)
+{
+	weblib::httpinfo thttpinfo;
+	thttpinfo.strurl = "https://transfer-wallet-service.stage.iconic-21.com";
+//	thttpinfo.strurl = "http://127.0.0.1:6000";
+	thttpinfo.strtarget = strtarget;
+	thttpinfo.stronly = stronly;
+	std::string strshaheadcontent = m_strshaheadcontent + strjson;
+	strshaheadcontent = sha256_to_base16(strshaheadcontent);
+	thttpinfo.addheadinfo.insert(std::make_pair(m_strshahead, strshaheadcontent));
+	thttpinfo.strjson = strjson;
+
+	std::stringstream sss;
+	sss << "strurl=" << thttpinfo.strurl << " strtarget=" << strtarget << " strshaheadcontent=" << strshaheadcontent << " strjson=" << strjson;
+	m_writelog(sss.str());
+
+	weblib::sendhttp(m_psendhttp, std::move(thttpinfo), std::move(dofun));
+}
+
+//检查玩家钱包
+void HttpSocket::checkreeluserbalance(std::string struseracc, std::int64_t iscore)
+{
+	rapidjson::Document doc;
+	doc.SetObject();
+	rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
+
+	doc.AddMember("casino", rapidjson::Value("luckybet777", allocator), allocator);
+	doc.AddMember("playerId", rapidjson::Value(struseracc.c_str(), allocator), allocator);
+	//std::string strjson{ "{\"casino\":\"luckybet777\",\"playerId\":\"testPlayer_5\",\"currency\":\"EUR\",\"country\":\"US\"}" };
+
+	std::string strjson = funclib::doctojson(doc);
+	std::string strtarget = "v2/tw/balance";
+}
+
+//创建玩家
+void HttpSocket::createreeluser(std::string struseracc, std::int64_t iscore, std::function<void(std::string&, int)>& dofun)
+{
+	m_writelog("--------------------createreeluser-------------------------");
+	rapidjson::Document doc;
+	doc.SetObject();
+	rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
+
+	doc.AddMember("casino", rapidjson::Value("luckybet777", allocator), allocator);
+	doc.AddMember("playerId", rapidjson::Value(struseracc.c_str(), allocator), allocator);
+	doc.AddMember("currency", rapidjson::Value("EUR", allocator), allocator);
+	doc.AddMember("country", rapidjson::Value("US", allocator), allocator);
+	//std::string strjson{ "{\"casino\":\"luckybet777\",\"playerId\":\"testPlayer_5\",\"currency\":\"EUR\",\"country\":\"US\"}" };
+
+	std::string strjson = funclib::doctojson(doc);
+	std::string strtarget = "v2/tw/createPlayer";
+
+	//创建玩家
+	sendreelmsg(struseracc, strtarget, strjson, std::move([this, struseracc, iscore, dofun](std::string strdata, int iret) {
+		
+		std::stringstream strlog;
+		strlog << "创建玩家: iret=" << iret << " strdata=" << strdata;
+		m_writelog(strlog.str());
+
+		bool bhaveuser{ false };
+		if (iret == 200)
+		{
+			rettype::type tret{ rettype::type::ini };
+			rapidjson::Document docdata;
+			rapidjson::ParseResult ok = docdata.Parse(strdata.c_str());
+			if (ok)
+			{
+				std::string strstatus{};
+				tret = funclib::getjsonvalue(docdata, "status", strstatus);
+				if (tret == rettype::type::exist)
+				{
+					if (strstatus == "ok")
+					{
+						bhaveuser = true;
+					}
+				}
+			}
+		}
+
+		//玩家创建成功
+		if (bhaveuser)
+		{
+			reelusertrans(struseracc, iscore, dofun);
+		}
+		else
+		{
+			std::string strret = funclib::errotojson(-1);
+			dofun(strret, 200);
+		}
+
+		}));
+}
+
+void HttpSocket::reelusertrans(std::string struseracc, std::int64_t iscore, std::function<void(std::string&, int)> dofun)
+{
+	m_writelog("--------------------reelusertrans-------------------------");
+	if (iscore > 0)
+	{
+		rapidjson::Document doc;
+		doc.SetObject();
+		rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
+
+		std::string strscore = funclib::getdouble(iscore);
+		std::string strtransid = funclib::getonlytoken(1, m_ucurid);
+
+		doc.AddMember("casino", rapidjson::Value("luckybet777", allocator), allocator);
+		doc.AddMember("playerId", rapidjson::Value(struseracc.c_str(), allocator), allocator);
+		doc.AddMember("transactionId", rapidjson::Value(strtransid.c_str(), allocator), allocator);
+		doc.AddMember("amount", rapidjson::Value(strscore.c_str(), allocator), allocator);
+		std::string strjson = funclib::doctojson(doc);
+		std::string strtarget = "v2/tw/transfer";
+
+		sendreelmsg(struseracc, strtarget, strjson, std::move([this, struseracc, dofun, iscore](std::string strdata, int iret) {
+
+			std::stringstream strlog;
+			strlog << "转账: iscore=" << iscore << " iret=" << iret << " strdata=" << strdata;
+			m_writelog(strlog.str());
+
+			double dscore{ 0 };
+			bool bscore{ false };
+			if (iret == 200)
+			{
+				rettype::type tret{ rettype::type::ini };
+				rapidjson::Document docdata;
+				rapidjson::ParseResult ok = docdata.Parse(strdata.c_str());
+				if (ok)
+				{
+					tret = funclib::getjsonvalue(docdata, "balance", dscore);
+					if (tret == rettype::type::exist)
+					{
+						bscore = true;
+					}
+					else
+					{
+						std::string strscore{};
+						tret = funclib::getjsonvalue(docdata, "balance", strscore);
+						if (tret == rettype::type::exist)
+						{
+							try
+							{
+								dscore = std::stod(strscore);
+								bscore = true;
+							}
+							catch (const std::exception&)
+							{
+								bscore = false;
+							}	
+						}
+					}
+				}
+			}
+
+			//转账成功
+			if (bscore)
+			{
+				//执行扣分操作
+				m_postmsg(std::move([this]() {
+					
+					//验证代理是否存在
+					//auto findagentview = make_document(kvp("account", treelplayuser.strextension1.c_str()), kvp("cert", treelplayuser.strcert.c_str()));
+					//auto vipuser = m_pvipuser->find_one(findagentview.view());
+					//if (!vipuser || !vipuser->view()["userid"] || !vipuser->view()["areaid"] || !vipuser->view()["apitype"])
+					//{
+						//strret = funclib::errotojson(Err_No_Agent);
+						//return strret;
+					//}
+
+					}));
+				//直接拉取游戏
+				getreelgameurl(struseracc, dofun);
+			}
+			else
+			{
+				std::string strret = funclib::errotojson(-1);
+				dofun(strret, 200);
+			}
+
+			}));
+	}
+	else
+	{
+		m_writelog("iscore = 0, 直接拉取游戏");
+		//直接拉取游戏
+		getreelgameurl(struseracc, dofun);
+	}
+}
+
+//拉取游戏
+void HttpSocket::getreelgameurl(std::string struseracc, std::function<void(std::string&, int)> dofun)
+{
+	m_writelog("--------------------getreelgameurl-------------------------");
+	rapidjson::Document doc;
+	doc.SetObject();
+	rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
+
+	//cashier:URL for opening the cashier on Casino site when a player has no funds.
+	//homepage:URL for returning to Lobby page on Casino site. This link is used for Exit button in mobile version of games.
+	//{"casino":"whitebom","playerId":"testPlayer_1","launchAlias":"launch_main_rol_01","language":"en","cashier":"https://cashier.com","homepage":"https://home.com"}
+	std::string strtransid = funclib::getonlytoken(1, m_ucurid);
+	doc.AddMember("casino", rapidjson::Value("luckybet777", allocator), allocator);
+	doc.AddMember("playerId", rapidjson::Value(struseracc.c_str(), allocator), allocator);
+	doc.AddMember("launchAlias", rapidjson::Value("launch_main_rol_01", allocator), allocator);
+	doc.AddMember("language", rapidjson::Value("en", allocator), allocator);
+	doc.AddMember("cashier", rapidjson::Value("https://cashier.com", allocator), allocator);
+	doc.AddMember("homepage", rapidjson::Value("https://home.com", allocator), allocator);
+
+	std::string strjson = funclib::doctojson(doc);
+	std::string strtarget = "v2/tw/startGame";
+
+	sendreelmsg(struseracc, strtarget, strjson, std::move([this, struseracc, dofun](std::string strdata, int iret) {
+		
+		std::stringstream strlog;
+		strlog << "拉取游戏: iret=" << iret << " strdata=" << strdata;
+		m_writelog(strlog.str());
+
+		if (iret == 200)
+		{
+			rettype::type tret{ rettype::type::ini };
+			rapidjson::Document docdata;
+			rapidjson::ParseResult ok = docdata.Parse(strdata.c_str());
+			if (ok)
+			{
+				dofun(strdata, 200);
+			}
+		}
+		else
+		{
+			std::string strret = funclib::errotojson(-1);
+			dofun(strret, 200);
+		}
+		
+		}));
 }

+ 35 - 15
webapi/webapi/HttpSocket.h

@@ -3,19 +3,20 @@
 #include "funall.h"
 #include "webfun.h"
 
-class IIhttpsocket
-{
-public:
-	std::function<void(weblib::httpinfo, std::function<void(std::string)>&&)> m_gamemsg{ nullptr };
-	std::function<void(std::string, boost::any)> m_updatestatic{ nullptr };
-	std::function<void(std::function<void()>&&)> m_postmsg{ nullptr };
-	std::function<void(std::string)> m_writelog{ nullptr };
+class IIhttpsocket
+{
+public:
+	std::function<void(weblib::httpinfo, std::function<void(std::string&, int)>&&)> m_gamemsg{ nullptr };
+	std::function<void(std::string, boost::any)> m_updatestatic{ nullptr };
+	std::function<void(std::function<void()>&&)> m_postmsg{ nullptr };
+	std::function<void(std::string)> m_writelog{ nullptr };
+
+public:
+	virtual void init() = 0;
+	virtual bool postmsg(std::function<void(std::string&, int)> funhttpmsg, std::map<std::string, std::string> getdata) = 0;
+	virtual void updatemsg(std::string strtype, boost::any getdata) = 0;
+};
 
-public:
-	virtual void init() = 0;
-	virtual bool postmsg(std::function<void(std::string&)> funhttpmsg, std::map<std::string, std::string> getdata) = 0;
-	virtual void updatemsg(std::string strtype, boost::any getdata) = 0;
-};
 
 
 class HttpSocket:public IIhttpsocket
@@ -28,6 +29,13 @@ protected:
 	std::unordered_map<std::int64_t, std::string> m_mapuseridname;
 	std::default_random_engine	m_random;
 
+	std::string m_strshahead;
+	std::string m_strshaheadcontent;
+	void* m_psendhttp;
+
+	static std::uint32_t m_gucurid;
+	std::uint32_t m_ucurid;
+
 	//接受http消息
 	std::map<std::string, funcmsg> m_callmsg;
 	staticdata m_staticdata;
@@ -86,7 +94,7 @@ public:
 	std::string getuseraccount(std::int32_t iregion);
 	void makegamelist(staticdata& tstaticdata);
 	void init();
-	bool postmsg(std::function<void(std::string&)> funhttpmsg, std::map<std::string, std::string> getdata);
+	bool postmsg(std::function<void(std::string&, int)> funhttpmsg, std::map<std::string, std::string> getdata);
 	void updatemsg(std::string strtype, boost::any getdata);
 
 protected:
@@ -95,9 +103,9 @@ protected:
 	//玩家账号注册
 	std::string regaccount(std::map<std::string, std::string> getdata);
 	//玩家更新分数
-	std::string updateuserscore(std::map<std::string, std::string> getdata, std::function<void(std::string&)>& dofun);
+	std::string updateuserscore(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun);
 	//把玩家踢出游戏
-	std::string adminhituser(std::map<std::string, std::string> getdata, std::function<void(std::string&)>& dofun);
+	std::string adminhituser(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun);
 	//管理员禁止管理员所属玩家
 	std::string adminforbiduser(std::map<std::string, std::string> getdata);
 	//获取账号
@@ -118,5 +126,17 @@ protected:
 	std::string backuseringot(std::map<std::string, std::string> getdata);
 	//获取所有总赌注和总输赢
 	std::string getalluserplayscoreinfo(std::map<std::string, std::string> getdata);
+	//-------------------------------真人视讯-----------------------------------------
+	//登录真人视讯
+	std::string reelplay(std::map<std::string, std::string> getdata, std::function<void(std::string&, int)>& dofun);
+	void sendreelmsg(std::string stronly, std::string strtarget, std::string strjson, std::function<void(std::string, int)>&& dofun);
+	//检查玩家钱包
+	void checkreeluserbalance(std::string struseracc, std::int64_t iscore);
+	//创建玩家
+	void createreeluser(std::string struseracc, std::int64_t iscore, std::function<void(std::string&, int)>& dofun);
+	//给玩家转账
+	void reelusertrans(std::string struseracc, std::int64_t iscore, std::function<void(std::string&, int)> dofun);
+	//拉取游戏
+	void getreelgameurl(std::string struseracc, std::function<void(std::string&, int)> dofun);
 };
 #endif

+ 27 - 1
webapi/webapi/data.h

@@ -63,8 +63,9 @@
 #define HTTPLUPDATEUSERINGOT		26				//添加奖励码
 #define HTTPLBACKINGOT				27				//回退奖励码
 #define HTTPLOOKUPALLUSERPLAYSCORE	28				//查询所有玩家总下注和总赢回
+#define HTTPLOGINREEL				29				//登录真人视讯
 
-#define HTTPMAX						29				//http最大id
+#define HTTPMAX						30				//http最大id
 
 //game msg define
 #define MDM_CS_REGISTER				1
@@ -677,4 +678,29 @@ struct CMD_CS_C_DelOnlineUser
 	DWORD							dwGameContextID;
 };
 
+struct reelplayuser
+{
+	std::string			strextension1{};			//代理
+	std::string			strcert{};					//密钥
+	std::string			struseracc{};				//玩家
+public:
+	std::string getfieldvalue(std::int32_t index)
+	{
+		const char* value[] = { "extension1", "cert", "useracc"};
+		return value[index];
+	}
+
+	void getdata()
+	{
+	}
+
+	bool datavalue()
+	{
+		if (strextension1.empty() || strcert.empty() || struseracc.empty())
+		{
+			return false;
+		}
+		return true;
+	}
+};
 #pragma pack()

+ 16 - 0
webapi/webapi/funall.h

@@ -1,5 +1,7 @@
 #pragma once
 #include "data.h"
+#include <iomanip>
+#include <openssl/sha.h>
 
 template<class T>
 inline rettype::type getmapvalue(std::string strvalue, std::map<std::string, std::string>& tmapvalue, T& tValue)
@@ -265,4 +267,18 @@ inline std::string straccount(std::string& doc, bool& bret)
 	}
 
 	return strtemp;
+}
+
+inline std::string sha256_to_base16(const std::string& input) {
+	unsigned char hash[SHA256_DIGEST_LENGTH];
+	SHA256_CTX sha256_ctx;
+	SHA256_Init(&sha256_ctx);
+	SHA256_Update(&sha256_ctx, input.c_str(), input.length());
+	SHA256_Final(hash, &sha256_ctx);
+
+	std::stringstream oss;
+	for (int i = 0; i < SHA256_DIGEST_LENGTH; ++i) {
+		oss << std::setw(2) << std::setfill('0') << std::hex << (int)hash[i];
+	}
+	return oss.str();
 }

+ 2 - 2
webapi/webapi/webapi.vcxproj

@@ -102,7 +102,7 @@
     <Link>
       <SubSystem>Windows</SubSystem>
       <AdditionalLibraryDirectories>$(SolutionDir)mgdb\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>bsoncxx.lib;mongocxx.lib;Synchronization.lib</AdditionalDependencies>
+      <AdditionalDependencies>Crypt32.lib;libssl.lib;libcrypto.lib;bsoncxx.lib;mongocxx.lib;Synchronization.lib</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>
@@ -160,7 +160,7 @@
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <AdditionalLibraryDirectories>$(SolutionDir)g3log\releaselib;$(SolutionDir)\mgdb\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>bsoncxx.lib;mongocxx.lib;Synchronization.lib</AdditionalDependencies>
+      <AdditionalDependencies>Crypt32.lib;libssl.lib;libcrypto.lib;bsoncxx.lib;mongocxx.lib;Synchronization.lib</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>

+ 6 - 1
webapi/webapi/webfun.h

@@ -16,6 +16,8 @@
 #define WEBFUN_API
 #endif
 
+#include <set>
+#include <map>
 #include <string>
 #include <functional>
 #include <boost/any.hpp>
@@ -27,6 +29,9 @@ namespace weblib
 		std::string strurl{};
 		std::string strtarget{};
 		std::string strjson{};
+		std::string stronly{};
+		std::map<std::string, std::string> addheadinfo{};
+		std::set<int> setresult_int{};
 	};
 
 	WEBFUN_API inline void* webini(int iport = 0, bool blog = true);
@@ -43,7 +48,7 @@ namespace weblib
 
 	WEBFUN_API inline void addhttpmsg(void* phttp, boost::any thttp);
 
-	WEBFUN_API inline void sendhttp(void* phttp, httpinfo&& thttpinfo, std::function<void(std::string)> &&dofun = nullptr);
+	WEBFUN_API inline void sendhttp(void* phttp, httpinfo&& thttpinfo, std::function<void(std::string, int)> &&dofun = nullptr);
 }
 
 #endif // WEBSOCKET_HPP