File tree Expand file tree Collapse file tree 8 files changed +46
-10
lines changed Expand file tree Collapse file tree 8 files changed +46
-10
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,38 @@ public enum RunningOs
25
25
: RunningOs . Unknown ;
26
26
27
27
public static readonly Architecture Architecture = RuntimeInformation . ProcessArchitecture ;
28
+
29
+ /// <summary>
30
+ /// 根据 MOJANG API 命名
31
+ /// </summary>
32
+ public static string Platform
33
+ {
34
+ get
35
+ {
36
+ return Os switch
37
+ {
38
+ RunningOs . Windows => Architecture switch
39
+ {
40
+ Architecture . X64 => "windows-x64" ,
41
+ Architecture . X86 => "windows-x86" ,
42
+ Architecture . Arm64 => "windows-arm64" ,
43
+ _ => "unknown"
44
+ } ,
45
+ RunningOs . Linux => Architecture switch
46
+ {
47
+ Architecture . X64 => "linux" ,
48
+ Architecture . X86 => "linux-i386" ,
49
+ _ => "unknown"
50
+ } ,
51
+ RunningOs . MacOs => Architecture switch
52
+ {
53
+ Architecture . X64 => "mac-os" ,
54
+ Architecture . Arm64 => "mac-os-arm64" ,
55
+ _ => "unknown"
56
+ } ,
57
+ RunningOs . Unknown => "unknown" ,
58
+ _ => "unknown"
59
+ } ;
60
+ }
61
+ }
28
62
}
Original file line number Diff line number Diff line change 1
- using Avalonia . Platform . Storage ;
2
- using CommunityToolkit . Mvvm . DependencyInjection ;
3
- using PCL . Neo . Services ;
4
- using System ;
5
1
using System . Diagnostics ;
6
- using System . IO ;
7
- using System . Net . Http ;
8
2
using System . Runtime . InteropServices ;
9
3
using System . Runtime . Versioning ;
10
- using System . Threading ;
11
- using System . Threading . Tasks ;
12
4
13
- namespace PCL . Neo . Helpers ;
5
+ namespace PCL . Neo . Core . Helpers ;
14
6
15
7
/// <summary>
16
8
/// 一些文件操作和下载请求之类的
Original file line number Diff line number Diff line change
1
+ using PCL . Neo . Core . Utils ;
1
2
using System . Diagnostics ;
2
3
using System . Text . RegularExpressions ;
3
4
Original file line number Diff line number Diff line change
1
+ using PCL . Neo . Core . Helpers ;
1
2
using System . Diagnostics ;
2
3
using System . Text . Json ;
3
4
using System . Text . Json . Nodes ;
@@ -105,7 +106,7 @@ public sealed record MojangJavaVersion(string Value)
105
106
}
106
107
107
108
string localFilePath = Path . Combine ( destinationFolder ,
108
- filePath . Replace ( "/" , Const . Sep . ToString ( ) ) ) ;
109
+ filePath . Replace ( "/" , Path . DirectorySeparatorChar . ToString ( ) ) ) ;
109
110
if ( isExecutable ) executableFiles . Add ( localFilePath ) ;
110
111
Directory . CreateDirectory ( Path . GetDirectoryName ( localFilePath ) ! ) ;
111
112
// 有的文件有LZMA压缩但是有的 tm 没有,尼玛搞了个解压缩发现文件少了几个
Original file line number Diff line number Diff line change
1
+ using PCL . Neo . Core . Utils ;
2
+
1
3
namespace PCL . Neo . Core . Models . Minecraft . Java ;
2
4
3
5
/// <summary>
Original file line number Diff line number Diff line change
1
+ using PCL . Neo . Core . Utils ;
1
2
using System . Diagnostics ;
2
3
using System . Text . RegularExpressions ;
3
4
Original file line number Diff line number Diff line change
1
+ using PCL . Neo . Core . Utils ;
1
2
using System . Collections . Immutable ;
2
3
3
4
namespace PCL . Neo . Core . Models . Minecraft . Java ;
Original file line number Diff line number Diff line change 6
6
<Nullable >enable</Nullable >
7
7
</PropertyGroup >
8
8
9
+ <ItemGroup >
10
+ <PackageReference Include =" SevenZip" Version =" 19.0.0" />
11
+ </ItemGroup >
12
+
9
13
</Project >
You can’t perform that action at this time.
0 commit comments