Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit 17227e6

Browse files
dev(base): 重构网络请求、进程启动、文件压缩、PE 头读取器、通过文件头验证压缩文件格式 (#5)
* refactor(network): 重构网络请求 * chore: 移除无用文件 * feat(base):通过文件头确定压缩文件格式 & PE 头读取器 * feat: (只有外壳的)启动游戏 --------- Co-authored-by: 薄奚梦灵 <boximengling@outlook.com>
1 parent fa394df commit 17227e6

File tree

15 files changed

+1125
-1149
lines changed

15 files changed

+1125
-1149
lines changed

.idea/.idea.SuikaiLauncher.Core/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.SuikaiLauncher.Core/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.SuikaiLauncher.Core/.idea/projectSettingsUpdater.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.SuikaiLauncher.Core/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.SuikaiLauncher.Core/.idea/workspace.xml

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SuikaiLauncher.Core.Account/Modules/Microsoft.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using SuikaiLauncher.Core.Account.JsonModel;
1+
using SuikaiLauncher.Core.Account.JsonModel;
22
using SuikaiLauncher.Core.Base;
33
using SuikaiLauncher.Core.Override;
44
using System.Runtime.CompilerServices;
55

66

7-
namespace SuikaiLauncher.Core.Account.Modules
7+
namespace SuikaiLauncher.Core.Account
88
{
99
public class Microsoft
1010
{
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
using System.Text;
2+
using SuikaiLauncher.Core.Base;
3+
4+
namespace SuikaiLauncher.Core.Account;
5+
/// <summary>
6+
/// 档案类
7+
/// </summary>
8+
public class Profile
9+
{
10+
private static StringBuilder StrBuilder = new("*",30);
11+
/// <summary>
12+
/// 用户名
13+
/// </summary>
14+
public required string Name { get; set; }
15+
/// <summary>
16+
/// UUID
17+
/// </summary>
18+
public required string uuid { get; set; }
19+
/// <summary>
20+
/// 访问令牌
21+
/// </summary>
22+
public required string accessToken { get; set; }
23+
/// <summary>
24+
/// 刷新令牌(可能为 null)
25+
/// </summary>
26+
public string? refreshToken { get; set; }
27+
/// <summary>
28+
/// 用户皮肤的下载地址,没有设置则为 null
29+
/// </summary>
30+
public string? Skin { get; set; }
31+
/// <summary>
32+
/// 披风下载地址,没有则为 null
33+
/// </summary>
34+
public string? Cape { get; set; }
35+
/// <summary>
36+
/// 账户类型
37+
/// </summary>
38+
public McLoginType LoginType {get; set;}
39+
/// <summary>
40+
/// 档案过期时间(Access Token)
41+
/// </summary>
42+
public long ExpiresIn { get; set; }
43+
/// <summary>
44+
/// 完全过期时间(Refresh Token)
45+
/// </summary>
46+
public long ExpiredAt { get; set; }
47+
/// <summary>
48+
/// 档案创建时间
49+
/// </summary>
50+
public long CreateAt { get; set; }
51+
52+
public static string RemoveSecret(string SecretText)
53+
{
54+
return SecretText.Substring(0, 5) + StrBuilder + SecretText.Substring(SecretText.Length - 5,SecretText.Length -1);
55+
}
56+
}
57+
/// <summary>
58+
/// 档案管理器
59+
/// </summary>
60+
public static class ProfileManager
61+
{
62+
public static Profile CurrentProfile
63+
{
64+
private set
65+
{
66+
67+
}
68+
get
69+
{
70+
71+
}
72+
}
73+
private static List<Profile>? profiles;
74+
/// <summary>
75+
/// 初始化档案数据库
76+
/// </summary>
77+
private static void InitializeProfilesDatabase()
78+
{
79+
80+
}
81+
/// <summary>
82+
/// 保存档案
83+
/// </summary>
84+
public static void SaveProfile()
85+
{
86+
87+
}
88+
/// <summary>
89+
/// 清空档案数据库缓存(被移除的档案会在下次加载时恢复,除非数据库没有整这个档案)
90+
/// </summary>
91+
public static void Clear()
92+
{
93+
94+
}
95+
/// <summary>
96+
/// 获取某一个档案
97+
/// </summary>
98+
/// <param name="ProfileId">档案索引</param>
99+
/// <returns>代表这个档案的 Profile 类</returns>
100+
public static Profile GetProfile(int ProfileId)
101+
{
102+
103+
}
104+
/// <summary>
105+
/// 删除某个档案(这会导致档案永久丢失)
106+
/// </summary>
107+
/// <param name="ProfileId">要删除的档案</param>
108+
public static void DeleteProfile(int ProfileId)
109+
{
110+
111+
}
112+
/// <summary>
113+
/// 删除整个档案数据库(这会导致存储在数据库的全部档案丢失)
114+
/// </summary>
115+
public static void DeleteProfiles()
116+
{
117+
118+
}
119+
/// <summary>
120+
/// 刷新档案,如果档案过期,则会尝试重新登录
121+
/// </summary>
122+
public static void RefreshProfile()
123+
{
124+
125+
}
126+
}
127+
128+
/// <summary>
129+
/// 账户类型
130+
/// </summary>
131+
public enum McLoginType
132+
{
133+
/// <summary>
134+
/// 离线
135+
/// </summary>
136+
Offline = 0,
137+
/// <summary>
138+
/// 微软(正版)
139+
/// </summary>
140+
Microsoft = 1,
141+
/// <summary>
142+
/// Yggdrasil 第三方登录
143+
/// </summary>
144+
Auth = 2,
145+
/// <summary>
146+
/// 统一通行证
147+
/// </summary>
148+
Nide = 3
149+
}

SuikaiLauncher.Core.Base/Modules/FileIO.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.IO.Compression;
88
using System.Linq.Expressions;
99
using System.Net;
10+
using System.Formats.Tar;
1011
using System.Security.Cryptography;
1112
using System.Text;
1213

@@ -217,6 +218,7 @@ public class ArchiveFile : IDisposable
217218
{
218219
private bool _dispose;
219220
private string FilePath;
221+
220222
private dynamic? Handler;
221223
private GZipStream? DataStream;
222224
public bool disposed
@@ -316,6 +318,5 @@ public async Task WriteFile(string ArchiveEntry,Stream FileReadStream)
316318
}
317319
}
318320
}
319-
320321
}
321322
}

0 commit comments

Comments
 (0)