From 3348c4c0287e3577a0e1d22689744c2e19565281 Mon Sep 17 00:00:00 2001 From: Tristan Read <60425965+ReadieFur@users.noreply.github.com> Date: Thu, 24 Mar 2022 17:20:54 +0000 Subject: [PATCH] Updated for BeatSaber 1.20.0 --- beatmods.md | 8 +++---- contributors.md | 1 + src/Client/MapEvents.cs | 22 ------------------- .../SwingRatingCounterDidFinishController.cs | 21 ------------------ src/DataPuller.csproj | 1 - src/HarmonyPatches.cs | 22 ------------------- src/Properties/AssemblyInfo.cs | 4 ++-- src/manifest.json | 16 +++++++------- 8 files changed, 15 insertions(+), 80 deletions(-) delete mode 100644 src/Controllers/SwingRatingCounterDidFinishController.cs diff --git a/beatmods.md b/beatmods.md index 83fd064..36ea74d 100644 --- a/beatmods.md +++ b/beatmods.md @@ -2,13 +2,13 @@ DataPuller ## Mod Version -2.0.11 +2.0.12 ## Game Version -1.19.0 +1.20.0 ## Dependencies -BSIPA@4.2.1,BeatSaverSharp@3.1.1,websocket-sharp@1.0.4,SongCore@3.9.0,SongDetailsCache@1.1.11,SiraUtil@3.0.2 +BSIPA@4.2.2,BeatSaverSharp@3.4.2,websocket-sharp@1.0.4,SongCore@3.9.5,SongDetailsCache@1.2.1,SiraUtil@3.0.5 ## Category Tweaks/Tools @@ -17,4 +17,4 @@ Tweaks/Tools Gathers data about the current map you are playing to then be sent out over a websocket for other software to use, e.g. A web overlay like BSDP-Overlay. This mod works with multi PC setups! ## More Info Link -https://github.com/kOFReadie/BSDataPuller/ \ No newline at end of file +https://github.com/ReadieFur/BSDataPuller/ \ No newline at end of file diff --git a/contributors.md b/contributors.md index 1ae9c4a..7ae6b92 100644 --- a/contributors.md +++ b/contributors.md @@ -6,5 +6,6 @@ | [UnskilledFreak](https://github.com/UnskilledFreak) | [CustomDifficultyLabel, Timing & Base64 Image](https://github.com/kOFReadie/BSDataPuller/pull/3) | | [Chenxiaolong](https://github.com/chenxiaolong) | [Update to expose rank and score with multipliers applied](https://github.com/kOFReadie/BSDataPuller/pull/5) | | [Macil](https://github.com/Macil) | [Use async IO to avoid blocking main thread](https://github.com/kOFReadie/BSDataPuller/pull/10) | +| [zeph-yr](https://github.com/zeph-yr) | [Fix for BeatSaber 1.20.0](https://github.com/ReadieFur/BSDataPuller/pull/16) | If you make any pull requests to this mod plese make sure to add your username to this list, I will fill in the details of what you contributed. \ No newline at end of file diff --git a/src/Client/MapEvents.cs b/src/Client/MapEvents.cs index 8ef6242..0373890 100644 --- a/src/Client/MapEvents.cs +++ b/src/Client/MapEvents.cs @@ -12,7 +12,6 @@ using HarmonyLib; using TMPro; using IPA.Utilities; -using DataPuller.Controllers; using System.Threading; using System.Timers; @@ -61,7 +60,6 @@ public void Initialize() multiplayerController.stateChangedEvent += MultiplayerController_stateChangedEvent; scoreController.scoreDidChangeEvent += ScoreDidChangeEvent; - //scoreController.immediateMaxPossibleScoreDidChangeEvent += ImmediateMaxPossibleScoreDidChangeEvent; MapData.IsMultiplayer = true; } @@ -81,7 +79,6 @@ public void Initialize() //In replay mode the scorecontroller does not work so 'RelativeScoreOrImmediateRankDidChangeEvent' will read from the UI scoreController.scoreDidChangeEvent += ScoreDidChangeEvent; - //scoreController.immediateMaxPossibleScoreDidChangeEvent += ImmediateMaxPossibleScoreDidChangeEvent; pauseController.didPauseEvent += LevelPausedEvent; pauseController.didResumeEvent += LevelUnpausedEvent; @@ -132,7 +129,6 @@ public void Dispose() #region Unsubscribe from events timer.Elapsed -= TimerElapsedEvent; - beatmapObjectManager.noteWasCutEvent -= NoteWasCutEvent; beatmapObjectManager.noteWasMissedEvent -= NoteWasMissedEvent; gameEnergyCounter.gameEnergyDidChangeEvent -= EnergyDidChangeEvent; @@ -140,7 +136,6 @@ public void Dispose() if (scoreController is ScoreController && multiplayerController is MultiplayerController) //In a multiplayer lobby { scoreController.scoreDidChangeEvent -= ScoreDidChangeEvent; - //scoreController.immediateMaxPossibleScoreDidChangeEvent -= ImmediateMaxPossibleScoreDidChangeEvent; multiplayerController.stateChangedEvent -= MultiplayerController_stateChangedEvent; } @@ -151,7 +146,6 @@ public void Dispose() else if (scoreController is ScoreController && pauseController is PauseController && standardLevelGameplayManager is StandardLevelGameplayManager) //Singleplayer/New replay. { scoreController.scoreDidChangeEvent -= ScoreDidChangeEvent; //In replay mode this does not fire so 'RelativeScoreOrImmediateRankDidChangeEvent' will read from the UI - //scoreController.immediateMaxPossibleScoreDidChangeEvent -= ImmediateMaxPossibleScoreDidChangeEvent; pauseController.didPauseEvent -= LevelPausedEvent; pauseController.didResumeEvent -= LevelUnpausedEvent; @@ -369,7 +363,6 @@ private void RelativeScoreOrImmediateRankDidChangeEvent() //For replay mode TextMeshProUGUI textMeshProUGUI = scoreUIController.GetField("_scoreText"); LiveData.Score = int.Parse(textMeshProUGUI.text.Replace(" ", "")); LiveData.ScoreWithMultipliers = ScoreModel.GetModifiedScoreForGameplayModifiersScoreMultiplier(LiveData.Score, MapData.ModifiersMultiplier); - //LiveData.MaxScore = ScoreModel.MaxRawScoreForNumberOfNotes(NoteCount); LiveData.MaxScoreWithMultipliers = ScoreModel.GetModifiedScoreForGameplayModifiersScoreMultiplier(LiveData.MaxScore, MapData.ModifiersMultiplier); SetRankAndAccuracy(); } @@ -381,13 +374,6 @@ private void ScoreDidChangeEvent(int score, int scoreWithMultipliers) SetRankAndAccuracy(); } - private void ImmediateMaxPossibleScoreDidChangeEvent(int maxScore, int maxScoreWithMultipliers) - { - LiveData.MaxScore = maxScore; - LiveData.MaxScoreWithMultipliers = maxScoreWithMultipliers; - SetRankAndAccuracy(); - } - private void SetRankAndAccuracy() { LiveData.Accuracy = relativeScoreAndImmediateRankCounter.relativeScore * 100; @@ -404,14 +390,6 @@ private void NoteWasCutEvent(NoteController arg1, in NoteCutInfo _noteCutInfo) NoteCount++; //_noteCutInfo.swingRatingCounter.RegisterDidFinishReceiver(new SwingRatingCounterDidFinishController(_noteCutInfo)); } - else - { - //Is this on miss and thats why I didnt check for miss before? (It's been a while since ive worked on this and I dont have the time to check again). - LiveData.ColorType = ColorType.None; - LiveData.Combo = 0; - LiveData.FullCombo = false; - LiveData.Misses++; - } //LiveData.Send(); //Sent by SetRankAndAccuracy() } diff --git a/src/Controllers/SwingRatingCounterDidFinishController.cs b/src/Controllers/SwingRatingCounterDidFinishController.cs deleted file mode 100644 index 672ee29..0000000 --- a/src/Controllers/SwingRatingCounterDidFinishController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using DataPuller.Client; - -namespace DataPuller.Controllers -{ - class SwingRatingCounterDidFinishController : ISaberSwingRatingCounterDidFinishReceiver - { - private NoteCutInfo noteCutInfo; - - public SwingRatingCounterDidFinishController(NoteCutInfo _noteCutInfo) - { - noteCutInfo = _noteCutInfo; - } - - public void HandleSaberSwingRatingCounterDidFinish(ISaberSwingRatingCounter saberSwingRatingCounter) - { - //ScoreModel.RawScoreWithoutMultiplier(saberSwingRatingCounter, noteCutInfo.cutDistanceToCenter, out int beforeCutRawScore, out int afterCutRawScore, out int cutDistanceRawScore); - //LiveData.BlockHitScore = new int[] { beforeCutRawScore, afterCutRawScore, cutDistanceRawScore }; - //noteCutInfo.swingRatingCounter.UnregisterDidFinishReceiver(this); - } - } -} diff --git a/src/DataPuller.csproj b/src/DataPuller.csproj index 5895612..c51a85b 100644 --- a/src/DataPuller.csproj +++ b/src/DataPuller.csproj @@ -126,7 +126,6 @@ - diff --git a/src/HarmonyPatches.cs b/src/HarmonyPatches.cs index ce3c9d5..fbb151c 100644 --- a/src/HarmonyPatches.cs +++ b/src/HarmonyPatches.cs @@ -8,16 +8,8 @@ internal class HandleScoringForNoteDidFinishPatch { static void Postfix(ScoringElement scoringElement) { - //Plugin.Logger.Debug("in Postfix"); - if (scoringElement != null) { - /*NoteData noteData = scoringElement.noteData; - if (noteData.colorType == ColorType.None) - { - LiveData.FullCombo = false; - }*/ - GoodCutScoringElement goodCutScoringElement; if ((goodCutScoringElement = (scoringElement as GoodCutScoringElement)) != null) { @@ -25,21 +17,7 @@ static void Postfix(ScoringElement scoringElement) LiveData.BlockHitScore = new int[] {goodCutScoringElement.cutScoreBuffer.beforeCutScore, goodCutScoringElement.cutScoreBuffer.afterCutScore, goodCutScoringElement.cutScoreBuffer.centerDistanceCutScore}; LiveData.Score += goodCutScoringElement.cutScore * goodCutScoringElement.multiplier; LiveData.MaxScore += goodCutScoringElement.maxPossibleCutScore * goodCutScoringElement.multiplier; - - Plugin.Logger.Info("Postfix: " + LiveData.Combo + " " + LiveData.BlockHitScore[0] + "," + LiveData.BlockHitScore[1] + "," + LiveData.BlockHitScore[2] + " " + LiveData.Score + " " + LiveData.MaxScore); } - - /*if (scoringElement is BadCutScoringElement) - { - LiveData.Misses++; - LiveData.FullCombo = false; - } - - if (scoringElement is MissScoringElement) - { - LiveData.Misses++; - LiveData.FullCombo = false; - }*/ } } } diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index dee1ec3..6319490 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.11")] -[assembly: AssemblyFileVersion("2.0.11")] +[assembly: AssemblyVersion("2.0.12")] +[assembly: AssemblyFileVersion("2.0.12")] diff --git a/src/manifest.json b/src/manifest.json index 66e4f57..b62a827 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -3,19 +3,19 @@ "id": "DataPuller", "name": "DataPuller", "author": "Readie", - "version": "2.0.11", + "version": "2.0.12", "description": "Gathers data about the current map you are playing to then be sent out over a websocket for other software to use, e.g. A web overlay like BSDP-Overlay. This mod works with multi PC setups!", - "gameVersion": "1.19.0", + "gameVersion": "1.20.0", "dependsOn": { - "BSIPA": "^4.2.1", - "BeatSaverSharp": "^3.1.1", + "BSIPA": "^4.2.2", + "BeatSaverSharp": "^3.4.2", "websocket-sharp": "^1.0.4", - "SongCore": "^3.9.0", - "SongDetailsCache": "^1.1.11", - "SiraUtil": "^3.0.2" + "SongCore": "^3.9.5", + "SongDetailsCache": "^1.2.1", + "SiraUtil": "^3.0.5" }, "links": { "project-home": "https://readie.global-gaming.co/bsdp-overlay/", - "project-source": "https://github.com/kOFReadie/BSDataPuller" + "project-source": "https://github.com/ReadieFur/BSDataPuller" } } \ No newline at end of file