Commit 26b3ac07 authored by Him188's avatar Him188

Unmodifiable IP list

parent 6d58cb18
...@@ -423,6 +423,7 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler { ...@@ -423,6 +423,7 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler {
} }
} }
@Suppress("MemberVisibilityCanBePrivate")
suspend fun changeOnlineStatus(status: ClientLoginStatus) { suspend fun changeOnlineStatus(status: ClientLoginStatus) {
socket.sendPacket(ClientChangeOnlineStatusPacket(bot.account.qqNumber, sessionKey, status)) socket.sendPacket(ClientChangeOnlineStatusPacket(bot.account.qqNumber, sessionKey, status))
} }
......
...@@ -14,10 +14,9 @@ import java.util.stream.Collectors ...@@ -14,10 +14,9 @@ import java.util.stream.Collectors
* @author Him188moe * @author Him188moe
*/ */
object TIMProtocol { object TIMProtocol {
val SERVER_IP: List<String> = object : ArrayList<String>() { val SERVER_IP: List<String> by lazy {
init {
//add("183.60.56.29") //add("183.60.56.29")
val list = mutableListOf<String>()
arrayOf( arrayOf(
"sz3.tencent.com", "sz3.tencent.com",
"sz4.tencent.com", "sz4.tencent.com",
...@@ -26,11 +25,10 @@ object TIMProtocol { ...@@ -26,11 +25,10 @@ object TIMProtocol {
"sz8.tencent.com", "sz8.tencent.com",
"sz9.tencent.com", "sz9.tencent.com",
"sz2.tencent.com" "sz2.tencent.com"
).forEach { this.add(InetAddress.getByName(it).hostAddress) } ).forEach { list.add(InetAddress.getByName(it).hostAddress) }
list.toList()
} }
}
get() = Collections.unmodifiableList(field)
const val head = "02" const val head = "02"
const val ver = "37 13" const val ver = "37 13"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment