Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+60 -60
View File
@@ -22,75 +22,75 @@ import java.util.HashMap;
public class UnloadObjectsMsg extends ClientNetMsg {
private HashMap<Integer,Integer> objectList = new HashMap<>();
private HashMap<Integer, Integer> objectList = new HashMap<>();
/**
* This is the general purpose constructor.
*/
public UnloadObjectsMsg() {
super(Protocol.FORGETOBJECTS);
init();
}
/**
* This is the general purpose constructor.
*/
public UnloadObjectsMsg() {
super(Protocol.FORGETOBJECTS);
init();
}
private void init() {
objectList = new HashMap<>();
}
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public UnloadObjectsMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.FORGETOBJECTS, origin, reader);
}
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public UnloadObjectsMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.FORGETOBJECTS, origin, reader);
}
private void init() {
objectList = new HashMap<>();
}
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) {
if (this.objectList == null){
writer.putInt(0);
return;
}
writer.putInt(this.objectList.size());
for (int objectUUID: this.objectList.keySet()){
writer.putInt(this.objectList.get(objectUUID));
writer.putInt(objectUUID);
}
}
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) {
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
init();
int size = reader.getInt();
if (this.objectList == null) {
writer.putInt(0);
return;
}
writer.putInt(this.objectList.size());
for (int objectUUID : this.objectList.keySet()) {
writer.putInt(this.objectList.get(objectUUID));
writer.putInt(objectUUID);
}
}
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
init();
int size = reader.getInt();
// for (int i = 0; i < size; i++)
// this.objectList.add(reader.getLong());
Logger.info( "Client telling server to unload objects.. ??");
}
Logger.info("Client telling server to unload objects.. ??");
}
public HashMap<Integer,Integer> getObjectList() {
return this.objectList;
}
public HashMap<Integer, Integer> getObjectList() {
return this.objectList;
}
public void addObject(AbstractGameObject value) {
this.objectList.put(value.getObjectUUID(), value.getObjectType().ordinal());
}
public void addObject(AbstractGameObject value) {
this.objectList.put(value.getObjectUUID(), value.getObjectType().ordinal());
}
public int size() {
return this.objectList.size();
}
public int size() {
return this.objectList.size();
}
@Override
protected int getPowerOfTwoBufferSize() {
return 13;
}
@Override
protected int getPowerOfTwoBufferSize() {
return 13;
}
}