From cc7bc8613bc65655f7a95fadb1e453eceed4711a Mon Sep 17 00:00:00 2001 From: akanyan Date: Mon, 8 Jul 2024 02:10:46 +0900 Subject: [PATCH] feat: add the remaining things * DisableMaintenance * UnlockAllMusic * UnlockGameEvents * UnlockMemoryChapters --- DisableMaintenance/DisableMaintenance.csproj | 7 +++ .../MU3.Operation/patch_ClosingManager.cs | 27 +++++++++++ .../MU3.Operation/patch_MaintenanceTimer.cs | 47 ++++++++++++++++++ Mu3Mods.sln | 48 +++++++++++++++++++ .../patch_MU3UICounter.cs | 0 .../patch_ANM_CMN_User.cs | 0 .../{MU3 => MU3.User}/patch_UserOption.cs | 0 .../patch_Scene_32_PrePlayMusic_Confirm.cs | 0 .../MU3.DataStudio/patch_MusicData.cs | 24 ++++++++++ UnlockAllMusic/MU3/patch_Scene_25_Login.cs | 20 ++++++++ UnlockAllMusic/UnlockAllMusic.csproj | 7 +++ UnlockFrameRate/MU3.Sys/patch_Config.cs | 2 + .../MU3.Client/patch_PacketGetGameEvent.cs | 35 ++++++++++++++ UnlockGameEvents/UnlockGameEvents.csproj | 7 +++ .../UnlockMasterDifficulty.csproj | 1 - .../patch_PacketGetUserMemoryChapter.cs | 32 +++++++++++++ .../UnlockMemoryChapters.csproj | 7 +++ 17 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 DisableMaintenance/DisableMaintenance.csproj create mode 100644 DisableMaintenance/MU3.Operation/patch_ClosingManager.cs create mode 100644 DisableMaintenance/MU3.Operation/patch_MaintenanceTimer.cs rename NaiveRating/{MU3 => MU3.CustomUI}/patch_MU3UICounter.cs (100%) rename NaiveRating/{MU3 => MU3.SceneObject}/patch_ANM_CMN_User.cs (100%) rename NaiveRating/{MU3 => MU3.User}/patch_UserOption.cs (100%) rename NaiveRating/{MU3.User => MU3}/patch_Scene_32_PrePlayMusic_Confirm.cs (100%) create mode 100644 UnlockAllMusic/MU3.DataStudio/patch_MusicData.cs create mode 100644 UnlockAllMusic/MU3/patch_Scene_25_Login.cs create mode 100644 UnlockAllMusic/UnlockAllMusic.csproj create mode 100644 UnlockGameEvents/MU3.Client/patch_PacketGetGameEvent.cs create mode 100644 UnlockGameEvents/UnlockGameEvents.csproj create mode 100644 UnlockMemoryChapters/MU3.Client/patch_PacketGetUserMemoryChapter.cs create mode 100644 UnlockMemoryChapters/UnlockMemoryChapters.csproj diff --git a/DisableMaintenance/DisableMaintenance.csproj b/DisableMaintenance/DisableMaintenance.csproj new file mode 100644 index 0000000..a5b98d4 --- /dev/null +++ b/DisableMaintenance/DisableMaintenance.csproj @@ -0,0 +1,7 @@ + + + Assembly-CSharp.DisableMaintenance.mm + Disable maintenance + + + \ No newline at end of file diff --git a/DisableMaintenance/MU3.Operation/patch_ClosingManager.cs b/DisableMaintenance/MU3.Operation/patch_ClosingManager.cs new file mode 100644 index 0000000..4366696 --- /dev/null +++ b/DisableMaintenance/MU3.Operation/patch_ClosingManager.cs @@ -0,0 +1,27 @@ +namespace MU3.Operation; + +class patch_ClosingManager: ClosingManager { + public new int getRemainingMinutes() { + return int.MaxValue; + } + + public new int getClosedRemainingMinutes() { + return int.MaxValue; + } + + public new bool isShowRemainingMinutes() { + return false; + } + + public new bool isReceptionClosed() { + return false; + } + + public new bool isForceLogout() { + return false; + } + + public new CreditUseRestriction getCreditUseRestriction() { + return CreditUseRestriction.None; + } +} diff --git a/DisableMaintenance/MU3.Operation/patch_MaintenanceTimer.cs b/DisableMaintenance/MU3.Operation/patch_MaintenanceTimer.cs new file mode 100644 index 0000000..7b61333 --- /dev/null +++ b/DisableMaintenance/MU3.Operation/patch_MaintenanceTimer.cs @@ -0,0 +1,47 @@ +namespace MU3.Operation; + +class patch_MaintenanceTimer: MaintenanceTimer { + public new bool isUnderServerMaintenance() { + return false; + } + + public new int getServerMaintenanceSec() { + return int.MaxValue; + } + + public new int getAutoRebootSec() { + return int.MaxValue; + } + + public new bool isAutoRebootNeeded() { + return false; + } + + public new int getRemainingMinutes() { + return int.MaxValue; + } + + public new int getClosedRemainingMinutes() { + return int.MaxValue; + } + + public new bool isShowRemainingMinutes() { + return false; + } + + public new bool isClosed() { + return false; + } + + public new bool isForceLogout() { + return false; + } + + public new ClosingManager.CreditUseRestriction getCreditUseRestriction() { + return ClosingManager.CreditUseRestriction.None; + } + + public new bool isCoinAcceptable() { + return true; + } +} diff --git a/Mu3Mods.sln b/Mu3Mods.sln index 57393a9..0f32ef3 100644 --- a/Mu3Mods.sln +++ b/Mu3Mods.sln @@ -25,6 +25,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockAndSetJewelBoostNine" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SortByInternalDifficulty", "SortByInternalDifficulty\SortByInternalDifficulty.csproj", "{0BF799DF-8837-4372-9F36-705CDC22374C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoadBoost", "LoadBoost\LoadBoost.csproj", "{56B75395-ED26-479B-B59F-DABB74513335}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableEncryption", "DisableEncryption\DisableEncryption.csproj", "{3F05931E-4444-4616-A0AC-047809821B0E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockMasterDifficulty", "UnlockMasterDifficulty\UnlockMasterDifficulty.csproj", "{965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockFrameRate", "UnlockFrameRate\UnlockFrameRate.csproj", "{0C3E8145-F91B-4F1F-97D1-17E12D49891B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockAllMusic", "UnlockAllMusic\UnlockAllMusic.csproj", "{C8948C3E-0434-429E-AFE6-4FB2DF246872}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMaintenance", "DisableMaintenance\DisableMaintenance.csproj", "{6C91EB92-3A30-43B5-8954-E84C610C1D67}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockGameEvents", "UnlockGameEvents\UnlockGameEvents.csproj", "{3B9B843D-DCA0-41FE-B642-6BCB187BBD5D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockMemoryChapters", "UnlockMemoryChapters\UnlockMemoryChapters.csproj", "{3A217A12-6082-491B-89F6-C1D13AD69A19}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -75,6 +91,38 @@ Global {0BF799DF-8837-4372-9F36-705CDC22374C}.Debug|x64.Build.0 = Debug|x64 {0BF799DF-8837-4372-9F36-705CDC22374C}.Release|x64.ActiveCfg = Release|x64 {0BF799DF-8837-4372-9F36-705CDC22374C}.Release|x64.Build.0 = Release|x64 + {56B75395-ED26-479B-B59F-DABB74513335}.Debug|x64.ActiveCfg = Debug|x64 + {56B75395-ED26-479B-B59F-DABB74513335}.Debug|x64.Build.0 = Debug|x64 + {56B75395-ED26-479B-B59F-DABB74513335}.Release|x64.ActiveCfg = Release|x64 + {56B75395-ED26-479B-B59F-DABB74513335}.Release|x64.Build.0 = Release|x64 + {3F05931E-4444-4616-A0AC-047809821B0E}.Debug|x64.ActiveCfg = Debug|x64 + {3F05931E-4444-4616-A0AC-047809821B0E}.Debug|x64.Build.0 = Debug|x64 + {3F05931E-4444-4616-A0AC-047809821B0E}.Release|x64.ActiveCfg = Release|x64 + {3F05931E-4444-4616-A0AC-047809821B0E}.Release|x64.Build.0 = Release|x64 + {965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022}.Debug|x64.ActiveCfg = Debug|x64 + {965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022}.Debug|x64.Build.0 = Debug|x64 + {965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022}.Release|x64.ActiveCfg = Release|x64 + {965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022}.Release|x64.Build.0 = Release|x64 + {0C3E8145-F91B-4F1F-97D1-17E12D49891B}.Debug|x64.ActiveCfg = Debug|x64 + {0C3E8145-F91B-4F1F-97D1-17E12D49891B}.Debug|x64.Build.0 = Debug|x64 + {0C3E8145-F91B-4F1F-97D1-17E12D49891B}.Release|x64.ActiveCfg = Release|x64 + {0C3E8145-F91B-4F1F-97D1-17E12D49891B}.Release|x64.Build.0 = Release|x64 + {C8948C3E-0434-429E-AFE6-4FB2DF246872}.Debug|x64.ActiveCfg = Debug|x64 + {C8948C3E-0434-429E-AFE6-4FB2DF246872}.Debug|x64.Build.0 = Debug|x64 + {C8948C3E-0434-429E-AFE6-4FB2DF246872}.Release|x64.ActiveCfg = Release|x64 + {C8948C3E-0434-429E-AFE6-4FB2DF246872}.Release|x64.Build.0 = Release|x64 + {6C91EB92-3A30-43B5-8954-E84C610C1D67}.Debug|x64.ActiveCfg = Debug|x64 + {6C91EB92-3A30-43B5-8954-E84C610C1D67}.Debug|x64.Build.0 = Debug|x64 + {6C91EB92-3A30-43B5-8954-E84C610C1D67}.Release|x64.ActiveCfg = Release|x64 + {6C91EB92-3A30-43B5-8954-E84C610C1D67}.Release|x64.Build.0 = Release|x64 + {3B9B843D-DCA0-41FE-B642-6BCB187BBD5D}.Debug|x64.ActiveCfg = Debug|x64 + {3B9B843D-DCA0-41FE-B642-6BCB187BBD5D}.Debug|x64.Build.0 = Debug|x64 + {3B9B843D-DCA0-41FE-B642-6BCB187BBD5D}.Release|x64.ActiveCfg = Release|x64 + {3B9B843D-DCA0-41FE-B642-6BCB187BBD5D}.Release|x64.Build.0 = Release|x64 + {3A217A12-6082-491B-89F6-C1D13AD69A19}.Debug|x64.ActiveCfg = Debug|x64 + {3A217A12-6082-491B-89F6-C1D13AD69A19}.Debug|x64.Build.0 = Debug|x64 + {3A217A12-6082-491B-89F6-C1D13AD69A19}.Release|x64.ActiveCfg = Release|x64 + {3A217A12-6082-491B-89F6-C1D13AD69A19}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NaiveRating/MU3/patch_MU3UICounter.cs b/NaiveRating/MU3.CustomUI/patch_MU3UICounter.cs similarity index 100% rename from NaiveRating/MU3/patch_MU3UICounter.cs rename to NaiveRating/MU3.CustomUI/patch_MU3UICounter.cs diff --git a/NaiveRating/MU3/patch_ANM_CMN_User.cs b/NaiveRating/MU3.SceneObject/patch_ANM_CMN_User.cs similarity index 100% rename from NaiveRating/MU3/patch_ANM_CMN_User.cs rename to NaiveRating/MU3.SceneObject/patch_ANM_CMN_User.cs diff --git a/NaiveRating/MU3/patch_UserOption.cs b/NaiveRating/MU3.User/patch_UserOption.cs similarity index 100% rename from NaiveRating/MU3/patch_UserOption.cs rename to NaiveRating/MU3.User/patch_UserOption.cs diff --git a/NaiveRating/MU3.User/patch_Scene_32_PrePlayMusic_Confirm.cs b/NaiveRating/MU3/patch_Scene_32_PrePlayMusic_Confirm.cs similarity index 100% rename from NaiveRating/MU3.User/patch_Scene_32_PrePlayMusic_Confirm.cs rename to NaiveRating/MU3/patch_Scene_32_PrePlayMusic_Confirm.cs diff --git a/UnlockAllMusic/MU3.DataStudio/patch_MusicData.cs b/UnlockAllMusic/MU3.DataStudio/patch_MusicData.cs new file mode 100644 index 0000000..8f15637 --- /dev/null +++ b/UnlockAllMusic/MU3.DataStudio/patch_MusicData.cs @@ -0,0 +1,24 @@ +namespace MU3.DataStudio; + +class patch_MusicData: MusicData { + public new int CostToUnlock { + get { + return 0; + } + private set { /* nop */ } + } + + public new bool PossessingFromTheBeginning { + get { + return true; + } + private set { /* nop */ } + } + + public new bool IsLockedAtTheBeginning { + get { + return false; + } + private set { /* nop */ } + } +} diff --git a/UnlockAllMusic/MU3/patch_Scene_25_Login.cs b/UnlockAllMusic/MU3/patch_Scene_25_Login.cs new file mode 100644 index 0000000..b180b27 --- /dev/null +++ b/UnlockAllMusic/MU3/patch_Scene_25_Login.cs @@ -0,0 +1,20 @@ +using MU3.User; +using MU3.Util; + +namespace MU3; + +class patch_Scene_25_Login: Scene_25_Login { + private enum State { + GetUserRatinglog = 24 + } + + private Mode mode_; + + private void GetUserActivityMusic_Init() { + // nop + } + private void GetUserActivityMusic_Proc() { + Singleton.instance.updateUserActivityInLoginEnd(); + mode_.set(State.GetUserRatinglog); + } +} diff --git a/UnlockAllMusic/UnlockAllMusic.csproj b/UnlockAllMusic/UnlockAllMusic.csproj new file mode 100644 index 0000000..eaab2d5 --- /dev/null +++ b/UnlockAllMusic/UnlockAllMusic.csproj @@ -0,0 +1,7 @@ + + + Assembly-CSharp.UnlockAllMusic.mm + Unlock all music + + + \ No newline at end of file diff --git a/UnlockFrameRate/MU3.Sys/patch_Config.cs b/UnlockFrameRate/MU3.Sys/patch_Config.cs index 953b26c..9675a3d 100644 --- a/UnlockFrameRate/MU3.Sys/patch_Config.cs +++ b/UnlockFrameRate/MU3.Sys/patch_Config.cs @@ -12,8 +12,10 @@ class patch_Config: Config { if(iniFile.getIntValue("Video", "VSync", 0) != 0) { QualitySettings.vSyncCount = 1; + Debug.Log("[UnlockFrameRate] VSync on"); } else { Application.targetFrameRate = iniFile.getIntValue("Video", "Framerate", 60); + Debug.Log("[UnlockFrameRate] Framerate lock: " + Application.targetFrameRate); } } } diff --git a/UnlockGameEvents/MU3.Client/patch_PacketGetGameEvent.cs b/UnlockGameEvents/MU3.Client/patch_PacketGetGameEvent.cs new file mode 100644 index 0000000..e348ecd --- /dev/null +++ b/UnlockGameEvents/MU3.Client/patch_PacketGetGameEvent.cs @@ -0,0 +1,35 @@ +using MU3.Data; +using MU3.Operation; +using MU3.Util; +using System; +using System.Linq; + +namespace MU3.Client; + +class patch_PacketGetGameEvent: Packet { + public Operation.GameEvent _gameEvent; + public Operation.GameEvent gameEvent => _gameEvent; + public extern State orig_proc(); + public override State proc() { + State state = orig_proc(); + if(state == State.Done) { + DateTime endDate = DateTime.Parse("2099-01-01 05:00:00.0"); + _gameEvent ??= new Operation.GameEvent(); + foreach(EventData eventData in SingletonStateMachine.instance.allEventData) { + IdPeriod idPeriod = Enumerable.FirstOrDefault(_gameEvent.list, (IdPeriod e) => e.id == eventData.id); + if(idPeriod != null) { + if(idPeriod.period.endDate < CustomDateTime.Now) { + idPeriod.period.endDate = endDate; + } + } else { + idPeriod = new(); + idPeriod.id = eventData.id; + idPeriod.period = new Period(DateTime.MinValue.Date, endDate); + _gameEvent.list.Add(idPeriod); + _gameEvent.lastUpdate = CustomDateTime.Now; + } + } + } + return state; + } +} diff --git a/UnlockGameEvents/UnlockGameEvents.csproj b/UnlockGameEvents/UnlockGameEvents.csproj new file mode 100644 index 0000000..937ec81 --- /dev/null +++ b/UnlockGameEvents/UnlockGameEvents.csproj @@ -0,0 +1,7 @@ + + + Assembly-CSharp.UnlockGameEvents.mm + Unlock game events + + + \ No newline at end of file diff --git a/UnlockMasterDifficulty/UnlockMasterDifficulty.csproj b/UnlockMasterDifficulty/UnlockMasterDifficulty.csproj index b0187fb..0f8f86a 100644 --- a/UnlockMasterDifficulty/UnlockMasterDifficulty.csproj +++ b/UnlockMasterDifficulty/UnlockMasterDifficulty.csproj @@ -2,7 +2,6 @@ Assembly-CSharp.UnlockMasterDifficulty.mm Unlock master difficulty - {965FCDBC-12EA-4F31-AAF6-9C4C3B9F7022} \ No newline at end of file diff --git a/UnlockMemoryChapters/MU3.Client/patch_PacketGetUserMemoryChapter.cs b/UnlockMemoryChapters/MU3.Client/patch_PacketGetUserMemoryChapter.cs new file mode 100644 index 0000000..59f9f26 --- /dev/null +++ b/UnlockMemoryChapters/MU3.Client/patch_PacketGetUserMemoryChapter.cs @@ -0,0 +1,32 @@ +using MU3.Data; +using MU3.User; +using MU3.Util; +using System.Collections.Generic; +using System.Linq; + +namespace MU3.Client; + +class patch_PacketGetUserMemoryChapter: Packet { + private Dictionary userMemoryChapter_; + public override State proc() { + switch(procImpl()) { + case State.Done: { + GetUserMemoryChapterResponse response_ = (query_ as GetUserMemoryChapter).response_; + foreach(MemoryChapterData memoryChapterData in SingletonStateMachine.instance.allMemoryChapterData) { + UserMemoryChapter userMemoryChapter = Enumerable.FirstOrDefault(response_.userMemoryChapterList, (UserMemoryChapter c) => c.chapterId == memoryChapterData.id); + if(userMemoryChapter != null) { + User.UserMemoryChapter userMemoryChapter2 = new User.UserMemoryChapter(); + userMemoryChapter2.copyFrom(userMemoryChapter); + userMemoryChapter_[userMemoryChapter2.ChapterId] = userMemoryChapter2; + } else { + User.UserMemoryChapter userMemoryChapter3 = new User.UserMemoryChapter(memoryChapterData.id); + userMemoryChapter_[userMemoryChapter3.ChapterId] = userMemoryChapter3; + } + } + Singleton.instance.UserMemoryChapter = userMemoryChapter_; + break; + } + } + return state_; + } +} diff --git a/UnlockMemoryChapters/UnlockMemoryChapters.csproj b/UnlockMemoryChapters/UnlockMemoryChapters.csproj new file mode 100644 index 0000000..3851115 --- /dev/null +++ b/UnlockMemoryChapters/UnlockMemoryChapters.csproj @@ -0,0 +1,7 @@ + + + Assembly-CSharp.UnlockMemoryChapters.mm + Unlock memory chapters + + + \ No newline at end of file