9 Commits
2.4.0 ... 2.5.0

Author SHA1 Message Date
HolographicHat
0094b9b959 Update README.md 2023-01-19 15:08:33 +08:00
HolographicHat
24b68fbed1 Merge pull request #46 from Finchaos/patch-1
Create Tutorial.md
2023-01-19 15:04:04 +08:00
HolographicHat
397923d4ad Update and rename tutorial.md to Tutorial.md 2023-01-19 14:54:08 +08:00
Finchaos
0a3482e7b2 Create tutorial.md 2023-01-19 14:21:34 +08:00
HolographicHat
7ae18cfbf0 v2.5 2023-01-18 11:52:00 +08:00
HolographicHat
24cd49fa03 3.4 AchievementAllDataNotify 2023-01-18 02:54:42 +08:00
HolographicHat
f0dbb9162b Use 77.cocogoat.cn 2023-01-18 02:47:20 +08:00
HolographicHat
68ff9c5a25 3.4 native lib 2023-01-18 02:46:54 +08:00
HolographicHat
31b77a9fb3 fix empty result and bump version to 2.4.1 2022-12-07 23:36:18 +08:00
11 changed files with 271 additions and 119 deletions

View File

@@ -13,11 +13,7 @@
- 没有窗口大小、游戏语言等要求
## 使用说明
第一次打开需要先设置原神主程序(YuanShen.exe/GenshinImpact.exe)所在路径
![alt](https://upload-bbs.mihoyo.com/upload/2022/04/06/165631158/e540a5a6d50cd5fdee19665435548e00_514247033566841954.jpg)
设置完毕后,等待原神启动
当你看到门时,点击进入游戏,游戏将自动退出
游戏退出后,在程序内输入数字以选择导出到哪个网站/应用
→ [Tutorial.md](Tutorial.md)
## 下载地址
[releases/latest](https://github.com/HolographicHat/YaeAchievement/releases/latest)

81
Tutorial.md Normal file
View File

@@ -0,0 +1,81 @@
## 使用说明
1.选择正确的下载文件以2.4.1版本为例):
点击该网址https://github.com/HolographicHat/YaeAchievement/releases
点击图中红框圈中的名称为“YaeAchievement.exe”的文件浏览器会自动弹出下载。建议将该文件保存在桌面或者其它易于寻找的文件夹内。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/1.png)
2.安装启动软件所需文件(若已安装该运行时可忽略此步骤)
点击该网址https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-6.0.9-windows-x64-installer。
进入网页后浏览器会自动弹出下载,同样地,将文件保存在桌面或者其它易于寻找的文件夹内。
下载完成后打开名称形如dotnet-runtime-x.x.x-win-x64.exe的文件会弹出安装窗口如下图所示。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/2.png)
直接点击安装即可。
3.打开主程序所需的操作以及成就导出的选择
双击在第一步下载的名称为“YaeAchievement.exe”的文件成功打开后会提示原神正在启动如下图所示。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/3.png)
原神启动完成后,点击进入游戏即可。
点击进入游戏后原神闪退,工具会提示您选择导出至何种工具,如下图所示。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/4.png)
此时可根据自己的需要进行选择,一般推荐导出至[0]椰羊以及[4]表格文件(.csv
选择完毕后各工具导出页面如下:
#### 椰羊:
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/5.png)
#### Snap.Hutao
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main//images/6.png)
#### Seelie.me
此时YaeAchievement会提示成就数据已导出。请在保存YaeAchievement的文件夹内找到名称形如export-20xxxxxxxxxxxx-seelie.json的文件。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/7.png)
然后点击该网址https://seelie.me/settings, 进入网页后选择导入,如下图所示。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/8.png)
点击导入后选中名称形如export-20xxxxxxxxxxxx-seelie.json的文件如下图所示。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/9.png)
当弹出如下图所示的提示时表示导入成功。
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/10.png)
此时可选择左栏成就,查看导入的成就数据。
#### 寻空:
![image](https://github.com/Finchaos/yae-markdown-230119/blob/main/images/11.png)
### 各种工具的介绍烦请移步至各工具的官方页面进行查看(下方序号对应导出序号)
0. [椰羊](https://cocogoat.work/achievement)
1. [Snap·HuTao](https://github.com/DGP-Studio/Snap.HuTao)
2. [Paimon.moe](https://paimon.moe/achievement/)
3. [Seelie.me](https://seelie.me/achievements)
4. [寻空](https://github.com/xunkong/xunkong)

View File

@@ -8,7 +8,7 @@ using std::to_string;
HWND unityWnd = 0;
HANDLE hPipe = 0;
std::set<UINT16> PacketWhitelist = { 179, 130, 156, 2692, 100, 43, 119 }; // ping, token, loginreq
std::set<UINT16> PacketWhitelist = { 105, 155, 187, 198, 2688, 20, 74 }; // Allow Protocol: GetPlayerToken, PlayerLogin, AchievementAllDataNotify, Ping
bool OnPacket(KcpPacket* pkt) {
if (pkt->data == nullptr) return true;
@@ -29,7 +29,7 @@ bool OnPacket(KcpPacket* pkt) {
return false;
}
printf("Passed cmdid: %d\n", ReadMapped<UINT16>(data->vector, 2));
if (ReadMapped<UINT16>(data->vector, 2) == 2692) {
if (ReadMapped<UINT16>(data->vector, 2) == 2688) {
auto headLength = ReadMapped<UINT16>(data->vector, 4);
auto dataLength = ReadMapped<UINT32>(data->vector, 6);
auto iStr = Genshin::ToBase64String(data, 10 + headLength, dataLength, nullptr);
@@ -70,8 +70,8 @@ namespace Hook {
}
void Run(HMODULE* phModule) {
AllocConsole();
freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
//AllocConsole();
//freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
while (
GetModuleHandle("UserAssembly.dll") == nullptr ||
(unityWnd = FindMainWindowByPID(GetCurrentProcessId())) == 0

View File

@@ -1,3 +1,3 @@
DO_API(0x02974550, 0x02970540, uint32_t, il2cpp_gchandle_new, (Il2CppObject* obj, bool pinned));
DO_API(0x02974260, 0x02970250, Il2CppObject*, il2cpp_gchandle_get_target, (uint32_t gchandle));
DO_API(0x028BF7E0, 0x028BBE80, Il2CppString*, il2cpp_string_new, (const char* str));
DO_API(0x02D2B620, 0x02D290A0, uint32_t, il2cpp_gchandle_new, (Il2CppObject* obj, bool pinned)); // search GCHandle.cpp in strings 2974550
DO_API(0x02D2B330, 0x02D28DB0, Il2CppObject*, il2cpp_gchandle_get_target, (uint32_t gchandle));
DO_API(0x02D2E840, 0x02D2C0A0, Il2CppString*, il2cpp_string_new, (const char* str));

View File

@@ -4,31 +4,28 @@ using namespace Genshin;
// N: System.Convert$ToBase64String
// L: mscorlib
// S: Ref/E8 ?? ?? ?? ?? 48 8B D8 EB 23 E8
DO_APP_FUNC(0x086B86C0, 0x086B6440, Il2CppString*, ToBase64String, (ByteArray* value, int offset, int length, void* method));
DO_APP_FUNC(0x08F056A0, 0x08F1A0F0, Il2CppString*, ToBase64String, (ByteArray* value, int offset, int length, void* method));
// N: MoleMole.MonoLoginMainPage.version$set
// L: Assembly-CSharp
// S: 84 C0 74 35 B9 52 FA 00 00 E8 ?? ?? ?? ?? 84 C0 74 27 B9 52 FA 00 00 E8 ?? ?? ?? ?? 48 85 C0 74 52 4C 8B C7 48 8B D3 48 8B C8 48 8B 5C 24 30 48 83 C4 20 5F E9
DO_APP_FUNC(0X04186660, 0x04180EC0, void, SetVersion, (void* obj, Il2CppString* value, void* method));
DO_APP_FUNC(0X05265A70, 0x052704C0, void, SetVersion, (void* obj, Il2CppString* value, void* method));
// N: UnityEngine.Application$RecordUserData
// L: UnityEngine.CoreModule
DO_APP_FUNC(0x090BEBC0, 0x090BD710, ByteArray*, RecordUserData, (int32_t nType, void* method));
DO_APP_FUNC(0x09932F30, 0x09947590, ByteArray*, RecordUserData, (int32_t nType, void* method));
// N: MoleMole.Packet$XorEncrypt [Obfuscated]
// L: Assembly-CSharp
DO_APP_FUNC(0x0423B270, 0x04235CE0, void, XorEncrypt, (ByteArray** data, int length, void* method));
DO_APP_FUNC(0x054B3120, 0x054BD670, void, XorEncrypt, (ByteArray** data, int length, void* method)); // OHOBJBNAMJM
// N: Kcp.KcpNative$kcp_client_send_packet [Obfuscated]
// L: Assembly-CSharp
DO_APP_FUNC(0x042281D0, 0x04222A60, int, KcpSend, (void* client, KcpPacket* pkt, void* method));
DO_APP_FUNC(0x050BB390, 0x050C5AC0, int, KcpSend, (void* client, KcpPacket* pkt, void* method)); // CKKPANHPFAP
// N: MoleMole.KcpClient$TryDequeueEvent [Obfuscated]
// L: Assembly-CSharp
// S: Ref/public static extern Int32 [A-Z]{11}\(IntPtr [A-Z]{11}, [A-Z]{11}& [A-Z]{11}\)
DO_APP_FUNC(0x02BAFFF0, 0x02BAC3D0, bool, KcpRecv, (void* client, ClientKcpEvent* evt, void* method));
DO_APP_FUNC(0x04496B50, 0x0449DBF0, bool, KcpRecv, (void* client, ClientKcpEvent* evt, void* method)); // GFFOOBHMCOJ
DO_APP_FUNC(0x08A43710, 0x08A41130, LPVOID, GetDefaultEncoding, (void* method));
DO_APP_FUNC(0x09254010, 0x09269550, LPVOID, GetDefaultEncoding, (void* method));
DO_APP_FUNC(0x08A42FB0, 0x08A409B0, Il2CppString*, GetString, (LPVOID encoding, LPVOID bytes, void* method));
DO_APP_FUNC(0x092538C0, 0x09268DE0, Il2CppString*, GetString, (LPVOID encoding, LPVOID bytes, void* method));

View File

@@ -1,3 +1,3 @@
using namespace Genshin;
DO_UNI_FUNC(0x00100300, 0x00100300, ByteArray*, UnityEngine_RecordUserData, (int32_t nType));
DO_UNI_FUNC(0x00100550, 0x00100550, ByteArray*, UnityEngine_RecordUserData, (int32_t nType));

View File

@@ -41,7 +41,7 @@ public static class Export {
var result = JsonSerializer.Serialize(ExportToUIAFApp(data));
using var request = new HttpRequestMessage {
Method = HttpMethod.Post,
RequestUri = new Uri($"https://77.cocogoat.work/v1/memo?source={App.AllAchievement}"),
RequestUri = new Uri($"https://77.cocogoat.cn/v1/memo?source={App.AllAchievement}"),
Content = new StringContent(result, Encoding.UTF8, "application/json")
};
using var response = Utils.CHttpClient.Send(request);

View File

@@ -20,8 +20,8 @@ public static class GlobalVars {
public static readonly string CachePath = Path.Combine(DataPath, "cache");
public static readonly string LibFilePath = Path.Combine(DataPath, "YaeAchievement.dll");
public const uint AppVersionCode = 33;
public const string AppVersionName = "2.4";
public const uint AppVersionCode = 35;
public const string AppVersionName = "2.5";
public const string PipeName = "YaeAchievementPipe";
public const string BucketHost = "https://cn-cd-1259389942.file.myqcloud.com";

View File

@@ -24,16 +24,16 @@ public static partial class AchievementAllDataNotifyReflection {
string.Concat(
"Ch5BY2hpZXZlbWVudEFsbERhdGFOb3RpZnkucHJvdG8iowIKGEFjaGlldmVt",
"ZW50QWxsRGF0YU5vdGlmeRIzCgRsaXN0GAQgAygLMiUuQWNoaWV2ZW1lbnRB",
"bGxEYXRhTm90aWZ5LkFjaGlldmVtZW50GtEBCgtBY2hpZXZlbWVudBIKCgJp",
"ZBgOIAEoDRI8CgZzdGF0dXMYDSABKA4yLC5BY2hpZXZlbWVudEFsbERhdGFO",
"b3RpZnkuQWNoaWV2ZW1lbnQuU3RhdHVzEg8KB2N1cnJlbnQYDCABKA0SDQoF",
"dG90YWwYCCABKA0SEQoJdGltZXN0YW1wGAsgASgNIkUKBlN0YXR1cxILCgdJ",
"bGxEYXRhTm90aWZ5LkFjaGlldmVtZW50GtEBCgtBY2hpZXZlbWVudBIRCgl0",
"aW1lc3RhbXAYBiABKA0SDwoHY3VycmVudBgKIAEoDRINCgV0b3RhbBgOIAEo",
"DRIKCgJpZBgNIAEoDRI8CgZzdGF0dXMYBSABKA4yLC5BY2hpZXZlbWVudEFs",
"bERhdGFOb3RpZnkuQWNoaWV2ZW1lbnQuU3RhdHVzIkUKBlN0YXR1cxILCgdJ",
"TlZBTElEEAASDgoKVU5GSU5JU0hFRBABEgwKCEZJTklTSEVEEAISEAoMUkVX",
"QVJEX1RBS0VOEANiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::AchievementAllDataNotify), global::AchievementAllDataNotify.Parser, new[]{ "List" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AchievementAllDataNotify.Types.Achievement), global::AchievementAllDataNotify.Types.Achievement.Parser, new[]{ "Id", "Status", "Current", "Total", "Timestamp" }, null, new[]{ typeof(global::AchievementAllDataNotify.Types.Achievement.Types.Status) }, null, null)})
new pbr::GeneratedClrTypeInfo(typeof(global::AchievementAllDataNotify), global::AchievementAllDataNotify.Parser, new[]{ "List" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::AchievementAllDataNotify.Types.Achievement), global::AchievementAllDataNotify.Types.Achievement.Parser, new[]{ "Timestamp", "Current", "Total", "Id", "Status" }, null, new[]{ typeof(global::AchievementAllDataNotify.Types.Achievement.Types.Status) }, null, null)})
}));
}
#endregion
@@ -255,11 +255,11 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Achievement(Achievement other) : this() {
id_ = other.id_;
status_ = other.status_;
timestamp_ = other.timestamp_;
current_ = other.current_;
total_ = other.total_;
timestamp_ = other.timestamp_;
id_ = other.id_;
status_ = other.status_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@@ -269,32 +269,20 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
return new Achievement(this);
}
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 14;
private uint id_;
/// <summary>Field number for the "timestamp" field.</summary>
public const int TimestampFieldNumber = 6;
private uint timestamp_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Id {
get { return id_; }
public uint Timestamp {
get { return timestamp_; }
set {
id_ = value;
}
}
/// <summary>Field number for the "status" field.</summary>
public const int StatusFieldNumber = 13;
private global::AchievementAllDataNotify.Types.Achievement.Types.Status status_ = global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::AchievementAllDataNotify.Types.Achievement.Types.Status Status {
get { return status_; }
set {
status_ = value;
timestamp_ = value;
}
}
/// <summary>Field number for the "current" field.</summary>
public const int CurrentFieldNumber = 12;
public const int CurrentFieldNumber = 10;
private uint current_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -306,7 +294,7 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
}
/// <summary>Field number for the "total" field.</summary>
public const int TotalFieldNumber = 8;
public const int TotalFieldNumber = 14;
private uint total_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -317,15 +305,27 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
}
}
/// <summary>Field number for the "timestamp" field.</summary>
public const int TimestampFieldNumber = 11;
private uint timestamp_;
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 13;
private uint id_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public uint Timestamp {
get { return timestamp_; }
public uint Id {
get { return id_; }
set {
timestamp_ = value;
id_ = value;
}
}
/// <summary>Field number for the "status" field.</summary>
public const int StatusFieldNumber = 5;
private global::AchievementAllDataNotify.Types.Achievement.Types.Status status_ = global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::AchievementAllDataNotify.Types.Achievement.Types.Status Status {
get { return status_; }
set {
status_ = value;
}
}
@@ -344,11 +344,11 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
if (ReferenceEquals(other, this)) {
return true;
}
if (Id != other.Id) return false;
if (Status != other.Status) return false;
if (Timestamp != other.Timestamp) return false;
if (Current != other.Current) return false;
if (Total != other.Total) return false;
if (Timestamp != other.Timestamp) return false;
if (Id != other.Id) return false;
if (Status != other.Status) return false;
return Equals(_unknownFields, other._unknownFields);
}
@@ -356,11 +356,11 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Id != 0) hash ^= Id.GetHashCode();
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) hash ^= Status.GetHashCode();
if (Timestamp != 0) hash ^= Timestamp.GetHashCode();
if (Current != 0) hash ^= Current.GetHashCode();
if (Total != 0) hash ^= Total.GetHashCode();
if (Timestamp != 0) hash ^= Timestamp.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode();
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) hash ^= Status.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
@@ -379,26 +379,26 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Total != 0) {
output.WriteRawTag(64);
output.WriteUInt32(Total);
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
output.WriteRawTag(40);
output.WriteEnum((int) Status);
}
if (Timestamp != 0) {
output.WriteRawTag(88);
output.WriteRawTag(48);
output.WriteUInt32(Timestamp);
}
if (Current != 0) {
output.WriteRawTag(96);
output.WriteRawTag(80);
output.WriteUInt32(Current);
}
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
output.WriteRawTag(104);
output.WriteEnum((int) Status);
}
if (Id != 0) {
output.WriteRawTag(112);
output.WriteRawTag(104);
output.WriteUInt32(Id);
}
if (Total != 0) {
output.WriteRawTag(112);
output.WriteUInt32(Total);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@@ -409,26 +409,26 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Total != 0) {
output.WriteRawTag(64);
output.WriteUInt32(Total);
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
output.WriteRawTag(40);
output.WriteEnum((int) Status);
}
if (Timestamp != 0) {
output.WriteRawTag(88);
output.WriteRawTag(48);
output.WriteUInt32(Timestamp);
}
if (Current != 0) {
output.WriteRawTag(96);
output.WriteRawTag(80);
output.WriteUInt32(Current);
}
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
output.WriteRawTag(104);
output.WriteEnum((int) Status);
}
if (Id != 0) {
output.WriteRawTag(112);
output.WriteRawTag(104);
output.WriteUInt32(Id);
}
if (Total != 0) {
output.WriteRawTag(112);
output.WriteUInt32(Total);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
@@ -439,11 +439,8 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Id != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Id);
}
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);
if (Timestamp != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Timestamp);
}
if (Current != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Current);
@@ -451,8 +448,11 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
if (Total != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Total);
}
if (Timestamp != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Timestamp);
if (Id != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Id);
}
if (Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
@@ -466,11 +466,8 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
if (other == null) {
return;
}
if (other.Id != 0) {
Id = other.Id;
}
if (other.Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
Status = other.Status;
if (other.Timestamp != 0) {
Timestamp = other.Timestamp;
}
if (other.Current != 0) {
Current = other.Current;
@@ -478,8 +475,11 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
if (other.Total != 0) {
Total = other.Total;
}
if (other.Timestamp != 0) {
Timestamp = other.Timestamp;
if (other.Id != 0) {
Id = other.Id;
}
if (other.Status != global::AchievementAllDataNotify.Types.Achievement.Types.Status.Invalid) {
Status = other.Status;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
@@ -496,24 +496,24 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 64: {
Total = input.ReadUInt32();
case 40: {
Status = (global::AchievementAllDataNotify.Types.Achievement.Types.Status) input.ReadEnum();
break;
}
case 88: {
case 48: {
Timestamp = input.ReadUInt32();
break;
}
case 96: {
case 80: {
Current = input.ReadUInt32();
break;
}
case 104: {
Status = (global::AchievementAllDataNotify.Types.Achievement.Types.Status) input.ReadEnum();
Id = input.ReadUInt32();
break;
}
case 112: {
Id = input.ReadUInt32();
Total = input.ReadUInt32();
break;
}
}
@@ -531,24 +531,24 @@ public sealed partial class AchievementAllDataNotify : pb::IMessage<AchievementA
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 64: {
Total = input.ReadUInt32();
case 40: {
Status = (global::AchievementAllDataNotify.Types.Achievement.Types.Status) input.ReadEnum();
break;
}
case 88: {
case 48: {
Timestamp = input.ReadUInt32();
break;
}
case 96: {
case 80: {
Current = input.ReadUInt32();
break;
}
case 104: {
Status = (global::AchievementAllDataNotify.Types.Achievement.Types.Status) input.ReadEnum();
Id = input.ReadUInt32();
break;
}
case 112: {
Id = input.ReadUInt32();
Total = input.ReadUInt32();
break;
}
}

View File

@@ -22,15 +22,16 @@ public static partial class UpdateInfoReflection {
static UpdateInfoReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChBVcGRhdGVJbmZvLnByb3RvIqwBCgpVcGRhdGVJbmZvEhMKC3ZlcnNpb25D",
"ChBVcGRhdGVJbmZvLnByb3RvIuIBCgpVcGRhdGVJbmZvEhMKC3ZlcnNpb25D",
"b2RlGAEgASgNEhMKC3ZlcnNpb25OYW1lGAIgASgJEhMKC2Rlc2NyaXB0aW9u",
"GAMgASgJEhMKC3BhY2thZ2VMaW5rGAQgASgJEhMKC2ZvcmNlVXBkYXRlGAUg",
"ASgIEhkKEWVuYWJsZUxpYkRvd25sb2FkGAYgASgIEhoKEmVuYWJsZUF1dG9E",
"b3dubG9hZBgHIAEoCGIGcHJvdG8z"));
"b3dubG9hZBgHIAEoCBIZChFjdXJyZW50Q05HYW1lSGFzaBgIIAEoCRIZChFj",
"dXJyZW50T1NHYW1lSGFzaBgJIAEoCWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::UpdateInfo), global::UpdateInfo.Parser, new[]{ "VersionCode", "VersionName", "Description", "PackageLink", "ForceUpdate", "EnableLibDownload", "EnableAutoDownload" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::UpdateInfo), global::UpdateInfo.Parser, new[]{ "VersionCode", "VersionName", "Description", "PackageLink", "ForceUpdate", "EnableLibDownload", "EnableAutoDownload", "CurrentCNGameHash", "CurrentOSGameHash" }, null, null, null, null)
}));
}
#endregion
@@ -78,6 +79,8 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
forceUpdate_ = other.forceUpdate_;
enableLibDownload_ = other.enableLibDownload_;
enableAutoDownload_ = other.enableAutoDownload_;
currentCNGameHash_ = other.currentCNGameHash_;
currentOSGameHash_ = other.currentOSGameHash_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@@ -171,6 +174,30 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
}
}
/// <summary>Field number for the "currentCNGameHash" field.</summary>
public const int CurrentCNGameHashFieldNumber = 8;
private string currentCNGameHash_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string CurrentCNGameHash {
get { return currentCNGameHash_; }
set {
currentCNGameHash_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "currentOSGameHash" field.</summary>
public const int CurrentOSGameHashFieldNumber = 9;
private string currentOSGameHash_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string CurrentOSGameHash {
get { return currentOSGameHash_; }
set {
currentOSGameHash_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
@@ -193,6 +220,8 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
if (ForceUpdate != other.ForceUpdate) return false;
if (EnableLibDownload != other.EnableLibDownload) return false;
if (EnableAutoDownload != other.EnableAutoDownload) return false;
if (CurrentCNGameHash != other.CurrentCNGameHash) return false;
if (CurrentOSGameHash != other.CurrentOSGameHash) return false;
return Equals(_unknownFields, other._unknownFields);
}
@@ -207,6 +236,8 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
if (ForceUpdate != false) hash ^= ForceUpdate.GetHashCode();
if (EnableLibDownload != false) hash ^= EnableLibDownload.GetHashCode();
if (EnableAutoDownload != false) hash ^= EnableAutoDownload.GetHashCode();
if (CurrentCNGameHash.Length != 0) hash ^= CurrentCNGameHash.GetHashCode();
if (CurrentOSGameHash.Length != 0) hash ^= CurrentOSGameHash.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
@@ -253,6 +284,14 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
output.WriteRawTag(56);
output.WriteBool(EnableAutoDownload);
}
if (CurrentCNGameHash.Length != 0) {
output.WriteRawTag(66);
output.WriteString(CurrentCNGameHash);
}
if (CurrentOSGameHash.Length != 0) {
output.WriteRawTag(74);
output.WriteString(CurrentOSGameHash);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@@ -291,6 +330,14 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
output.WriteRawTag(56);
output.WriteBool(EnableAutoDownload);
}
if (CurrentCNGameHash.Length != 0) {
output.WriteRawTag(66);
output.WriteString(CurrentCNGameHash);
}
if (CurrentOSGameHash.Length != 0) {
output.WriteRawTag(74);
output.WriteString(CurrentOSGameHash);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
@@ -322,6 +369,12 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
if (EnableAutoDownload != false) {
size += 1 + 1;
}
if (CurrentCNGameHash.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CurrentCNGameHash);
}
if (CurrentOSGameHash.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CurrentOSGameHash);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
@@ -355,6 +408,12 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
if (other.EnableAutoDownload != false) {
EnableAutoDownload = other.EnableAutoDownload;
}
if (other.CurrentCNGameHash.Length != 0) {
CurrentCNGameHash = other.CurrentCNGameHash;
}
if (other.CurrentOSGameHash.Length != 0) {
CurrentOSGameHash = other.CurrentOSGameHash;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
@@ -398,6 +457,14 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
EnableAutoDownload = input.ReadBool();
break;
}
case 66: {
CurrentCNGameHash = input.ReadString();
break;
}
case 74: {
CurrentOSGameHash = input.ReadString();
break;
}
}
}
#endif
@@ -441,6 +508,14 @@ public sealed partial class UpdateInfo : pb::IMessage<UpdateInfo>
EnableAutoDownload = input.ReadBool();
break;
}
case 66: {
CurrentCNGameHash = input.ReadString();
break;
}
case 74: {
CurrentOSGameHash = input.ReadString();
break;
}
}
}
}

View File

@@ -79,6 +79,9 @@ public static class Utils {
throw new Win32Exception();
}
}
// ReSharper disable once NotAccessedField.Local
private static UpdateInfo _updateInfo = null!;
public static void CheckUpdate(bool useLocalLib) {
var info = UpdateInfo.Parser.ParseFrom(GetBucketFileAsByteArray("schicksal/version"))!;
@@ -110,6 +113,7 @@ public static class Utils {
} else if (info.EnableLibDownload) {
File.WriteAllBytes(GlobalVars.LibFilePath, GetBucketFileAsByteArray("schicksal/lib.dll"));
}
_updateInfo = info;
}
public static void CheckSelfIsRunning() {
@@ -203,9 +207,8 @@ public static class Utils {
#if DEBUG
return true;
#else
return File.Exists(path) && File.ReadAllBytes(path).MD5Hash()
is "34433aa962523e55213c596d4e6b1f9c"
or "1fa8e1445b8121d5d1b5c1e6a8daa905"; // TODO: Use api
var hash = File.ReadAllBytes(path).MD5Hash();
return File.Exists(path) && (hash == _updateInfo.CurrentCNGameHash || hash == _updateInfo.CurrentOSGameHash);
#endif
}