Reformatted using IntelliJ

This commit is contained in:
UnlegitDqrk
2026-02-06 17:59:04 +01:00
parent 68aa9c1df2
commit 0e5e0b5668
17 changed files with 130 additions and 129 deletions

View File

@@ -5,7 +5,9 @@ import lombok.Getter;
import org.openautonomousconnection.protocol.versions.ProtocolVersion;
import org.openautonomousconnection.protocol.versions.v1_0_0.beta.INSResponseStatus;
import java.io.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.UUID;
/**
@@ -19,19 +21,12 @@ public abstract class OACPacket extends Packet {
*/
@Getter
private final ProtocolVersion protocolVersion;
private final int id;
/**
* The response code for the packet, defaulting to RESPONSE_NOT_REQUIRED.
*/
private INSResponseStatus responseCode = INSResponseStatus.RESPONSE_NOT_REQUIRED;
private final int id;
@Override
public int getPacketID() {
return id;
}
/**
* Constructor for OACPacket.
*
@@ -43,6 +38,11 @@ public abstract class OACPacket extends Packet {
this.protocolVersion = protocolVersion;
}
@Override
public int getPacketID() {
return id;
}
/**
* Gets the response code for the packet.
*
@@ -65,7 +65,7 @@ public abstract class OACPacket extends Packet {
* Writes the packet data to the output stream.
*
* @param outputStream The output stream to write the packet data to.
* @throws IOException If an I/O error occurs.
* @throws IOException If an I/O error occurs.
*/
@Override
public final void write(DataOutputStream outputStream) throws IOException {
@@ -94,7 +94,7 @@ public abstract class OACPacket extends Packet {
* Abstract method to be implemented by subclasses for writing specific packet data.
*
* @param outputStream The output stream to write the packet data to.
* @throws IOException If an I/O error occurs.
* @throws IOException If an I/O error occurs.
*/
public abstract void onWrite(DataOutputStream outputStream) throws IOException;
@@ -102,7 +102,7 @@ public abstract class OACPacket extends Packet {
* Abstract method to be implemented by subclasses for reading specific packet data.
*
* @param inputStream The input stream to read the packet data from.
* @throws IOException If an I/O error occurs.
* @throws IOException If an I/O error occurs.
*/
public abstract void onRead(DataInputStream inputStream, UUID clientID) throws IOException;