-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sophon and HYP install mechanism
- Loading branch information
Showing
8 changed files
with
290 additions
and
164 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
CollapseLauncher/Classes/Helper/JsonConverter/RegionResourcePluginValidateConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace CollapseLauncher.Helper.JsonConverter | ||
{ | ||
public class RegionResourcePluginValidateConverter : JsonConverter<List<RegionResourcePluginValidate>> | ||
{ | ||
public override bool CanConvert(Type type) | ||
{ | ||
return true; | ||
} | ||
|
||
public override List<RegionResourcePluginValidate> Read( | ||
ref Utf8JsonReader reader, | ||
Type typeToConvert, | ||
JsonSerializerOptions options) | ||
{ | ||
string valueString = EmptiedBackslash(reader.ValueSpan); | ||
List<RegionResourcePluginValidate> returnList = valueString.Deserialize<List<RegionResourcePluginValidate>>(InternalAppJSONContext.Default); | ||
|
||
return returnList; | ||
} | ||
|
||
private unsafe string EmptiedBackslash(ReadOnlySpan<byte> span) | ||
{ | ||
Span<byte> buffer = new byte[span.Length]; | ||
int indexIn = 0; | ||
int indexOut = 0; | ||
while (indexIn < span.Length) | ||
{ | ||
if (span[indexIn] == '\\') | ||
{ | ||
++indexIn; | ||
continue; | ||
} | ||
|
||
buffer[indexOut] = span[indexIn]; | ||
++indexIn; | ||
++indexOut; | ||
} | ||
|
||
fixed (byte* bufferPtr = buffer) | ||
{ | ||
return Encoding.UTF8.GetString(bufferPtr, indexOut); | ||
} | ||
} | ||
|
||
public override void Write( | ||
Utf8JsonWriter writer, | ||
List<RegionResourcePluginValidate> baseType, | ||
JsonSerializerOptions options) | ||
{ | ||
|
||
throw new JsonException($"Serializing is not supported!"); | ||
} | ||
} | ||
} |
255 changes: 157 additions & 98 deletions
255
CollapseLauncher/Classes/Helper/LauncherApiLoader/HoYoPlay/HoYoPlayLauncherApiLoader.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Hi3Helper.Sophon
updated
5 files
+3 −3 | Hi3Helper.Sophon.Universal.csproj | |
+3 −3 | Hi3Helper.Sophon.csproj | |
+1 −1 | Pack.cmd | |
+25 −28 | SophonAsset.cs | |
+2 −2 | SophonAssetStream.cs |