Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
准备v2.7-RC-dev4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nambers committed Aug 5, 2021
1 parent bd8936c commit 5b560d6
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## v2.7-RC-dev4

+ 支持把plugin部分发布到maven, 以增加mcl支持
+ mirai依赖更新到v2.7-RC-dev-3
+ loader支持(-g)参数创建(覆盖)config.json模板
+ 修复匿名聊天造成的找不到群成员造成的异常退出

> 该版本主要为了发布到maven,较于上一版没什么改动
## v2.7-RC-dev3

+ 优化cmake组合方式(所以推荐一并更新全部的Cmake文件)
Expand Down
2 changes: 1 addition & 1 deletion cpp/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//

// MiraiCP依赖文件(只需要引入这一个)
#include "miraiCP.hpp"
#include <miraiCP.hpp>
using namespace std;
using namespace MiraiCP;
// 多线程示例
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/miraiCP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace MiraiCP {
using json = nlohmann::json;
// 开始声明MiraiCP常量声明代码
/// MiraiCP当前版本
const std::string MiraiCPVersion = "v2.7-RC-dev3";
const std::string MiraiCPVersion = "v2.7-RC-dev4";

/// @brief 插件信息
class PluginConfig{
Expand Down
2 changes: 1 addition & 1 deletion kotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlinVersion = "1.5.10"
miraiVersion = "2.7-RC-dev-3"
miraiCPVersion = "2.7-RC-dev3"
miraiCPVersion = "2.7-RC-dev4"

[libraries]
mirai-core-api = { module = "net.mamoe:mirai-core-api", version.ref = "miraiVersion" }
Expand Down
30 changes: 27 additions & 3 deletions kotlin/loader/src/main/kotlin/KotlinMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import tech.eritquearcus.miraicp.shared.PublicShared.logger
import tech.eritquearcus.miraicp.shared.PublicShared.now_tag
import tech.eritquearcus.miraicp.shared.PublicShared.onEnable
import java.io.File
import kotlin.system.exitProcess

private fun String.decodeHex(): ByteArray {
check(length % 2 == 0) { "Must have an even length" }
Expand Down Expand Up @@ -153,15 +154,36 @@ fun main(args: Array<String>){
var f = File(path)
when(args.size) {
1 -> {
if(args[0] == "-g"){
File("config.json").writeText(
"""
{
"accounts": [{
"id": qqid,
"passwords": "passwords密码",
"protocol": "pad",
"heatBeat": "STAT_HB",
"md5": false,
"autoLogin": false
}],
"cppPath": "dll路径"
}
""".trimIndent()
)
println("生成成功")
exitProcess(0)
}
f = File(args[0])
if (!f.exists() || !f.isFile || !f.canRead()) {
println("配置文件路径(${f.absolutePath})读取错误,文件不存在/不是文件/不可读, 使用默认路径重试")
println("配置文件路径(${f.absolutePath})读取错误,文件不存在/不是文件/不可读, 使用默认路径(./config.json)重试")
f = File(path)
if (!f.exists() || !f.isFile || !f.canRead()) {
f = File(path)
if (!f.exists() || !f.isFile || !f.canRead()) {
println("默认配置文件路径(${f.absolutePath})读取错误,文件不存在/不是文件/不可读")
return
println("使用 -g 可以生成config.json模板(java -jar MiraiCP-loader-<version>.jar -g)")
exitProcess(1)
}
}
}
Expand All @@ -171,7 +193,9 @@ fun main(args: Array<String>){
f = File(path)
if (!f.exists() || !f.isFile || !f.canRead()) {
println("默认配置文件路径(${f.absolutePath})读取错误,文件不存在/不是文件/不可读")
return
println("使用 -g 可以生成config.json模板(java -jar MiraiCP-loader-<version>.jar -g)")
System.`in`.read()
exitProcess(1)
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions kotlin/loader/src/main/kotlin/console/Console.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ import net.mamoe.mirai.utils.PlatformLogger
import org.fusesource.jansi.Ansi
import org.jline.reader.LineReader
import org.jline.reader.LineReaderBuilder
import org.jline.reader.UserInterruptException
import org.jline.reader.impl.completer.NullCompleter
import org.jline.terminal.Terminal
import org.jline.terminal.TerminalBuilder
import org.jline.terminal.impl.AbstractWindowsTerminal
import tech.eritquearcus.miraicp.loader.KotlinMain
import tech.eritquearcus.miraicp.shared.PublicShared
import java.time.LocalDateTime
import kotlin.system.exitProcess

@OptIn(MiraiInternalApi::class)
object Console {
Expand Down Expand Up @@ -93,6 +95,8 @@ object Console {
} catch (e: CancellationException) {
PublicShared.logger.error(e)
return@launch
}catch(e: UserInterruptException){
exitProcess(1)
}
if (re.isEmpty() || re.isBlank()) continue
Command.parse(re)
Expand Down
2 changes: 1 addition & 1 deletion kotlin/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mavenCentralPublish {
publicationConfigurators.add {
groupId = "io.github.nambers"
artifactId = "MiraiCP-plugin"
// artifact("MiraiCP-plugin-2.7-RC-dev3.mirai.jar")
description = "C++ SDK of Mirai"
artifact(tasks["buildPlugin"])
this.pom {
name.set("MiraiCP-plugin")
Expand Down
2 changes: 1 addition & 1 deletion kotlin/plugin/src/main/kotlin/PluginMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object PluginMain : KotlinPlugin(
JvmPluginDescription(
id = "tech.eritquearcus.miraiCP",
name = "miraiCP",
version = "2.7-RC-dev3"
version = "2.7-RC-dev4"
){
author("Eritque arcus")
}
Expand Down
2 changes: 1 addition & 1 deletion kotlin/shared/src/main/kotlin/PublicShared.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object PublicShared {
lateinit var cpp: CPP_lib
val gson: Gson = Gson()
lateinit var logger: MiraiLogger
const val now_tag = "v2.7-RC-dev3"
const val now_tag = "v2.7-RC-dev4"
lateinit var dll_name: String
val logger4plugins: MutableMap<String, MiraiLogger> = mutableMapOf()

Expand Down

0 comments on commit 5b560d6

Please sign in to comment.