Netcode updates
This commit is contained in:
@@ -2,7 +2,17 @@ package mindustry.net;
|
||||
|
||||
import arc.util.io.*;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public abstract class Packet{
|
||||
//internally used by generated code
|
||||
//TODO intermediate buffers should ONLY be needed for:
|
||||
//readObject
|
||||
//readBuilding
|
||||
//readUnit (possibly)
|
||||
protected static final ReusableByteInStream BAIS = new ReusableByteInStream();
|
||||
protected static final Reads READ = new Reads(new DataInputStream(BAIS));
|
||||
|
||||
//these are constants because I don't want to bother making an enum to mirror the annotation enum
|
||||
|
||||
/** Does not get handled unless client is connected. */
|
||||
@@ -15,6 +25,10 @@ public abstract class Packet{
|
||||
public void read(Reads read){}
|
||||
public void write(Writes write){}
|
||||
|
||||
public void read(Reads read, int length){
|
||||
read(read);
|
||||
}
|
||||
|
||||
public int getPriority(){
|
||||
return priorityNormal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user