mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-06-02 17:39:16 +08:00
修复 未开盘就能开始的问题
修复 无人下注就能开始的问题
This commit is contained in:
parent
7398e175bf
commit
a4f16a42a3
@ -59,6 +59,9 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
private data class Horse(val type: Int, var position: Int = 0)
|
private data class Horse(val type: Int, var position: Int = 0)
|
||||||
private data class Rank(val horses: List<Horse>, val job: Job)
|
private data class Rank(val horses: List<Horse>, val job: Job)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖池
|
||||||
|
*/
|
||||||
private val pools = mutableMapOf<Long, MutableList<Bet>>()
|
private val pools = mutableMapOf<Long, MutableList<Bet>>()
|
||||||
private const val horseCount = 5 //多少个马
|
private const val horseCount = 5 //多少个马
|
||||||
private const val lapLength = 20 //赛道长度
|
private const val lapLength = 20 //赛道长度
|
||||||
@ -87,6 +90,11 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
return sb.toString()
|
return sb.toString()
|
||||||
}
|
}
|
||||||
private suspend fun startRank(subject: Group) {
|
private suspend fun startRank(subject: Group) {
|
||||||
|
val t = pools[subject.id] ?: return
|
||||||
|
if (t.size == 0) {
|
||||||
|
subject.sendMessage("无人下注,无法开始哦")
|
||||||
|
return
|
||||||
|
}
|
||||||
if (ranks[subject.id] != null) return
|
if (ranks[subject.id] != null) return
|
||||||
logger.info("开始赛马")
|
logger.info("开始赛马")
|
||||||
subject.sendMessage("赛马开始辣,走过路过不要错过")
|
subject.sendMessage("赛马开始辣,走过路过不要错过")
|
||||||
|
Loading…
Reference in New Issue
Block a user