Initial Repository Push
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
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 AcceptInviteToGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int guildUUID;
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public AcceptInviteToGuildMsg() {
|
||||
super(Protocol.JOINGUILD);
|
||||
}
|
||||
|
||||
public AcceptInviteToGuildMsg(int guildUUID, int unknown01, int unknown02) {
|
||||
super(Protocol.JOINGUILD);
|
||||
this.guildUUID = guildUUID;
|
||||
this.unknown01 = unknown01;
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 AcceptInviteToGuildMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.JOINGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(this.guildUUID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied
|
||||
* ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt(); // Object Type padding
|
||||
this.guildUUID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the guildUUID
|
||||
*/
|
||||
public int getGuildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown02
|
||||
*/
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown02
|
||||
* the unknown02 to set
|
||||
*/
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
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 AcceptSubInviteMsg extends ClientNetMsg {
|
||||
|
||||
private int guildUUID;
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
private String response;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public AcceptSubInviteMsg() {
|
||||
super(Protocol.JOINFORPROVINCE);
|
||||
}
|
||||
|
||||
public AcceptSubInviteMsg(int guildUUID, int unknown01, int unknown02, String response) {
|
||||
super(Protocol.JOINFORPROVINCE);
|
||||
this.guildUUID = guildUUID;
|
||||
this.unknown01 = unknown01;
|
||||
this.unknown02 = unknown02;
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 AcceptSubInviteMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.JOINFORPROVINCE, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(this.guildUUID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putString(this.response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt(); // Object Type Padding
|
||||
this.guildUUID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
reader.getString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the guildUUID
|
||||
*/
|
||||
public int guildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown02
|
||||
*/
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown02
|
||||
* the unknown02 to set
|
||||
*/
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
|
||||
public String getResponse() {
|
||||
return this.response;
|
||||
}
|
||||
|
||||
public void setResponse(String value) {
|
||||
this.response = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 BanishUnbanishMsg extends ClientNetMsg {
|
||||
|
||||
private int target;
|
||||
private int msgType;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public BanishUnbanishMsg() {
|
||||
super(Protocol.BANISHMEMBER);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 BanishUnbanishMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.BANISHMEMBER, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt();
|
||||
target = reader.getInt();
|
||||
|
||||
//Unknows?
|
||||
reader.getInt();
|
||||
this.msgType = reader.getInt();
|
||||
reader.getInt();
|
||||
}
|
||||
|
||||
public int getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public int getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public void setMsgType(int msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 BreakFealtyMsg extends ClientNetMsg {
|
||||
|
||||
private int guildUUID;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public BreakFealtyMsg() {
|
||||
super(Protocol.BREAKFEALTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 BreakFealtyMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.BREAKFEALTY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt(); // Object Type Padding
|
||||
this.guildUUID = reader.getInt();
|
||||
reader.getInt();
|
||||
}
|
||||
|
||||
public int getGuildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
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 ChangeRankMsg extends ClientNetMsg {
|
||||
|
||||
private int playerUUID;
|
||||
private int previousRank, newRank;
|
||||
private byte ic, rec, tax;
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChangeRankMsg() {
|
||||
super(Protocol.GUILDRANKCHANGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChangeRankMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.GUILDRANKCHANGE, origin, reader);
|
||||
}
|
||||
|
||||
public int getPlayerUUID() {
|
||||
return playerUUID;
|
||||
}
|
||||
|
||||
public int getPreviousRank() {
|
||||
return previousRank;
|
||||
}
|
||||
|
||||
public void setPreviousRank(int previousRank) {
|
||||
this.previousRank = previousRank;
|
||||
}
|
||||
|
||||
public int getNewRank() {
|
||||
return newRank;
|
||||
}
|
||||
|
||||
public void setNewRank(int newRank) {
|
||||
this.newRank = newRank;
|
||||
}
|
||||
|
||||
public byte getIc() {
|
||||
return ic;
|
||||
}
|
||||
|
||||
public void setIc(byte ic) {
|
||||
this.ic = ic;
|
||||
}
|
||||
|
||||
public byte getRec() {
|
||||
return rec;
|
||||
}
|
||||
|
||||
public void setRec(byte rec) {
|
||||
this.rec = rec;
|
||||
}
|
||||
|
||||
public byte getTax() {
|
||||
return tax;
|
||||
}
|
||||
|
||||
public void setTax(byte tax) {
|
||||
this.tax = tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(GameObjectType.PlayerCharacter.ordinal());
|
||||
writer.putInt(this.playerUUID);
|
||||
writer.putInt(this.newRank);
|
||||
writer.putInt(this.previousRank);
|
||||
|
||||
writer.put(ic);
|
||||
writer.put(tax);
|
||||
writer.put(rec);
|
||||
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putString(this.errorMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied
|
||||
* ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt(); // Object Type Padding
|
||||
this.playerUUID = reader.getInt();
|
||||
this.newRank = reader.getInt();
|
||||
this.previousRank = reader.getInt();
|
||||
this.ic = reader.get();
|
||||
this.tax = reader.get();
|
||||
this.rec = reader.get();
|
||||
|
||||
reader.getInt(); //Pad
|
||||
|
||||
this.errorMsg = reader.getString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 DisbandGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int response;
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public DisbandGuildMsg() {
|
||||
super(Protocol.DISBANDGUILD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 DisbandGuildMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.DISBANDGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.response);
|
||||
writer.putString(this.message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.response = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
//this.sourceID = reader.getInt();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 DismissGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int unknown01;
|
||||
private int guildType;
|
||||
private int guildID;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public DismissGuildMsg() {
|
||||
super(Protocol.DISMISSGUILD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 DismissGuildMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.DISMISSGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.unknown01 = reader.getInt();
|
||||
this.guildType = reader.getInt();
|
||||
this.guildID = reader.getInt();
|
||||
reader.getInt();
|
||||
|
||||
}
|
||||
|
||||
public int getUnknown01() {
|
||||
return this.unknown01;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setUnknown01(int value) {
|
||||
this.unknown01 = value;
|
||||
}
|
||||
|
||||
public int getGuildID() {
|
||||
return guildID;
|
||||
}
|
||||
|
||||
public void setGuildID(int guildID) {
|
||||
this.guildID = guildID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 GuildControlMsg extends ClientNetMsg {
|
||||
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
private int unknown03;
|
||||
private int unknown04;
|
||||
private String message;
|
||||
private byte unknown05;
|
||||
private int unknown06;
|
||||
private int unknown07;
|
||||
private byte unknown08;
|
||||
|
||||
private byte isGM;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildControlMsg() {
|
||||
super(Protocol.REQUESTMEMBERLIST);
|
||||
this.unknown01 = 2;
|
||||
this.unknown02 = 0;
|
||||
this.unknown03 = 0;
|
||||
this.unknown04 = 0;
|
||||
this.message = "No error message";
|
||||
this.unknown05 = 0;
|
||||
this.unknown06 = 0;
|
||||
this.unknown07 = 257;
|
||||
this.unknown08 = (byte) 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildControlMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.REQUESTMEMBERLIST, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putString(this.message);
|
||||
|
||||
writer.put((byte) 1); //Always 1
|
||||
|
||||
writer.put(isGM); //Can be Tax Collector
|
||||
writer.put(isGM); //Can be Recruiter
|
||||
writer.put(isGM); //Can be IC
|
||||
writer.put(isGM);
|
||||
|
||||
writer.put(isGM); //Can be GM
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.unknown04 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.unknown05 = reader.get();
|
||||
if (this.unknown05 == (byte) 1) {
|
||||
this.unknown06 = reader.getInt();
|
||||
this.unknown07 = reader.getInt();
|
||||
this.unknown08 = reader.get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown02
|
||||
*/
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown02
|
||||
* the unknown02 to set
|
||||
*/
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown03
|
||||
*/
|
||||
public int getUnknown03() {
|
||||
return unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown03
|
||||
* the unknown03 to set
|
||||
*/
|
||||
public void setUnknown03(int unknown03) {
|
||||
this.unknown03 = unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown04
|
||||
*/
|
||||
public int getUnknown04() {
|
||||
return unknown04;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown04
|
||||
* the unknown04 to set
|
||||
*/
|
||||
public void setUnknown04(int unknown04) {
|
||||
this.unknown04 = unknown04;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown05
|
||||
*/
|
||||
public byte getUnknown05() {
|
||||
return unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown05
|
||||
* the unknown05 to set
|
||||
*/
|
||||
public void setUnknown05(byte unknown05) {
|
||||
this.unknown05 = unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown06
|
||||
*/
|
||||
public int getUnknown06() {
|
||||
return unknown06;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown06
|
||||
* the unknown06 to set
|
||||
*/
|
||||
public void setUnknown06(int unknown06) {
|
||||
this.unknown06 = unknown06;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown07
|
||||
*/
|
||||
public int getUnknown07() {
|
||||
return unknown07;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown07
|
||||
* the unknown07 to set
|
||||
*/
|
||||
public void setUnknown07(int unknown07) {
|
||||
this.unknown07 = unknown07;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown08
|
||||
*/
|
||||
public byte getUnknown08() {
|
||||
return unknown08;
|
||||
}
|
||||
|
||||
public void setGM(byte b) {
|
||||
this.isGM = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown08
|
||||
* the unknown08 to set
|
||||
*/
|
||||
public void setUnknown08(byte unknown08) {
|
||||
this.unknown08 = unknown08;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
public class GuildCreationCloseMsg extends ClientNetMsg {
|
||||
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildCreationCloseMsg() {
|
||||
super(Protocol.CANCELGUILDCREATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildCreationCloseMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CANCELGUILDCREATION, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
for(int j = 0; j < 4; j++) {
|
||||
int i = reader.getInt();
|
||||
Logger.info( j+ "->" + i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.objects.GuildTag;
|
||||
import engine.objects.Item;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
public class GuildCreationFinalizeMsg extends ClientNetMsg {
|
||||
|
||||
private GuildTag guildTag;
|
||||
|
||||
private String guildName;
|
||||
private String guildMotto;
|
||||
|
||||
private int unknown01; //Appears to be a pad
|
||||
private int unknown02; //Appears to be a pad
|
||||
private int unknown03; //Appears to be a pad
|
||||
|
||||
private int icVote;
|
||||
private int membershipVote;
|
||||
|
||||
private int unknown04; //Always -1
|
||||
private int unknown05; //Appears to be a pad
|
||||
private int unknown06; //Appears to be a pad
|
||||
private int subType; //Appears to be a pad
|
||||
private int unknown08; //3 = close window, 4 = Failure to create Guild.
|
||||
private boolean close = false;
|
||||
private int charterUUID;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildCreationFinalizeMsg() {
|
||||
super(Protocol.CREATEPETITION);
|
||||
}
|
||||
|
||||
public GuildCreationFinalizeMsg(boolean close) {
|
||||
super(Protocol.CREATEPETITION);
|
||||
this.close = close;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildCreationFinalizeMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CREATEPETITION, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
GuildTag._serializeForDisplay(guildTag,writer);
|
||||
|
||||
writer.putString(this.guildName);
|
||||
writer.putString(this.guildMotto);
|
||||
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
|
||||
writer.putInt(this.membershipVote);
|
||||
writer.putInt(this.icVote);
|
||||
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putInt(this.unknown05);
|
||||
|
||||
writer.putInt(this.unknown06);
|
||||
writer.putInt(3);
|
||||
writer.putInt(this.unknown08);
|
||||
writer.putInt(GameObjectType.Item.ordinal());
|
||||
writer.putInt(this.charterUUID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
guildTag = new GuildTag(reader, true);
|
||||
|
||||
this.guildName = reader.getString();
|
||||
this.guildMotto = reader.getString();
|
||||
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
|
||||
this.membershipVote = reader.getInt();
|
||||
this.icVote = reader.getInt();
|
||||
|
||||
this.unknown04 = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
|
||||
this.unknown06 = reader.getInt();
|
||||
this.subType = reader.getInt();
|
||||
this.unknown08 = reader.getInt();
|
||||
reader.getInt(); // Object Type padding
|
||||
this.charterUUID = reader.getInt();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.guildName;
|
||||
}
|
||||
|
||||
public String getMotto() {
|
||||
return this.guildMotto;
|
||||
}
|
||||
|
||||
public Item getCharter() {
|
||||
|
||||
Item charterObject;
|
||||
|
||||
charterObject = Item.getFromCache(this.charterUUID);
|
||||
|
||||
if (charterObject == null)
|
||||
Logger.error( "Invalid charter object UUID: " + this.charterUUID);
|
||||
|
||||
return charterObject;
|
||||
}
|
||||
|
||||
public GuildTag getGuildTag() {
|
||||
return this.guildTag;
|
||||
}
|
||||
|
||||
public int getMemberVoteFlag() {
|
||||
|
||||
if (this.membershipVote != 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getICVoteFlag() {
|
||||
|
||||
if (this.icVote != 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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;
|
||||
import engine.objects.GuildTag;
|
||||
|
||||
public class GuildCreationOptionsMsg extends ClientNetMsg {
|
||||
|
||||
private int screenType;
|
||||
private ScreenType messageScreen;
|
||||
private boolean close = false;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildCreationOptionsMsg() {
|
||||
super(Protocol.CHECKUNIQUEGUILD);
|
||||
}
|
||||
public GuildCreationOptionsMsg(boolean close) {
|
||||
super(Protocol.CHECKUNIQUEGUILD);
|
||||
this.close = close;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildCreationOptionsMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHECKUNIQUEGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.screenType);
|
||||
if (this.close){
|
||||
writer.putInt(2);
|
||||
writer.putInt(0);
|
||||
// writer.putInt(0);
|
||||
return;
|
||||
}
|
||||
if(this.messageScreen != null) {
|
||||
this.messageScreen._serialize(writer);
|
||||
} else {
|
||||
writer.putInt(0);
|
||||
writer.putInt(5);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.screenType = reader.getInt();
|
||||
if(this.screenType == 1) {
|
||||
this.messageScreen = new Screen1();
|
||||
} else if(this.screenType == 2){
|
||||
this.messageScreen = new Screen2();
|
||||
} else {
|
||||
System.out.println("Attempting to Deserilaize: Message Type" + screenType);
|
||||
int counter = 0;
|
||||
do {
|
||||
int i = reader.getInt();
|
||||
System.out.println(counter++ + "->" + i);
|
||||
} while (true);
|
||||
}
|
||||
this.messageScreen._deserialize(reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rulership
|
||||
*/
|
||||
public int getScreenType() {
|
||||
return this.screenType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rulership
|
||||
* the rulership to set
|
||||
*/
|
||||
public void setScreenType(int type) {
|
||||
this.screenType = type;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ScreenType {
|
||||
public abstract void _serialize(ByteBufferWriter writer);
|
||||
public abstract void _deserialize(ByteBufferReader reader) ;
|
||||
}
|
||||
|
||||
class Screen1 extends ScreenType{
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
private String name;
|
||||
private String motto;
|
||||
|
||||
@Override
|
||||
public void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putString(this.name);
|
||||
}
|
||||
@Override
|
||||
public void _deserialize(ByteBufferReader reader)
|
||||
{
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.name = reader.getString();
|
||||
this.motto = reader.getString();
|
||||
}
|
||||
}
|
||||
|
||||
class Screen2 extends ScreenType{
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
private GuildTag gt;
|
||||
|
||||
@Override
|
||||
public void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putInt(this.unknown02);
|
||||
GuildTag._serializeForGuildCreation(this.gt,writer);
|
||||
}
|
||||
@Override
|
||||
public void _deserialize(ByteBufferReader reader)
|
||||
{
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.gt = new GuildTag(reader, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,453 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.objects.*;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
||||
public class GuildInfoMsg extends ClientNetMsg {
|
||||
|
||||
private int msgType;
|
||||
private int objectUUID;
|
||||
private int objectType;
|
||||
private Guild guild;
|
||||
private AbstractGameObject ago;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildInfoMsg() {
|
||||
super(Protocol.UPDATEGUILD);
|
||||
this.msgType = 4;
|
||||
this.objectType = 0;
|
||||
this.objectUUID = 0;
|
||||
|
||||
}
|
||||
|
||||
public GuildInfoMsg(AbstractGameObject ago, Guild guild, int unknown01) {
|
||||
super(Protocol.UPDATEGUILD);
|
||||
this.msgType = unknown01;
|
||||
this.objectType = ago.getObjectType().ordinal();
|
||||
this.objectUUID = ago.getObjectUUID();
|
||||
this.ago = ago;
|
||||
|
||||
this.guild = guild;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 GuildInfoMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.UPDATEGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.msgType);
|
||||
|
||||
if(this.msgType == 2) {
|
||||
new GuildInfoMessageType2(this.ago, guild)._serialize(writer);
|
||||
} else if(this.msgType == 5) {
|
||||
new GuildInfoMessageType5(this.ago, guild)._serialize(writer);
|
||||
}else if(this.msgType == 4){
|
||||
new GuildInfoMessageType4(this.ago, guild)._serialize(writer);
|
||||
} else {
|
||||
writer.putLong(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.put((byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.msgType = reader.getInt();
|
||||
this.objectType = reader.getInt();
|
||||
this.objectUUID = reader.getInt();
|
||||
|
||||
if (this.msgType == 1)
|
||||
reader.getInt();
|
||||
reader.getInt(); // PAdding
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.get();
|
||||
|
||||
//default guild tag deserializations.
|
||||
if (this.msgType == 5){
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
|
||||
reader.getInt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public void setMsgType(int msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the objectUUID
|
||||
*/
|
||||
public int getObjectID() {
|
||||
return objectUUID;
|
||||
}
|
||||
|
||||
public int getObjectType() {
|
||||
return objectType;
|
||||
}
|
||||
|
||||
public void setObjectType(int objectType) {
|
||||
this.objectType = objectType;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class GuildInfoMessageType {
|
||||
protected int objectType;
|
||||
protected int objectID;
|
||||
protected Guild g;
|
||||
protected AbstractGameObject ago;
|
||||
|
||||
public GuildInfoMessageType(AbstractGameObject ago, Guild g) {
|
||||
this.objectType = ago.getObjectType().ordinal();
|
||||
this.objectID = ago.getObjectUUID();
|
||||
this.ago = ago;
|
||||
this.g = g;
|
||||
}
|
||||
|
||||
abstract void _serialize(ByteBufferWriter writer);
|
||||
}
|
||||
|
||||
class GuildInfoMessageType2 extends GuildInfoMessageType {
|
||||
|
||||
public GuildInfoMessageType2(AbstractGameObject ago, Guild g) {
|
||||
super(ago, g);
|
||||
}
|
||||
|
||||
@Override
|
||||
void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.objectType);
|
||||
writer.putInt(this.objectID);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(1);
|
||||
|
||||
Guild nation = null;
|
||||
if (this.g != null) {
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(g.getObjectUUID());
|
||||
writer.putString(g.getName());
|
||||
|
||||
if(this.objectType == GameObjectType.PlayerCharacter.ordinal()) {
|
||||
PlayerCharacter pc = PlayerCharacter.getFromCache(this.objectID);
|
||||
|
||||
if(pc != null) {
|
||||
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
|
||||
}
|
||||
} else {
|
||||
writer.putInt(5);
|
||||
}
|
||||
GuildTag._serializeForDisplay(g.getGuildTag(),writer);
|
||||
nation = this.g.getNation();
|
||||
} else {
|
||||
writer.putLong(0L);
|
||||
writer.putString("");
|
||||
GuildTag._serializeForDisplay(GuildTag.ERRANT,writer);
|
||||
}
|
||||
|
||||
writer.putInt(1);
|
||||
if (nation != null) {
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(nation.getObjectUUID());
|
||||
|
||||
City city = g.getOwnedCity();
|
||||
if (city != null) {
|
||||
writer.putString(city.getCityName());
|
||||
writer.putInt(city.getObjectType().ordinal());
|
||||
writer.putInt(city.getObjectUUID());
|
||||
} else {
|
||||
writer.putString(""); //city name
|
||||
writer.putLong(0L); //should be city ID
|
||||
}
|
||||
|
||||
GuildTag._serializeForDisplay(nation.getGuildTag(),writer);
|
||||
|
||||
} else {
|
||||
writer.putLong(0L);
|
||||
writer.putString("");
|
||||
writer.putLong(0L);
|
||||
GuildTag._serializeForDisplay(GuildTag.ERRANT,writer);
|
||||
}
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putInt(0);
|
||||
writer.put((byte)0);
|
||||
}
|
||||
}
|
||||
|
||||
class GuildInfoMessageType4 extends GuildInfoMessageType {
|
||||
|
||||
public GuildInfoMessageType4(AbstractGameObject ago, Guild g) {
|
||||
super(ago, g);
|
||||
}
|
||||
|
||||
@Override
|
||||
void _serialize(ByteBufferWriter writer) {
|
||||
String cityName = "";
|
||||
writer.putInt(this.objectType);
|
||||
writer.putInt(this.objectID);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
PlayerCharacter pc = PlayerCharacter.getFromCache(this.objectID);
|
||||
if (this.g == null || pc == null){
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.put((byte)0);
|
||||
return;
|
||||
}
|
||||
|
||||
writer.putInt(1);
|
||||
Guild nation = this.g.getNation();
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putString(g.getName());
|
||||
writer.putInt(0);
|
||||
GuildTag._serializeForDisplay(g.getGuildTag(),writer);
|
||||
writer.putInt(1);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
City city = g.getOwnedCity();
|
||||
if (city != null)
|
||||
cityName = city.getCityName();
|
||||
writer.putString(nation.getName());
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
GuildTag._serializeForDisplay(nation.getGuildTag(),writer);
|
||||
writer.putInt(1);
|
||||
|
||||
writer.putString(g.getName());
|
||||
writer.putString(g.getMotto());
|
||||
writer.putString(nation.getName());
|
||||
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
|
||||
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus()));
|
||||
writer.putInt(g.getCharter());
|
||||
writer.putString(cityName); //Shows City Name FUCK
|
||||
AbstractCharacter guildLeader;
|
||||
String guildLeaderName = "";
|
||||
if (g.isNPCGuild()){
|
||||
guildLeader = NPC.getFromCache(g.getGuildLeaderUUID());
|
||||
if (guildLeader != null)
|
||||
guildLeaderName = guildLeader.getName();
|
||||
}
|
||||
|
||||
else{
|
||||
guildLeader = PlayerCharacter.getFromCache(g.getGuildLeaderUUID());
|
||||
if (guildLeader != null)
|
||||
guildLeaderName = ((PlayerCharacter)guildLeader).getCombinedName();
|
||||
}
|
||||
|
||||
writer.putString(guildLeaderName);
|
||||
writer.putString(pc.getName());
|
||||
|
||||
writer.putDateTime(DateTime.now());
|
||||
writer.put((byte)1);
|
||||
writer.put((byte)1);
|
||||
writer.put((byte)1);
|
||||
writer.put((byte)0);
|
||||
writer.putInt(0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// writer.put((byte)0);
|
||||
|
||||
|
||||
// writer.putString(cityName);
|
||||
// writer.putInt(10);
|
||||
// writer.putInt(6);
|
||||
// writer.putInt(10);
|
||||
// writer.putString(cityName);
|
||||
// writer.putString(pc.getFirstName());
|
||||
// writer.putString("Nation Leader");
|
||||
// writer.putDateTime(DateTime.now());
|
||||
// writer.put((byte)1);
|
||||
// writer.put((byte)1);
|
||||
// writer.putInt(1);
|
||||
// writer.putInt(this.objectType);
|
||||
// writer.putInt(this.objectID);
|
||||
// writer.putInt(0);
|
||||
// writer.putInt(0);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class GuildInfoMessageType5 extends GuildInfoMessageType {
|
||||
|
||||
public GuildInfoMessageType5(AbstractGameObject ago, Guild g) {
|
||||
super(ago, g);
|
||||
}
|
||||
|
||||
@Override
|
||||
void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
PlayerCharacter pc = null;
|
||||
|
||||
if(ago.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
pc = (PlayerCharacter) ago;
|
||||
}
|
||||
|
||||
if(pc != null && g != null && g.getObjectUUID() != 0) {
|
||||
Guild n = g.getNation();
|
||||
if(n == null) {
|
||||
n = Guild.getErrantNation();
|
||||
}
|
||||
|
||||
writer.putInt(ago.getObjectType().ordinal());
|
||||
writer.putInt(ago.getObjectUUID());
|
||||
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putInt(1);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putString(g.getName()); //No Effect?
|
||||
writer.putInt(0); //Pad
|
||||
|
||||
GuildTag._serializeForDisplay(g.getGuildTag(),writer); //Also a waste of space...
|
||||
|
||||
writer.putInt(1);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putString(n.getName()); //No Effect?
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
GuildTag._serializeForDisplay(n.getGuildTag(),writer);
|
||||
|
||||
writer.putInt(1);
|
||||
|
||||
writer.putString(g.getName()); //Guild Name
|
||||
writer.putString(g.getMotto()); //TODO Motto
|
||||
writer.putString(n.getName()); //Nation Name
|
||||
|
||||
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); //Rank
|
||||
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title
|
||||
writer.putInt(g.getCharter());
|
||||
|
||||
if(g.getNation().equals(Guild.getErrantNation()))
|
||||
writer.putString("Errant");
|
||||
else
|
||||
writer.putString("City");
|
||||
writer.putString("Guild Leader");
|
||||
writer.putString(""); //Nation Leader - I believe
|
||||
|
||||
DateTime now = DateTime.now();
|
||||
writer.putDateTime(now);
|
||||
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 0);
|
||||
writer.put((byte) 0);
|
||||
|
||||
GuildTag._serializeForDisplay(g.getGuildTag(),writer);
|
||||
GuildTag._serializeForDisplay(g.getNation().getGuildTag(),writer);
|
||||
writer.putInt(0);
|
||||
} else {
|
||||
writer.putLong(0);
|
||||
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
writer.put((byte) 0);
|
||||
|
||||
GuildTag._serializeForDisplay(GuildTag.ERRANT,writer);
|
||||
GuildTag._serializeForDisplay(GuildTag.ERRANT,writer);
|
||||
|
||||
writer.putInt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.GuildHistory;
|
||||
import engine.objects.GuildStatusController;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class GuildListMsg extends ClientNetMsg {
|
||||
|
||||
private GuildListMessageType glm;
|
||||
|
||||
/**
|
||||
* Type 1 Constructor - Guild Roster
|
||||
*/
|
||||
public GuildListMsg(Guild g) {
|
||||
super(Protocol.SENDMEMBERENTRY);
|
||||
this.glm = new GuildListMessageType1(g);
|
||||
}
|
||||
|
||||
/**
|
||||
* Type 4 Constructor - Guild History
|
||||
*/
|
||||
public GuildListMsg(PlayerCharacter pc) {
|
||||
super(Protocol.SENDMEMBERENTRY);
|
||||
this.glm = new GuildListMessageType2(pc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildListMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.SENDMEMBERENTRY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
//TODO Find Default and null check this
|
||||
this.glm._serialize(writer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
/*
|
||||
*
|
||||
* The Server should never receive this message directly.
|
||||
* Instances in recordings will need to be decoded by hand,
|
||||
* converting from our format to the standard format will
|
||||
* cause more problems than its worth to fix.
|
||||
*
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.get();
|
||||
this.unknown04 = reader.getInt();
|
||||
this.unknown05 = reader.get();
|
||||
this.unknown06 = reader.getInt();
|
||||
int size = reader.getInt();
|
||||
for (int i = 0; i < size; i++) {
|
||||
GuildTableList gt = new GuildTableList();
|
||||
reader.getInt(); // Player Character ID Type
|
||||
gt.setUUID(reader.getInt());
|
||||
gt.setName(reader.getString());
|
||||
gt.setActionType(reader.get());
|
||||
gt.setGuildTitle(reader.getInt());
|
||||
gt.setGuildRank(reader.getInt());
|
||||
gt.setUnknown02(reader.getInt());
|
||||
gt.setUnknown03(reader.getInt());
|
||||
gt.setUnknown04(reader.getInt());
|
||||
gt.setUnknown05(reader.getInt());
|
||||
gt.setUnknown06(reader.getInt());
|
||||
gt.setUnknown07(reader.getInt());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerOfTwoBufferSize() {
|
||||
// Larger size for historically larger opcodes
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class GuildListMessageType {
|
||||
public ArrayList<Guild> history = new ArrayList<>();
|
||||
|
||||
abstract void _serialize(ByteBufferWriter writer);
|
||||
}
|
||||
|
||||
class GuildListMessageType1 extends GuildListMessageType {
|
||||
|
||||
private Guild g;
|
||||
|
||||
public GuildListMessageType1(Guild g) {
|
||||
this.g = g;
|
||||
}
|
||||
|
||||
@Override
|
||||
void _serialize(ByteBufferWriter writer) {
|
||||
Enum.GuildType gt = Enum.GuildType.getGuildTypeFromInt(g.getCharter());
|
||||
|
||||
writer.putInt(1);
|
||||
writer.putInt(gt.ordinal()); //Charter Type
|
||||
writer.putInt(1); //Always 1?
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) 0);
|
||||
writer.putInt(gt.getNumberOfRanks()); //Number of Ranks
|
||||
|
||||
|
||||
ArrayList<PlayerCharacter> guildRoster = Guild.GuildRoster(g);
|
||||
writer.putInt(guildRoster.size() + g.getBanishList().size());
|
||||
|
||||
// Send guild list of each player
|
||||
for (PlayerCharacter player : guildRoster) {
|
||||
|
||||
byte isActive = SessionManager.getPlayerCharacterByID(player.getObjectUUID()) != null ? (byte)1 : (byte)0;
|
||||
writer.putInt(Enum.GameObjectType.PlayerCharacter.ordinal());
|
||||
writer.putInt(player.getObjectUUID());
|
||||
writer.putString(player.getCombinedName());
|
||||
writer.put(isActive); //Active?
|
||||
writer.putInt(GuildStatusController.getTitle(player.getGuildStatus()));
|
||||
writer.putInt(GuildStatusController.getRank(player.getGuildStatus()));
|
||||
writer.putInt(0); // 1/2 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(GuildStatusController.getRank(player.getGuildStatus()));
|
||||
writer.putInt(0); // window failed to open when set to 1
|
||||
}
|
||||
|
||||
for (PlayerCharacter banished : g.getBanishList()){
|
||||
byte isActive = SessionManager.getPlayerCharacterByID(banished.getObjectUUID()) != null ? (byte)1 : (byte)0;
|
||||
writer.putInt(Enum.GameObjectType.PlayerCharacter.ordinal());
|
||||
writer.putInt(banished.getObjectUUID());
|
||||
writer.putString(banished.getCombinedName());
|
||||
writer.put(isActive); //Active?
|
||||
writer.putInt(GuildStatusController.getTitle(banished.getGuildStatus()));
|
||||
writer.putInt(3);
|
||||
writer.putInt(0); // 1/2 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(0); // 1 has no effect
|
||||
writer.putInt(3);
|
||||
writer.putInt(0); // window failed to open when set to 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuildListMessageType2 extends GuildListMessageType {
|
||||
|
||||
private PlayerCharacter pc;
|
||||
|
||||
public GuildListMessageType2(PlayerCharacter pc) {
|
||||
this.pc = pc;
|
||||
}
|
||||
|
||||
@Override
|
||||
void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
Guild g = pc.getGuild();
|
||||
|
||||
writer.putInt(4);
|
||||
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
|
||||
writer.put((byte) 0);
|
||||
writer.put((byte) 0);
|
||||
writer.putInt(1);
|
||||
writer.putInt(pc.getObjectType().ordinal());
|
||||
writer.putInt(pc.getObjectUUID());
|
||||
writer.putString(pc.getCombinedName());
|
||||
|
||||
writer.put((byte) 1);
|
||||
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title Maybe?
|
||||
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); //Rank?
|
||||
|
||||
writer.putInt(pc.getRaceToken()); //race token
|
||||
writer.putInt(pc.getBaseClassToken()); //class token
|
||||
|
||||
writer.putInt(2); //PAD
|
||||
writer.putInt(pc.getLevel());
|
||||
writer.putInt(g.getCharter());
|
||||
|
||||
//TODO Get Guild History from the DB
|
||||
//ArrayList<GuildHistory> history = DbManager.GuildQueries.GET_GUILD_HISTORY_OF_PLAYER((int)pc.getPlayerUUID());
|
||||
writer.putInt(pc.getGuildHistory().size()); //Number of Entries
|
||||
|
||||
for(GuildHistory guildHistory : pc.getGuildHistory()) {
|
||||
writer.putInt(guildHistory.getHistoryType().getType());
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt((int) guildHistory.getGuildID());
|
||||
writer.putString(guildHistory.getGuildName());
|
||||
writer.putInt(0);
|
||||
writer.putDateTime(guildHistory.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 GuildUnknownMsg extends ClientNetMsg {
|
||||
|
||||
private int unknown01;
|
||||
private int unknown02;
|
||||
private int unknown03;
|
||||
private byte unknownByte;
|
||||
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildUnknownMsg() {
|
||||
super(Protocol.UPDATECLIENTALLIANCES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildUnknownMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.UPDATECLIENTALLIANCES, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.put((byte)1);
|
||||
// writer.putInt(this.unknown01);
|
||||
// writer.putInt(this.unknown02);
|
||||
// writer.putInt(this.unknown02);
|
||||
// writer.putInt(this.unknownByte);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.unknown01 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknownByte = reader.get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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;
|
||||
import engine.objects.GuildTag;
|
||||
|
||||
public class InviteToGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int response;
|
||||
private int sourceType;
|
||||
private int sourceUUID;
|
||||
private int targetType;
|
||||
private int targetUUID;
|
||||
private int unknown01;
|
||||
private String message;
|
||||
private GuildTag gt;
|
||||
private String guildName;
|
||||
private int guildType;
|
||||
private int guildID;
|
||||
private String targetName;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public InviteToGuildMsg() {
|
||||
super(Protocol.INVITETOGUILD);
|
||||
this.response = 0;
|
||||
this.message = "No error 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 InviteToGuildMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.INVITETOGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.response);
|
||||
writer.putLong(this.sourceUUID);
|
||||
writer.putLong(this.targetUUID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.gt.backgroundColor01);
|
||||
writer.putInt(this.gt.backgroundColor02);
|
||||
writer.putInt(this.gt.symbolColor);
|
||||
writer.putInt(this.gt.symbol);
|
||||
writer.putInt(this.gt.backgroundDesign);
|
||||
writer.putString(this.guildName);
|
||||
writer.putInt(this.guildType);
|
||||
writer.putInt(this.guildID);
|
||||
writer.putString(this.targetName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.response = reader.getInt();
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceUUID = reader.getInt();
|
||||
this.targetType = reader.getInt();
|
||||
this.targetUUID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.gt = new GuildTag(reader);
|
||||
this.guildName = reader.getString();
|
||||
this.guildType = reader.getInt();
|
||||
this.guildID = reader.getInt();
|
||||
this.targetName = reader.getString();
|
||||
}
|
||||
|
||||
public GuildTag getGuildTag() {
|
||||
return this.gt;
|
||||
}
|
||||
|
||||
public void setGuildTag(GuildTag gt) {
|
||||
this.gt = gt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the response
|
||||
*/
|
||||
public int getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param response
|
||||
* the response to set
|
||||
*/
|
||||
public void setResponse(int response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceUUID
|
||||
*/
|
||||
public int getSourceUUID() {
|
||||
return sourceUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceUUID
|
||||
* the sourceUUID to set
|
||||
*/
|
||||
public void setSourceUUID(int sourceUUID) {
|
||||
this.sourceUUID = sourceUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetUUID
|
||||
*/
|
||||
public int getTargetUUID() {
|
||||
return targetUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetUUID
|
||||
* the targetUUID to set
|
||||
*/
|
||||
public void setTargetUUID(int targetUUID) {
|
||||
this.targetUUID = targetUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param guildName
|
||||
* the guildName to set
|
||||
*/
|
||||
public void setGuildName(String guildName) {
|
||||
this.guildName = guildName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param guildID
|
||||
* the guildID to set
|
||||
*/
|
||||
public void setGuildUUID(int guildID) {
|
||||
this.guildID = guildID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetName
|
||||
*/
|
||||
public String getTargetName() {
|
||||
return targetName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetName
|
||||
* the targetName to set
|
||||
*/
|
||||
public void setTargetName(String targetName) {
|
||||
this.targetName = targetName;
|
||||
}
|
||||
|
||||
public void setSourceType(int sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
public void setTargetType(int targetType) {
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
public void setGuildType(int guildType) {
|
||||
this.guildType = guildType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetType
|
||||
*/
|
||||
public int getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.guild;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.objects.GuildTag;
|
||||
|
||||
public class InviteToSubMsg extends ClientNetMsg {
|
||||
|
||||
//12d67402 0000f062 56253600 0010b062 d7821800 00000000
|
||||
//10000000 4e006f0020006500720072006f00720020006d00650073007300610067006500
|
||||
//0a000000 03000000 07000000 a0000000 04000000
|
||||
//17000000 4800650072006f006500730020006f0066002000530065006100200044006f006700730020005200650073007400
|
||||
//0000200a 33000000 00000000 01000000
|
||||
|
||||
//12d67402 0000d062 11fe1700 00009063 3ee91300 00000000
|
||||
//10000000 4e006f0020006500720072006f00720020006d00650073007300610067006500
|
||||
//08000000 08000000 07000000 96000000 0d000000
|
||||
//11000000 42006c006f006f00640020004d006f006f006e00200052006900730069006e006700
|
||||
//0000c006 64540000 01000000 00000000
|
||||
|
||||
//12d67402 0000e062 db2d0000 00005063 116e1100 00000000
|
||||
//10000000 4e006f0020006500720072006f00720020006d00650073007300610067006500
|
||||
//05000000 11000000 0e000000 95000000 05000000
|
||||
//09000000 530074006f0072006d0068006f006c006400
|
||||
//0000c006 56300000 01000000 00000000
|
||||
|
||||
private int sourceUUID;
|
||||
private int targetUUID;
|
||||
private int unknown01;
|
||||
private String message;
|
||||
private GuildTag gt;
|
||||
private String guildName;
|
||||
private int guildUUID;
|
||||
private int unknown02;
|
||||
private int unknown03;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public InviteToSubMsg() {
|
||||
super(Protocol.INVITEGUILDFEALTY);
|
||||
this.message = "No error 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 InviteToSubMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.INVITEGUILDFEALTY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(GameObjectType.PlayerCharacter.ordinal());
|
||||
writer.putInt(this.sourceUUID);
|
||||
writer.putInt(GameObjectType.PlayerCharacter.ordinal());
|
||||
writer.putInt(this.targetUUID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.gt.backgroundColor01);
|
||||
writer.putInt(this.gt.backgroundColor02);
|
||||
writer.putInt(this.gt.symbolColor);
|
||||
writer.putInt(this.gt.symbol);
|
||||
writer.putInt(this.gt.backgroundDesign);
|
||||
writer.putString(this.guildName);
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(this.guildUUID);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt();
|
||||
this.sourceUUID = reader.getInt();
|
||||
reader.getInt();
|
||||
this.targetUUID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.gt = new GuildTag(reader);
|
||||
this.guildName = reader.getString();
|
||||
reader.getInt(); // Padding for Object Type
|
||||
this.guildUUID = reader.getInt();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
}
|
||||
|
||||
public GuildTag getGuildTag() {
|
||||
return this.gt;
|
||||
}
|
||||
|
||||
public void setGuildTag(GuildTag gt) {
|
||||
this.gt = gt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceUUID
|
||||
*/
|
||||
public int getSourceUUID() {
|
||||
return sourceUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetUUID
|
||||
*/
|
||||
public int getTargetUUID() {
|
||||
return targetUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the guildName
|
||||
*/
|
||||
public String getGuildName() {
|
||||
return guildName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param guildName
|
||||
* the guildName to set
|
||||
*/
|
||||
public void setGuildName(String guildName) {
|
||||
this.guildName = guildName;
|
||||
}
|
||||
|
||||
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
public int getUnknown03() {
|
||||
return unknown03;
|
||||
}
|
||||
|
||||
public void setUnknown03(int unknown03) {
|
||||
this.unknown03 = unknown03;
|
||||
}
|
||||
|
||||
public int getGuildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
public void setGuildUUID(int guildUUID) {
|
||||
this.guildUUID = guildUUID;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 LeaveGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int response;
|
||||
private String message;
|
||||
private long sourceID;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public LeaveGuildMsg() {
|
||||
super(Protocol.LEAVEGUILD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 LeaveGuildMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.LEAVEGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.response);
|
||||
writer.putString(this.message);
|
||||
writer.putLong(this.sourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.response = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.sourceID = reader.getLong();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the response
|
||||
*/
|
||||
public int getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param response
|
||||
* the response to set
|
||||
*/
|
||||
public void setResponse(int response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceID
|
||||
*/
|
||||
public long getSourceID() {
|
||||
return sourceID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceID
|
||||
* the sourceID to set
|
||||
*/
|
||||
public void setSourceID(long sourceID) {
|
||||
this.sourceID = sourceID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 MOTDMsg extends ClientNetMsg {
|
||||
|
||||
private int type;
|
||||
private byte response;
|
||||
private int unknown01;
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public MOTDMsg() {
|
||||
super(Protocol.MOTD);
|
||||
this.type = 0;
|
||||
this.response = (byte) 0;
|
||||
this.unknown01 = 0;
|
||||
this.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 MOTDMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.MOTD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.type);
|
||||
writer.put(this.response);
|
||||
if (this.response == (byte) 1) {
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.type = reader.getInt();
|
||||
this.response = reader.get();
|
||||
if (this.response == (byte) 1) {
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*/
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the response
|
||||
*/
|
||||
public byte getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param response
|
||||
* the response to set
|
||||
*/
|
||||
public void setResponse(byte response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 ReqGuildListMsg extends ClientNetMsg {
|
||||
|
||||
private long nationCompID;
|
||||
private long guildToSubCompID;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ReqGuildListMsg() {
|
||||
super(Protocol.REQUESTGUILDLIST);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ReqGuildListMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.REQUESTGUILDLIST, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt();
|
||||
reader.getString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.GuildTag;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SendGuildEntryMsg extends ClientNetMsg {
|
||||
|
||||
private PlayerCharacter pc;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public SendGuildEntryMsg(PlayerCharacter pc) {
|
||||
super(Protocol.SENDGUILDENTRY);
|
||||
this.pc = pc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 SendGuildEntryMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.SENDGUILDENTRY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
ArrayList<Guild>subsAndSovs = new ArrayList<>();
|
||||
|
||||
Guild nation = pc.getGuild().getNation();
|
||||
if (pc.getGuild() != nation)
|
||||
subsAndSovs.add(nation);
|
||||
subsAndSovs.addAll(pc.getGuild().getSubGuildList());
|
||||
|
||||
|
||||
writer.putInt(1);
|
||||
//GuildState
|
||||
//Petitioner = 2, Sworn = 4 , Nation = 5, protectorate = 6, city-State = 7(nation), province = 8,
|
||||
|
||||
writer.putInt(subsAndSovs.size());
|
||||
writer.putInt(1);
|
||||
if (subsAndSovs.size() > 0){
|
||||
|
||||
for (Guild guild : subsAndSovs){
|
||||
int state = guild.getGuildState().getStateID();
|
||||
|
||||
writer.putInt(guild.getObjectType().ordinal());
|
||||
writer.putInt(guild.getObjectUUID());
|
||||
|
||||
writer.putString(guild.getName());
|
||||
|
||||
//TODO set Alliance date
|
||||
writer.putShort((short)1);
|
||||
writer.putInt(0);
|
||||
writer.putShort((short)0);
|
||||
writer.put((byte)0);
|
||||
|
||||
writer.putInt(state);
|
||||
GuildTag._serializeForDisplay(guild.getGuildTag(),writer);
|
||||
if (guild == nation)
|
||||
writer.putInt(2); // Break Fealty
|
||||
else
|
||||
writer.putInt(1); // Dismiss, Swear In.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
|
||||
}
|
||||
|
||||
public PlayerCharacter getPc() {
|
||||
return pc;
|
||||
}
|
||||
|
||||
public void setPc(PlayerCharacter pc) {
|
||||
this.pc = pc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 SwearInGuildMsg extends ClientNetMsg {
|
||||
|
||||
private int guildType;
|
||||
private int guildUUID;
|
||||
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public SwearInGuildMsg() {
|
||||
super(Protocol.SWEARINGUILD);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 SwearInGuildMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.SWEARINGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
|
||||
this.guildType = reader.getInt();
|
||||
this.guildUUID = reader.getInt();
|
||||
reader.getInt();
|
||||
this.message = reader.getString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetType
|
||||
*/
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public int getGuildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// 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 SwearInMsg extends ClientNetMsg {
|
||||
|
||||
private int targetType;
|
||||
private int targetID;
|
||||
private int unknown01;
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public SwearInMsg() {
|
||||
super(Protocol.ACTIVATEPLEDGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 SwearInMsg(AbstractConnection origin, ByteBufferReader reader)
|
||||
{
|
||||
super(Protocol.ACTIVATEPLEDGE, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.targetType);
|
||||
writer.putInt(this.targetID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.targetType = reader.getInt();
|
||||
this.targetID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetType
|
||||
*/
|
||||
public int getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetType
|
||||
* the targetType to set
|
||||
*/
|
||||
public void setTargetType(int targetType) {
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetID
|
||||
*/
|
||||
public int getTargetID() {
|
||||
return targetID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetID
|
||||
* the targetID to set
|
||||
*/
|
||||
public void setTargetID(int targetID) {
|
||||
this.targetID = targetID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user