スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)
- 自インスタンスメンバーアクセスへの this. 付与(28ファイル) - .editorconfig に準拠したインデント・波括弧・空白スタイルの適用 - UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
This commit is contained in:
1 parent
2fa40c950f
commit
ae86b53147
28 files changed
+1362
-1380
No files matched your search
@@ -170,7 +170,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
long packageJsonOffset = -1;
|
||||
long packageJsonSize = -1;
|
||||
|
||||
TraverseFiles(filesRoot, "", dataOffset, fs.Length, result, includeFileList,
|
||||
this.TraverseFiles(filesRoot, "", dataOffset, fs.Length, result, includeFileList,
|
||||
ref systemJsonRelative, ref systemJsonOffset, ref systemJsonSize,
|
||||
ref packageJsonRelative, ref packageJsonOffset, ref packageJsonSize);
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
|
||||
if (val.TryGetProperty("files", out var subFiles))
|
||||
{
|
||||
TraverseFiles(subFiles, path, dataOffset, fileLength, result, includeFileList,
|
||||
this.TraverseFiles(subFiles, path, dataOffset, fileLength, result, includeFileList,
|
||||
ref systemJsonRelative, ref systemJsonOffset, ref systemJsonSize,
|
||||
ref packageJsonRelative, ref packageJsonOffset, ref packageJsonSize);
|
||||
}
|
||||
@@ -395,7 +395,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
// UNC パス (例: \\server\share\...) の場合
|
||||
if (normalized.StartsWith(@"\\", StringComparison.Ordinal))
|
||||
{
|
||||
return @"\\?\UNC\" + normalized.Substring(2);
|
||||
return @"\\?\UNC\" + normalized[2..];
|
||||
}
|
||||
|
||||
// 相対パスの場合は安全に絶対パスを取得してからプレフィックスを付与
|
||||
@@ -408,7 +408,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
}
|
||||
if (full.StartsWith(@"\\", StringComparison.Ordinal))
|
||||
{
|
||||
return @"\\?\UNC\" + full.Substring(2);
|
||||
return @"\\?\UNC\" + full[2..];
|
||||
}
|
||||
return @"\\?\" + full;
|
||||
}
|
||||
@@ -447,7 +447,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
}
|
||||
|
||||
// ヘッダ詳細解析
|
||||
var inspect = InspectAsar(targetAsar, includeFileList: true);
|
||||
var inspect = this.InspectAsar(targetAsar, includeFileList: true);
|
||||
if (!inspect.IsValid || inspect.FileEntries.Count == 0)
|
||||
{
|
||||
return (false, "asar ファイルのヘッダ解析に失敗したか、ファイルが含まれていません。");
|
||||
@@ -503,20 +503,18 @@ namespace GameLauncher.Engines.Nwjs
|
||||
fs.Seek(dataOffset + entry.Offset, SeekOrigin.Begin);
|
||||
long remaining = entry.Size;
|
||||
|
||||
using (var outFs = new FileStream(destFilePath, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||
using var outFs = new FileStream(destFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||
while (remaining > 0)
|
||||
{
|
||||
while (remaining > 0)
|
||||
{
|
||||
int toRead = (int)Math.Min(remaining, buffer.Length);
|
||||
int read = fs.Read(buffer, 0, toRead);
|
||||
if (read == 0) break;
|
||||
int toRead = (int)Math.Min(remaining, buffer.Length);
|
||||
int read = fs.Read(buffer, 0, toRead);
|
||||
if (read == 0) break;
|
||||
|
||||
outFs.Write(buffer, 0, read);
|
||||
remaining -= read;
|
||||
extractedBytes += read;
|
||||
outFs.Write(buffer, 0, read);
|
||||
remaining -= read;
|
||||
extractedBytes += read;
|
||||
|
||||
progress?.Report((extractedBytes, totalBytes, i + 1, totalFiles, Path.GetFileName(entry.RelativePath)));
|
||||
}
|
||||
progress?.Report((extractedBytes, totalBytes, i + 1, totalFiles, Path.GetFileName(entry.RelativePath)));
|
||||
}
|
||||
}
|
||||
catch (Exception fileEx)
|
||||
@@ -573,7 +571,7 @@ namespace GameLauncher.Engines.Nwjs
|
||||
: asarPath + AsarBackupSuffix;
|
||||
|
||||
var originalAsar = asarPath.EndsWith(AsarBackupSuffix, StringComparison.OrdinalIgnoreCase)
|
||||
? asarPath.Substring(0, asarPath.Length - AsarBackupSuffix.Length)
|
||||
? asarPath[..^AsarBackupSuffix.Length]
|
||||
: asarPath;
|
||||
|
||||
string extExtractedDir = ToExtendedPath(extractedDir);
|
||||
|
||||
Reference in new issue
Block a user