bug fix
This commit is contained in:
parent
42b584a123
commit
822b0a8208
|
|
@ -168,12 +168,16 @@ object InviteCodeCommands {
|
|||
|
||||
private fun CommandBuilder.CommandComponent.cmdRemove() = literal("remove") {
|
||||
execute<ConsoleCommandSender> { sender, _, arg ->
|
||||
val findings = InviteCode.find { InviteCodes.inviteCode eq arg }
|
||||
if (findings.empty()) {
|
||||
sender.sendMessage("§e| §7该邀请码不存在, 无需删除.")
|
||||
PluginScope.launch {
|
||||
transaction {
|
||||
val findings = InviteCode.find { InviteCodes.inviteCode eq arg }
|
||||
if (findings.empty()) {
|
||||
sender.sendMessage("§e| §7该邀请码不存在, 无需删除.")
|
||||
}
|
||||
findings.first().delete()
|
||||
sender.sendMessage("§a| §7成功删除该邀请码.")
|
||||
}
|
||||
}
|
||||
findings.first().delete()
|
||||
sender.sendMessage("§a| §7成功删除该邀请码.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,8 +185,10 @@ object InviteCodeCommands {
|
|||
execute<ConsoleCommandSender> { sender, _, _ ->
|
||||
PluginScope.launch {
|
||||
val codes = ArrayList<String>(2000)
|
||||
InviteCode.find { InviteCodes.uid eq null }.forEach {
|
||||
codes.add(it.inviteCode)
|
||||
transaction {
|
||||
InviteCode.find { InviteCodes.uid eq null }.forEach {
|
||||
codes.add(it.inviteCode)
|
||||
}
|
||||
}
|
||||
val result = codes.joinToString("\n")
|
||||
val output = File(getDataFolder(), "current.txt")
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
package cc.maxmc.invite.command
|
||||
|
||||
import cc.maxmc.invite.data.InviteCode
|
||||
import cc.maxmc.invite.data.InviteCodes
|
||||
import org.jetbrains.exposed.sql.SchemaUtils
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
|
||||
object DebugCommands {
|
||||
fun debug() {
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
taboolib.common.platform.function.console().sendMessage("§c| DEBUG 模式已开启!")
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
|
||||
taboolib.common.platform.command.command("idebug") {
|
||||
literal("clean") {
|
||||
execute<org.bukkit.entity.Player> { sender, _, _ ->
|
||||
transaction {
|
||||
SchemaUtils.drop(InviteCodes)
|
||||
SchemaUtils.create(InviteCodes)
|
||||
sender.sendMessage("§a| §7成功清空数据库")
|
||||
}
|
||||
}
|
||||
}
|
||||
literal("rename") {
|
||||
dynamic {
|
||||
execute<org.bukkit.entity.Player> { sender, _, arg ->
|
||||
transaction {
|
||||
InviteCode.find { InviteCodes.uid eq sender.uniqueId }.first().run {
|
||||
name = arg
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//package cc.maxmc.invite.command
|
||||
//
|
||||
//import cc.maxmc.invite.data.InviteCode
|
||||
//import cc.maxmc.invite.data.InviteCodes
|
||||
//import org.jetbrains.exposed.sql.SchemaUtils
|
||||
//import org.jetbrains.exposed.sql.transactions.transaction
|
||||
//
|
||||
//object DebugCommands {
|
||||
// fun debug() {
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c| DEBUG 模式已开启!")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
// taboolib.common.platform.function.console().sendMessage("§c|")
|
||||
//
|
||||
// taboolib.common.platform.command.command("idebug") {
|
||||
// literal("clean") {
|
||||
// execute<org.bukkit.entity.Player> { sender, _, _ ->
|
||||
// transaction {
|
||||
// SchemaUtils.drop(InviteCodes)
|
||||
// SchemaUtils.create(InviteCodes)
|
||||
// sender.sendMessage("§a| §7成功清空数据库")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// literal("rename") {
|
||||
// dynamic {
|
||||
// execute<org.bukkit.entity.Player> { sender, _, arg ->
|
||||
// transaction {
|
||||
// InviteCode.find { InviteCodes.uid eq sender.uniqueId }.first().run {
|
||||
// name = arg
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Loading…
Reference in New Issue