Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support packing maps to .oramap using third-party software #21323

Open
LipkeGu opened this issue Feb 2, 2024 · 3 comments
Open

Support packing maps to .oramap using third-party software #21323

LipkeGu opened this issue Feb 2, 2024 · 3 comments
Labels

Comments

@LipkeGu
Copy link
Member

LipkeGu commented Feb 2, 2024

System Information

  • Operating System: Windows 11 Pro (x64)
  • OpenRA Version: DEV-VERSION (bleed)
  • OpenRA Mod: ra
  • Source: Official download package OR self-compiled OR third-party package
  • For self-compiled or third-party packages: Mono version

Exception log

RemoveValidRelationsFromCapturable: Remove ValidRelations property from Capturable.
   Updating map... FAILED

   The automated changes for this rule were not applied because of an error.
   After the issue reported below is resolved you should run the updater
   with SOURCE set to RemoveValidRelationsFromCapturable to retry these changes

   The exception reported was:
     ICSharpCode.SharpZipLib.Zip.ZipException: Failed to copy bytes expected 108 read 0
        at ICSharpCode.SharpZipLib.Zip.ZipFile.CopyEntryDataDirect(ZipUpdate update, Stream stream, Boolean updateCrc, Int64& destinationPosition, Int64& sourcePosition)
        at ICSharpCode.SharpZipLib.Zip.ZipFile.CopyEntryDirect(ZipFile workFile, ZipUpdate update, Int64& destinationPosition)
        at ICSharpCode.SharpZipLib.Zip.ZipFile.RunUpdates()
        at ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate()
        at OpenRA.FileSystem.ZipFileLoader.ReadWriteZipFile.Update(String filename, Byte[] contents) in D:\Project\OpenRA\OpenRA.Game\FileSystem\ZipFile.cs:line 128
        at OpenRA.Mods.Common.UpdateRules.UpdateExtensions.Save(List`1 files) in D:\Project\OpenRA\OpenRA.Mods.Common\UpdateRules\UpdateUtils.cs:line 349
        at OpenRA.Mods.Common.UtilityCommands.UpdateMapCommand.ApplyRules(ModData modData, IReadWritePackage mapPackage, IEnumerable`1 rules) in D:\Project\OpenRA\OpenRA.Mods.Common\UtilityCommands\UpdateMapCommand.cs:line 112
ExtractResourceStorageFromHarvester: Renames StoresResources to StoresPlayerResources and extracts StoresResources from Harvester.
   Updating map... FAILED

   The automated changes for this rule were not applied because of an error.
   After the issue reported below is resolved you should run the updater
   with SOURCE set to ExtractResourceStorageFromHarvester to retry these changes

   The exception reported was:
     System.ObjectDisposedException: Cannot access a disposed object.
     Object name: 'ZipFile'.
        at ICSharpCode.SharpZipLib.Zip.ZipFile.GetEntry(String name)
        at OpenRA.FileSystem.ZipFileLoader.ReadOnlyZipFile.GetStream(String filename) in D:\Project\OpenRA\OpenRA.Game\FileSystem\ZipFile.cs:line 40
        at OpenRA.Mods.Common.UpdateRules.UpdateUtils.UpdateMap(ModData modData, IReadWritePackage mapPackage, UpdateRule rule, List`1& files, HashSet`1 externalFilenames) in D:\Project\OpenRA\OpenRA.Mods.Common\UpdateRules\UpdateUtils.cs:line 88
        at OpenRA.Mods.Common.UtilityCommands.UpdateMapCommand.ApplyRules(ModData modData, IReadWritePackage mapPackage, IEnumerable`1 rules) in D:\Project\OpenRA\OpenRA.Mods.Common\UtilityCommands\UpdateMapCommand.cs:line 109
ReplacePaletteModifiers: Replace palette modifiers with post-processing shaders.
   Updating map... FAILED

Replay

try to update the map https://resource.openra.net/maps/55706/

Additional information

@LipkeGu LipkeGu added the Crash label Feb 2, 2024
@LipkeGu LipkeGu changed the title My game crashed OpenRA.Utility: Update-Map (Failed to copy bytes expected x read y) -> Cannot access a disposed object. Feb 2, 2024
@LipkeGu
Copy link
Member Author

LipkeGu commented Feb 3, 2024

It seems to happen when a map is repacked with winrar

@PunkPun
Copy link
Member

PunkPun commented Feb 3, 2024

related #8999

it has been true for a while that a lot of zippers aren't compatible with our zip library.

The usual recommendation we give is to use map editor to compress. Though alternatives have beed found, f.e. the python zip library produces compatible maps

@PunkPun PunkPun added Feature and removed Crash labels Feb 3, 2024
@abcdefg30 abcdefg30 changed the title OpenRA.Utility: Update-Map (Failed to copy bytes expected x read y) -> Cannot access a disposed object. Support packing maps to .oramap using third-party software Feb 7, 2024
@anvilvapre
Copy link
Contributor

Perhaps clarify the exception message so that in future people understand the cause and can find the solution themselves. i.e. refer them to comp zip application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants