diff --git a/Classes/Define/Platform.h b/Classes/Define/Platform.h index 5a0fa0fc..a76f6c47 100644 --- a/Classes/Define/Platform.h +++ b/Classes/Define/Platform.h @@ -30,18 +30,18 @@ #define VERSION_FRAME_SDK INTERFACE_VERSION(6,3) //框架版本; #define LOGON_SERVER_ADDRESS "121.40.40.53" //登录服务器地址; -#define WEB_SERVER_ADDRESS "http://queyi.ppxq.net" //WEB服务器地址; +#define WEB_SERVER_ADDRESS "http://121.40.40.53:9002/" //WEB服务器地址; //#define LOGON_SERVER_ADDRESS "47.100.47.128" //登录服务器地址; //#define WEB_SERVER_ADDRESS "http://queyi.ppxq.net" //WEB服务器地址; -#define PAY_TO_PLAYER_HTTP_ADDRESS "http://queyi.ppxq.net/Lobby/PayToPlayer" //转账给玩家; -#define PAY_LOG_HTTP_ADDRESS "http://queyi.ppxq.net/Lobby/GetPayLog" //充值记录; -#define GET_NICKNAME_HTTP_ADDRESS "http://queyi.ppxq.net/Lobby/GetPlayerNickName" //获取昵称; -#define DUI_HUAN_HTTP_ADDRESS "http://queyi.ppxq.net/duihuan.html" //兑换地址; -#define GONG_HUI_HTTP_ADDRESS "http://queyi.ppxq.net/gonghui.html" //公会地址; -#define HEAD_HTTP_ADDRESS "http://queyi.ppxq.net/b.php?id=%d" //头像地址; -#define SHARE_HTTP_ADDRESS "http://queyi.ppxq.net/qy.html" //分享地址; +#define PAY_TO_PLAYER_HTTP_ADDRESS "http://121.40.40.53/Lobby/PayToPlayer" //转账给玩家; +#define PAY_LOG_HTTP_ADDRESS "http://121.40.40.53/Lobby/GetPayLog" //充值记录; +#define GET_NICKNAME_HTTP_ADDRESS "http://121.40.40.53/Lobby/GetPlayerNickName" //获取昵称; +#define DUI_HUAN_HTTP_ADDRESS "http://121.40.40.53/duihuan.html" //兑换地址; +#define GONG_HUI_HTTP_ADDRESS "http://121.40.40.53/gonghui.html" //公会地址; +#define HEAD_HTTP_ADDRESS "http://121.40.40.53/b.php?id=%d" //头像地址; +#define SHARE_HTTP_ADDRESS "http://121.40.40.53/qy.html" //分享地址; #define LOGON_SERVER_PORT 10086 //登录服务器端口; //#define LOGON_SERVER_PORT 10090 //登录服务器端口; diff --git a/Classes/Mission/LoginMission.cpp b/Classes/Mission/LoginMission.cpp index 8b3ad29c..bff856f1 100644 --- a/Classes/Mission/LoginMission.cpp +++ b/Classes/Mission/LoginMission.cpp @@ -17,20 +17,20 @@ LoginMission::LoginMission() } -// ûصӿ +// ���ûص��ӿ� void LoginMission::setMissionSink(ILoginMissionSink* pILoginMissionSink) { mILoginMissionSink = pILoginMissionSink; } -// ˺ŵ½ +// �˺ŵ�½ void LoginMission::loginAccount(const CMD_GP_LogonAccounts& LoginAccount) { memcpy(&mLoginAccount, &LoginAccount, sizeof(mLoginAccount)); mMissionType = MISSION_LOGIN_ACCOUNT; start(); } -// ο͵¼ +// �ο͵�¼ void LoginMission::loginVisitor(const CMD_GP_VisitorLogon& VisitorAccount) { memcpy(&mVisitorAccount, &VisitorAccount, sizeof(VisitorAccount)); @@ -39,7 +39,7 @@ void LoginMission::loginVisitor(const CMD_GP_VisitorLogon& VisitorAccount) start(); } -// I D½ +// I D��½ void LoginMission::loginGameID(const CMD_GP_LogonByUserID& LoginGameID) { memcpy(&mLoginGameID, &LoginGameID, sizeof(mLoginGameID)); @@ -60,7 +60,7 @@ void LoginMission::updateOnlineInfo() start(); } -// +//�������� bool LoginMission::updateServerInfo(uint16 kind) { KIND_ITER it = std::find(mKindList.begin(), mKindList.end(), kind); @@ -84,38 +84,38 @@ bool LoginMission::updateServerInfo(uint16 kind) return true; } -// ½ +// ��½ bool LoginMission::sendLoginVisitor(const CMD_GP_VisitorLogon& VisitorAccount) { CGlobalUserInfo * pGlobalUserInfo=CGlobalUserInfo::GetInstance(); tagGlobalUserData * pGlobalUserData=pGlobalUserInfo->GetGlobalUserData(); strncpy(pGlobalUserData->szPassword,mVisitorAccount.szPassWord,countarray(pGlobalUserData->szPassword)); - // + //�������� send(MDM_GP_LOGON, SUB_GP_LOGON_VISITOR, (void*)&mVisitorAccount, sizeof(mVisitorAccount)); return true; } -//͵½Ϣ +//���͵�½��Ϣ bool LoginMission::sendLoginAccount(const CMD_GP_LogonAccounts& LoginAccount) { cocos2d::log(("LoginMission::sendLoginAccount\n")); - // + //�������� CGlobalUserInfo * pGlobalUserInfo=CGlobalUserInfo::GetInstance(); tagGlobalUserData * pGlobalUserData=pGlobalUserInfo->GetGlobalUserData(); strncpy(pGlobalUserData->szPassword,LoginAccount.szPassword, countarray(pGlobalUserData->szPassword)); - // + //�������� send(MDM_GP_LOGON, SUB_GP_LOGON_ACCOUNTS, (void*)&LoginAccount, sizeof(LoginAccount)); return true; } -//͵½Ϣ +//���͵�½��Ϣ bool LoginMission::sendLoginGameID(const CMD_GP_LogonByUserID& LoginGameID) { return true; } -//עϢ +//����ע����Ϣ bool LoginMission::sendRegisterPacket(const CMD_GP_RegisterAccounts& RegisterAccount) { cocos2d::log(("LoginMission::sendRegisterPacket\n")); @@ -124,20 +124,20 @@ bool LoginMission::sendRegisterPacket(const CMD_GP_RegisterAccounts& RegisterAcc tagGlobalUserData * pGlobalUserData=pGlobalUserInfo->GetGlobalUserData(); strncpy(pGlobalUserData->szPassword,RegisterAccount.szLogonPass, countarray(pGlobalUserData->szPassword)); - // + //�������� send(MDM_GP_LOGON, SUB_GP_REGISTER_ACCOUNTS, (void*)&RegisterAccount, sizeof(RegisterAccount)); return true; } -// +// �������� bool LoginMission::sendUpdateOnlineInfoPacket() { return true; } -// ͷб +// �������ͷ����б� void LoginMission::sendUpdateServerInfo() { } @@ -148,26 +148,26 @@ void LoginMission::onEventTCPSocketLink() switch (mMissionType) { - // ½ + // ��½ case MISSION_LOGIN_ACCOUNT: sendLoginAccount(mLoginAccount); break; case MISSION_LOGIN_VISITOR: sendLoginVisitor(mVisitorAccount); break; - // ½ + // ��½ case MISSION_LOGIN_GAMEID: sendLoginGameID(mLoginGameID); break; - // ע + // ע�� case MISSION_REGISTER: sendRegisterPacket(mRegisterAccount); break; - // + // �������� case MISSION_UPDATE_INFO: sendUpdateOnlineInfoPacket(); break; - // ͷб + // �������ͷ����б� case MISSION_SERVER_INFO: sendUpdateServerInfo(); break; @@ -202,20 +202,20 @@ bool LoginMission::onEventTCPSocketRead(int main, int sub, void* data, int size) } ////////////////////////////////////////////////////////////////////////// -// ½Ϣ +// ��½��Ϣ bool LoginMission::onSocketMainLogon(int sub, void* data, int size) { switch (sub) { - //¼ɹ + //��¼�ɹ� case SUB_GP_LOGON_SUCCESS: return onSocketSubLogonSuccess(data, size); - //¼ʧ + //��¼ʧ�� case SUB_GP_LOGON_FAILURE: return onSocketSubLogonFailure(data, size); - //¼ʧ + //��¼ʧ�� case SUB_GP_VALIDATE_MBCARD: return onSocketSubLogonValidateMBCard(data, size); - //ʾ + //������ʾ case SUB_GP_UPDATE_NOTIFY: return onSocketSubUpdateNotify(data, size); - //¼ + //��¼��? case SUB_GP_LOGON_FINISH: return onSocketSubLogonFinish(data, size); case SUB_GP_GROWLEVEL_CONFIG: return true; case SUB_GP_MATCH_SIGNUPINFO: return onSocketSubMacthSignupInfo(data, size); @@ -225,14 +225,14 @@ bool LoginMission::onSocketMainLogon(int sub, void* data, int size) return false; } -//¼ɹ +//��¼�ɹ� bool LoginMission::onSocketSubLogonSuccess(void* data, int size) { cocos2d::log(("LoginMission::onSocketSubLogonSuccess\n")); - //½ɹ + //��½�ɹ� CMD_GP_LogonSuccess* pData = (CMD_GP_LogonSuccess*)data; - // + //�������� CGlobalUserInfo * pGlobalUserInfo=CGlobalUserInfo::GetInstance(); tagGlobalUserData * pGlobalUserData=pGlobalUserInfo->GetGlobalUserData(); @@ -240,7 +240,7 @@ bool LoginMission::onSocketSubLogonSuccess(void* data, int size) pGlobalUserData->lUserInsure = pData->lUserInsure; pGlobalUserData->lGrade = pData->lGrade; - //Ϣ + //������Ϣ pGlobalUserData->wFaceID = pData->wFaceID; pGlobalUserData->cbGender = pData->cbGender; pGlobalUserData->dwUserID =pData->dwUserID; @@ -249,13 +249,13 @@ bool LoginMission::onSocketSubLogonSuccess(void* data, int size) pGlobalUserData->dwExperience =pData->dwExperience; pGlobalUserData->cbInsureEnabled = pData->cbInsureEnabled; pGlobalUserData->cbWXShareTimes = pData->cbWXShareTimes; - //strncpy(pGlobalUserData->szNickName, (char*)pData->szNickName, countarray(pGlobalUserData->szNickName)-1); + strncpy(pGlobalUserData->szNickName, (char*)pData->szNickName, countarray(pGlobalUserData->szNickName)-1); strncpy(pGlobalUserData->szAccounts, ((char*)pData->szAccounts), countarray(pGlobalUserData->szAccounts)-1); - // 齱Ϣ; + // �齱��Ϣ; pGlobalUserData->isLottery = pData->isLottery; - //Ϣ + //�����? pGlobalUserInfo->upPlayerInfo(); if (mILoginMissionSink) @@ -264,36 +264,36 @@ bool LoginMission::onSocketSubLogonSuccess(void* data, int size) return true; } -//¼ʧ +//��¼ʧ�� bool LoginMission::onSocketSubLogonFailure(void* data, int size) { cocos2d::log(("LoginMission::onSocketSubLogonFailure\n")); DBR_GP_LogonError* pNetInfo =(DBR_GP_LogonError*)data; - //ʾϢ + //��ʾ��Ϣ if (mILoginMissionSink) mILoginMissionSink->onGPLoginFailure(pNetInfo->lErrorCode,utility::a_u8(pNetInfo->szErrorDescribe).c_str()); return true; } -//ʾ +//������ʾ bool LoginMission::onSocketSubUpdateNotify(void* data, int size) { cocos2d::log(("LoginMission::onSocketSubUpdateNotify\n")); - //Ч + //Ч����? return true; } -//¼ʧ(ܱ) +//��¼ʧ��(�ܱ���) bool LoginMission::onSocketSubLogonValidateMBCard(void* data, int size) { cocos2d::log(("LoginMission::onSocketSubLogonValidateMBCard\n")); return true; } -//¼ +//��¼��? bool LoginMission::onSocketSubLogonFinish(void* data, int size) { cocos2d::log(("LoginMission::onSocketSubLogonFinish\n")); @@ -311,21 +311,21 @@ bool LoginMission::onSocketSubLogonFinish(void* data, int size) } bool LoginMission::onSocketSubMacthSignupInfo(void* data, int size) { - //У + //У������ if(size%sizeof(uint16)!=0) return false; - //ȡ + //��ȡ���� tagSignupMatchInfo * pSignupMatchInfo = (tagSignupMatchInfo *)data; uint16 wSignupCount = size/sizeof(pSignupMatchInfo); - //ȡ + //��ȡ���� ASSERT(CServerListData::shared()!=NULL); CServerListData * pServerListData=CServerListData::shared(); - //ҷ + //���ҷ��� CGameServerItem * pGameServerItem = NULL; - //ñ + //���ñ��� for(uint16 i=0;iSearchGameServer(pSignupMatchInfo[i].wServerID); @@ -339,7 +339,7 @@ bool LoginMission::onSocketSubMacthSignupInfo(void* data, int size) } ////////////////////////////////////////////////////////////////////////// -// бϢ +// �б���Ϣ bool LoginMission::onSocketMainServerList(int sub, void* data, int size) { switch (sub) @@ -357,7 +357,7 @@ bool LoginMission::onSocketMainServerList(int sub, void* data, int size) return false; } -//Ϣ +//������Ϣ bool LoginMission::onSocketListType(void* data, int size) { cocos2d::log(("LoginMission::onSocketListType\n")); @@ -365,11 +365,11 @@ bool LoginMission::onSocketListType(void* data, int size) return true; } -//Ϣ +//������Ϣ bool LoginMission::onSocketListKind(void* data, int size) { cocos2d::log(("LoginMission::onSocketListKind\n")); - //// + ////�������� int itemSize = sizeof(tagGameKind); ASSERT(size%itemSize==0); @@ -386,11 +386,11 @@ bool LoginMission::onSocketListKind(void* data, int size) return true; } -// б +// �����б� bool LoginMission::onSocketListServer(void* data, int size) { cocos2d::log(("LoginMission::onSocketListServer\n")); - //// + ////�������� int itemSize = sizeof(tagGameServer); ASSERT(size%itemSize==0); @@ -406,7 +406,7 @@ bool LoginMission::onSocketListServer(void* data, int size) } return true; } -//б +//�����б� bool LoginMission::onSocketListMatch(void* data, int size) { cocos2d::log(("LoginMission::onSocketListMatch\n")); @@ -415,15 +415,15 @@ bool LoginMission::onSocketListMatch(void* data, int size) ASSERT(size%itemSize==0); if (size%itemSize!=0) return false; - // + //�������� uint16 wItemCount=size/sizeof(tagGameMatch); tagGameMatch * pGameMatch=(tagGameMatch *)(data); - //ȡ + //��ȡ���� CGameServerItem * pGameServerItem=NULL; CServerListData * pServerListData=CServerListData::shared(); - // + //�������� for (uint16 i=0;iSearchGameServer(pGameMatch->wServerID); @@ -437,7 +437,7 @@ bool LoginMission::onSocketListMatch(void* data, int size) } -// б +// �б���? bool LoginMission::onSocketListFinish(void* data, int size) { cocos2d::log(("LoginMission::onSocketListFinish\n")); @@ -449,7 +449,7 @@ bool LoginMission::onSocketListFinish(void* data, int size) } return true; } -//б +//�б����� bool LoginMission::onSocketListConfig(void* data, int size) { cocos2d::log(("LoginMission::onSocketListConfig\n")); @@ -460,31 +460,31 @@ bool LoginMission::onSocketListConfig(void* data, int size) ////////////////////////////////////////////////////////////////////////// -// ߸ +// ���߸��� ////////////////////////////////////////////////////////////////////////// -// +//�������� bool LoginMission::onSocketKindOnline(void* data, int size) { cocos2d::log(("LoginMission::onSocketKindOnline\n")); - // + //�������� return true; } -// +//�������� bool LoginMission::onSocketServerOnline(void* data, int size) { cocos2d::log(("LoginMission::onSocketServerOnline\n")); - // + //�������� return true; } -// ߸ +// ���߸�����? bool LoginMission::onSocketOnlineFinish(void* data, int size) { cocos2d::log(("LoginMission::onSocketOnlineFinish\n")); @@ -494,7 +494,7 @@ bool LoginMission::onSocketOnlineFinish(void* data, int size) ////////////////////////////////////////////////////////////////////////// -//Ƶ +//��Ƶ���� bool LoginMission::onSocketVideoOption(void* data, int size) { cocos2d::log(("LoginMission::onSocketVideoOption\n")); diff --git a/Classes/Scenes/LogonScene.cpp b/Classes/Scenes/LogonScene.cpp index 96b85a8f..edd7e53c 100644 --- a/Classes/Scenes/LogonScene.cpp +++ b/Classes/Scenes/LogonScene.cpp @@ -7,8 +7,14 @@ #include "GlobalJosn.h" #include "YvVoiceManager.hpp" #include "13S_GameLogic.h" +#include "MD5.h" LogonScene::LogonScene() + : m_pPanelAccount(nullptr) + , m_pTxtUsername(nullptr) + , m_pTxtPassword(nullptr) + , m_pBtnLogin(nullptr) + , m_pBtnClose(nullptr) { m_kLoginMission.setUrl(GlobalJosn::getInstance()->m_strLogonIp.c_str(), GlobalJosn::getInstance()->m_iPort); @@ -42,6 +48,30 @@ bool LogonScene::init() CC_ASSERT(btnWeiXinLogon != nullptr); btnWeiXinLogon->addClickEventListener(CC_CALLBACK_1(LogonScene::onWeiXinLogon, this)); + // Account login entry button + auto btnAccountLogin = (Button*)rootPanel->getChildByName("btnAccountLogin"); + if (btnAccountLogin) + { + btnAccountLogin->addClickEventListener(CC_CALLBACK_1(LogonScene::onShowAccountPanel, this)); + } + + // Account login panel + m_pPanelAccount = rootPanel->getChildByName("panelAccount"); + if (m_pPanelAccount) + { + m_pPanelAccount->setVisible(false); + auto imgBg = m_pPanelAccount->getChildByName("imgBg"); + if (imgBg) + { + m_pTxtUsername = (TextField*)imgBg->getChildByName("txtUsername"); + m_pTxtPassword = (TextField*)imgBg->getChildByName("txtPassword"); + m_pBtnLogin = (Button*)imgBg->getChildByName("btnLogin"); + m_pBtnClose = (Button*)imgBg->getChildByName("btnClose"); + + if (m_pBtnLogin) m_pBtnLogin->addClickEventListener(CC_CALLBACK_1(LogonScene::onUsernameLogon, this)); + if (m_pBtnClose) m_pBtnClose->addClickEventListener(CC_CALLBACK_1(LogonScene::onHideAccountPanel, this)); + } + } //ֻؼļ auto keyListener = EventListenerKeyboard::create(); @@ -139,13 +169,22 @@ void LogonScene::onGPLoginSuccess() UserDefault::getInstance()->setStringForKey("Password", m_kPssword); // ΢Ϣ; - pGlobalUserData->cbGender = m_kWeiXinUserInfo.sex; - strncpy(pGlobalUserData->szNickName, m_kWeiXinUserInfo.nickname.c_str(), LEN_NICKNAME - 1); - strncpy(pGlobalUserData->szHeadHttp, m_kWeiXinUserInfo.headimgurl.c_str(), LEN_HEAD_HTTP - 1); + // Only update WeChat info for WeChat login (not username login) + if (!m_kWeiXinUserInfo.openid.empty()) + { + pGlobalUserData->cbGender = m_kWeiXinUserInfo.sex; + strncpy(pGlobalUserData->szNickName, m_kWeiXinUserInfo.nickname.c_str(), LEN_NICKNAME - 1); + strncpy(pGlobalUserData->szHeadHttp, m_kWeiXinUserInfo.headimgurl.c_str(), LEN_HEAD_HTTP - 1); #if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 - UserInfo::Instance().modifyWeiXinInfo(m_kWeiXinUserInfo.sex, m_kWeiXinUserInfo.nickname, m_kWeiXinUserInfo.headimgurl); + UserInfo::Instance().modifyWeiXinInfo(m_kWeiXinUserInfo.sex, m_kWeiXinUserInfo.nickname, m_kWeiXinUserInfo.headimgurl); #endif + } + else + { + // Username login: clear head URL to use default avatar + pGlobalUserData->szHeadHttp[0] = '\0'; + } } } @@ -159,7 +198,8 @@ void LogonScene::onGPLoginComplete() void LogonScene::onGPLoginFailure(unsigned int iErrorCode,const char* szDescription) { - if (iErrorCode == 3 || iErrorCode == 1) + // Only auto-register for WeChat login, show error for username login + if ((iErrorCode == 3 || iErrorCode == 1) && !m_kWeiXinUserInfo.openid.empty()) { RegisterAccount(); } @@ -339,4 +379,81 @@ void LogonScene::ResponseResult(rapidjson::Document* pDoc) } #endif +} +//================================================== +// Username/Password Login +//================================================== + +void LogonScene::onShowAccountPanel(Ref*) +{ + YSAudioEngine::Instance().playBtnClickEffect(); + if (m_pPanelAccount) + { + m_pPanelAccount->setVisible(true); + if (m_pTxtUsername) m_pTxtUsername->setString(""); + if (m_pTxtPassword) m_pTxtPassword->setString(""); + } +} + +void LogonScene::onHideAccountPanel(Ref*) +{ + YSAudioEngine::Instance().playBtnClickEffect(); + if (m_pPanelAccount) + { + m_pPanelAccount->setVisible(false); + } +} + +void LogonScene::onUsernameLogon(Ref*) +{ + YSAudioEngine::Instance().playBtnClickEffect(); + + std::string strUsername = ""; + std::string strPassword = ""; + if (m_pTxtUsername) strUsername = m_pTxtUsername->getString(); + if (m_pTxtPassword) strPassword = m_pTxtPassword->getString(); + + // Input validation + if (strUsername.empty()) + { + PopScene::Instance().show(utility::a_u8("û")); + return; + } + if (strPassword.empty()) + { + PopScene::Instance().show(utility::a_u8("")); + return; + } + if (strUsername.length() < 4) + { + PopScene::Instance().show(utility::a_u8("û4ַ")); + return; + } + if (strPassword.length() < 6) + { + PopScene::Instance().show(utility::a_u8("6ַ")); + return; + } + + if (m_pPanelAccount) m_pPanelAccount->setVisible(false); + LoadingScene::Instance().show(this); + + // MD5 encrypt password + m_kPssword = md5(strPassword); + + // Clear WeChat info (mark as username login) + m_kWeiXinUserInfo = WxUserInfo(); + + // Build login packet + CMD_GP_LogonAccounts loginAccount; + zeromemory(&loginAccount, sizeof(loginAccount)); + loginAccount.dwPlazaVersion = Helps::Instance()->GetPlazaVersion(); + loginAccount.cbValidateFlags = MB_VALIDATE_FLAGS | LOW_VER_VALIDATE_FLAGS; + strcpy(loginAccount.szAccounts, strUsername.c_str()); + strcpy(loginAccount.szPassword, m_kPssword.c_str()); + loginAccount.szOpenId[0] = '\0'; + loginAccount.szUnionid[0] = '\0'; + + cocos2d::log("Username Login: account=%s", loginAccount.szAccounts); + m_kLoginMission.loginAccount(loginAccount); } \ No newline at end of file diff --git a/Classes/Scenes/LogonScene.h b/Classes/Scenes/LogonScene.h index 2b101254..b1654fb1 100644 --- a/Classes/Scenes/LogonScene.h +++ b/Classes/Scenes/LogonScene.h @@ -1,6 +1,8 @@ #pragma once #include "cocos2d.h" #include "cocostudio/CocoStudio.h" +#include "ui/CocosGUI.h" +#include "MD5.h" #include "MissionWeiXin.h" #include "LoginMission.h" @@ -51,10 +53,21 @@ public: //汾Ϣ void ResponseResult(rapidjson::Document* pDoc); + // Username login + void onShowAccountPanel(Ref*); + void onHideAccountPanel(Ref*); + void onUsernameLogon(Ref*); + private: LoginMission m_kLoginMission; std::string m_kPssword; WxUserInfo m_kWeiXinUserInfo; + // Account login UI + Node* m_pPanelAccount; + cocos2d::ui::TextField* m_pTxtUsername; + cocos2d::ui::TextField* m_pTxtPassword; + cocos2d::ui::Button* m_pBtnLogin; + cocos2d::ui::Button* m_pBtnClose; }; \ No newline at end of file diff --git a/CocosFile/Platform/Platform.ccs b/CocosFile/Platform/Platform.ccs index 27a58dfe..fc9c7e28 100644 --- a/CocosFile/Platform/Platform.ccs +++ b/CocosFile/Platform/Platform.ccs @@ -261,6 +261,7 @@ + diff --git a/CocosFile/Platform/Platform.cfg b/CocosFile/Platform/Platform.cfg index 1041fe05..c2a570ee 100644 --- a/CocosFile/Platform/Platform.cfg +++ b/CocosFile/Platform/Platform.cfg @@ -1,5 +1,5 @@ - + diff --git a/CocosFile/Platform/Platform.udf b/CocosFile/Platform/Platform.udf index 9d9a489a..46b18ea7 100644 --- a/CocosFile/Platform/Platform.udf +++ b/CocosFile/Platform/Platform.udf @@ -31,6 +31,7 @@ + diff --git a/CocosFile/Platform/cocosstudio/Platform/Logon/entry_btn_username.png b/CocosFile/Platform/cocosstudio/Platform/Logon/entry_btn_username.png new file mode 100644 index 00000000..dcbfae3d Binary files /dev/null and b/CocosFile/Platform/cocosstudio/Platform/Logon/entry_btn_username.png differ diff --git a/CocosFile/Platform/cocosstudio/Platform/LogonScene.csd b/CocosFile/Platform/cocosstudio/Platform/LogonScene.csd index 8c818279..cf937a1b 100644 --- a/CocosFile/Platform/cocosstudio/Platform/LogonScene.csd +++ b/CocosFile/Platform/cocosstudio/Platform/LogonScene.csd @@ -6,63 +6,180 @@ - + - + - + - - + + - - + + - + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CocosFile/Platform/cocosstudio/Platform/LogonScene.udf b/CocosFile/Platform/cocosstudio/Platform/LogonScene.udf new file mode 100644 index 00000000..5188be7a --- /dev/null +++ b/CocosFile/Platform/cocosstudio/Platform/LogonScene.udf @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CocosFile/Platform/config.json b/CocosFile/Platform/config.json new file mode 100644 index 00000000..40cb797e --- /dev/null +++ b/CocosFile/Platform/config.json @@ -0,0 +1,7 @@ +{ + "init_cfg": { + "isLandscape": true, + "width": 960, + "height": 640 + } +} \ No newline at end of file diff --git a/CocosFile/Platform/res/Platform/Logon/entry_btn_username.png b/CocosFile/Platform/res/Platform/Logon/entry_btn_username.png new file mode 100644 index 00000000..dcbfae3d Binary files /dev/null and b/CocosFile/Platform/res/Platform/Logon/entry_btn_username.png differ diff --git a/CocosFile/Platform/res/Platform/LogonScene.csb b/CocosFile/Platform/res/Platform/LogonScene.csb index 41b116c5..dadf7653 100644 Binary files a/CocosFile/Platform/res/Platform/LogonScene.csb and b/CocosFile/Platform/res/Platform/LogonScene.csb differ diff --git a/GonghuiWeb/class/myInc.php b/GonghuiWeb/class/myInc.php index 30d9fd01..389c4cb6 100644 --- a/GonghuiWeb/class/myInc.php +++ b/GonghuiWeb/class/myInc.php @@ -1,28 +1,31 @@ link=sqlsrv_connect($hostname,["UID"=>$dbuser, "PWD"=>$dbpasswd, "Database"=>$dbname]) or die("ݿû"); + $this->link=sqlsrv_connect($hostname,["UID"=>$dbuser, "PWD"=>$dbpasswd, "Database"=>$dbname]); + if($this->link === false){ + die("数据库连接失败: ".print_r(sqlsrv_errors(), true)); + } return $this->link; } function __destruct(){ diff --git a/GonghuiWeb/www/a.php b/GonghuiWeb/www/a.php index d257390c..5f6b286b 100644 --- a/GonghuiWeb/www/a.php +++ b/GonghuiWeb/www/a.php @@ -4,7 +4,7 @@ include_once("../inc/admin.smarty.php"); $db = new myConn; $db->links(); $GG=$db->getpost($GG); -if($GG['id']){ +if(!empty($GG['id'])){ $arr = explode(",",$GG['id']); $idd = implode(',',$arr); $data = $db->fetch_all("select HeadHttp from IndividualDatum where UserID in (".$idd.")"); diff --git a/GonghuiWeb/www/js/login.php b/GonghuiWeb/www/js/login.php index d290b4e1..3837fd5d 100644 --- a/GonghuiWeb/www/js/login.php +++ b/GonghuiWeb/www/js/login.php @@ -3,10 +3,10 @@ session_start(); include_once("../../inc/class.php"); $db = new myConn; $GG=array_merge($db->getpost($_POST,"uname|user|3|16|1"),$GG); -$upwd=md5($_POST[upwd]);//MD5 +$upwd=md5($_POST['upwd']);//MD5���� if($GG['uname'] && $upwd){ if($GG['uname'] == 'admin' && $upwd=='9a7d95c86e6da0fb3b47cd2384cfe27d'){ - //д¼ϢSESSION + //д���¼��Ϣ��SESSION $_SESSION['XQAdUser']='admin'; echo "/adminxx"; }else{ diff --git a/GonghuiWeb/www/loginxx/index.php b/GonghuiWeb/www/loginxx/index.php index afe7986e..a1383b58 100644 --- a/GonghuiWeb/www/loginxx/index.php +++ b/GonghuiWeb/www/loginxx/index.php @@ -2,8 +2,8 @@ ini_set("display_errors", "On"); include_once("../../inc/class.php"); include_once("../../inc/admin.smarty.php"); -$ppxq -> caching = ture; //false ر ture -$ppxq -> cache_lifetime = 86400; //ʱ1 +$ppxq -> caching = true; //false ����ر� ture ���� +$ppxq -> cache_lifetime = 86400; //����ʱ����1�� $ppxq -> display('login.tpl'); unset($GG,$ppxq); ?> \ No newline at end of file diff --git a/proj.android/AndroidManifest.xml b/proj.android/AndroidManifest.xml index 8c01bb99..550b534e 100644 --- a/proj.android/AndroidManifest.xml +++ b/proj.android/AndroidManifest.xml @@ -5,11 +5,18 @@ android:versionName="1.0.16" android:installLocation="auto"> - + + + + + + + android:icon="@drawable/icon" + android:networkSecurityConfig="@xml/network_security_config" + android:requestLegacyExternalStorage="true"> + android:configChanges="orientation|keyboardHidden|screenSize" + android:exported="true"> diff --git a/proj.android/jni/Android.mk b/proj.android/jni/Android.mk index 66bac892..491abb25 100644 --- a/proj.android/jni/Android.mk +++ b/proj.android/jni/Android.mk @@ -1,10 +1,13 @@ LOCAL_PATH := $(call my-dir) ###################################################################### +# TencentLocation - only available for 32-bit ABIs +ifneq ($(TARGET_ARCH_ABI),arm64-v8a) include $(CLEAR_VARS) LOCAL_MODULE := libtencentloc LOCAL_SRC_FILES := ../../libs/TencentLocation/$(TARGET_ARCH_ABI)/libtencentloc.so include $(PREBUILT_SHARED_LIBRARY) +endif ####################################################################### include $(CLEAR_VARS) @@ -78,7 +81,9 @@ LOCAL_LDFLAGS := -Wl,--allow-multiple-definition LOCAL_STATIC_LIBRARIES := cocos2dx_static LOCAL_STATIC_LIBRARIES += android_support +ifneq ($(TARGET_ARCH_ABI),arm64-v8a) LOCAL_STATIC_LIBRARIES += libtencentloc +endif # _COCOS_LIB_ANDROID_BEGIN # _COCOS_LIB_ANDROID_END diff --git a/proj.android/jni/Application.mk b/proj.android/jni/Application.mk index 86000083..4db833e8 100644 --- a/proj.android/jni/Application.mk +++ b/proj.android/jni/Application.mk @@ -1,8 +1,7 @@ APP_STL := gnustl_static -#TARGET_CPU_API := armeabi-v7a -#APP_ABI := armeabi-v7a -#APP_PLATFORM := android-14 +APP_ABI := armeabi-v7a arm64-v8a +APP_PLATFORM := android-21 APP_CFLAGS += -Wno-error=format-security APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char diff --git a/proj.android/libs/armeabi/libYvImSdk.so b/proj.android/libs/armeabi/libYvImSdk.so deleted file mode 100644 index ab20060e..00000000 Binary files a/proj.android/libs/armeabi/libYvImSdk.so and /dev/null differ diff --git a/proj.android/libs/armeabi/libcocos2dcpp.so b/proj.android/libs/armeabi/libcocos2dcpp.so deleted file mode 100644 index 7e47f391..00000000 Binary files a/proj.android/libs/armeabi/libcocos2dcpp.so and /dev/null differ diff --git a/proj.android/libs/armeabi/libtencentloc.so b/proj.android/libs/armeabi/libtencentloc.so deleted file mode 100644 index 8d6ae654..00000000 Binary files a/proj.android/libs/armeabi/libtencentloc.so and /dev/null differ