Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpx3 committed Jan 6, 2020
1 parent 295b08f commit e6d52f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/de/jpx3/ips/connect/bukkit/PacketReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public void onPluginMessageReceive(PluginMessageEvent event) {
receivePayloadPacket((UserConnection) event.getReceiver(), event.getData());
}

public void receivePayloadPacket(UserConnection player, byte[] data) {
public void receivePayloadPacket(UserConnection player,
byte[] data
) {
ByteArrayDataInput inputData = newByteArrayDataInputFrom(data);

try {

String channelName = readChannelName(inputData);
if (!channelName.equalsIgnoreCase(PROTOCOL_HEADER)) {
return;
Expand All @@ -60,7 +62,6 @@ public void receivePayloadPacket(UserConnection player, byte[] data) {
PROTOCOL_VERSION,
protocolVersion
);

throw new ProtocolVersionMismatchException(
invalidVersionExceptionMessage
);
Expand All @@ -69,7 +70,7 @@ public void receivePayloadPacket(UserConnection player, byte[] data) {
AbstractPacket constructedPacket = constructPacketFrom(inputData);

String footer = readFooter(inputData);
if (!footer.equalsIgnoreCase("IPC_END")) {
if (!footer.equalsIgnoreCase(PROTOCOL_FOOTER)) {
throw new InvalidPacketException("Invalid end of packet");
}

Expand Down

0 comments on commit e6d52f8

Please sign in to comment.