mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-24 14:30:09 +08:00
Updated sth
This commit is contained in:
parent
305a7a6f73
commit
70dc6cf63c
@ -9,6 +9,10 @@ fun <E : AsyncEvent> E.broadcastAsync(callback: Consumer<E>): CompletableFuture<
|
||||
return MiraiEventManager.getInstance().broadcastEventAsync(this, callback)
|
||||
}
|
||||
|
||||
fun <E : AsyncEvent> E.broadcastAsync(callback: Runnable): CompletableFuture<out AsyncEvent> {
|
||||
fun <E : AsyncEvent> E.broadcastAsync(callback: Runnable): CompletableFuture<E> {
|
||||
return MiraiEventManager.getInstance().broadcastEventAsync(this, callback)
|
||||
}
|
||||
|
||||
fun <E : AsyncEvent> E.broadcastAsyncSmart(): CompletableFuture<E> {
|
||||
return MiraiEventManager.getInstance().broadcastEventAsync(this)
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
package net.mamoe.mirai.event
|
||||
|
||||
fun <E : MiraiEvent> E.broadcast(): E {
|
||||
fun <E : MiraiEvent> E.broadcastSmart(): E {
|
||||
MiraiEventManager.getInstance().broadcastEvent(this as MiraiEvent)
|
||||
return this
|
||||
}
|
@ -4,6 +4,8 @@ import net.mamoe.mirai.message.FaceID;
|
||||
import net.mamoe.mirai.message.Message;
|
||||
|
||||
/**
|
||||
* QQ 自带表情
|
||||
*
|
||||
* @author Him188moe
|
||||
*/
|
||||
public final class Face extends Message {
|
||||
|
@ -51,8 +51,6 @@ object Protocol {
|
||||
const val key00BA = "C1 9C B8 C8 7B 8C 81 BA 9E 9E 7A 89 E1 7A EC 94"
|
||||
const val key00BAFix = "69 20 D1 14 74 F5 B3 93 E4 D5 02 B3 71 1A CD 2A"
|
||||
|
||||
const val encryptKey = "“BA 42 FF 01 CF B4 FF D2 12 F0 6E A7 1B 7C B3 08”"
|
||||
|
||||
/**
|
||||
* 0836_622_fix2
|
||||
*/
|
||||
|
@ -8,7 +8,9 @@ import java.lang.reflect.Field
|
||||
import java.util.*
|
||||
import java.util.zip.CRC32
|
||||
|
||||
@JvmSynthetic
|
||||
fun ByteArray.toHexString(): String = toHexString(" ")
|
||||
|
||||
fun ByteArray.toHexString(separator: String = " "): String = this.joinToString(separator) {
|
||||
var ret = it.toString(16).toUpperCase()
|
||||
if (ret.length == 1) {
|
||||
@ -20,12 +22,12 @@ fun ByteArray.toHexString(separator: String = " "): String = this.joinToString(s
|
||||
@ExperimentalUnsignedTypes
|
||||
fun ByteArray.toUHexString(separator: String = " "): String = this.toUByteArray().toUHexString(separator)
|
||||
|
||||
fun ByteArray.__toUHexString(separator: String = " "): String = this.toUByteArray().toUHexString(separator)
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
@JvmSynthetic
|
||||
fun ByteArray.toUHexString(): String = this.toUByteArray().toUHexString()
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
@JvmSynthetic
|
||||
fun UByteArray.toUHexString(separator: String = " "): String {
|
||||
return this.joinToString(separator) {
|
||||
var ret = it.toString(16).toUpperCase()
|
||||
@ -37,6 +39,7 @@ fun UByteArray.toUHexString(separator: String = " "): String {
|
||||
}
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
@JvmSynthetic
|
||||
fun UByteArray.toUHexString(): String = this.toUHexString(" ")
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
@ -75,6 +78,7 @@ fun getRandomByteArray(length: Int): ByteArray {
|
||||
return bytes.toByteArray()
|
||||
}
|
||||
|
||||
@JvmSynthetic
|
||||
operator fun File.plus(child: String): File = File(this, child)
|
||||
|
||||
private const val GTK_BASE_VALUE: Int = 5381
|
||||
|
@ -50,7 +50,7 @@ public class HexComparator {
|
||||
|
||||
@SuppressWarnings({"unused", "NonAsciiCharacters"})
|
||||
private static class TestConsts {
|
||||
private static final String 牛逼 = UtilsKt.__toUHexString("牛逼".getBytes(), " ");
|
||||
private static final String 牛逼 = UtilsKt.toUHexString("牛逼".getBytes(), " ");
|
||||
private static final String _1994701021 = ClientPacketKt.toHexString(1994701021, " ");
|
||||
private static final String _1040400290 = ClientPacketKt.toHexString(1040400290, " ");
|
||||
private static final String _580266363 = ClientPacketKt.toHexString(580266363, " ");
|
||||
|
Loading…
Reference in New Issue
Block a user