Public Repository for the Magicbane Shadowbane Emulator
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.

80 lines
2.4 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 DeleteItemMsg extends ClientNetMsg {
private int type;
private int objectUUID;
private int unknown1, unknown2;
public DeleteItemMsg(int type, int objectUUID) {
super(Protocol.DELETEOBJECT);
this.type = type;
this.objectUUID = objectUUID;
this.unknown1 = 0;
this.unknown2 = 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 DeleteItemMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.DELETEOBJECT, origin, reader);
}
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
this.type = reader.getInt();
this.objectUUID = reader.getInt();
this.unknown1 = reader.getInt();
this.unknown2 = reader.getInt();
}
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) throws SerializationException {
writer.putInt(this.type);
writer.putInt(this.objectUUID);
writer.putInt(this.unknown1);
writer.putInt(this.unknown2);
}
/**
* @return the type
*/
public int getType() {
return type;
}
/**
* @return the objectUUID
*/
public int getUUID() {
return objectUUID;
}
}