当前位置: 首页>>代码示例>>C++>>正文


C++ AppDelegate::GetToolsDiff方法代码示例

本文整理汇总了C++中AppDelegate::GetToolsDiff方法的典型用法代码示例。如果您正苦于以下问题:C++ AppDelegate::GetToolsDiff方法的具体用法?C++ AppDelegate::GetToolsDiff怎么用?C++ AppDelegate::GetToolsDiff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppDelegate的用法示例。


在下文中一共展示了AppDelegate::GetToolsDiff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: syncFlow

void GameWin::syncFlow()
{
	AppDelegate *app = (AppDelegate*)Application::getInstance();
	std::string  strFlow= updateFlow();//read local and add current

	NetworkType Networ = app->GetNetWorkStatus();
	if (Networ != NetworkTypeNone)
	{
		if (m_UserID > 0 && strFlow.length()>0)
		{
			_UserInfo userInfo = DataAccess::getUserInfoByID(m_UserID);
			HttpRequest* request = new HttpRequest();
			request->setUrl(UCAPIWebPostURL);
			request->setRequestType(HttpRequest::Type::POST);
			request->setResponseCallback(CC_CALLBACK_2(GameWin::onSyncCompleted, this));

			//char p[10];
			//sprintf(p, "%s", strFlow);
			std::string sPost = "action=save_user_info&EncryptData=";

			long lUserDiff = app->GetUserScoreDiff();
			int iLevel = app->GetUserLevel();


			char p1[10];
			char p2[10];
			char p3[10];
			sprintf(p1, "%d", lUserDiff);
			sprintf(p2, "%d", iLevel);
			string s1 = p1;
			string s2 = p2;

			//std::string sPost = "action=sync_point&EncryptData=";
			int iTools = app->GetToolsDiff();
			sprintf(p3, "%d", iTools);
			string s4 = p3;

			string s3 = "score = " + strFlow + "&local_point = " + s1 + "&LV = " + s2 + "&UserID = " + userInfo.strUserGuid+"&VirtualPops=" + s4;
			s3 = app->encode_data_for_http(s3);
			sPost = sPost + s3;
			sPost = sPost + "&" + app->GetAccessString();

			const char* postData = sPost.c_str();
			request->setRequestData(postData, strlen(postData));
			request->setTag("save_ranking");
			cocos2d::network::HttpClient::getInstance()->send(request);
			request->release();
		}
		else updateLocalFlow();//not login or read local error
	}
	else
	{
		updateLocalFlow();//no network
	}
}
开发者ID:zhuanglm,项目名称:TweeBaaMobileApp,代码行数:55,代码来源:GameWinScene.cpp


注:本文中的AppDelegate::GetToolsDiff方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。