Project cleanup pre merge.
This commit is contained in:
@@ -18,246 +18,249 @@ import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ItemEffectMsg extends ClientNetMsg {
|
||||
|
||||
protected int numTrains;
|
||||
protected int effectID;
|
||||
protected int sourceType;
|
||||
protected int sourceID;
|
||||
protected int targetType;
|
||||
protected int targetID;
|
||||
protected int numTrains;
|
||||
protected int effectID;
|
||||
protected int sourceType;
|
||||
protected int sourceID;
|
||||
protected int targetType;
|
||||
protected int targetID;
|
||||
|
||||
protected int unknown02;
|
||||
protected int unknown03;
|
||||
protected int duration;
|
||||
protected int unknown05;
|
||||
protected byte unknown06;
|
||||
protected int ItemType;
|
||||
protected int powerTypeID;
|
||||
protected String powerUsedName;
|
||||
protected int itemID;
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ItemEffectMsg() {
|
||||
super(Protocol.POWERACTION);
|
||||
this.numTrains = 0;
|
||||
this.effectID = 0;
|
||||
this.sourceType = 0;
|
||||
this.sourceID = 0;
|
||||
this.targetType = 0;
|
||||
this.targetID = 0;
|
||||
protected int unknown02;
|
||||
protected int unknown03;
|
||||
protected int duration;
|
||||
protected int unknown05;
|
||||
protected byte unknown06;
|
||||
protected int ItemType;
|
||||
protected int powerTypeID;
|
||||
protected String powerUsedName;
|
||||
protected int itemID;
|
||||
|
||||
this.unknown02 = 0;
|
||||
this.unknown03 = 0;
|
||||
this.duration = 0;
|
||||
this.unknown05 = 0;
|
||||
this.unknown06 = (byte) 0;
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ItemEffectMsg() {
|
||||
super(Protocol.POWERACTION);
|
||||
this.numTrains = 0;
|
||||
this.effectID = 0;
|
||||
this.sourceType = 0;
|
||||
this.sourceID = 0;
|
||||
this.targetType = 0;
|
||||
this.targetID = 0;
|
||||
|
||||
this.ItemType = 0;
|
||||
this.itemID = 0;
|
||||
this.powerUsedName = "";
|
||||
}
|
||||
this.unknown02 = 0;
|
||||
this.unknown03 = 0;
|
||||
this.duration = 0;
|
||||
this.unknown05 = 0;
|
||||
this.unknown06 = (byte) 0;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ItemEffectMsg(AbstractWorldObject source, AbstractWorldObject target, int numTrains, int effectID, int duration,
|
||||
int powerUsedID, String powerUsedName) {
|
||||
super(Protocol.POWERACTION);
|
||||
this.numTrains = numTrains;
|
||||
this.effectID = effectID;
|
||||
this.ItemType = 0;
|
||||
this.itemID = 0;
|
||||
this.powerUsedName = "";
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
this.sourceType = source.getObjectType().ordinal();
|
||||
this.sourceID = source.getObjectUUID();
|
||||
} else {
|
||||
this.sourceType = 0;
|
||||
this.sourceID = 0;
|
||||
}
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ItemEffectMsg(AbstractWorldObject source, AbstractWorldObject target, int numTrains, int effectID, int duration,
|
||||
int powerUsedID, String powerUsedName) {
|
||||
super(Protocol.POWERACTION);
|
||||
this.numTrains = numTrains;
|
||||
this.effectID = effectID;
|
||||
|
||||
if (target != null) {
|
||||
this.targetType = target.getObjectType().ordinal();
|
||||
this.targetID = target.getObjectUUID();
|
||||
} else {
|
||||
this.targetType = 0;
|
||||
this.targetID = 0;
|
||||
}
|
||||
this.unknown02 = 0; //0 = apply, 2= remove
|
||||
this.unknown03 = 0;
|
||||
this.duration = duration;
|
||||
this.unknown05 = 0; //1 = remove item effect
|
||||
this.unknown06 = (byte) 0; //1 = remove item effect
|
||||
this.ItemType = powerUsedID;
|
||||
this.itemID = 0;
|
||||
this.powerUsedName = powerUsedName;
|
||||
}
|
||||
if (source != null) {
|
||||
this.sourceType = source.getObjectType().ordinal();
|
||||
this.sourceID = source.getObjectUUID();
|
||||
} else {
|
||||
this.sourceType = 0;
|
||||
this.sourceID = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ItemEffectMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.POWERACTION, origin, reader);
|
||||
}
|
||||
if (target != null) {
|
||||
this.targetType = target.getObjectType().ordinal();
|
||||
this.targetID = target.getObjectUUID();
|
||||
} else {
|
||||
this.targetType = 0;
|
||||
this.targetID = 0;
|
||||
}
|
||||
this.unknown02 = 0; //0 = apply, 2= remove
|
||||
this.unknown03 = 0;
|
||||
this.duration = duration;
|
||||
this.unknown05 = 0; //1 = remove item effect
|
||||
this.unknown06 = (byte) 0; //1 = remove item effect
|
||||
this.ItemType = powerUsedID;
|
||||
this.itemID = 0;
|
||||
this.powerUsedName = powerUsedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.numTrains);
|
||||
writer.putInt(this.effectID);
|
||||
/**
|
||||
* 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 ItemEffectMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.POWERACTION, origin, reader);
|
||||
}
|
||||
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.targetType);
|
||||
writer.putInt(this.targetID);
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.numTrains);
|
||||
writer.putInt(this.effectID);
|
||||
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.duration);
|
||||
writer.putInt(this.unknown05);
|
||||
writer.put(this.unknown06);
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.targetType);
|
||||
writer.putInt(this.targetID);
|
||||
|
||||
writer.putInt(this.ItemType);
|
||||
writer.putInt(this.itemID);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.duration);
|
||||
writer.putInt(this.unknown05);
|
||||
writer.put(this.unknown06);
|
||||
|
||||
writer.putString(this.powerUsedName);
|
||||
}
|
||||
writer.putInt(this.ItemType);
|
||||
writer.putInt(this.itemID);
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.numTrains = reader.getInt();
|
||||
this.effectID = reader.getInt();
|
||||
writer.putString(this.powerUsedName);
|
||||
}
|
||||
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.targetType = reader.getInt();
|
||||
this.targetID = reader.getInt();
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.numTrains = reader.getInt();
|
||||
this.effectID = reader.getInt();
|
||||
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.duration = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
this.unknown06 = reader.get();
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.targetType = reader.getInt();
|
||||
this.targetID = reader.getInt();
|
||||
|
||||
this.ItemType = reader.getInt();
|
||||
this.itemID = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.duration = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
this.unknown06 = reader.get();
|
||||
|
||||
this.powerUsedName = reader.getString();
|
||||
}
|
||||
this.ItemType = reader.getInt();
|
||||
this.itemID = reader.getInt();
|
||||
|
||||
public int getNumTrains() {
|
||||
return this.numTrains;
|
||||
}
|
||||
this.powerUsedName = reader.getString();
|
||||
}
|
||||
|
||||
public int getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
public int getNumTrains() {
|
||||
return this.numTrains;
|
||||
}
|
||||
|
||||
public int getSourceType() {
|
||||
return this.sourceType;
|
||||
}
|
||||
public void setNumTrains(int value) {
|
||||
this.numTrains = value;
|
||||
}
|
||||
|
||||
public int getSourceID() {
|
||||
return this.sourceID;
|
||||
}
|
||||
public int getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public int getTargetType() {
|
||||
return this.targetType;
|
||||
}
|
||||
public void setEffectID(int value) {
|
||||
this.effectID = value;
|
||||
}
|
||||
|
||||
public int getTargetID() {
|
||||
return this.targetID;
|
||||
}
|
||||
public int getSourceType() {
|
||||
return this.sourceType;
|
||||
}
|
||||
|
||||
public int getUnknown02() {
|
||||
return this.unknown02;
|
||||
}
|
||||
public void setSourceType(int value) {
|
||||
this.sourceType = value;
|
||||
}
|
||||
|
||||
public int getUnknown03() {
|
||||
return this.unknown03;
|
||||
}
|
||||
public int getSourceID() {
|
||||
return this.sourceID;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
public void setSourceID(int value) {
|
||||
this.sourceID = value;
|
||||
}
|
||||
|
||||
public int getUnknown05() {
|
||||
return this.unknown05;
|
||||
}
|
||||
public int getTargetType() {
|
||||
return this.targetType;
|
||||
}
|
||||
|
||||
public byte getUnknown06() {
|
||||
return this.unknown06;
|
||||
}
|
||||
public void setTargetType(int value) {
|
||||
this.targetType = value;
|
||||
}
|
||||
|
||||
public int getItemType() {
|
||||
return this.ItemType;
|
||||
}
|
||||
public int getItemID() {
|
||||
return this.itemID;
|
||||
}
|
||||
public int getTargetID() {
|
||||
return this.targetID;
|
||||
}
|
||||
|
||||
public String getPowerUsedName() {
|
||||
return this.powerUsedName;
|
||||
}
|
||||
public void setTargetID(int value) {
|
||||
this.targetID = value;
|
||||
}
|
||||
|
||||
public void setNumTrains(int value) {
|
||||
this.numTrains = value;
|
||||
}
|
||||
public int getUnknown02() {
|
||||
return this.unknown02;
|
||||
}
|
||||
|
||||
public void setEffectID(int value) {
|
||||
this.effectID = value;
|
||||
}
|
||||
public void setUnknown02(int value) {
|
||||
this.unknown02 = value;
|
||||
}
|
||||
|
||||
public void setSourceType(int value) {
|
||||
this.sourceType = value;
|
||||
}
|
||||
public int getUnknown03() {
|
||||
return this.unknown03;
|
||||
}
|
||||
|
||||
public void setSourceID(int value) {
|
||||
this.sourceID = value;
|
||||
}
|
||||
public void setUnknown03(int value) {
|
||||
this.unknown03 = value;
|
||||
}
|
||||
|
||||
public void setTargetType(int value) {
|
||||
this.targetType = value;
|
||||
}
|
||||
public int getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public void setTargetID(int value) {
|
||||
this.targetID = value;
|
||||
}
|
||||
public void setDuration(int value) {
|
||||
this.duration = value;
|
||||
}
|
||||
|
||||
public void setUnknown02(int value) {
|
||||
this.unknown02 = value;
|
||||
}
|
||||
public int getUnknown05() {
|
||||
return this.unknown05;
|
||||
}
|
||||
|
||||
public void setUnknown03(int value) {
|
||||
this.unknown03 = value;
|
||||
}
|
||||
public void setUnknown05(int value) {
|
||||
this.unknown05 = value;
|
||||
}
|
||||
|
||||
public void setDuration(int value) {
|
||||
this.duration = value;
|
||||
}
|
||||
public byte getUnknown06() {
|
||||
return this.unknown06;
|
||||
}
|
||||
|
||||
public void setUnknown05(int value) {
|
||||
this.unknown05 = value;
|
||||
}
|
||||
public void setUnknown06(byte value) {
|
||||
this.unknown06 = value;
|
||||
}
|
||||
|
||||
public void setUnknown06(byte value) {
|
||||
this.unknown06 = value;
|
||||
}
|
||||
public int getItemType() {
|
||||
return this.ItemType;
|
||||
}
|
||||
|
||||
public void setItemType(int value) {
|
||||
this.ItemType = value;
|
||||
}
|
||||
public void setItemID(int value){
|
||||
this.itemID = value;
|
||||
}
|
||||
public void setItemType(int value) {
|
||||
this.ItemType = value;
|
||||
}
|
||||
|
||||
public void setPowerUsedName(String value) {
|
||||
this.powerUsedName = value;
|
||||
}
|
||||
public int getItemID() {
|
||||
return this.itemID;
|
||||
}
|
||||
|
||||
public void setItemID(int value) {
|
||||
this.itemID = value;
|
||||
}
|
||||
|
||||
public String getPowerUsedName() {
|
||||
return this.powerUsedName;
|
||||
}
|
||||
|
||||
public void setPowerUsedName(String value) {
|
||||
this.powerUsedName = value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user