mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 17:20:11 +08:00
Fix missing file
This commit is contained in:
parent
b240370f20
commit
9c15287305
@ -163,12 +163,11 @@ internal class GroupImpl(
|
|||||||
Highway.RequestDataTrans(
|
Highway.RequestDataTrans(
|
||||||
uin = bot.uin,
|
uin = bot.uin,
|
||||||
command = "PicUp.DataUp",
|
command = "PicUp.DataUp",
|
||||||
buildVer = bot.client.buildVer,
|
sequenceId = bot.client.nextHighwayDataTransSequenceId(),
|
||||||
uKey = response.uKey,
|
uKey = response.uKey,
|
||||||
data = image.input,
|
data = image.input,
|
||||||
dataSize = image.inputSize.toInt(),
|
dataSize = image.inputSize.toInt(),
|
||||||
md5 = image.md5,
|
md5 = image.md5
|
||||||
sequenceId = bot.client.nextHighwayDataTransSequenceId()
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
// }
|
// }
|
||||||
@ -182,6 +181,7 @@ internal class GroupImpl(
|
|||||||
println(proto.contentToString())
|
println(proto.contentToString())
|
||||||
println(readBytes(bodyLength).toUHexString())
|
println(readBytes(bodyLength).toUHexString())
|
||||||
}
|
}
|
||||||
|
socket.close()
|
||||||
val resourceId = image.calculateImageResourceId()
|
val resourceId = image.calculateImageResourceId()
|
||||||
return NotOnlineImageFromFile(
|
return NotOnlineImageFromFile(
|
||||||
resourceId = resourceId,
|
resourceId = resourceId,
|
||||||
|
@ -67,13 +67,12 @@ object Highway {
|
|||||||
uin: Long,
|
uin: Long,
|
||||||
command: String,
|
command: String,
|
||||||
sequenceId: Int,
|
sequenceId: Int,
|
||||||
buildVer: String,
|
|
||||||
appId: Int = 537062845,
|
appId: Int = 537062845,
|
||||||
dataFlag: Int = 4096,
|
dataFlag: Int = 4096,
|
||||||
commandId: Int = 2,
|
commandId: Int = 2,
|
||||||
localId: Int = 2052,
|
localId: Int = 2052,
|
||||||
|
|
||||||
uKey: ByteArray,
|
uKey: ByteArray,
|
||||||
|
|
||||||
data: Input,
|
data: Input,
|
||||||
dataSize: Int,
|
dataSize: Int,
|
||||||
md5: ByteArray
|
md5: ByteArray
|
||||||
@ -87,7 +86,6 @@ object Highway {
|
|||||||
appid = appId,
|
appid = appId,
|
||||||
dataflag = dataFlag,
|
dataflag = dataFlag,
|
||||||
commandId = commandId,
|
commandId = commandId,
|
||||||
buildVer = buildVer,
|
|
||||||
localeId = localId
|
localeId = localId
|
||||||
)
|
)
|
||||||
val segHead = CSDataHighwayHead.SegHead(
|
val segHead = CSDataHighwayHead.SegHead(
|
||||||
@ -97,6 +95,7 @@ object Highway {
|
|||||||
md5 = md5,
|
md5 = md5,
|
||||||
fileMd5 = md5
|
fileMd5 = md5
|
||||||
)
|
)
|
||||||
|
//println(data.readBytes().toUHexString())
|
||||||
return Codec.buildC2SData(dataHighwayHead, segHead, EMPTY_BYTE_ARRAY, null, data, dataSize)
|
return Codec.buildC2SData(dataHighwayHead, segHead, EMPTY_BYTE_ARRAY, null, data, dataSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,9 +120,9 @@ object Highway {
|
|||||||
writeInt(head.size)
|
writeInt(head.size)
|
||||||
writeInt(bodySize)
|
writeInt(bodySize)
|
||||||
writeFully(head)
|
writeFully(head)
|
||||||
body.copyTo(this)
|
check(body.copyTo(this).toInt() == bodySize) { "bad body size" }
|
||||||
writeByte(41)
|
writeByte(41)
|
||||||
}
|
}.also { println(it.remaining) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,6 +5,7 @@ import kotlinx.io.pool.useInstance
|
|||||||
import net.mamoe.mirai.data.Packet
|
import net.mamoe.mirai.data.Packet
|
||||||
import net.mamoe.mirai.event.Subscribable
|
import net.mamoe.mirai.event.Subscribable
|
||||||
import net.mamoe.mirai.qqandroid.QQAndroidBot
|
import net.mamoe.mirai.qqandroid.QQAndroidBot
|
||||||
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.TroopManagement
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImageUpPacket
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImageUpPacket
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package net.mamoe.mirai.qqandroid.utils
|
||||||
|
|
||||||
|
|
||||||
|
fun Int.toIpV4AddressString(): String {
|
||||||
|
@Suppress("NAME_SHADOWING")
|
||||||
|
var var0 = this.toLong() and 0xFFFFFFFF
|
||||||
|
return buildString {
|
||||||
|
for (var2 in 3 downTo 0) {
|
||||||
|
append(255L and var0 % 256L)
|
||||||
|
var0 /= 256L
|
||||||
|
if (var2 != 0) {
|
||||||
|
append('.')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -34,7 +34,8 @@ fun File.toExternalImage(): ExternalImage {
|
|||||||
md5 = this.inputStream().use { it.md5() },
|
md5 = this.inputStream().use { it.md5() },
|
||||||
imageFormat = this.nameWithoutExtension,
|
imageFormat = this.nameWithoutExtension,
|
||||||
input = this.inputStream().asInput(IoBuffer.Pool),
|
input = this.inputStream().asInput(IoBuffer.Pool),
|
||||||
inputSize = this.length()
|
inputSize = this.length(),
|
||||||
|
filename = this.name
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user