2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.msg.group ;
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 FormationFollowMsg extends ClientNetMsg {
2023-07-15 09:23:48 -04:00
private boolean follow ;
private int formation ;
private int unknown01 ;
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* This is the general purpose constructor.
*/
public FormationFollowMsg () {
super ( Protocol . GROUPFOLLOW );
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* 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 FormationFollowMsg ( AbstractConnection origin , ByteBufferReader reader ) {
super ( Protocol . GROUPFOLLOW , origin , reader );
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* Serializes the subclass specific items to the supplied ByteBufferWriter.
*/
@Override
protected void _serialize ( ByteBufferWriter writer ) {
if ( this . follow ) {
writer . putInt ( 1 );
writer . putInt ( 0 );
} else {
writer . putInt ( 0 );
writer . putInt ( 1 );
}
writer . putInt ( this . formation );
writer . putInt ( this . unknown01 );
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* Deserializes the subclass specific items from the supplied ByteBufferReader.
*/
@Override
protected void _deserialize ( ByteBufferReader reader ) {
2022-04-30 09:41:17 -04:00
this . follow = reader . getInt () == 1 ;
2023-07-15 09:23:48 -04:00
reader . getInt ();
this . formation = reader . getInt ();
this . unknown01 = reader . getInt ();
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @return the follow
*/
public boolean isFollow () {
return follow ;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @param follow the follow to set
*/
public void setFollow ( boolean follow ) {
this . follow = follow ;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @return the formation
*/
public int getFormation () {
return formation ;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @param formation the formation to set
*/
public void setFormation ( int formation ) {
this . formation = formation ;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @return the unknown01
*/
public int getUnknown01 () {
return unknown01 ;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
/**
* @param unknown01 the unknown01 to set
*/
public void setUnknown01 ( int unknown01 ) {
this . unknown01 = unknown01 ;
}
2022-04-30 09:41:17 -04:00
}