Example #1
0
        public static HouseholdContentsProxy Import(string packageName)
        {
            ulong lotId = DownloadContent.ImportHouseholdContentsFromExportBin(packageName);

            if (lotId != 0x0L)
            {
                HouseholdContentsProxy householdContents = new HouseholdContentsProxy();
                if (DownloadContent.ImportHouseholdContents(householdContents, lotId))
                {
                    householdContents.mContents.ContentId = lotId;
                    return(householdContents);
                }
            }

            return(null);
        }
Example #2
0
        public static void Import(ExportBinContents ths, bool origImport)
        {
            switch (ths.mExportBinType)
            {
            case ExportBinType.Household:
                ulong lotId = DownloadContent.ImportHouseholdContentsFromExportBin(ths.mPackageName);
                if (lotId != 0x0L)
                {
                    // Custom
                    HouseholdContentsProxy proxy = new HouseholdContentsProxy();
                    if (DownloadContent.ImportHouseholdContents(proxy, lotId))
                    {
                        ths.mHouseholdContents           = proxy.Contents;
                        ths.mHouseholdContents.ContentId = lotId;
                    }
                }
                break;

            case ExportBinType.HouseholdLot:
            case ExportBinType.Lot:
                ulong oldLotContentId = 0x0L;
                ulong lotContendId    = DownloadContent.ImportLotContentsFromExportBin(ths.mPackageName, ref oldLotContentId);
                if (lotContendId != 0x0L)
                {
                    if (ths.mExportBinType == ExportBinType.HouseholdLot)
                    {
                        // Custom
                        HouseholdContentsProxy proxy = new HouseholdContentsProxy();
                        ths.mHouseholdContents = proxy.Contents;

                        if (DownloadContent.ImportHouseholdContents(proxy, lotContendId))
                        {
                            ths.mHouseholdContents.ContentId = lotContendId;
                        }
                    }

                    LotContents contents2 = new LotContents(ths.mPackageName, lotContendId, ths.mHouseholdContents, ths.mLotContentsWorth, ths.LotType, ths.LotContentsSizeX, ths.LotContentsSizeY, ths.IsHouseboatLot, ths.mLotMaxLevel, oldLotContentId, ths.mResidentialLotSubType, ths.mCommercialLotSubType);
                    ths.mLotContents = contents2;
                }
                break;
            }

            if (origImport || (ths.mIndexMap == null))
            {
                ths.mIndexMap = CreateIndexMap(ths.Household);
            }
        }