Skip to content

Commit

Permalink
release 1.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Apr 4, 2022
1 parent b84a2f4 commit e952e14
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 150 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@

* 接入 `Mirai Console Terminal` 实时查看终端输出
* 接入 `Mirai Console` 执行命令,监控运行状态
* 接入 `Mirai Console Loader` 进行包管理 - 请安装 [MCL Addon](https://github.com/iTXTech/mcl-addon)

即将到来:

* 接入 `Mirai Console Loader` 进行包管理
* 接入 `Mirai Web Panel` 使用 `WebUI` 管理 `Mirai Console`

~~请注意,`iTXTech Soyuz`尚在`pre-alpha`阶段,可能存在各种`bug`和安全性问题,请小心使用,如遇问题请立即前往`issue`发送反馈。~~

## `/soyuz` 命令

```
/soyuz disconnect <connectionId> # 断开指定连接
/soyuz disconnectAll # 断开所有连接
/soyuz list # 列出所有连接
/soyuz token [token] # 设置或重新生成 Access Token
/soyuz disconnect <连接ID> # 断开指定连接
/soyuz disconnectAll # 断开所有连接
/soyuz list # 列出所有连接
/soyuz token [token] # 设置或重新生成 Access Token
```

## 安装
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "org.itxtech"
version = "1.0.0"
version = "1.0.0-beta.1"
description = "The Websocket API Server for Mirai Console"

kotlin {
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/org/itxtech/soyuz/command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import net.mamoe.mirai.console.command.CommandSender
import net.mamoe.mirai.console.command.CompositeCommand
import net.mamoe.mirai.console.util.ConsoleExperimentalApi
import java.text.StringCharacterIterator
import kotlin.math.abs

@OptIn(ConsoleExperimentalApi::class)
object SoyuzCommand : CompositeCommand(
Expand Down Expand Up @@ -75,7 +76,7 @@ object SoyuzCommand : CompositeCommand(
}

private fun humanReadableSize(bytes: Int): String {
val absB = if (bytes == Int.MIN_VALUE) Int.MAX_VALUE else Math.abs(bytes)
val absB = if (bytes == Int.MIN_VALUE) Int.MAX_VALUE else abs(bytes)
if (absB < 1024) {
return "$bytes B"
}
Expand Down
137 changes: 0 additions & 137 deletions src/main/kotlin/org/itxtech/soyuz/handler/builtin/mcl.kt

This file was deleted.

7 changes: 4 additions & 3 deletions src/main/kotlin/org/itxtech/soyuz/handler/handler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import org.itxtech.soyuz.BaseMessage
import org.itxtech.soyuz.ReplyMessage
import org.itxtech.soyuz.Soyuz
import org.itxtech.soyuz.SoyuzWebSocketSession
import org.itxtech.soyuz.handler.builtin.*
import org.itxtech.soyuz.handler.builtin.CommandHandler
import org.itxtech.soyuz.handler.builtin.ListPluginHandler
import org.itxtech.soyuz.handler.builtin.MiraiInfoHandler
import org.itxtech.soyuz.handler.builtin.PushLogHandler

class HandlerAlreadyExistsException(msg: String) : Exception(msg)
class InvalidSoyuzMessageException(msg: String) : Exception(msg)
Expand All @@ -42,8 +45,6 @@ object HandlerManager {
register(MiraiInfoHandler())
register(CommandHandler())
register(PushLogHandler())

initializeMclHandler()
}

fun register(handler: SoyuzHandler): HandlerManager {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/itxtech/soyuz/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object Soyuz : KotlinPlugin(
JvmPluginDescription(
id = "org.itxtech.soyuz",
name = "Soyuz",
version = "1.0.0"
version = "1.0.0-beta.1"
) {
author("PeratX")
info("The Websocket API Server for Mirai Console")
Expand Down

0 comments on commit e952e14

Please sign in to comment.