Skip to content

Commit

Permalink
fix: PlayerDataからchainvoteパラメータを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Mar 1, 2023
1 parent 7e75281 commit 759ed91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.github.unchama.seichiassist.subsystems.ranking.domain.{
Ranking,
RankingRecordWithPosition
}
import com.github.unchama.seichiassist.subsystems.vote.VoteAPI
import com.github.unchama.seichiassist.util.TypeConverter
import org.bukkit.Bukkit
import org.bukkit.ChatColor._
Expand All @@ -25,7 +26,8 @@ class PlayerStatsLoreGenerator(
playerData: PlayerData,
seichiRanking: Ranking[SeichiAmountData],
seichiAmountData: SeichiAmountData,
expBarVisibility: BreakCountBarVisibility
expBarVisibility: BreakCountBarVisibility,
voteAPI: VoteAPI[IO, Player]
) {
private val targetPlayer: Player = Bukkit.getPlayer(playerData.uuid)

Expand Down Expand Up @@ -167,11 +169,15 @@ class PlayerStatsLoreGenerator(
/**
* 連続投票日数の説明文.
*/
private def totalChainVoteDaysDescription(): List[String] =
if (playerData.ChainVote > 0)
List(s"$RESET${GRAY}連続投票日数:${playerData.ChainVote}")
private def totalChainVoteDaysDescription(): List[String] = {
val consecutiveVoteStreakDays =
voteAPI.currentConsecutiveVoteStreakDays(targetPlayer.getUniqueId).unsafeRunSync().value

if (consecutiveVoteStreakDays > 0)
List(s"$RESET${GRAY}連続投票日数:${consecutiveVoteStreakDays}")
else
Nil
}

/**
* Expバーの説明文.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class PlayerData(@Deprecated() val uuid: UUID, val name: String) {
var loginStatus: LoginStatus = LoginStatus(null)
// 期間限定ログイン用
var LimitedLoginCount = 0
var ChainVote = 0

// region スキル関連のデータ
val skillState: Ref[IO, PlayerSkillState] = Ref.unsafe(PlayerSkillState.initial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ object PlayerDataLoading {

playerData.lastcheckdate = sdf.format(cal.getTime)

playerData.ChainVote = rs.getInt("chainvote")

// 実績解除フラグのBitSet型への復元処理
// 初回nullエラー回避のための分岐
try {
Expand Down

0 comments on commit 759ed91

Please sign in to comment.