Skip to content

Commit

Permalink
Fix: Custom Scoreboard Broken Lines (#3192)
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 authored Jan 11, 2025
1 parent 20d661b commit b2544ac
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,24 @@ object ScoreboardPattern {
"(?:§f)?Kills: §.\\d+",
)

/**
* Somtimes when the scoreboard updates, it only updates half way,
* causing some lines to become mixed with other lines -> broken.
* This should already get handled fine but sometimes these errors still occur with some lines way too often.
* This pattern is to catch those lines.
*/
/**
* REGEX-TEST: §e§l⚡ §cRedston
* REGEX-TEST: §ce: §e§b0%
* REGEX-TEST: Starting in: §a0 §c1:55
*/
val brokenPatterns by group.list(
"broken",
"\\s*§.§l⚡ §cRedston",
"\\s*§ce: §e§b0%",
"\\s*Starting in: §a0 §c[\\d:]+",
)

// Lines from the tablist
private val tablistGroup = group.group("tablist")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,120 +39,123 @@ object UnknownLinesHandler {
/**
* Remove known lines with patterns
**/
private val patternsToExclude = mutableListOf(
PurseAPI.coinsPattern,
SbPattern.motesPattern,
BitsAPI.bitsScoreboardPattern,
SbPattern.heatPattern,
SbPattern.copperPattern,
SbPattern.locationPattern,
SbPattern.lobbyCodePattern,
SbPattern.datePattern,
SbPattern.timePattern,
SbPattern.footerPattern,
SbPattern.yearVotesPattern,
SbPattern.votesPattern,
SbPattern.waitingForVotePattern,
SbPattern.northstarsPattern,
SbPattern.profileTypePattern,
SbPattern.autoClosingPattern,
SbPattern.startingInPattern,
SbPattern.timeElapsedPattern,
SbPattern.instanceShutdownPattern,
SbPattern.keysPattern,
SbPattern.clearedPattern,
SbPattern.soloPattern,
SbPattern.teammatesPattern,
SbPattern.floor3GuardiansPattern,
SbPattern.m7dragonsPattern,
SbPattern.wavePattern,
SbPattern.tokensPattern,
SbPattern.submergesPattern,
SbPattern.medalsPattern,
SbPattern.lockedPattern,
SbPattern.cleanUpPattern,
SbPattern.pastingPattern,
SbPattern.peltsPattern,
SbPattern.mobLocationPattern,
SbPattern.jacobsContestPattern,
SbPattern.plotPattern,
SbPattern.powderGreedyPattern,
SbPattern.windCompassPattern,
SbPattern.windCompassArrowPattern,
SbPattern.miningEventPattern,
SbPattern.miningEventZonePattern,
SbPattern.raffleUselessPattern,
SbPattern.raffleTicketsPattern,
SbPattern.rafflePoolPattern,
SbPattern.mithrilUselessPattern,
SbPattern.mithrilRemainingPattern,
SbPattern.mithrilYourMithrilPattern,
SbPattern.nearbyPlayersPattern,
SbPattern.uselessGoblinPattern,
SbPattern.remainingGoblinPattern,
SbPattern.yourGoblinKillsPattern,
SbPattern.magmaBossPattern,
SbPattern.damageSoakedPattern,
SbPattern.killMagmasPattern,
SbPattern.killMagmasDamagedSoakedBarPattern,
SbPattern.reformingPattern,
SbPattern.bossHealthPattern,
SbPattern.bossHealthBarPattern,
SpidersDenAPI.broodmotherPattern,
SbPattern.bossHPPattern,
SbPattern.bossDamagePattern,
SbPattern.slayerQuestPattern,
SbPattern.essencePattern,
SbPattern.redstonePattern,
SbPattern.anniversaryPattern,
SbPattern.visitingPattern,
SbPattern.flightDurationPattern,
SbPattern.dojoChallengePattern,
SbPattern.dojoDifficultyPattern,
SbPattern.dojoPointsPattern,
SbPattern.dojoTimePattern,
SbPattern.objectivePattern,
ServerRestartTitle.restartingGreedyPattern,
SbPattern.travelingZooPattern,
SbPattern.newYearPattern,
SbPattern.spookyPattern,
SbPattern.winterEventStartPattern,
SbPattern.winterNextWavePattern,
SbPattern.winterWavePattern,
SbPattern.winterMagmaLeftPattern,
SbPattern.winterTotalDmgPattern,
SbPattern.winterCubeDmgPattern,
SbPattern.riftDimensionPattern,
RiftBloodEffigies.heartsPattern,
SbPattern.wtfAreThoseLinesPattern,
SbPattern.timeLeftPattern,
SbPattern.darkAuctionCurrentItemPattern,
MiningAPI.coldPattern,
SbPattern.riftHotdogTitlePattern,
SbPattern.riftHotdogEatenPattern,
SbPattern.mineshaftNotStartedPattern,
SbPattern.queuePattern,
SbPattern.queueTierPattern,
SbPattern.queuePositionPattern,
SbPattern.queueWaitingForLeaderPattern,
SbPattern.fortunateFreezingBonusPattern,
SbPattern.riftAveikxPattern,
SbPattern.riftHayEatenPattern,
SbPattern.fossilDustPattern,
SbPattern.cluesPattern,
SbPattern.barryProtestorsQuestlinePattern,
SbPattern.barryProtestorsHandledPattern,
SbPattern.timeSlicedPattern,
SbPattern.bigDamagePattern,
SbPattern.carnivalPattern,
SbPattern.carnivalTasksPattern,
SbPattern.carnivalTokensPattern,
SbPattern.carnivalFruitsPattern,
SbPattern.carnivalScorePattern,
SbPattern.carnivalCatchStreakPattern,
SbPattern.carnivalAccuracyPattern,
SbPattern.carnivalKillsPattern,
)
private val patternsToExclude = (
mutableListOf(
PurseAPI.coinsPattern,
SbPattern.motesPattern,
BitsAPI.bitsScoreboardPattern,
SbPattern.heatPattern,
SbPattern.copperPattern,
SbPattern.locationPattern,
SbPattern.lobbyCodePattern,
SbPattern.datePattern,
SbPattern.timePattern,
SbPattern.footerPattern,
SbPattern.yearVotesPattern,
SbPattern.votesPattern,
SbPattern.waitingForVotePattern,
SbPattern.northstarsPattern,
SbPattern.profileTypePattern,
SbPattern.autoClosingPattern,
SbPattern.startingInPattern,
SbPattern.timeElapsedPattern,
SbPattern.instanceShutdownPattern,
SbPattern.keysPattern,
SbPattern.clearedPattern,
SbPattern.soloPattern,
SbPattern.teammatesPattern,
SbPattern.floor3GuardiansPattern,
SbPattern.m7dragonsPattern,
SbPattern.wavePattern,
SbPattern.tokensPattern,
SbPattern.submergesPattern,
SbPattern.medalsPattern,
SbPattern.lockedPattern,
SbPattern.cleanUpPattern,
SbPattern.pastingPattern,
SbPattern.peltsPattern,
SbPattern.mobLocationPattern,
SbPattern.jacobsContestPattern,
SbPattern.plotPattern,
SbPattern.powderGreedyPattern,
SbPattern.windCompassPattern,
SbPattern.windCompassArrowPattern,
SbPattern.miningEventPattern,
SbPattern.miningEventZonePattern,
SbPattern.raffleUselessPattern,
SbPattern.raffleTicketsPattern,
SbPattern.rafflePoolPattern,
SbPattern.mithrilUselessPattern,
SbPattern.mithrilRemainingPattern,
SbPattern.mithrilYourMithrilPattern,
SbPattern.nearbyPlayersPattern,
SbPattern.uselessGoblinPattern,
SbPattern.remainingGoblinPattern,
SbPattern.yourGoblinKillsPattern,
SbPattern.magmaBossPattern,
SbPattern.damageSoakedPattern,
SbPattern.killMagmasPattern,
SbPattern.killMagmasDamagedSoakedBarPattern,
SbPattern.reformingPattern,
SbPattern.bossHealthPattern,
SbPattern.bossHealthBarPattern,
SpidersDenAPI.broodmotherPattern,
SbPattern.bossHPPattern,
SbPattern.bossDamagePattern,
SbPattern.slayerQuestPattern,
SbPattern.essencePattern,
SbPattern.redstonePattern,
SbPattern.anniversaryPattern,
SbPattern.visitingPattern,
SbPattern.flightDurationPattern,
SbPattern.dojoChallengePattern,
SbPattern.dojoDifficultyPattern,
SbPattern.dojoPointsPattern,
SbPattern.dojoTimePattern,
SbPattern.objectivePattern,
ServerRestartTitle.restartingGreedyPattern,
SbPattern.travelingZooPattern,
SbPattern.newYearPattern,
SbPattern.spookyPattern,
SbPattern.winterEventStartPattern,
SbPattern.winterNextWavePattern,
SbPattern.winterWavePattern,
SbPattern.winterMagmaLeftPattern,
SbPattern.winterTotalDmgPattern,
SbPattern.winterCubeDmgPattern,
SbPattern.riftDimensionPattern,
RiftBloodEffigies.heartsPattern,
SbPattern.wtfAreThoseLinesPattern,
SbPattern.timeLeftPattern,
SbPattern.darkAuctionCurrentItemPattern,
MiningAPI.coldPattern,
SbPattern.riftHotdogTitlePattern,
SbPattern.riftHotdogEatenPattern,
SbPattern.mineshaftNotStartedPattern,
SbPattern.queuePattern,
SbPattern.queueTierPattern,
SbPattern.queuePositionPattern,
SbPattern.queueWaitingForLeaderPattern,
SbPattern.fortunateFreezingBonusPattern,
SbPattern.riftAveikxPattern,
SbPattern.riftHayEatenPattern,
SbPattern.fossilDustPattern,
SbPattern.cluesPattern,
SbPattern.barryProtestorsQuestlinePattern,
SbPattern.barryProtestorsHandledPattern,
SbPattern.timeSlicedPattern,
SbPattern.bigDamagePattern,
SbPattern.carnivalPattern,
SbPattern.carnivalTasksPattern,
SbPattern.carnivalTokensPattern,
SbPattern.carnivalFruitsPattern,
SbPattern.carnivalScorePattern,
SbPattern.carnivalCatchStreakPattern,
SbPattern.carnivalAccuracyPattern,
SbPattern.carnivalKillsPattern,
) + SbPattern.brokenPatterns
).toMutableList()

private var remoteOnlyPatternsAdded = false

fun handleUnknownLines() {
Expand Down

0 comments on commit b2544ac

Please sign in to comment.