Мелкие правки, добавление ещё отладки.
This commit is contained in:
parent
a980c33437
commit
be9a394c7f
@ -9,6 +9,10 @@ import main.vp_server_integration.Vp_server_integration.Companion.LOGGER
|
||||
class TotalBalanceModules {
|
||||
companion object {
|
||||
fun getEssentialsBalance(): Float {
|
||||
LOGGER.info("Calculating dynamic rate using baltop")
|
||||
// Force update balance top and delay to avoid empty string
|
||||
CommandCapture.execute("baltop force")
|
||||
Thread.sleep(300)
|
||||
val output = CommandCapture.execute("baltop")
|
||||
LOGGER.info("Balance top command output: $output")
|
||||
|
||||
|
||||
@ -306,8 +306,6 @@ invoice_timeout_seconds=$DEFAULT_INVOICE_TIMEOUT_SECONDS
|
||||
*/
|
||||
private fun calculateDynamicRate(): Double {
|
||||
return if (COURSE_DYNAMIC_COMMAND == "baltop force") {
|
||||
LOGGER.info("Calculating dynamic rate using baltop - Step 4.1")
|
||||
CommandCapture.execute("baltop force")
|
||||
val globalBalance = TotalBalanceModules.getEssentialsBalance()
|
||||
LOGGER.info("Global balance: $globalBalance")
|
||||
|
||||
@ -418,7 +416,7 @@ invoice_timeout_seconds=$DEFAULT_INVOICE_TIMEOUT_SECONDS
|
||||
*/
|
||||
private fun sendPaymentPrompt(sender: Player, amount: Double, amountLC: Double, invoiceId: String?) {
|
||||
val colored = ChatColor.translateAlternateColorCodes('&',
|
||||
"${PREFIX}Нажмите здесь, чтобы конвертировать &6$amount VPC &3d &6${String.format("%.4f", amountLC)}")
|
||||
"${PREFIX}Нажмите здесь, чтобы конвертировать &6$amount VPC &3в &6${String.format("%.4f", amountLC)}")
|
||||
val message = TextComponent(colored)
|
||||
message.clickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, "/vpc pay $USERNAME $amount $invoiceId")
|
||||
message.hoverEvent = HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||
@ -629,6 +627,7 @@ invoice_timeout_seconds=$DEFAULT_INVOICE_TIMEOUT_SECONDS
|
||||
val entry = authIterator.next()
|
||||
val invoiceId = entry.value
|
||||
val creationTime = INVOICE_CREATION_TIMES[invoiceId] ?: continue
|
||||
LOGGER.info("invoice ( $invoiceId ) left to live: ${timeoutMillis - (currentTime - creationTime)}")
|
||||
|
||||
if (currentTime - creationTime > timeoutMillis) {
|
||||
LOGGER.info("Deleting expired auth invoice: $invoiceId")
|
||||
@ -659,6 +658,7 @@ invoice_timeout_seconds=$DEFAULT_INVOICE_TIMEOUT_SECONDS
|
||||
val entry = paymentIterator.next()
|
||||
val invoiceId = entry.value
|
||||
val creationTime = INVOICE_CREATION_TIMES[invoiceId] ?: continue
|
||||
LOGGER.info("invoice ( $invoiceId ) left to live: ${timeoutMillis - (currentTime - creationTime)}")
|
||||
|
||||
if (currentTime - creationTime > timeoutMillis) {
|
||||
LOGGER.info("Deleting expired payment invoice: $invoiceId")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user