Skip to content

Commit

Permalink
Updated for BeatSaber 1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ReadieFur committed Mar 24, 2022
1 parent dc1d96f commit 3348c4c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 80 deletions.
8 changes: 4 additions & 4 deletions beatmods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/
https://github.com/ReadieFur/BSDataPuller/
1 change: 1 addition & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
22 changes: 0 additions & 22 deletions src/Client/MapEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using HarmonyLib;
using TMPro;
using IPA.Utilities;
using DataPuller.Controllers;
using System.Threading;
using System.Timers;

Expand Down Expand Up @@ -61,7 +60,6 @@ public void Initialize()

multiplayerController.stateChangedEvent += MultiplayerController_stateChangedEvent;
scoreController.scoreDidChangeEvent += ScoreDidChangeEvent;
//scoreController.immediateMaxPossibleScoreDidChangeEvent += ImmediateMaxPossibleScoreDidChangeEvent;

MapData.IsMultiplayer = true;
}
Expand All @@ -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;
Expand Down Expand Up @@ -132,15 +129,13 @@ public void Dispose()
#region Unsubscribe from events
timer.Elapsed -= TimerElapsedEvent;

beatmapObjectManager.noteWasCutEvent -= NoteWasCutEvent;
beatmapObjectManager.noteWasMissedEvent -= NoteWasMissedEvent;

gameEnergyCounter.gameEnergyDidChangeEvent -= EnergyDidChangeEvent;

if (scoreController is ScoreController && multiplayerController is MultiplayerController) //In a multiplayer lobby
{
scoreController.scoreDidChangeEvent -= ScoreDidChangeEvent;
//scoreController.immediateMaxPossibleScoreDidChangeEvent -= ImmediateMaxPossibleScoreDidChangeEvent;

multiplayerController.stateChangedEvent -= MultiplayerController_stateChangedEvent;
}
Expand All @@ -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;
Expand Down Expand Up @@ -369,7 +363,6 @@ private void RelativeScoreOrImmediateRankDidChangeEvent() //For replay mode
TextMeshProUGUI textMeshProUGUI = scoreUIController.GetField<TextMeshProUGUI, ScoreUIController>("_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();
}
Expand All @@ -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;
Expand All @@ -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()
}
Expand Down
21 changes: 0 additions & 21 deletions src/Controllers/SwingRatingCounterDidFinishController.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/DataPuller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
<ItemGroup>
<Compile Include="Client\LiveData.cs" />
<Compile Include="Client\MapData.cs" />
<Compile Include="Controllers\SwingRatingCounterDidFinishController.cs" />
<Compile Include="HarmonyPatches.cs" />
<Compile Include="Installers\ClientInstaller.cs" />
<Compile Include="Server\Server.cs" />
Expand Down
22 changes: 0 additions & 22 deletions src/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,16 @@ 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)
{
LiveData.Combo++;
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;
}*/
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
16 changes: 8 additions & 8 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 3348c4c

Please sign in to comment.