背景和头像缺失
This commit is contained in:
@@ -372,7 +372,7 @@ void MainScene::startUnionRoomTime()
|
||||
|
||||
void MainScene::RequsetUnionRoomList(bool isLoading /*= true*/)
|
||||
{
|
||||
if (this->isVisible() && m_PanelRoom->isVisible() && m_dwSelectUnionCode != 0)
|
||||
if (this->isVisible() && m_PanelRoom->isVisible() && m_dwSelectUnionCode > 0 && m_dwSelectUnionCode < 100000000)
|
||||
{
|
||||
// 连续三次刷新失败,强制刷新;
|
||||
if (m_isRefreshing && m_nRefreshErr < 3)
|
||||
@@ -387,6 +387,7 @@ void MainScene::RequsetUnionRoomList(bool isLoading /*= true*/)
|
||||
}
|
||||
|
||||
CMD_GR_GetUnionRoomInfo getUnionRoom;
|
||||
memset(&getUnionRoom, 0, sizeof(getUnionRoom)); // 添加这行
|
||||
getUnionRoom.dwUserID = UserInfo::getInstance()->getUserID();
|
||||
getUnionRoom.dwUnionCode = m_dwSelectUnionCode;
|
||||
m_kUserInGameServer.PerformGetUnionRoomList(&getUnionRoom);
|
||||
@@ -399,26 +400,45 @@ void MainScene::RequsetUnionRoomList(bool isLoading /*= true*/)
|
||||
// 显示工会列表;
|
||||
void MainScene::ShowUnionList(tagUnionAndGameList* pUnionAndGameList)
|
||||
{
|
||||
if (m_UnionList == nullptr) return;
|
||||
if (pUnionAndGameList == nullptr) return;
|
||||
utility::mlog("ShowUnionList: called");
|
||||
utility::mlog("ShowUnionList: m_UnionList=%p, m_PanelRoom=%p", m_UnionList, m_PanelRoom);
|
||||
|
||||
if (m_UnionList == nullptr) {
|
||||
utility::mlog("ShowUnionList: m_UnionList is NULL, return!");
|
||||
return;
|
||||
}
|
||||
if (pUnionAndGameList == nullptr) {
|
||||
utility::mlog("ShowUnionList: pUnionAndGameList is NULL, return!");
|
||||
return;
|
||||
}
|
||||
|
||||
m_UnionList->removeAllChildren();
|
||||
|
||||
int iUnionCount = pUnionAndGameList->kUnionList.size();
|
||||
utility::mlog("ShowUnionList: iUnionCount=%d", iUnionCount);
|
||||
|
||||
// 玩家没有工会;
|
||||
if (iUnionCount <= 0)
|
||||
{
|
||||
utility::mlog("ShowUnionList: no unions, hiding panel");
|
||||
m_PanelRoom->setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
utility::mlog("ShowUnionList: showing panel, creating union buttons...");
|
||||
m_PanelRoom->setVisible(true);
|
||||
|
||||
// 获取上次选择的工会;
|
||||
std::string strUnionCode = StringUtils::format("UnionCode_%d", UserInfo::Instance().getGameID());
|
||||
m_dwSelectUnionCode = UserDefault::getInstance()->getIntegerForKey(strUnionCode.c_str(), 0);
|
||||
|
||||
// 校验:过滤无效的工会代码
|
||||
if (m_dwSelectUnionCode < 0 || m_dwSelectUnionCode > 100000000)
|
||||
{
|
||||
utility::mlog("ShowUnionList: invalid m_dwSelectUnionCode=%d, reset to 0", m_dwSelectUnionCode);
|
||||
m_dwSelectUnionCode = 0;
|
||||
UserDefault::getInstance()->setIntegerForKey(strUnionCode.c_str(), 0);
|
||||
}
|
||||
|
||||
uint32 dwMeUserID = CGlobalUserInfo::GetInstance()->getUserID();
|
||||
|
||||
// 列表调整;
|
||||
@@ -434,6 +454,17 @@ void MainScene::ShowUnionList(tagUnionAndGameList* pUnionAndGameList)
|
||||
{
|
||||
tagUnionItem* pUnionItem = &pUnionAndGameList->kUnionList[i];
|
||||
|
||||
// 添加日志
|
||||
utility::mlog("UnionItem[%d]: UserID=%d, Code=%d, GoldOpen=%d, Open=%d, People=%d, Card=%d, Name=%s",
|
||||
i,
|
||||
pUnionItem->dwUserID,
|
||||
pUnionItem->dwUnionCode,
|
||||
pUnionItem->cbUnionGoldOpen,
|
||||
pUnionItem->cbUnionOpen,
|
||||
pUnionItem->lPeople,
|
||||
pUnionItem->lUnionCard,
|
||||
pUnionItem->szUnionName);
|
||||
|
||||
DWORD dwUnionCode = pUnionItem->dwUnionCode;
|
||||
BYTE cbUnionGoldOpen = pUnionItem->cbUnionGoldOpen;
|
||||
|
||||
@@ -488,6 +519,8 @@ void MainScene::ShowUnionList(tagUnionAndGameList* pUnionAndGameList)
|
||||
btnUnionItem->setVisible(true);
|
||||
m_UnionList->addChild(btnUnionItem);
|
||||
}
|
||||
// 在 for 循环结束后添加:
|
||||
utility::mlog("ShowUnionList: added %d union buttons", iUnionCount);
|
||||
|
||||
// 加载房间;
|
||||
if (m_dwSelectUnionCode != 0 && !m_isRefreshing)
|
||||
@@ -510,6 +543,8 @@ void MainScene::ShowUnionList(tagUnionAndGameList* pUnionAndGameList)
|
||||
m_btnBackUnion->setVisible(false);
|
||||
m_btnRefresh->setVisible(false);
|
||||
}
|
||||
// 在函数最后添加:
|
||||
utility::mlog("ShowUnionList: m_dwSelectUnionCode=%d, m_isRefreshing=%d", m_dwSelectUnionCode, m_isRefreshing);
|
||||
}
|
||||
|
||||
// 房间列表;
|
||||
@@ -680,7 +715,7 @@ void MainScene::showUnionRoomList(tagRoomItemList *pRoomItemList)
|
||||
std::string strText = StringUtils::format("%s, %s.", strRoomInfo.c_str(), strGameRule.c_str());
|
||||
std::string strUrl = GlobalJosn::getInstance()->getShareInfoByKind(SH_KIND_WEIXIN_URL);
|
||||
std::string strUrlInfo = StringUtils::format("%s?param=%d", strUrl.c_str(), dwRoomID);
|
||||
MissionWeiXin::Instance().shareUrlWeiXin(strUrlInfo, utility::a_u8(strGameName), strText);
|
||||
MissionWeiXin::Instance().shareUrlWeiXin(strUrlInfo, strGameName, strText);
|
||||
|
||||
//SelectShareScene::Instance().shareRoomInfo(strUrlInfo, utility::a_u8(strGameName), strText, 0);
|
||||
});
|
||||
@@ -806,7 +841,7 @@ void MainScene::upPlayerInfo()
|
||||
//玩家账号
|
||||
auto txtUserName = (Text*)panelUser->getChildByName("txtUserName");
|
||||
CC_ASSERT(txtUserName != nullptr);
|
||||
txtUserName->setString(UserInfo::Instance().getUserNicName());
|
||||
txtUserName->setString(utility::a_u8(UserInfo::Instance().getUserNicName()));
|
||||
|
||||
//房卡
|
||||
auto txtDiamond = (Text*)panelUser->getChildByName("txtDiamond");
|
||||
@@ -1256,8 +1291,16 @@ void MainScene::onUserInUnion(CMD_GP_InUnion* pNetInfo)
|
||||
|
||||
void MainScene::onUnionAndGameInfo(tagUnionAndGameList *pUnionAndGameList)
|
||||
{
|
||||
// 添加日志
|
||||
utility::mlog("onUnionAndGameInfo: pUnionAndGameList=%p", pUnionAndGameList);
|
||||
if (pUnionAndGameList != nullptr) {
|
||||
utility::mlog("onUnionAndGameInfo: UnionCount=%d", pUnionAndGameList->kUnionList.size());
|
||||
}
|
||||
|
||||
if (pUnionAndGameList == nullptr) return;
|
||||
|
||||
utility::mlog("onUnionAndGameInfo: m_GameUnionNode=%p", m_GameUnionNode);
|
||||
|
||||
if (m_GameUnionNode != nullptr)
|
||||
{
|
||||
m_GameUnionNode->ShowUnionList(pUnionAndGameList);
|
||||
|
||||
Reference in New Issue
Block a user