Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Intersect.Editor/Forms/FrmUploadToServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ private async void btnUpload_Click(object sender, EventArgs e)
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/'))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.OfType<string>();
}
catch
Expand Down Expand Up @@ -598,7 +598,7 @@ private async void btnUpload_Click(object sender, EventArgs e)
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/'))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.OfType<string>();
}
catch
Expand Down
66 changes: 33 additions & 33 deletions Intersect.Editor/Forms/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2184,37 +2184,37 @@ private void createUpdate(string sourceDirectory, string targetDirectory, Update
var pathToPacksDirectory = Path.Combine(pathToResourcesDirectory, "packs");
if (packagingEnabled && Directory.Exists(pathToPacksDirectory))
{
// When packaging is enabled: include packs, exclude source files
// When packaging is enabled: include packs, exclude source files for both client and editor
var packFileNames = Directory.GetFiles(pathToPacksDirectory, "*.meta");

// Exclude source texture files that were packed
clientExcludeFiles.AddRange(
packFileNames.SelectMany(
pack =>
var packedTextureFiles = packFileNames.SelectMany(
pack =>
{
try
{
try
{
var tokenPack = JToken.Parse(GzipCompression.ReadDecompressedString(pack));
if (tokenPack is not JObject objectPack || !objectPack.TryGetValue("frames", out var tokenFrames))
{
return Enumerable.Empty<string>();
}

return tokenFrames.Children()
.OfType<JObject>()
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/'))
.OfType<string>();
}
catch
var tokenPack = JToken.Parse(GzipCompression.ReadDecompressedString(pack));
if (tokenPack is not JObject objectPack || !objectPack.TryGetValue("frames", out var tokenFrames))
{
return Enumerable.Empty<string>();
}

return tokenFrames.Children()
.OfType<JObject>()
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.OfType<string>();
}
)
);
catch
{
return Enumerable.Empty<string>();
}
}
).ToList();
clientExcludeFiles.AddRange(packedTextureFiles);
editorExcludeFiles.AddRange(packedTextureFiles);

// Exclude source sound files that were packed
var soundIndex = Path.Combine(pathToPacksDirectory, "sound.index");
Expand All @@ -2223,11 +2223,11 @@ private void createUpdate(string sourceDirectory, string targetDirectory, Update
try
{
using AssetPacker soundPacker = new(soundIndex, pathToPacksDirectory);
clientExcludeFiles.AddRange(
soundPacker.FileList.Select(
sound => Path.Combine(resourcesDirectoryName, "sounds", sound.ToLower(CultureInfo.CurrentCulture)).Replace('\\', '/')
)
);
var packedSoundFiles = soundPacker.FileList.Select(
sound => Path.Combine(resourcesDirectoryName, "sounds", sound.ToLower(CultureInfo.CurrentCulture)).Replace('\\', '/')
).ToList();
clientExcludeFiles.AddRange(packedSoundFiles);
editorExcludeFiles.AddRange(packedSoundFiles);
}
catch
{
Expand All @@ -2242,11 +2242,11 @@ private void createUpdate(string sourceDirectory, string targetDirectory, Update
try
{
using AssetPacker musicPacker = new(musicIndex, pathToPacksDirectory);
clientExcludeFiles.AddRange(
musicPacker.FileList.Select(
music => Path.Combine(resourcesDirectoryName, "music", music.ToLower(CultureInfo.CurrentCulture)).Replace('\\', '/')
)
);
var packedMusicFiles = musicPacker.FileList.Select(
music => Path.Combine(resourcesDirectoryName, "music", music.ToLower(CultureInfo.CurrentCulture)).Replace('\\', '/')
).ToList();
clientExcludeFiles.AddRange(packedMusicFiles);
editorExcludeFiles.AddRange(packedMusicFiles);
}
catch
{
Expand Down