forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.1 KiB
105 lines
3.1 KiB
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . |
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· |
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ |
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ |
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ |
|
// Magicbane Emulator Project © 2013 - 2022 |
|
// www.magicbane.com |
|
|
|
|
|
package engine.net.client.msg; |
|
|
|
|
|
import engine.exception.SerializationException; |
|
import engine.net.AbstractConnection; |
|
import engine.net.ByteBufferReader; |
|
import engine.net.ByteBufferWriter; |
|
import engine.net.client.Protocol; |
|
|
|
public class TransferAssetMsg extends ClientNetMsg { |
|
|
|
private int objectType; |
|
private int objectID; |
|
private int targetType; |
|
private int targetID; |
|
private int pad = 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 TransferAssetMsg(AbstractConnection origin, ByteBufferReader reader) { |
|
super(Protocol.TRANSFERASSET, origin, reader); |
|
} |
|
|
|
/** |
|
* Deserializes the subclass specific items from the supplied NetMsgReader. |
|
*/ |
|
@Override |
|
protected void _deserialize(ByteBufferReader reader) { |
|
this.pad = reader.getInt(); |
|
this.objectType = reader.getInt(); |
|
this.objectID = reader.getInt(); |
|
this.targetType = reader.getInt(); |
|
this.targetID = reader.getInt(); |
|
reader.getShort(); |
|
} |
|
|
|
/** |
|
* Serializes the subclass specific items to the supplied NetMsgWriter. |
|
*/ |
|
@Override |
|
protected void _serialize(ByteBufferWriter writer) throws SerializationException { |
|
writer.putInt(this.pad); |
|
writer.putInt(this.objectType); |
|
writer.putInt(this.objectID); |
|
writer.putInt(this.targetType); |
|
writer.putInt(this.targetID); |
|
writer.putShort((short) 0); |
|
|
|
} |
|
|
|
public int getObjectType() { |
|
return objectType; |
|
} |
|
|
|
public void setObjectType(int value) { |
|
this.objectType = value; |
|
} |
|
|
|
public int getPad() { |
|
return pad; |
|
} |
|
|
|
public void setPad(int value) { |
|
this.pad = value; |
|
} |
|
|
|
public int getTargetType() { |
|
return targetType; |
|
} |
|
|
|
public void setTargetObject(int targetObject) { |
|
this.targetType = targetObject; |
|
} |
|
|
|
public int getTargetID() { |
|
return targetID; |
|
} |
|
|
|
public void setTargetID(int targetID) { |
|
this.targetID = targetID; |
|
} |
|
|
|
public int getObjectID() { |
|
return objectID; |
|
} |
|
|
|
public void setObjectID(int objectID) { |
|
this.objectID = objectID; |
|
} |
|
|
|
|
|
} |