111 lines
2.7 KiB
Java
111 lines
2.7 KiB
Java
|
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||
|
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||
|
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||
|
|
// Magicbane Emulator Project © 2013 - 2022
|
||
|
|
// www.magicbane.com
|
||
|
|
|
||
|
|
|
||
|
|
package engine.net.client.msg.guild;
|
||
|
|
|
||
|
|
|
||
|
|
import engine.net.AbstractConnection;
|
||
|
|
import engine.net.ByteBufferReader;
|
||
|
|
import engine.net.ByteBufferWriter;
|
||
|
|
import engine.net.client.Protocol;
|
||
|
|
import engine.net.client.msg.ClientNetMsg;
|
||
|
|
|
||
|
|
public class MOTDCommitMsg extends ClientNetMsg {
|
||
|
|
|
||
|
|
private String message;
|
||
|
|
private int unknown01;
|
||
|
|
private int type;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* This is the general purpose constructor.
|
||
|
|
*/
|
||
|
|
public MOTDCommitMsg() {
|
||
|
|
super(Protocol.SETMOTD);
|
||
|
|
this.message = "";
|
||
|
|
this.unknown01 = 0;
|
||
|
|
this.type = 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 MOTDCommitMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||
|
|
super(Protocol.SETMOTD, origin, reader);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||
|
|
*/
|
||
|
|
@Override
|
||
|
|
protected void _serialize(ByteBufferWriter writer) {
|
||
|
|
writer.putString(this.message);
|
||
|
|
writer.putInt(this.unknown01);
|
||
|
|
writer.putInt(this.type);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||
|
|
*/
|
||
|
|
@Override
|
||
|
|
protected void _deserialize(ByteBufferReader reader) {
|
||
|
|
this.message = reader.getString();
|
||
|
|
this.unknown01 = reader.getInt();
|
||
|
|
this.type = reader.getInt();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return the message
|
||
|
|
*/
|
||
|
|
public String getMessage() {
|
||
|
|
return message;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param message
|
||
|
|
* the message to set
|
||
|
|
*/
|
||
|
|
public void setMessage(String message) {
|
||
|
|
this.message = message;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return the unknown01
|
||
|
|
*/
|
||
|
|
public int getUnknown01() {
|
||
|
|
return unknown01;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param unknown01
|
||
|
|
* the unknown01 to set
|
||
|
|
*/
|
||
|
|
public void setUnknown01(int unknown01) {
|
||
|
|
this.unknown01 = unknown01;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return the type
|
||
|
|
*/
|
||
|
|
public int getType() {
|
||
|
|
return type;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param type
|
||
|
|
* the type to set
|
||
|
|
*/
|
||
|
|
public void setType(int type) {
|
||
|
|
this.type = type;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|