mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-17 07:59:19 +08:00
update project structure
This commit is contained in:
parent
f71ae87f09
commit
2f2b175153
@ -0,0 +1,8 @@
|
||||
package net.mamoe.mirai.network;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
public class BinaryStream {
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package net.mamoe.mirai.network.packet;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
public interface Packet {
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package net.mamoe.mirai.network.packet;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
public @interface PacketId {
|
||||
/**
|
||||
* 获取用于识别的包 ID
|
||||
*/
|
||||
int value();
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package net.mamoe.mirai.network.packet.client;
|
||||
|
||||
import net.mamoe.mirai.network.packet.PacketId;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
@PacketId(5)
|
||||
public class ClientLoginPacket extends ClientPacket {
|
||||
@Override
|
||||
public void encode() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package net.mamoe.mirai.network.packet.client;
|
||||
|
||||
import net.mamoe.mirai.network.packet.Packet;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
public abstract class ClientPacket extends DataOutputStream implements Packet {
|
||||
public ClientPacket() {
|
||||
super(new ByteArrayOutputStream());
|
||||
}
|
||||
|
||||
public long readQQ() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode this packet
|
||||
*/
|
||||
public abstract void encode();
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package net.mamoe.mirai.network.packet.server;
|
||||
|
||||
import net.mamoe.mirai.network.packet.Packet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @author Him188moe @ Mirai Project
|
||||
*/
|
||||
public abstract class ServerPacket extends DataInputStream implements Packet {
|
||||
public ServerPacket(@NotNull InputStream in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public ServerPacket(@NotNull byte[] in) {
|
||||
this(new ByteArrayInputStream(in));
|
||||
}
|
||||
|
||||
public abstract void decode();
|
||||
}
|
Loading…
Reference in New Issue
Block a user