private void SyncRandomizedRhcToCache(string rhDir) { var cachePath = Path.Combine(rhDir, "cache"); var cacheFile = IBinarySerializableExtensions.Deserialize(cachePath, CacheFile.Deserialize); var sync = new RhcSynchronizer(cacheFile, rhcFile); sync.Sync(); cacheFile.SerializeToFile(cachePath); }
private void SyncSongAssetsToCache(string rhDir, RhSongAssets assets) { var cachePath = Path.Combine(rhDir, "cache"); var cacheFile = IBinarySerializableExtensions.Deserialize(cachePath, CacheFile.Deserialize); var songSynchronizer = new RhSongAssetsSynchronizer(cacheFile, assets); songSynchronizer.Sync(); cacheFile.SerializeToFile(cachePath); }
public void EditRhprojData() { var testFile = Path.Combine(backupDir, "f6e66110-bac2-4bf8-ae13-65b40ea2bb3a.rhproj"); var file = ReadRhprojFile(testFile); var rhcPath = Path.Combine(gameDir, "df76ece8-b8f9-1a41-9651-01bbcb3308f0.rhc"); var rhcFile = IBinarySerializableExtensions.Deserialize(rhcPath, RhcFile.Deserialize); file.rhcFile = rhcFile; var rhsPath = Path.Combine(gameDir, "e10133c1-a7eb-f749-9c03-95591ad0e5ae.rhs"); var rhsFile = IBinarySerializableExtensions.Deserialize(rhsPath, RhsFile.Deserialize); file.rhsFile = rhsFile; file.SerializeToFile(testFile); }
public void EditTimingData() { var rhsPath = Path.Combine(rhPath, "0174eed2-8658-4b48-87e4-7e5f0753b79d.rhs"); var rhsFile = IBinarySerializableExtensions.Deserialize(rhsPath, RhsFile.Deserialize); rhsFile.internalGuid = new RhGuid(); rhsFile.timingData.offsetMultiplier = 0; //rhsFile.timingData.entries[0].startBpm /= 2; //rhsFile.pngGuid = new RhGuid(new byte[] { 38, 202, 1, 86, 253, 228, 71, 86, 152, 232, 0, 213, 9, 179, 44, 201 }); rhsFile.SerializeToFile(rhsPath); var cachePath = Path.Combine(rhPath, "cache"); var rhsGuid = new RhGuid(new byte[] { 0x01, 0x74, 0xee, 0xd2, 0x86, 0x58, 0x4b, 0x48, 0x87, 0xe4, 0x7e, 0x5f, 0x07, 0x53, 0xb7, 0x9d }); var cacheFile = IBinarySerializableExtensions.Deserialize(cachePath, CacheFile.Deserialize); var rhsSynchronizer = new RhsSynchronizer(cacheFile, rhsFile); rhsSynchronizer.Sync(); cacheFile.SerializeToFile(cachePath); }
public void Convert() { var assets = converter.Convert(); SyncSongAssetsToCache(rhDir, assets); var rhprojConverter = new RhprojConverter(); var rhprojFiles = rhprojConverter.Convert(assets.rhsFile, assets.rhcFiles); var tabsPath = Path.Combine(rhDir, "Backup", "tabs"); var tabsFile = IBinarySerializableExtensions.Deserialize(tabsPath, TabsFile.Deserialize); foreach (var rhprojFile in rhprojFiles) { var rhcGuid = rhprojFile.rhcFile.rhcGuid; var filename = rhcGuid.ToString() + ".rhproj"; var destPath = Path.Combine(rhDir, "Backup", filename); rhprojFile.SerializeToFile(destPath); tabsFile.rhprojFileGuids.Insert(0, rhcGuid); } tabsFile.SerializeToFile(tabsPath); }
private RhcFile ReadRhcFile(string path) { return(IBinarySerializableExtensions.Deserialize(path, RhcFile.Deserialize)); }
public RhcRandomizer(RandomizerSettings settings) { this.settings = settings; rhcFile = IBinarySerializableExtensions.Deserialize(settings.rhPath, RhcFile.Deserialize); }
private static CacheFile ReadCacheFile(string path) { return(IBinarySerializableExtensions.Deserialize(path, CacheFile.Deserialize)); }