/
InitialProtocol.java
47 lines (40 loc) · 1.82 KB
/
InitialProtocol.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package net.ME1312.SubData.Server.Protocol.Initial;
import net.ME1312.SubData.Server.Protocol.Internal.PacketDisconnect;
import net.ME1312.SubData.Server.Protocol.Internal.PacketDisconnectUnderstood;
import net.ME1312.SubData.Server.Protocol.PacketIn;
import net.ME1312.SubData.Server.Protocol.PacketOut;
import java.util.HashMap;
/**
* Initial Protocol Container Class
*/
public final class InitialProtocol {
private static final HashMap<Class<? extends PacketOut>, Integer> pOut = new HashMap<Class<? extends PacketOut>, Integer>();
private static final HashMap<Integer, PacketIn> pIn = new HashMap<Integer, PacketIn>();
private InitialProtocol() {}
static {
pIn.put(0x0000, new InitPacketDeclaration());
pIn.put(0x0001, new InitPacketChangeEncryption());
pIn.put(0x0002, new InitPacketPostDeclaration());
pIn.put(0x0003, new InitPacketLogin());
pIn.put(0xFFFA, new InitPacketVerifyState());
pIn.put(0xFFFB, new InitPacketChangeState());
pIn.put(0xFFFD, new InitPacketNull());
pIn.put(0xFFFE, new PacketDisconnectUnderstood());
pIn.put(0xFFFF, new PacketDisconnect());
pOut.put(InitPacketDeclaration.class, 0x0000);
pOut.put(InitPacketChangeEncryption.class, 0x0001);
pOut.put(InitPacketPostDeclaration.class, 0x0002);
pOut.put(InitPacketLogin.class, 0x0003);
pOut.put(InitPacketVerifyState.class, 0xFFFA);
pOut.put(InitPacketChangeState.class, 0xFFFB);
pOut.put(InitPacketNull.class, 0xFFFD);
pOut.put(PacketDisconnectUnderstood.class, 0xFFFE);
pOut.put(PacketDisconnect.class, 0xFFFF);
}
/**
* InitialProtocol Packet Tag Class<br>
* Classes that implement this may be sent during the INITIALIZATION state
*/
public interface Packet extends InitialPacket {
}
}