mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 18:47:28 +08:00
[+] Show tip when saving is done
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using Main;
|
||||||
using Process;
|
using Process;
|
||||||
|
|
||||||
namespace AquaMai.Helpers;
|
namespace AquaMai.Helpers;
|
||||||
@@ -6,6 +7,7 @@ namespace AquaMai.Helpers;
|
|||||||
public class SharedInstances
|
public class SharedInstances
|
||||||
{
|
{
|
||||||
public static ProcessDataContainer ProcessDataContainer { get; private set; }
|
public static ProcessDataContainer ProcessDataContainer { get; private set; }
|
||||||
|
public static GameMainObject GameMainObject { get; private set; }
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(ProcessDataContainer), MethodType.Constructor)]
|
[HarmonyPatch(typeof(ProcessDataContainer), MethodType.Constructor)]
|
||||||
@@ -13,4 +15,11 @@ public class SharedInstances
|
|||||||
{
|
{
|
||||||
ProcessDataContainer = __instance;
|
ProcessDataContainer = __instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(GameMainObject), "Awake")]
|
||||||
|
public static void OnCreateGameMainObject(GameMainObject __instance)
|
||||||
|
{
|
||||||
|
GameMainObject = __instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,19 +175,11 @@ namespace AquaMai
|
|||||||
if (_hasErrors)
|
if (_hasErrors)
|
||||||
{
|
{
|
||||||
MelonLogger.Warning("========================================================================!!!");
|
MelonLogger.Warning("========================================================================!!!");
|
||||||
MelonLogger.Warning("加载过程中检测到错误!");
|
MelonLogger.Warning(Locale.LoadError);
|
||||||
MelonLogger.Warning("- 请检查你是否安装了错误的 AquaMai 版本,比如在 SDGA 上使用了 SDEZ 的版本");
|
|
||||||
MelonLogger.Warning("- 你是否正在使用魔改的 Assembly-CSharp.dll,这会导致函数不一致而无法找到需要修改的函数");
|
|
||||||
MelonLogger.Warning("- 请检查是否有冲突的 Mod,或者开启了不兼容的选项");
|
|
||||||
MelonLogger.Warning("===========================================================================");
|
|
||||||
MelonLogger.Warning("Errors detected while loading!");
|
|
||||||
MelonLogger.Warning("- Check if you have installed the wrong version of AquaMai, such as using SDEZ version on SDGA");
|
|
||||||
MelonLogger.Warning("- Are you using a modified Assembly-CSharp.dll, which will cause inconsistent functions and cannot find the functions that need to be modified");
|
|
||||||
MelonLogger.Warning("- Check for conflicting mods, or enabled incompatible options");
|
|
||||||
MelonLogger.Warning("===========================================================================");
|
MelonLogger.Warning("===========================================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
MelonLogger.Msg("Loaded!");
|
MelonLogger.Msg(Locale.Loaded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
72
AquaMai/Resources/Locale.Designer.cs
generated
72
AquaMai/Resources/Locale.Designer.cs
generated
@@ -7,12 +7,10 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using MelonLoader;
|
|
||||||
|
|
||||||
namespace AquaMai.Resources {
|
namespace AquaMai.Resources {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,15 +22,15 @@ namespace AquaMai.Resources {
|
|||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Locale {
|
internal class Locale {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Locale() {
|
internal Locale() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -46,7 +44,7 @@ namespace AquaMai.Resources {
|
|||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
@@ -60,7 +58,28 @@ namespace AquaMai.Resources {
|
|||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Loaded!.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Loaded {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Loaded", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Errors detected while loading!
|
||||||
|
///- Check if you have installed the wrong version of AquaMai, such as using SDEZ version on SDGA
|
||||||
|
///- Are you using a modified Assembly-CSharp.dll, which will cause inconsistent functions and cannot find the functions that need to be modified
|
||||||
|
///- Check for conflicting mods, or enabled incompatible options.
|
||||||
|
/// </summary>
|
||||||
|
internal static string LoadError {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LoadError", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to End.
|
/// Looks up a localized string similar to End.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -69,7 +88,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("MarkRepeatEnd", resourceCulture);
|
return ResourceManager.GetString("MarkRepeatEnd", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Start.
|
/// Looks up a localized string similar to Start.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -78,7 +97,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("MarkRepeatStart", resourceCulture);
|
return ResourceManager.GetString("MarkRepeatStart", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Pause.
|
/// Looks up a localized string similar to Pause.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -87,7 +106,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("Pause", resourceCulture);
|
return ResourceManager.GetString("Pause", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Loop Not Set.
|
/// Looks up a localized string similar to Loop Not Set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -96,7 +115,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("RepeatNotSet", resourceCulture);
|
return ResourceManager.GetString("RepeatNotSet", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Reset.
|
/// Looks up a localized string similar to Reset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -105,7 +124,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("RepeatReset", resourceCulture);
|
return ResourceManager.GetString("RepeatReset", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Loop Set.
|
/// Looks up a localized string similar to Loop Set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -114,7 +133,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("RepeatStartEndSet", resourceCulture);
|
return ResourceManager.GetString("RepeatStartEndSet", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Loop Start Set.
|
/// Looks up a localized string similar to Loop Start Set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -123,7 +142,16 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("RepeatStartSet", resourceCulture);
|
return ResourceManager.GetString("RepeatStartSet", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Saving... Do not exit the game.
|
||||||
|
/// </summary>
|
||||||
|
internal static string SavingDontExit {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SavingDontExit", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Seek <<.
|
/// Looks up a localized string similar to Seek <<.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -132,7 +160,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("SeekBackward", resourceCulture);
|
return ResourceManager.GetString("SeekBackward", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Seek >>.
|
/// Looks up a localized string similar to Seek >>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -141,7 +169,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("SeekForward", resourceCulture);
|
return ResourceManager.GetString("SeekForward", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Speed.
|
/// Looks up a localized string similar to Speed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -150,7 +178,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("Speed", resourceCulture);
|
return ResourceManager.GetString("Speed", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Speed -.
|
/// Looks up a localized string similar to Speed -.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -159,7 +187,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("SpeedDown", resourceCulture);
|
return ResourceManager.GetString("SpeedDown", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Speed Reset.
|
/// Looks up a localized string similar to Speed Reset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -168,7 +196,7 @@ namespace AquaMai.Resources {
|
|||||||
return ResourceManager.GetString("SpeedReset", resourceCulture);
|
return ResourceManager.GetString("SpeedReset", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Speed +.
|
/// Looks up a localized string similar to Speed +.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -57,4 +57,16 @@
|
|||||||
<data name="SpeedReset" xml:space="preserve">
|
<data name="SpeedReset" xml:space="preserve">
|
||||||
<value>Speed Reset</value>
|
<value>Speed Reset</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LoadError" xml:space="preserve">
|
||||||
|
<value>Errors detected while loading!
|
||||||
|
- Check if you have installed the wrong version of AquaMai, such as using SDEZ version on SDGA
|
||||||
|
- Are you using a modified Assembly-CSharp.dll, which will cause inconsistent functions and cannot find the functions that need to be modified
|
||||||
|
- Check for conflicting mods, or enabled incompatible options</value>
|
||||||
|
</data>
|
||||||
|
<data name="SavingDontExit" xml:space="preserve">
|
||||||
|
<value>Saving... Do not exit the game</value>
|
||||||
|
</data>
|
||||||
|
<data name="Loaded" xml:space="preserve">
|
||||||
|
<value>Loaded!</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -50,4 +50,16 @@
|
|||||||
<data name="SpeedUp" xml:space="preserve">
|
<data name="SpeedUp" xml:space="preserve">
|
||||||
<value>速度 +</value>
|
<value>速度 +</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="LoadError" xml:space="preserve">
|
||||||
|
<value>加载过程中检测到错误!
|
||||||
|
- 请检查你是否安装了错误的 AquaMai 版本,比如在 SDGA 上使用了 SDEZ 的版本
|
||||||
|
- 你是否正在使用魔改的 Assembly-CSharp.dll,这会导致函数不一致而无法找到需要修改的函数
|
||||||
|
- 请检查是否有冲突的 Mod,或者开启了不兼容的选项</value>
|
||||||
|
</data>
|
||||||
|
<data name="SavingDontExit" xml:space="preserve">
|
||||||
|
<value>正在保存… 请不要关闭游戏</value>
|
||||||
|
</data>
|
||||||
|
<data name="Loaded" xml:space="preserve">
|
||||||
|
<value>加载完成!</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using AquaMai.Helpers;
|
||||||
|
using AquaMai.Resources;
|
||||||
using DB;
|
using DB;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MAI2.Util;
|
using MAI2.Util;
|
||||||
@@ -15,181 +17,238 @@ using Net.Packet.Helper;
|
|||||||
using Net.Packet.Mai2;
|
using Net.Packet.Mai2;
|
||||||
using Process;
|
using Process;
|
||||||
using Process.UserDataNet.State.UserDataULState;
|
using Process.UserDataNet.State.UserDataULState;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace AquaMai.UX
|
namespace AquaMai.UX;
|
||||||
|
|
||||||
|
public class ImmediateSave
|
||||||
{
|
{
|
||||||
public class ImmediateSave
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(StateULUserAime), "RequestUploadUserPlayLogData")]
|
||||||
|
public static bool PreRequestUploadUserPlayLogData(StateULUserAime __instance)
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
Traverse.Create(__instance).Method("RequestUploadUserPortraitData").GetValue();
|
||||||
[HarmonyPatch(typeof(StateULUserAime), "RequestUploadUserPlayLogData")]
|
return false;
|
||||||
public static bool PreRequestUploadUserPlayLogData(StateULUserAime __instance)
|
}
|
||||||
|
|
||||||
|
private static SavingUi ui;
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(ResultProcess), "OnStart")]
|
||||||
|
public static void ResultProcessOnStart()
|
||||||
|
{
|
||||||
|
var doneCount = 0;
|
||||||
|
|
||||||
|
void CheckSaveDone()
|
||||||
{
|
{
|
||||||
Traverse.Create(__instance).Method("RequestUploadUserPortraitData").GetValue();
|
doneCount++;
|
||||||
return false;
|
if (doneCount == 4)
|
||||||
|
{
|
||||||
|
if (ui != null)
|
||||||
|
{
|
||||||
|
UnityEngine.Object.Destroy(ui);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
for (int i = 0; i < 2; i++)
|
||||||
[HarmonyPatch(typeof(ResultProcess), "OnStart")]
|
|
||||||
public static void ResultProcessOnStart()
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; i++)
|
var userData = Singleton<UserDataManager>.Instance.GetUserData(i);
|
||||||
|
if (!userData.IsEntry || userData.IsGuest())
|
||||||
{
|
{
|
||||||
var userData = Singleton<UserDataManager>.Instance.GetUserData(i);
|
doneCount += 2;
|
||||||
if(!userData.IsEntry) continue;
|
continue;
|
||||||
if(userData.IsGuest()) continue;
|
}
|
||||||
|
|
||||||
SaveDataFix(userData);
|
if (ui == null)
|
||||||
|
{
|
||||||
|
ui = SharedInstances.GameMainObject.gameObject.AddComponent<SavingUi>();
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveDataFix(userData);
|
||||||
# if SDGA145
|
# if SDGA145
|
||||||
PacketHelper.StartPacket(new PacketUploadUserPlaylog(i, userData, (int)GameManager.MusicTrackNumber - 1,
|
PacketHelper.StartPacket(new PacketUploadUserPlaylog(i, userData, (int)GameManager.MusicTrackNumber - 1,
|
||||||
# else
|
# else
|
||||||
var accessToken = Singleton<OperationManager>.Instance.GetAccessToken(i);
|
var accessToken = Singleton<OperationManager>.Instance.GetAccessToken(i);
|
||||||
PacketHelper.StartPacket(new PacketUploadUserPlaylog(i, userData, (int)GameManager.MusicTrackNumber - 1, accessToken,
|
PacketHelper.StartPacket(new PacketUploadUserPlaylog(i, userData, (int)GameManager.MusicTrackNumber - 1, accessToken,
|
||||||
# endif
|
|
||||||
delegate { MelonLogger.Msg("Playlog saved"); },
|
|
||||||
delegate(PacketStatus err)
|
|
||||||
{
|
|
||||||
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
|
||||||
MelonLogger.Error("Playlog save error");
|
|
||||||
MelonLogger.Error(err);
|
|
||||||
}));
|
|
||||||
# if SDGA145
|
|
||||||
PacketHelper.StartPacket(new PacketUpsertUserAll(i, userData, delegate(int code)
|
|
||||||
# else
|
|
||||||
PacketHelper.StartPacket(new PacketUpsertUserAll(i, userData, accessToken, delegate(int code)
|
|
||||||
# endif
|
# endif
|
||||||
|
delegate
|
||||||
{
|
{
|
||||||
if (code == 1)
|
MelonLogger.Msg("Playlog saved");
|
||||||
{
|
CheckSaveDone();
|
||||||
MelonLogger.Msg("UserAll saved");
|
},
|
||||||
}
|
delegate(PacketStatus err)
|
||||||
else
|
{
|
||||||
{
|
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
||||||
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
MelonLogger.Error("Playlog save error");
|
||||||
MelonLogger.Error("UserAll upsert error");
|
MelonLogger.Error(err);
|
||||||
MelonLogger.Error(code);
|
MessageHelper.ShowMessage("Playlog save error");
|
||||||
}
|
CheckSaveDone();
|
||||||
}, delegate(PacketStatus err)
|
}));
|
||||||
|
# if SDGA145
|
||||||
|
PacketHelper.StartPacket(new PacketUpsertUserAll(i, userData, delegate(int code)
|
||||||
|
# else
|
||||||
|
PacketHelper.StartPacket(new PacketUpsertUserAll(i, userData, accessToken, delegate(int code)
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
if (code == 1)
|
||||||
|
{
|
||||||
|
MelonLogger.Msg("UserAll saved");
|
||||||
|
CheckSaveDone();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
||||||
MelonLogger.Error("UserAll upsert error");
|
MelonLogger.Error("UserAll upsert error");
|
||||||
MelonLogger.Error(err);
|
MelonLogger.Error(code);
|
||||||
}));
|
MessageHelper.ShowMessage("UserAll upsert error");
|
||||||
|
CheckSaveDone();
|
||||||
|
}
|
||||||
|
}, delegate(PacketStatus err)
|
||||||
|
{
|
||||||
|
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i);
|
||||||
|
MelonLogger.Error("UserAll upsert error");
|
||||||
|
MelonLogger.Error(err);
|
||||||
|
MessageHelper.ShowMessage("UserAll upsert error");
|
||||||
|
CheckSaveDone();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void SaveDataFix(UserData userData)
|
||||||
|
{
|
||||||
|
UserDetail detail = userData.Detail;
|
||||||
|
_ = userData.ScoreList;
|
||||||
|
detail.EventWatchedDate = TimeManager.GetDateString(TimeManager.PlayBaseTime);
|
||||||
|
userData.CalcTotalValue();
|
||||||
|
float num = 0f;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (userData.RatingList.RatingList.Any())
|
||||||
|
{
|
||||||
|
num = userData.RatingList.RatingList.Last().SingleRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
|
||||||
private static void SaveDataFix(UserData userData)
|
|
||||||
{
|
{
|
||||||
UserDetail detail = userData.Detail;
|
}
|
||||||
_ = userData.ScoreList;
|
|
||||||
detail.EventWatchedDate = TimeManager.GetDateString(TimeManager.PlayBaseTime);
|
num = (float)Math.Ceiling((double)((num + 1f) / GameManager.TheoryRateBorderNum) * 10.0);
|
||||||
userData.CalcTotalValue();
|
float num2 = 0f;
|
||||||
float num = 0f;
|
try
|
||||||
try
|
{
|
||||||
|
if (userData.RatingList.NextRatingList.Any())
|
||||||
{
|
{
|
||||||
if (userData.RatingList.RatingList.Any())
|
num2 = userData.RatingList.NewRatingList.Last().SingleRate;
|
||||||
{
|
|
||||||
num = userData.RatingList.RatingList.Last().SingleRate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
num2 = (float)Math.Ceiling((double)((num2 + 1f) / GameManager.TheoryRateBorderNum) * 10.0);
|
||||||
|
string logDateString = TimeManager.GetLogDateString(TimeManager.PlayBaseTime);
|
||||||
|
string timeJp = (string.IsNullOrEmpty(userData.Detail.DailyBonusDate) ? TimeManager.GetLogDateString(0L) : userData.Detail.DailyBonusDate);
|
||||||
|
if (userData.IsEntry && userData.Detail.IsNetMember >= 2 && !GameManager.IsEventMode && TimeManager.GetUnixTime(logDateString) > TimeManager.GetUnixTime(timeJp) && Singleton<UserDataManager>.Instance.IsSingleUser() && !GameManager.IsFreedomMode && !GameManager.IsCourseMode && !DoneEntry.IsWeekdayBonus(userData))
|
||||||
|
{
|
||||||
|
userData.Detail.DailyBonusDate = logDateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UserRate> list = new List<UserRate>();
|
||||||
|
List<UserRate> list2 = new List<UserRate>();
|
||||||
|
List<UserScore>[] scoreList = userData.ScoreList;
|
||||||
|
List<UserRate> ratingList = userData.RatingList.RatingList;
|
||||||
|
List<UserRate> newRatingList = userData.RatingList.NewRatingList;
|
||||||
|
int achive = RatingTableID.Rate_22.GetAchive();
|
||||||
|
for (int j = 0; j < scoreList.Length; j++)
|
||||||
|
{
|
||||||
|
if (scoreList[j] == null)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = (float)Math.Ceiling((double)((num + 1f) / GameManager.TheoryRateBorderNum) * 10.0);
|
foreach (UserScore item2 in scoreList[j])
|
||||||
float num2 = 0f;
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (userData.RatingList.NextRatingList.Any())
|
if (achive <= item2.achivement)
|
||||||
{
|
|
||||||
num2 = userData.RatingList.NewRatingList.Last().SingleRate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
num2 = (float)Math.Ceiling((double)((num2 + 1f) / GameManager.TheoryRateBorderNum) * 10.0);
|
|
||||||
string logDateString = TimeManager.GetLogDateString(TimeManager.PlayBaseTime);
|
|
||||||
string timeJp = (string.IsNullOrEmpty(userData.Detail.DailyBonusDate) ? TimeManager.GetLogDateString(0L) : userData.Detail.DailyBonusDate);
|
|
||||||
if (userData.IsEntry && userData.Detail.IsNetMember >= 2 && !GameManager.IsEventMode && TimeManager.GetUnixTime(logDateString) > TimeManager.GetUnixTime(timeJp) && Singleton<UserDataManager>.Instance.IsSingleUser() && !GameManager.IsFreedomMode && !GameManager.IsCourseMode && !DoneEntry.IsWeekdayBonus(userData))
|
|
||||||
{
|
|
||||||
userData.Detail.DailyBonusDate = logDateString;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<UserRate> list = new List<UserRate>();
|
|
||||||
List<UserRate> list2 = new List<UserRate>();
|
|
||||||
List<UserScore>[] scoreList = userData.ScoreList;
|
|
||||||
List<UserRate> ratingList = userData.RatingList.RatingList;
|
|
||||||
List<UserRate> newRatingList = userData.RatingList.NewRatingList;
|
|
||||||
int achive = RatingTableID.Rate_22.GetAchive();
|
|
||||||
for (int j = 0; j < scoreList.Length; j++)
|
|
||||||
{
|
|
||||||
if (scoreList[j] == null)
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (UserScore item2 in scoreList[j])
|
MusicData music = Singleton<DataManager>.Instance.GetMusic(item2.id);
|
||||||
|
if (music == null)
|
||||||
{
|
{
|
||||||
if (achive <= item2.achivement)
|
continue;
|
||||||
{
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
MusicData music = Singleton<DataManager>.Instance.GetMusic(item2.id);
|
UserRate item = new UserRate(item2.id, j, item2.achivement, (uint)music.version);
|
||||||
if (music == null)
|
if (item.OldFlag)
|
||||||
|
{
|
||||||
|
if (num <= (float)item.Level && !ratingList.Contains(item))
|
||||||
{
|
{
|
||||||
continue;
|
list.Add(item);
|
||||||
}
|
|
||||||
|
|
||||||
UserRate item = new UserRate(item2.id, j, item2.achivement, (uint)music.version);
|
|
||||||
if (item.OldFlag)
|
|
||||||
{
|
|
||||||
if (num <= (float)item.Level && !ratingList.Contains(item))
|
|
||||||
{
|
|
||||||
list.Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (num2 <= (float)item.Level && !newRatingList.Contains(item))
|
|
||||||
{
|
|
||||||
list2.Add(item);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (num2 <= (float)item.Level && !newRatingList.Contains(item))
|
||||||
|
{
|
||||||
|
list2.Add(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.Sort();
|
list.Sort();
|
||||||
list.Reverse();
|
list.Reverse();
|
||||||
if (list.Count > 10)
|
if (list.Count > 10)
|
||||||
{
|
{
|
||||||
list.RemoveRange(10, list.Count - 10);
|
list.RemoveRange(10, list.Count - 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
userData.RatingList.NextRatingList = list;
|
userData.RatingList.NextRatingList = list;
|
||||||
list2.Sort();
|
list2.Sort();
|
||||||
list2.Reverse();
|
list2.Reverse();
|
||||||
if (list2.Count > 10)
|
if (list2.Count > 10)
|
||||||
{
|
{
|
||||||
list2.RemoveRange(10, list2.Count - 10);
|
list2.RemoveRange(10, list2.Count - 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
userData.RatingList.NextNewRatingList = list2;
|
userData.RatingList.NextNewRatingList = list2;
|
||||||
|
|
||||||
userData.Detail.LastPlayCredit = 0;
|
userData.Detail.LastPlayCredit = 0;
|
||||||
userData.Detail.LastPlayMode = 0;
|
userData.Detail.LastPlayMode = 0;
|
||||||
if (GameManager.IsFreedomMode)
|
if (GameManager.IsFreedomMode)
|
||||||
{
|
{
|
||||||
userData.Detail.LastPlayMode = 1;
|
userData.Detail.LastPlayMode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameManager.IsCourseMode)
|
if (GameManager.IsCourseMode)
|
||||||
{
|
{
|
||||||
userData.Detail.LastPlayMode = 2;
|
userData.Detail.LastPlayMode = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
userData.Detail.LastGameId = "SDEZ";
|
# if SDGA145
|
||||||
userData.Detail.LastRomVersion = Singleton<SystemConfig>.Instance.config.romVersionInfo.versionNo.versionString;
|
userData.Detail.LastGameId = "SDGA";
|
||||||
userData.Detail.LastDataVersion = Singleton<SystemConfig>.Instance.config.dataVersionInfo.versionNo.versionString;
|
# else
|
||||||
|
userData.Detail.LastGameId = "SDEZ";
|
||||||
|
# endif
|
||||||
|
userData.Detail.LastRomVersion = Singleton<SystemConfig>.Instance.config.romVersionInfo.versionNo.versionString;
|
||||||
|
userData.Detail.LastDataVersion = Singleton<SystemConfig>.Instance.config.dataVersionInfo.versionNo.versionString;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SavingUi : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void OnGUI()
|
||||||
|
{
|
||||||
|
var y = Screen.height * .075f;
|
||||||
|
var width = GuiSizes.FontSize * 20f;
|
||||||
|
var x = GuiSizes.PlayerCenter + GuiSizes.PlayerWidth / 2f - width;
|
||||||
|
var rect = new Rect(x, y, width, GuiSizes.LabelHeight * 2.5f);
|
||||||
|
|
||||||
|
var labelStyle = GUI.skin.GetStyle("label");
|
||||||
|
labelStyle.fontSize = (int)(GuiSizes.FontSize * 1.2);
|
||||||
|
labelStyle.alignment = TextAnchor.MiddleCenter;
|
||||||
|
|
||||||
|
GUI.Box(rect, "");
|
||||||
|
GUI.Label(rect, Locale.SavingDontExit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user