Sfoglia il codice sorgente

Moved debuggers from mirai-core to mirai-debug

Him188 6 anni fa
parent
commit
39d8406018

+ 1 - 1
.gitignore

@@ -13,7 +13,7 @@
 # Package Files #
 *.war
 *.jar
-!/mirai-core/lib/jpcap.jar
+!/mirai-debug/lib/jpcap.jar
 *.nar
 *.ear
 *.zip

+ 1 - 1
mirai-core/pom.xml

@@ -23,7 +23,7 @@
             <artifactId>jpcap</artifactId>
             <version>0.1.18-002</version>
             <scope>system</scope>
-            <systemPath>${project.basedir}/lib/jpcap.jar</systemPath>
+            <systemPath>../mirai-debug/lib/jpcap.jar</systemPath>
         </dependency>
 
         <dependency>

+ 0 - 8
mirai-core/src/test/java/TestKt.kt

@@ -1,8 +0,0 @@
-import net.mamoe.mirai.utils.toUHexString
-
-/**
- * @author Him188moe
- */
-fun main() {
-    println("牛逼".toByteArray().toUHexString())
-}

+ 0 - 0
mirai-core/lib/jpcap.jar → mirai-debug/lib/jpcap.jar


+ 101 - 0
mirai-debug/pom.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>mirai-debug</artifactId>
+    <version>1.0</version>
+
+    <packaging>jar</packaging>
+
+    <parent>
+        <groupId>net.mamoe</groupId>
+        <artifactId>mirai</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>net.mamoe</groupId>
+            <artifactId>mirai-core</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/jpcap/jpcap -->
+        <dependency>
+            <groupId>jpcap</groupId>
+            <artifactId>jpcap</artifactId>
+            <version>0.1.18-002</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/jpcap.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jetbrains.kotlinx</groupId>
+            <artifactId>kotlinx-coroutines-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-stdlib</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-reflect</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/main/kotlin</sourceDirectory>
+        <resources>
+            <resource>
+                <directory>/src/main/resources</directory>
+
+                <includes>
+                    <include>**/*.*</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok-maven-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <args>
+                        <arg>-XXLanguage:+InlineClasses</arg>
+                    </args>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 0 - 0
mirai-core/src/test/java/HexComparator.java → mirai-debug/src/main/kotlin/HexComparator.java


+ 1 - 4
mirai-core/src/test/java/PacketDebuger.kt → mirai-debug/src/main/kotlin/PacketDebuger.kt

@@ -5,10 +5,7 @@ import jpcap.packet.IPPacket
 import jpcap.packet.UDPPacket
 import net.mamoe.mirai.network.protocol.tim.TIMProtocol
 import net.mamoe.mirai.network.protocol.tim.packet.*
-import net.mamoe.mirai.network.protocol.tim.packet.login.ServerLoginResponseFailedPacket
-import net.mamoe.mirai.network.protocol.tim.packet.login.ServerLoginResponseKeyExchangePacket
-import net.mamoe.mirai.network.protocol.tim.packet.login.ServerLoginResponseSuccessPacket
-import net.mamoe.mirai.network.protocol.tim.packet.login.ServerLoginResponseVerificationCodeInitPacket
+import net.mamoe.mirai.network.protocol.tim.packet.login.*
 import net.mamoe.mirai.utils.*
 import java.io.DataInputStream
 

+ 0 - 0
mirai-core/src/test/java/packets.txt → mirai-debug/src/main/resources/packets.txt


+ 2 - 0
pom.xml

@@ -15,6 +15,8 @@
         <module>mirai-console</module>
         <module>mirai-api</module>
         <module>mirai-demos</module>
+
+        <module>mirai-debug</module>
     </modules>
 
     <repositories>