本文整理汇总了C++中AppDelegate::base64_xxtea_encode方法的典型用法代码示例。如果您正苦于以下问题:C++ AppDelegate::base64_xxtea_encode方法的具体用法?C++ AppDelegate::base64_xxtea_encode怎么用?C++ AppDelegate::base64_xxtea_encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDelegate
的用法示例。
在下文中一共展示了AppDelegate::base64_xxtea_encode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateLocalFlow
void GameWin::updateLocalFlow()
{
AppDelegate *app = (AppDelegate*)Application::getInstance();
char cFlow[20] = "\0";
std::string strLocal = "";
for (int i = 0; i < 6; i++)
{
sprintf(cFlow, "%d,\0", m_iLocal[i]);
strLocal += cFlow;
}
strLocal = app->base64_xxtea_encode(strLocal);
DataAccess::setParamValue("LocalFlow", strLocal);
DataAccess::setParamValue("SyncFlag", "1");
}
示例2: onHttpRequestCompleted
void RegisterView::onHttpRequestCompleted(HttpClient *sender, HttpResponse *response)
{
std::string title = "\0";
std::string msg = "\0";
if (!response)
{
title = "Register Error\0";
msg = "Register Error.\0";
ShowMsg(title, msg);
return;
}
// You can get original request type from: response->request->reqType
if (0 != strlen(response->getHttpRequest()->getTag()))
{
log("%s completed", response->getHttpRequest()->getTag());
}
int statusCode = response->getResponseCode();
char statusString[64] = {};
sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag());
log("response code: %d", statusCode);
if (!response->isSucceed())
{
log("response failed");
log("error buffer: %s", response->getErrorBuffer());
title = "Register Error\0";
msg = "Register Error.\0";
ShowMsg(title, msg);
return;
}
if (statusCode != 200){
log("response code failed");
log("error buffer: %s", response->getErrorBuffer());
title = "Register Error\0";
msg = "Register Error.\0";
ShowMsg(title, msg);
return;
}
// dump data
std::vector<char> *buffer = response->getResponseData();
string sXml(buffer->begin(),buffer->end());
pugi::xml_document doc;
pugi::char_t cXml[1024];
strcpy(cXml,sXml.c_str());
pugi::xml_parse_result result = doc.load_string(cXml);
pugi::xml_node nodes = doc.child("mobileAppRegister");
std::string strError=nodes.child_value("error");
char p[100];
strcpy(p,strError.c_str());
if(atoi(p)==0)
{
//get user guid
string strUserGuid=nodes.child_value("UserGuid");
/*UserDefault::getInstance()->setStringForKey("UserGuid", strUserGuid);
UserDefault::getInstance()->setIntegerForKey("remember_me", 1);
UserDefault::getInstance()->setStringForKey("tweebaa_username", sUserName);
UserDefault::getInstance()->setStringForKey("tweebaa_Password", sPassword);
UserDefault::getInstance()->flush();*/
AppDelegate *app = (AppDelegate*)Application::getInstance();
sUserName = app->base64_xxtea_encode(sUserName);
sPassword = app->base64_xxtea_encode(sPassword);
string strTool = DataAccess::getParamValue("Total_Tool_Num","\0");
int iTool=0;
if (strTool.length() > 0)
{
iTool = atoi(app->base64_xxtea_decode(strTool).c_str());
}
DataAccess::addUser(strUserGuid, sUserName, sPassword);
_UserInfo userInfo = DataAccess::getUserInfoByName(sUserName);
m_UserID = userInfo.nUserID;
UserDefault::getInstance()->setIntegerForKey("CurrentUserId", m_UserID);
app->UpdateUserScore(1, 50);
char sTool[10];
sprintf(sTool, "%d", iTool + 10);
strTool = sTool;
strTool = app->base64_xxtea_encode(strTool);
DataAccess::setParamValue("Total_Tool_Num", strTool);
//get it
//string s=CCUserDefault::sharedUserDefault()->getStringForKey("UserGuid");
//auto scene = CollageMainTab::createScene();
/*auto scene = ChooseLayer::createScene();
TransitionScene *transition = TransitionFade::create(1, scene);
Director::getInstance()->replaceScene(transition);*/
this->cleanup();
m_Refresh = 1;
Director::getInstance()->popScene();
}
if(atoi(p)==-1){
title = "Input Error\0";
//.........这里部分代码省略.........