Update pom.xml

This commit is contained in:
Him188 2019-09-29 23:26:19 +08:00
parent f2ddcb7ec8
commit 4ca1884831
6 changed files with 30 additions and 61 deletions

View File

@ -1,6 +1,5 @@
package net.mamoe.mirai; package net.mamoe.mirai;
import java.io.PrintStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -33,10 +32,6 @@ public class MiraiAPI {
MiraiMain.main(args); MiraiMain.main(args);
} }
public static void setLogger(PrintStream stream){
MiraiServer.getInstance().getLogger().setOutPutStream(stream);
}
public static String getMiraiVersion(){ public static String getMiraiVersion(){
return MiraiServer.MIRAI_VERSION; return MiraiServer.MIRAI_VERSION;
} }

View File

@ -26,19 +26,6 @@
<systemPath>${project.basedir}/lib/jpcap.jar</systemPath> <systemPath>${project.basedir}/lib/jpcap.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-core</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-packetfactory-static</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
@ -92,13 +79,6 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -113,19 +93,6 @@
</resources> </resources>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>net.mamoe.mirai.MiraiMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>

View File

@ -116,10 +116,6 @@ public final class Bot implements Closeable {
this.contacts.qqs.clear(); this.contacts.qqs.clear();
} }
public void addFriend(long qq) {
}
/* PRIVATE */ /* PRIVATE */
private static final AtomicInteger _id = new AtomicInteger(0); private static final AtomicInteger _id = new AtomicInteger(0);

View File

@ -287,6 +287,7 @@ internal class BotNetworkHandlerImpl(private val bot: Bot) : BotNetworkHandler {
is ServerLoginResponseFailedPacket -> { is ServerLoginResponseFailedPacket -> {
socket.loginFuture?.complete(packet.loginState) socket.loginFuture?.complete(packet.loginState)
bot.close()
return return
} }

View File

@ -18,7 +18,7 @@ object Protocol {
//add("183.60.56.29") //add("183.60.56.29")
arrayOf( arrayOf(
//"sz3.tencent.com", "sz3.tencent.com",
"sz4.tencent.com", "sz4.tencent.com",
"sz5.tencent.com", "sz5.tencent.com",
"sz6.tencent.com", "sz6.tencent.com",

View File

@ -1,10 +1,12 @@
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import net.mamoe.mirai.Bot import net.mamoe.mirai.Bot
import net.mamoe.mirai.network.packet.login.LoginState import net.mamoe.mirai.network.packet.login.LoginState
import net.mamoe.mirai.utils.BotAccount import net.mamoe.mirai.utils.BotAccount
import net.mamoe.mirai.utils.Console import net.mamoe.mirai.utils.Console
import java.util.* import java.util.*
import java.util.concurrent.TimeUnit
/** /**
* 筛选掉无法登录(冻结/设备锁/UNKNOWN) qq * 筛选掉无法登录(冻结/设备锁/UNKNOWN) qq
@ -64,28 +66,36 @@ val qqList = "2535777366----abc123456\n" +
"2534037598----abc123456\n" "2534037598----abc123456\n"
fun main() { suspend fun main() {
val goodBotList = Collections.synchronizedList(mutableListOf<Bot>()) val goodBotList = Collections.synchronizedList(mutableListOf<Bot>())
qqList.split("\n").forEach { withContext(Dispatchers.Default) {
GlobalScope.launch { qqList.split("\n")
val strings = it.split("----") .filterNot { it.isEmpty() }
val bot = Bot(BotAccount(strings[0].toLong(), strings[1].let { password -> .map { it.split("----") }
if (password.endsWith(".")) { .map { Pair(it[0].toLong(), it[1]) }
return@let password.substring(0, password.length - 1) .forEach { (qq, password) ->
} launch {
return@let password val bot = Bot(
}), Console()) BotAccount(
qq,
if (password.endsWith(".")) password.substring(0, password.length - 1) else password
),
Console()
)
bot.network.tryLogin().whenComplete { state, _ -> withContext(Dispatchers.IO) {
bot.network.tryLogin().get(3, TimeUnit.MILLISECONDS)
}.let { state ->
if (!(state == LoginState.BLOCKED || state == LoginState.DEVICE_LOCK || state == LoginState.WRONG_PASSWORD)) { if (!(state == LoginState.BLOCKED || state == LoginState.DEVICE_LOCK || state == LoginState.WRONG_PASSWORD)) {
goodBotList.add(bot) goodBotList.add(bot)
} } else {
}
}
}
Thread.sleep(9 * 3000) }
}
}
}
}
println(goodBotList.joinToString("\n") { it.account.qqNumber.toString() + " " + it.account.password }) println(goodBotList.joinToString("\n") { it.account.qqNumber.toString() + " " + it.account.password })
} }