Skip to content

Commit

Permalink
cleanup code and add jvmName annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Jan 4, 2025
1 parent 9f74ff2 commit 8079c8a
Show file tree
Hide file tree
Showing 22 changed files with 20 additions and 85 deletions.
3 changes: 0 additions & 3 deletions .space.kts

This file was deleted.

1 change: 0 additions & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ repositories {
}

dependencies {
api(libs.gson)
api(libs.java.websocket)
api(rootProject)
}
27 changes: 0 additions & 27 deletions api/src/main/kotlin/cn/rtast/kwsify/Base64.kt

This file was deleted.

1 change: 1 addition & 0 deletions api/src/main/kotlin/cn/rtast/kwsify/IOperation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/11/30
*/

@file:JvmName("IOperation")

package cn.rtast.kwsify

Expand Down
1 change: 1 addition & 0 deletions api/src/main/kotlin/cn/rtast/kwsify/Kwsify.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/11/30
*/

@file:JvmName("Kwsify")

package cn.rtast.kwsify

Expand Down
1 change: 1 addition & 0 deletions api/src/main/kotlin/cn/rtast/kwsify/Subscriber.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/11/30
*/

@file:JvmName("Subscriber")

package cn.rtast.kwsify

Expand Down
16 changes: 0 additions & 16 deletions src/main/kotlin/cn/rtast/kwsify/Const.kt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/kotlin/cn/rtast/kwsify/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package cn.rtast.kwsify

import cn.rtast.kwsify.util.WebsocketServer
import cn.rtast.kwsify.util.KWsifyServer
import kotlinx.cli.ArgParser
import kotlinx.cli.ArgType
import kotlinx.cli.required
Expand All @@ -16,5 +16,5 @@ fun main(args: Array<String>) {
val parser = ArgParser("kwsify-cli")
val port by parser.option(ArgType.Int, shortName = "p", description = "Port number").required()
parser.parse(args)
WebsocketServer(port).start()
KWsifyServer(port).start()
}
1 change: 1 addition & 0 deletions src/main/kotlin/cn/rtast/kwsify/entity/ConnectionState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/12/1
*/

@file:JvmName("ConnectionState")

package cn.rtast.kwsify.entity

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/cn/rtast/kwsify/entity/HeartbeatPacket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2025/1/4
*/

@file:JvmName("HeartbeatPacket")

package cn.rtast.kwsify.entity

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/cn/rtast/kwsify/entity/OPCodePacket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2025/1/3
*/

@file:JvmName("OPCodePacket")

package cn.rtast.kwsify.entity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2025/1/3
*/

@file:JvmName("OutboundMessageBytesPacket")

package cn.rtast.kwsify.entity

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/cn/rtast/kwsify/entity/PublishPacket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/12/1
*/

@file:JvmName("PublishPacket")

package cn.rtast.kwsify.entity

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/cn/rtast/kwsify/entity/SubscribePacket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/12/1
*/

@file:JvmName("SubscribePacket")

package cn.rtast.kwsify.entity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/12/1
*/

@file:JvmName("UnsubscribePacket")

package cn.rtast.kwsify.entity

Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/cn/rtast/kwsify/enums/OPCode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Date: 2024/11/30
*/

@file:JvmName("OPCode")

package cn.rtast.kwsify.enums

object OPCode {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/cn/rtast/kwsify/util/Binary.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ package cn.rtast.kwsify.util

import java.nio.ByteBuffer

fun ByteBuffer.putBoolean(value: Boolean) {
internal fun ByteBuffer.putBoolean(value: Boolean) {
put(if (value) 1.toByte() else 0.toByte())
}

fun ByteBuffer.getBoolean(): Boolean {
internal fun ByteBuffer.getBoolean(): Boolean {
return get() == 1.toByte()
}
25 changes: 0 additions & 25 deletions src/main/kotlin/cn/rtast/kwsify/util/Json.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Date: 2024/11/30
*/

@file:JvmName("KWsifyServer")

package cn.rtast.kwsify.util

Expand All @@ -16,7 +17,7 @@ import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.util.*

class WebsocketServer(private val port: Int) : WebSocketServer(InetSocketAddress(port)) {
class KWsifyServer(private val port: Int) : WebSocketServer(InetSocketAddress(port)) {

private val connectionState = mutableListOf<ConnectionState>()

Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/conf.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/test/kotlin/test/TestServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

package test

import cn.rtast.kwsify.util.WebsocketServer
import cn.rtast.kwsify.util.KWsifyServer

fun main() {
WebsocketServer(8080).start()
KWsifyServer(8080).start()
}
Empty file removed src/test/resources/.gitkeep
Empty file.

0 comments on commit 8079c8a

Please sign in to comment.