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.
73 lines
2.1 KiB
73 lines
2.1 KiB
3 years ago
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||
|
// Magicbane Emulator Project © 2013 - 2022
|
||
|
// www.magicbane.com
|
||
|
|
||
|
|
||
|
package engine.net.client.msg;
|
||
|
|
||
|
|
||
|
import engine.net.AbstractConnection;
|
||
|
import engine.net.ByteBufferReader;
|
||
|
import engine.net.ByteBufferWriter;
|
||
|
import engine.net.client.Protocol;
|
||
|
|
||
|
|
||
|
public class SafeModeMsg extends ClientNetMsg {
|
||
|
|
||
|
private String message;
|
||
|
|
||
|
/**
|
||
|
* Helper Constructor.
|
||
|
*
|
||
|
* This is the general purpose constructor.
|
||
|
*/
|
||
|
public SafeModeMsg() {
|
||
|
this("Safe Mode");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This is the general purpose constructor.
|
||
|
*/
|
||
|
public SafeModeMsg(String message) {
|
||
|
super(Protocol.SAFEMODE);
|
||
|
this.message = message;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 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 SafeModeMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||
|
super(Protocol.SAFEMODE, origin, reader);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||
|
*/
|
||
|
@Override
|
||
|
protected void _serialize(ByteBufferWriter writer) {
|
||
|
writer.putString(this.message);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||
|
*/
|
||
|
@Override
|
||
|
protected void _deserialize(ByteBufferReader reader) {
|
||
|
this.message = reader.getString();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return the message
|
||
|
*/
|
||
|
public String getMessage() {
|
||
|
return message;
|
||
|
}
|
||
|
}
|