void PlayerData::BuildBasicData(Store db) { BuildBasePropData (db); BuildScenePropsData (db); BuildCardData (db); BuildCardRosterData (db); BuildEquipPkgData (db); BuildOfficerData (db); BuildPersonalMailData (db); BuildArenaTable (db); BuildCashPropsData (db); BuildManorPropsData (db); BuildEventData (db); BuildQuestData (db); BuildWorshipData (db); BuildWorldBossData (db); BuildDialData (db); BuildVipTable (db); BuildDataType (db, PlayerDataType_End); DBLOG; }
void PlayerData::BuildDungeonProgressData(Store db) { BuildDataType (db, PlayerDataType_Dungeon); db << dungeonProgress; DEBUG_LOG("打包玩家关卡进度 bigLv %u smallLv %u\n", dungeonProgress.bigLv, dungeonProgress.smallLv); }
void PlayerData::BuildRandShopTable(Store db) { BuildDataType (db, PlayerDataType_RandShopItem); MAP_RANDSHOP::iterator it = m_randShop.begin(); MAP_RANDSHOP::iterator end = m_randShop.end(); uint32 ShopSize = m_randShop.size(); db << ShopSize; while (it != end) { db << it->first; uint32 count = it->second.size(); db << count; MAP_RANDITEM::iterator item_it = it->second.begin(); MAP_RANDITEM::iterator item_end = it->second.end(); while (item_it != item_end) { db << item_it->first << item_it->second; ++item_it; } ++it; } }
void PlayerData::BuildExtendData(Store db) { BuildSundryPkgData (db); BuildGemPkgData (db); BuildCardChipsPkgData (db); BuildEquipChipsPkgData (db); BuildLotteryPropsData (db); BuildDungeonProgressData (db); BuildSceneRewardData (db); BuildSceneStateTable (db); BuildRandShopPropsData (db); BuildRandShopTable (db); BuildNormalShopTable (db); BuildDaySignTable (db); BuildBabelTable (db); BuildHuntingData (db); BuildDrawCardData (db); BuildMartData (db); BuildTreasureData (db); // BuildSceneScoreTable (db); BuildDataType (db, PlayerDataType_End); int verify = 123456; db << verify; }
void PlayerData::BuildTreasureData(Store db) { if (mTreasureData.empty()) return; BuildDataType (db, PlayerDataType_Treasure); db.append(mTreasureData.data(), mTreasureData.size()); }
void PlayerData::BuildEventData(Store db) { if (mEventData.empty()) return; BuildDataType (db, PlayerDataType_Event); db.append(mEventData.data(), mEventData.size()); }
void PlayerData::BuildActivityData(Store db) { if (mActivityData.empty()) return; BuildDataType (db, PlayerDataType_Activity); db.append(mActivityData.data(), mActivityData.size()); }
void PlayerData::BuildDialData(Store db) { if(mDialData.empty()) return; BuildDataType (db, PlayerDataType_Dial); db.append(mDialData.data(), mDialData.size()); }
void PlayerData::BuildEquipChipsPkgData(Store db) { BuildDataType (db, PlayerDataType_EquipChips); db << static_cast<int>(m_pkgEquipChips.size()); for (const auto& p : m_pkgEquipChips) { db << p.first << p.second; } }
void PlayerData::BuildGemPkgData(Store db) { BuildDataType (db, PlayerDataType_Gem); db << static_cast<int>(m_pkgGem.size()); for (const auto& p : m_pkgGem) { db << p.first << p.second; } }
void PlayerData::BuildSundryPkgData(Store db) { BuildDataType (db, PlayerDataType_Sundry); db << static_cast<int>(m_pkgSundry.size()); for (const auto& p : m_pkgSundry) { db << p.first << p.second; } }
void PlayerData::BuildCardData(Store db) { BuildDataType (db, PlayerDataType_Card); uint16 count = m_cardMap.size(); db << count; for (const auto& p : m_cardMap) { db << p.second; } }
void PlayerData::BuildEquipPkgData(Store db) { BuildDataType (db, PlayerDataType_Equip); int count = m_pkgEquip.size(); db << count; for (const auto& p : m_pkgEquip) { db << p.first << p.second; } }
void PlayerData::BuildSceneRewardData(Store db) { BuildDataType (db,PlayerDataType_SceneReward); uint16 sz = m_sceneReward.size(); db << sz; MAP_SCENEREWARD::iterator it = m_sceneReward.begin(); for (; it != m_sceneReward.end(); ++it) { db << it->first << it->second; } }
void PlayerData::BuildLotteryPropsData(Store db) { BuildDataType (db, PlayerDataType_Lottery); uint16 sz = m_lottery.size(); db << sz; MAP_LOTTERYPROPS::iterator it = m_lottery.begin(); for (; it != m_lottery.end(); ++it) { db << it->second; } }
void PlayerData::BuildNormalShopTable(Store db) { BuildDataType (db, PlayerDataType_NormalShop); uint32 count = m_normalShop.size(); db << count; MAP_NORMALSHOP::iterator it = m_normalShop.begin(); for (; it != m_normalShop.end(); ++it) { db << it->first << it->second; } }
void PlayerData::BuildCardRosterData(Store db) { BuildDataType (db, PlayerDataType_Roster); int c = m_cardRoster.size(); db << c; for (const auto x : m_cardRoster) { db << x.first; } }
void PlayerData::BuildHuntingData(Store db) { BuildDataType (db, PlayerDataType_HuntingData); db << huntingProps.stayPos << huntingProps.remainTimes << huntingProps.buyTimes << huntingProps.restoreTime; for(uint8 i=0; i<3; ++i) { db << huntingProps.missions[i].missionType; db << huntingProps.missions[i].require; db << huntingProps.missions[i].value; db << huntingProps.missions[i].rewarded; } }
void PlayerData::BuildSceneStateTable(Store db) { BuildDataType (db, PlayerDataType_SceneState); uint16 sz = m_sceneState.size(); db << sz; MAP_SCENESTATE::iterator it = m_sceneState.begin(); for (; it != m_sceneState.end(); ++it) { db << it->first << it->second; } }
void PlayerData::BuildDrawCardData(Store db) { BuildDataType (db, PlayerDataType_DrawCardData); db << drawCardProps.remainTimes; for(uint8 i=0; i<6; ++i) { db << drawCardProps.cards[i].prob; db << drawCardProps.cards[i].itemType; db << drawCardProps.cards[i].itemId; db << drawCardProps.cards[i].itemCount; db << drawCardProps.cards[i].itemPos; db << drawCardProps.cards[i].gained; } }
void PlayerData::BuildMartData(Store db) { if (martMap.empty()) return; BuildDataType (db, PlayerDataType_Mart); uint32 count = martMap.size(); db << count; for (MapUint_Uint::iterator it = martMap.begin(); it != martMap.end(); ++it) { db << it->first; db << it->second; } }
void PlayerData::BuildQuestData(Store db) { BuildDataType (db, PlayerDataType_Quest); int sz = 0; if (getId() == 105101) { int i = 1; i += 1; } sz = questStatus.size(); db << sz; for (const auto& qv : questStatus) { db << qv.first << qv.second.value << qv.second.status; } }
void PlayerData::BuildPersonalMailData(Store db) { BuildDataType (db, PlayerDataType_Mail); int sz = m_personalMail.size(); db << sz; MAP_PERSONAL_MAIL::iterator it = m_personalMail.begin(); MAP_PERSONAL_MAIL::iterator end = m_personalMail.end(); while (it != end) { db << it->second; ++it; } db << mailProps; }
void PlayerData::BuildWorshipData(Store db) { BuildDataType (db, PlayerDataType_Worship); db << worshipProps; }
HRESULT CDBIContext::BuildArrayType (CString strRangeList, const CString &strNamespace, CString strText, const CString &strDBIFile, CTypeDBI *&pType) { HRESULT hr; CComObject<CTypeDBI> *pTypeDBI; CTypeDBI *pElementType; int iPos; long lLowerBound; long lUpperBound; CString strRange; CString strBound; LPTSTR pszEnd; int iIndex; pType = NULL; iPos = strRangeList.Find (_T (',')); if (iPos == -1) { strRange = strRangeList; strRangeList = ""; } else { strRange = strRangeList.Left (iPos); strRangeList = strRangeList.Mid (iPos + 1); }; iPos = strRange.Find (_T ('.')); ASSERT (iPos != -1 && iPos + 1 < strRange.GetLength () && strRange[iPos + 1] == _T ('.')); if (iPos == -1 || iPos + 1 >= strRange.GetLength () || strRange[iPos + 1] != _T ('.')) { return (E_UNEXPECTED); }; strBound = strRange.Left (iPos); strBound.TrimLeft (); strBound.TrimRight (); lLowerBound = _tcstol (strBound, &pszEnd, 10); ASSERT (pszEnd == NULL || *pszEnd == _T ('\0')); if (pszEnd != NULL && *pszEnd != _T ('\0')) { return (E_UNEXPECTED); }; strBound = strRange.Mid (iPos + 2); strBound.TrimLeft (); strBound.TrimRight (); lUpperBound = _tcstol (strBound, &pszEnd, 10); ASSERT (pszEnd == NULL || *pszEnd == _T ('\0')); if (pszEnd != NULL && *pszEnd != _T ('\0')) { return (E_UNEXPECTED); }; strRangeList.TrimLeft (); if (!strRangeList.IsEmpty ()) { hr = BuildArrayType (strRangeList, strNamespace, strText, strDBIFile, pElementType); } else { strText.TrimLeft (); ASSERT (strText.Left (2).CompareNoCase (_T ("OF")) == 0 && _istspace (strText[2])); if (strText.Left (2).CompareNoCase (_T ("OF")) != 0 || !_istspace (strText[2])) { return (E_UNEXPECTED); }; hr = BuildDataType (strText.Mid (3), "<POUS>", strDBIFile, pElementType); }; if (FAILED (hr)) { return (hr); }; ASSERT (pElementType != NULL); if (pElementType == NULL) { return (E_UNEXPECTED); }; for (iIndex = 0; iIndex < m_UserTypes.GetSize (); ++iIndex) { CTypeDBI *pUserType; pUserType = m_UserTypes[iIndex]; ASSERT (pUserType != NULL); if (pUserType == NULL) { pElementType->Release (); return (E_UNEXPECTED); }; if (!pUserType->GetTypeName ().IsEmpty () || pUserType->GetKind () != DBIArrayType) continue; if (pElementType == pUserType->GetElementType () && lLowerBound == pUserType->GetLowerBound () && lUpperBound == pUserType->GetUpperBound ()) { pType = pUserType; pType->AddRef (); return (S_OK); }; }; hr = CComObject<CTypeDBI>::CreateInstance (&pTypeDBI); if (FAILED (hr)) { pElementType->Release (); return (hr); }; ASSERT (pTypeDBI != NULL); if (pTypeDBI == NULL) { pElementType->Release (); return (E_UNEXPECTED); }; pTypeDBI->AddRef (); hr = pTypeDBI->Init (this, pElementType, lLowerBound, lUpperBound); if (FAILED (hr)) { pElementType->Release (); pTypeDBI->Release (); return (hr); }; m_UserTypes.Add (pTypeDBI); pType = pTypeDBI; return (S_OK); }
void PlayerData::BuildOfficerData(Store db) { BuildDataType (db, PlayerDataType_Officer); db << officerProps; }
void PlayerData::BuildWorldBossData(Store db) { BuildDataType (db, PlayerDataType_WorldBoss); db << bossProps; }
void PlayerData::BuildCashPropsData(Store db) { BuildDataType (db, PlayerDataType_CashProps); db << cashProps; }
void PlayerData::BuildManorPropsData(Store db) { BuildDataType (db, PlayerDataType_ManorProps); db << manorProps; }
void PlayerData::BuildRandShopPropsData(Store db) { BuildDataType (db, PlayerDataType_RandShop); db << RandProps; }