blob: b7d6eda31252bd214cb2ce9df5c50a0625c771d4 (
plain) (
blame)
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
|
package cuchaz.enigma.network.packet;
import cuchaz.enigma.analysis.EntryReference;
import cuchaz.enigma.gui.GuiController;
import cuchaz.enigma.translation.representation.entry.Entry;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public class MarkDeobfuscatedS2CPacket implements Packet<GuiController> {
private int syncId;
private Entry<?> entry;
MarkDeobfuscatedS2CPacket() {
}
public MarkDeobfuscatedS2CPacket(int syncId, Entry<?> entry) {
this.syncId = syncId;
this.entry = entry;
}
@Override
public void read(DataInput input) throws IOException {
this.syncId = input.readUnsignedShort();
this.entry = PacketHelper.readEntry(input);
}
@Override
public void write(DataOutput output) throws IOException {
output.writeShort(syncId);
PacketHelper.writeEntry(output, entry);
}
@Override
public void handle(GuiController controller) {
controller.markAsDeobfuscated(new EntryReference<>(entry, entry.getName()), false);
controller.sendPacket(new ConfirmChangeC2SPacket(syncId));
}
}
|