diff --git a/build.gradle.kts b/build.gradle.kts index ee5f11b..548627d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ plugins { kotlin("jvm") version "1.9.23" application - id("io.ktor.plugin") version "2.3.9" + id("io.ktor.plugin") version "2.3.10" } group = "net.taehui" @@ -26,10 +26,10 @@ implementation("com.lmax:disruptor:3.4.4") implementation("com.sun.mail:jakarta.mail:2.0.1") implementation("commons-codec:commons-codec:1.16.1") - implementation("commons-io:commons-io:2.16.0") + implementation("commons-io:commons-io:2.16.1") implementation("io.netty:netty-all:4.1.108.Final") implementation("jakarta.mail:jakarta.mail-api:2.1.3") - implementation("net.dv8tion:JDA:5.0.0-beta.21") + implementation("net.dv8tion:JDA:5.0.0-beta.22") implementation("org.apache.commons:commons-compress:1.26.1") implementation("org.apache.commons:commons-dbcp2:2.12.0") implementation("org.apache.commons:commons-lang3:3.14.0") diff --git a/msedgedriver.exe b/msedgedriver.exe index 82e36bd..e39d29d 100644 --- a/msedgedriver.exe +++ b/msedgedriver.exe Binary files differ diff --git a/src/main/kotlin/net/taehui/twilight/Component.kt b/src/main/kotlin/net/taehui/twilight/Component.kt index 0ddcba0..3d74009 100644 --- a/src/main/kotlin/net/taehui/twilight/Component.kt +++ b/src/main/kotlin/net/taehui/twilight/Component.kt @@ -129,6 +129,7 @@ const val HIGHEST_HIT_POINTS_MODE = 5 const val FAVOR_HIT_POINTS_MODE = 6 const val TEST_HIT_POINTS_MODE = 7 + const val YELL_HIT_POINTS_MODE = 8 const val DEFAULT_LONG_NOTE_MODE = 0 const val INPUT_LONG_NOTE_MODE = 2 diff --git a/src/main/kotlin/net/taehui/twilight/Logger.kt b/src/main/kotlin/net/taehui/twilight/Logger.kt index 71cd17e..7148e5f 100644 --- a/src/main/kotlin/net/taehui/twilight/Logger.kt +++ b/src/main/kotlin/net/taehui/twilight/Logger.kt @@ -18,7 +18,7 @@ return CompletableFuture.supplyAsync { try { onHandle() - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) throw e } @@ -29,7 +29,7 @@ return CompletableFuture.runAsync { try { onHandle() - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) throw e } diff --git a/src/main/kotlin/net/taehui/twilight/Utility.kt b/src/main/kotlin/net/taehui/twilight/Utility.kt index 45e48dd..0374833 100644 --- a/src/main/kotlin/net/taehui/twilight/Utility.kt +++ b/src/main/kotlin/net/taehui/twilight/Utility.kt @@ -117,7 +117,7 @@ ): Boolean { return autoMode == Component.DEFAULT_AUTO_MODE && (judgmentMode == Component.DEFAULT_JUDGMENT_MODE || judgmentMode == Component.HIGHER_JUDGMENT_MODE || judgmentMode == Component.HIGHEST_JUDGMENT_MODE) && - (hitPointsMode == Component.DEFAULT_HIT_POINTS_MODE || hitPointsMode == Component.HIGHER_HIT_POINTS_MODE || hitPointsMode == Component.HIGHEST_HIT_POINTS_MODE || hitPointsMode == Component.FAILED_HIT_POINTS_MODE) && + (hitPointsMode == Component.DEFAULT_HIT_POINTS_MODE || hitPointsMode == Component.HIGHER_HIT_POINTS_MODE || hitPointsMode == Component.HIGHEST_HIT_POINTS_MODE || hitPointsMode == Component.FAILED_HIT_POINTS_MODE|| hitPointsMode == Component.YELL_HIT_POINTS_MODE) && longNoteMode == Component.DEFAULT_LONG_NOTE_MODE && inputFavorMode == Component.DEFAULT_INPUT_FAVOR_MODE && noteModifyMode == Component.DEFAULT_NOTE_MODIFY_MODE && diff --git a/src/main/kotlin/net/taehui/twilight/system/AbilitySystem.kt b/src/main/kotlin/net/taehui/twilight/system/AbilitySystem.kt index 88c61a8..ff50aa3 100644 --- a/src/main/kotlin/net/taehui/twilight/system/AbilitySystem.kt +++ b/src/main/kotlin/net/taehui/twilight/system/AbilitySystem.kt @@ -197,7 +197,7 @@ try { DB.learnAbility() logInfo("Learned Ability") - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } }.thenAccept { diff --git a/src/main/kotlin/net/taehui/twilight/system/DB.kt b/src/main/kotlin/net/taehui/twilight/system/DB.kt index 4f624de..95f77d4 100644 --- a/src/main/kotlin/net/taehui/twilight/system/DB.kt +++ b/src/main/kotlin/net/taehui/twilight/system/DB.kt @@ -533,7 +533,7 @@ logger.logInfo("PMSed ${dbStatement.executeUpdate()} Comments") } it.commit() - } catch (e: Throwable) { + } catch (e: Exception) { it.rollback() } } @@ -633,7 +633,7 @@ } it.commit() - } catch (e: Throwable) { + } catch (e: Exception) { it.rollback() } } @@ -753,7 +753,7 @@ } } } - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } futureLearnCommentsStatus.incrementAndGet() @@ -2024,7 +2024,7 @@ dbStatement.execute() } it.commit() - } catch (e: Throwable) { + } catch (e: Exception) { it.rollback() } } diff --git a/src/main/kotlin/net/taehui/twilight/system/IO.kt b/src/main/kotlin/net/taehui/twilight/system/IO.kt index aa621f9..27995fa 100644 --- a/src/main/kotlin/net/taehui/twilight/system/IO.kt +++ b/src/main/kotlin/net/taehui/twilight/system/IO.kt @@ -300,7 +300,7 @@ it ) } - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } finally { futureLearnNotesStatus.incrementAndGet() @@ -516,7 +516,7 @@ } } } catch (_: UserInterruptException) { - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } } diff --git a/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt b/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt index 7e4af26..7daa9d4 100644 --- a/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt +++ b/src/main/kotlin/net/taehui/twilight/system/PlatformSystem.kt @@ -123,7 +123,7 @@ doCallPlatformAvatars() qwilightPlatform?.audioManager?.openAudioConnection(qwilightPlatform?.getVoiceChannelById(platformClient.siteAudio)) - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } } else { @@ -245,7 +245,7 @@ ) } }?.queue() - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } } diff --git a/src/main/kotlin/net/taehui/twilight/system/TVSystem.kt b/src/main/kotlin/net/taehui/twilight/system/TVSystem.kt index 782e1a6..328b362 100644 --- a/src/main/kotlin/net/taehui/twilight/system/TVSystem.kt +++ b/src/main/kotlin/net/taehui/twilight/system/TVSystem.kt @@ -68,33 +68,27 @@ ) }.toSet() - it.get("https://chzzk.naver.com/search?query=Qwilight") - + it.get("https://chzzk.naver.com/category/GAME/Qwilight") val test1 = - By.cssSelector("#layout-body > div > section > section") + By.cssSelector("#layout-body > div > section > div > ul > li > div > div > div:nth-child(2)") val elements1 = try { WebDriverWait( it, Duration.ofSeconds(1) ).until(ExpectedConditions.visibilityOfAllElementsLocatedBy(test1)) - it.findElements(test1).filter { - it.findElement(By.cssSelector("strong")).text == "라이브" - }.map { - it.findElements(By.cssSelector("div > ul > li")) - } + it.findElements(test1) } catch (e: TimeoutException) { emptyList() - }.flatten().map { - val titleElement = it.findElement(By.cssSelector("div > div > div > a")) + }.map { + val titleElement = it.findElement(By.cssSelector("a")) TVItem( titleElement.getAttribute("href"), titleElement.text.split("\n")[0], - it.findElement(By.cssSelector("div > div > div > div")).text.split("\n")[0] + it.findElement(By.cssSelector("div > a > span > span")).text ) }.toSet() val elements = elements0.plus(elements1) - elements.subtract(lastElements).filter { pendingElements.remove(it) == null }.forEach { @@ -113,7 +107,7 @@ lastElements = elements } }, 0L, 1L, TimeUnit.MINUTES) - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } } else { diff --git a/src/main/kotlin/net/taehui/twilight/system/WitSystem.kt b/src/main/kotlin/net/taehui/twilight/system/WitSystem.kt index 59d4663..37155be 100644 --- a/src/main/kotlin/net/taehui/twilight/system/WitSystem.kt +++ b/src/main/kotlin/net/taehui/twilight/system/WitSystem.kt @@ -40,7 +40,7 @@ if (!date.isBefore(it.first)) { try { it.second(date)() - } catch (e: Throwable) { + } catch (e: Exception) { logFault(e) } witValues.remove(it)