forked from MagicBane/Server
Initial Repository Push
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.exception.SerializationException;
|
||||
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.AbstractWorldObject;
|
||||
|
||||
public abstract class AbstractChatMsg extends ClientNetMsg {
|
||||
|
||||
protected int sourceType;
|
||||
protected int sourceID;
|
||||
protected String sourceName;
|
||||
protected AbstractWorldObject source;
|
||||
|
||||
protected int unknown01;
|
||||
protected String message;
|
||||
protected int unknown02;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
protected AbstractChatMsg(Protocol protocolMsg, AbstractWorldObject source, String message) {
|
||||
super(protocolMsg);
|
||||
|
||||
this.unknown01 = 0;
|
||||
this.message = message;
|
||||
this.source = source;
|
||||
this.unknown02 = 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.
|
||||
*/
|
||||
protected AbstractChatMsg(Protocol protocolMsg, AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(protocolMsg, origin, reader);
|
||||
|
||||
//THIS may cause initialization error, but messing up guild chat
|
||||
//this.unknown01 = 0;
|
||||
//this.unknown02 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
protected AbstractChatMsg(AbstractChatMsg msg) {
|
||||
super(msg.getProtocolMsg());
|
||||
this.sourceType = msg.sourceType;
|
||||
this.sourceID = msg.sourceID;
|
||||
this.sourceName = msg.sourceName;
|
||||
this.source = msg.source;
|
||||
this.unknown01 = msg.unknown01;
|
||||
this.message = msg.getMessage();
|
||||
this.unknown02 = msg.getUnknown02();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected abstract void _deserialize(ByteBufferReader reader) ;
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected abstract void _serialize(ByteBufferWriter writer) throws SerializationException;
|
||||
|
||||
/**
|
||||
* @return the unknown01
|
||||
*/
|
||||
public int getUnknown01() {
|
||||
return unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown02
|
||||
*/
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown01
|
||||
* the unknown01 to set
|
||||
*/
|
||||
public void setUnknown01(int unknown01) {
|
||||
this.unknown01 = unknown01;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown02
|
||||
* the unknown02 to set
|
||||
*/
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceObjName
|
||||
*/
|
||||
public AbstractWorldObject getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceObjName
|
||||
* the sourceObjName to set
|
||||
*/
|
||||
public void setSource(AbstractWorldObject source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceType
|
||||
*/
|
||||
public int getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sourceID
|
||||
*/
|
||||
public int getSourceID() {
|
||||
return sourceID;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the sourceName
|
||||
*/
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceType
|
||||
* the sourceType to set
|
||||
*/
|
||||
public void setSourceType(int sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceID
|
||||
* the sourceID to set
|
||||
*/
|
||||
public void setSourceID(int sourceID) {
|
||||
this.sourceID = sourceID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sourceName
|
||||
* the sourceName to set
|
||||
*/
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.session.Session;
|
||||
|
||||
public class ChatCSRMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatCSRMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATCSR, source, 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 ChatCSRMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATCSR, origin, reader);
|
||||
Session s = SessionManager.getSession((ClientConnection) origin);
|
||||
if (s == null)
|
||||
return;
|
||||
this.source = s.getPlayerCharacter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatCSRMsg(ChatCSRMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
reader.getInt();
|
||||
reader.getLong();
|
||||
this.message = reader.getString();
|
||||
reader.getInt(); // pad
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.source.getObjectType().ordinal());
|
||||
writer.putInt(this.source.getObjectUUID());
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putString(this.source.getName());
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
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.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class ChatCityMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatCityMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATCITY, source, 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 ChatCityMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATCITY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatCityMsg(ChatCityMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
long sourceID = reader.getLong();
|
||||
int objectUUID = AbstractGameObject.extractUUID(GameObjectType.PlayerCharacter, sourceID);
|
||||
this.source = SessionManager.getPlayerCharacterByID(objectUUID);
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
// TODO Implement Serialize
|
||||
if (this.source != null){
|
||||
writer.putInt(source.getObjectType().ordinal());
|
||||
writer.putInt(source.getObjectUUID());
|
||||
}
|
||||
|
||||
else
|
||||
writer.putLong(0L);
|
||||
writer.putInt(0);
|
||||
writer.putString(this.message);
|
||||
if (this.source == null) {
|
||||
// TODO log error here
|
||||
writer.putString("");
|
||||
writer.putInt(0);
|
||||
} else {
|
||||
writer.putString(((AbstractCharacter) this.source).getFirstName());
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class ChatGlobalMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
|
||||
//chat global is using leader channel protocolMsg now.
|
||||
public ChatGlobalMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.LEADERCHANNELMESSAGE, source, 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 ChatGlobalMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.LEADERCHANNELMESSAGE, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatGlobalMsg(ChatGlobalMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
|
||||
this.unknown02 = reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
reader.getInt();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
if (this.source == null) {
|
||||
// TODO log error here
|
||||
writer.putString("");
|
||||
writer.putInt(0);
|
||||
} else {
|
||||
writer.putString(((AbstractCharacter) this.source).getFirstName());
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
writer.putInt(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatGroupMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatGroupMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATGROUP, source, 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 ChatGroupMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATGROUP, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatGroupMsg(ChatGroupMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
|
||||
writer.putString(this.message);
|
||||
writer.putString(this.sourceName);
|
||||
|
||||
writer.putInt(this.unknown02);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatGuildMsg extends AbstractChatMsg {
|
||||
|
||||
protected int unknown03;
|
||||
protected int unknown04;
|
||||
protected int unknown05;
|
||||
protected int unknown06;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatGuildMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATGUILD, source, message);
|
||||
this.unknown03 = 0;
|
||||
this.unknown04 = 0;
|
||||
this.unknown05 = 0;
|
||||
this.unknown06 = 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 ChatGuildMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATGUILD, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatGuildMsg(ChatGuildMsg msg) {
|
||||
super(msg);
|
||||
this.unknown03 = msg.unknown03;
|
||||
this.unknown04 = msg.unknown04;
|
||||
this.unknown05 = msg.unknown05;
|
||||
this.unknown06 = msg.unknown06;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.sourceName = reader.getString();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.unknown04 = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
this.unknown06 = reader.getInt();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putString(this.sourceName);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putInt(this.unknown05);
|
||||
writer.putInt(this.unknown06);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 unknown05
|
||||
*/
|
||||
public int getUnknown05() {
|
||||
return unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown05
|
||||
* the unknown05 to set
|
||||
*/
|
||||
public void setUnknown05(int 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatICMsg extends AbstractChatMsg {
|
||||
|
||||
protected int unknown03;
|
||||
protected int unknown04;
|
||||
protected int unknown05;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatICMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATIC, source, message);
|
||||
this.unknown03 = 0;
|
||||
this.unknown04 = 0;
|
||||
this.unknown05 = 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 ChatICMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATIC, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatICMsg(ChatICMsg msg) {
|
||||
super(msg);
|
||||
this.unknown03 = msg.unknown03;
|
||||
this.unknown04 = msg.unknown04;
|
||||
this.unknown05 = msg.unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.unknown04 = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putString(this.sourceName);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putInt(this.unknown05);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 unknown05
|
||||
*/
|
||||
public int getUnknown05() {
|
||||
return unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown05
|
||||
* the unknown05 to set
|
||||
*/
|
||||
public void setUnknown05(int unknown05) {
|
||||
this.unknown05 = unknown05;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatInfoMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatInfoMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATINFO, source, 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 ChatInfoMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATINFO, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatInfoMsg(ChatInfoMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
// TODO Implement Serialization
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatLeaderMsg extends AbstractChatMsg {
|
||||
|
||||
protected int unknown03;
|
||||
protected int unknown04;
|
||||
protected int unknown05;
|
||||
protected int unknown06;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatLeaderMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.LEADERCHANNELMESSAGE, source, message);
|
||||
this.unknown03 = 0;
|
||||
this.unknown04 = 0;
|
||||
this.unknown05 = 0;
|
||||
this.unknown06 = 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 ChatLeaderMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.LEADERCHANNELMESSAGE, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatLeaderMsg(ChatLeaderMsg msg) {
|
||||
super(msg);
|
||||
this.unknown03 = msg.unknown03;
|
||||
this.unknown04 = msg.unknown04;
|
||||
this.unknown05 = msg.unknown05;
|
||||
this.unknown06 = msg.unknown06;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.unknown04 = reader.getInt();
|
||||
this.unknown05 = reader.getInt();
|
||||
this.unknown06 = reader.getInt();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
writer.putString(this.sourceName);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putInt(this.unknown05);
|
||||
writer.putInt(this.unknown06);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 unknown05
|
||||
*/
|
||||
public int getUnknown05() {
|
||||
return unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown05
|
||||
* the unknown05 to set
|
||||
*/
|
||||
public void setUnknown05(int 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatPvPMsg extends AbstractChatMsg {
|
||||
|
||||
protected int unknown03;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatPvPMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATPVP, source, message);
|
||||
this.unknown03 = 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 ChatPvPMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATPVP, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatPvPMsg(ChatPvPMsg msg) {
|
||||
super(msg);
|
||||
this.unknown03 = msg.unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.message = reader.getString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(0); // Probably Type
|
||||
writer.putInt(0); // Probably objectUUID
|
||||
writer.putInt(0);
|
||||
|
||||
writer.putString(this.message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown03
|
||||
*/
|
||||
public int getUnknown03() {
|
||||
return unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown03
|
||||
* the unknown03 to set
|
||||
*/
|
||||
public void setUnknown03(int unknown03) {
|
||||
this.unknown03 = unknown03;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
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.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class ChatSayMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatSayMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATSAY, source, 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 ChatSayMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATSAY, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatSayMsg(ChatSayMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
|
||||
long sourceID = reader.getLong();
|
||||
this.unknown01 = reader.getInt();
|
||||
|
||||
int objectUUID = AbstractGameObject.extractUUID(GameObjectType.PlayerCharacter, sourceID);
|
||||
this.source = SessionManager.getPlayerCharacterByID(objectUUID);
|
||||
|
||||
// this.unknown01 = reader.getInt(); //not needed?
|
||||
this.message = reader.getString();
|
||||
|
||||
this.sourceName = reader.getString();
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
if (this.source != null){
|
||||
writer.putInt(this.source.getObjectType().ordinal());
|
||||
writer.putInt(source.getObjectUUID());
|
||||
}
|
||||
else
|
||||
writer.putLong(0L);
|
||||
writer.putInt(0);
|
||||
writer.putString(this.message);
|
||||
if (this.source == null) {
|
||||
// TODO log error here
|
||||
writer.putString("");
|
||||
writer.putInt(0);
|
||||
} else {
|
||||
writer.putString(((AbstractCharacter) this.source).getFirstName());
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class ChatShoutMsg extends AbstractChatMsg {
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatShoutMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.CHATSHOUT, source, 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 ChatShoutMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATSHOUT, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatShoutMsg(ChatShoutMsg msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString();
|
||||
|
||||
this.unknown02 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.sourceType);
|
||||
writer.putInt(this.sourceID);
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
if (this.source == null) {
|
||||
// TODO log error here
|
||||
writer.putString("");
|
||||
writer.putInt(0);
|
||||
} else {
|
||||
writer.putString(((AbstractCharacter) this.source).getFirstName());
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
public class ChatSystemChannelMsg extends AbstractChatMsg {
|
||||
|
||||
// TODO enum this?
|
||||
|
||||
// messageType
|
||||
// 1 = Error
|
||||
// 2 = Info
|
||||
// 3 = Message of the Day
|
||||
protected int messageType;
|
||||
|
||||
protected int unknown03;
|
||||
protected int unknown04;
|
||||
|
||||
protected int channel;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatSystemChannelMsg(AbstractWorldObject source, String message, int messageType) {
|
||||
super(Protocol.SYSTEMCHANNEL, source, message);
|
||||
this.channel = 0;
|
||||
this.messageType = messageType;
|
||||
this.unknown03 = 0;
|
||||
this.unknown04 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatSystemChannelMsg(ChatSystemChannelMsg msg) {
|
||||
super(msg);
|
||||
this.messageType = msg.messageType;
|
||||
this.unknown03 = msg.unknown03;
|
||||
this.unknown04 = msg.unknown04;
|
||||
this.channel = msg.channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChatSystemChannelMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.SYSTEMCHANNEL, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.channel = reader.getInt();
|
||||
this.messageType = reader.getInt();
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.unknown04 = reader.getInt(); // seems to alternate beween 0x0 and
|
||||
// 0x40C30000
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.channel);
|
||||
writer.putInt(this.messageType);
|
||||
if (this.source != null)
|
||||
;// writer.putLong(this.source.getCompositeID());
|
||||
else
|
||||
// writer.putLong(0L);
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.unknown04);
|
||||
|
||||
/*
|
||||
* for (String key : this.vars.keySet()) { writer.putString(key);
|
||||
* writer.putString(this.vars.get(key)); }
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the channel
|
||||
*/
|
||||
public int getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param channel
|
||||
* the channel to set
|
||||
*/
|
||||
public void setChannel(int channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the messageType
|
||||
*/
|
||||
public int getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param messageType
|
||||
* the messageType to set
|
||||
*/
|
||||
public void setMessageType(int messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
||||
public class ChatSystemMsg extends AbstractChatMsg {
|
||||
|
||||
// TODO enum this?
|
||||
|
||||
// channel
|
||||
// 1 = System
|
||||
// 2 = General Announcement (Flashing at top of screen!)
|
||||
// 3 = Commander
|
||||
// 5 = Nation
|
||||
// 6 = Leader
|
||||
// 7 = Shout
|
||||
// 8 = Siege
|
||||
// 9 = Territory
|
||||
// 10 = Info
|
||||
// 12 = Guild
|
||||
// 13 = Inner Council
|
||||
// 14 = Group
|
||||
// 15 = City
|
||||
// 16 = say
|
||||
// 17 = Emote
|
||||
// 19 = tell
|
||||
protected int channel;
|
||||
|
||||
// messageType
|
||||
// 1 = Error
|
||||
// 2 = Info
|
||||
// 3 = Message of the Day
|
||||
protected int messageType;
|
||||
|
||||
protected int unknown03;
|
||||
protected int numVariables;
|
||||
// TODO this doesn't need to be a global value,
|
||||
// its inherit to the HashMap
|
||||
protected ConcurrentHashMap<String, String> vars;
|
||||
|
||||
// TODO make a list of variables
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatSystemMsg(AbstractWorldObject source, String message) {
|
||||
super(Protocol.SYSTEMBROADCASTCHANNEL, source, message);
|
||||
this.messageType = 2;
|
||||
this.unknown03 = 0;
|
||||
this.numVariables = 0;
|
||||
vars = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChatSystemMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.SYSTEMBROADCASTCHANNEL, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatSystemMsg(ChatSystemMsg msg) {
|
||||
super(msg);
|
||||
this.channel = msg.channel;
|
||||
this.messageType = msg.messageType;
|
||||
this.unknown03 = msg.unknown03;
|
||||
this.numVariables = msg.numVariables;
|
||||
this.vars = msg.vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.vars = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
|
||||
this.channel = reader.getInt();
|
||||
this.messageType = reader.getInt();
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
|
||||
this.message = reader.getString();
|
||||
this.unknown03 = reader.getInt();
|
||||
this.numVariables = reader.getInt();
|
||||
|
||||
for (int i = 0; i < this.numVariables; ++i) {
|
||||
String key = reader.getString();
|
||||
String value = reader.getString();
|
||||
reader.get();
|
||||
this.vars.put(key, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.channel);
|
||||
writer.putInt(this.messageType);
|
||||
if (this.source != null){
|
||||
writer.putInt(source.getObjectType().ordinal());
|
||||
writer.putInt(source.getObjectUUID());
|
||||
}
|
||||
else
|
||||
writer.putLong(0L);
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.unknown03);
|
||||
writer.putInt(this.numVariables);
|
||||
|
||||
for (String key : this.vars.keySet()) {
|
||||
writer.putString(key);
|
||||
writer.putString(this.vars.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the channel
|
||||
*/
|
||||
public int getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param channel
|
||||
* the channel to set
|
||||
*/
|
||||
public void setChannel(int channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the messageType
|
||||
*/
|
||||
public int getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param messageType
|
||||
* the messageType to set
|
||||
*/
|
||||
public void setMessageType(int messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown03
|
||||
*/
|
||||
public int getUnknown03() {
|
||||
return unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown03
|
||||
* the unknown03 to set
|
||||
*/
|
||||
public void setUnknown03(int unknown03) {
|
||||
this.unknown03 = unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the numVariables
|
||||
*/
|
||||
public int getNumVariables() {
|
||||
return numVariables;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the vars
|
||||
*/
|
||||
public ConcurrentHashMap<String, String> getVars() {
|
||||
return vars;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
public class ChatTellMsg extends AbstractChatMsg {
|
||||
|
||||
protected AbstractWorldObject target;
|
||||
protected int targetType;
|
||||
protected int targetID;
|
||||
protected String targetName;
|
||||
protected int unknown03;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public ChatTellMsg(AbstractWorldObject source, AbstractWorldObject target, String message) {
|
||||
super(Protocol.CHATTELL, source, message);
|
||||
this.target = target;
|
||||
|
||||
// TODO could this be simplified? Check serializer;
|
||||
if (this.target != null) {
|
||||
this.targetType = target.getObjectType().ordinal();
|
||||
this.targetID = target.getObjectUUID();
|
||||
this.targetName = target.getName();
|
||||
}
|
||||
this.unknown03 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public ChatTellMsg(ChatTellMsg msg) {
|
||||
super(msg);
|
||||
this.target = msg.target;
|
||||
this.targetType = msg.targetType;
|
||||
this.targetID = msg.targetID;
|
||||
this.targetName = msg.targetName;
|
||||
this.unknown03 = msg.unknown03;
|
||||
}
|
||||
|
||||
public int getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
|
||||
public int getTargetID() {
|
||||
return targetID;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ChatTellMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.CHATTELL, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.sourceType = reader.getInt();
|
||||
this.sourceID = reader.getInt();
|
||||
this.unknown01 = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.sourceName = reader.getString(); // sourceName
|
||||
this.targetType = reader.getInt();
|
||||
this.targetID = reader.getInt();
|
||||
this.targetName = reader.getString();
|
||||
this.unknown02 = reader.getInt();
|
||||
this.unknown03 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putInt(this.source.getObjectType().ordinal());
|
||||
writer.putInt(source.getObjectUUID());
|
||||
writer.putInt(this.unknown01);
|
||||
writer.putString(this.message);
|
||||
if (AbstractWorldObject.IsAbstractCharacter(source)) {
|
||||
writer.putString(((AbstractCharacter) this.source).getFirstName());
|
||||
} else {
|
||||
writer.putString(this.source.getName());
|
||||
}
|
||||
if (this.target != null) {
|
||||
writer.putInt(this.target.getObjectType().ordinal());
|
||||
writer.putInt(this.target.getObjectUUID());
|
||||
if (AbstractWorldObject.IsAbstractCharacter(target)) {
|
||||
writer.putString(((AbstractCharacter) this.target).getFirstName());
|
||||
} else {
|
||||
writer.putString(this.target.getName());
|
||||
}
|
||||
} else {
|
||||
writer.putInt(this.targetType);
|
||||
writer.putInt(this.targetID);
|
||||
writer.putString(this.targetName);
|
||||
}
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
writer.putInt(MBServerStatics.worldMapID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the target
|
||||
*/
|
||||
public AbstractWorldObject getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param target
|
||||
* the target to set
|
||||
*/
|
||||
public void setTarget(AbstractWorldObject target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the targetName
|
||||
*/
|
||||
public String getTargetName() {
|
||||
return targetName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetName
|
||||
* the targetName to set
|
||||
*/
|
||||
public void setTargetName(String targetName) {
|
||||
this.targetName = targetName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown03
|
||||
*/
|
||||
public int getUnknown03() {
|
||||
return unknown03;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown03
|
||||
* the unknown03 to set
|
||||
*/
|
||||
public void setUnknown03(int unknown03) {
|
||||
this.unknown03 = unknown03;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg.chat;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
public class GuildEnterWorldMsg extends AbstractChatMsg {
|
||||
|
||||
protected String name;
|
||||
protected int guildTitle;
|
||||
protected int charterType;
|
||||
protected int unknown04;
|
||||
protected int guildUUID;
|
||||
protected int unknown05;
|
||||
protected int unknown06;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public GuildEnterWorldMsg(PlayerCharacter source) {
|
||||
super(Protocol.GUILDMEMBERONLINE, source, "[!PLAYERRANK!] !PLAYERNAME! is online");
|
||||
|
||||
this.name = "";
|
||||
this.guildTitle = 0;
|
||||
this.charterType = 9;
|
||||
this.unknown02 = 12;
|
||||
this.unknown04 = 2;
|
||||
this.guildUUID = 0;
|
||||
this.unknown05 = 0x2E46D00C;
|
||||
this.unknown06 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
public GuildEnterWorldMsg(GuildEnterWorldMsg msg) {
|
||||
super(msg);
|
||||
this.name = msg.name;
|
||||
this.guildTitle = msg.guildTitle;
|
||||
this.charterType = msg.charterType;
|
||||
this.unknown04 = msg.unknown04;
|
||||
this.guildUUID = msg.guildUUID;
|
||||
this.unknown05 = msg.unknown05;
|
||||
this.unknown06 = msg.unknown06;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 GuildEnterWorldMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.GUILDMEMBERONLINE, origin, reader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied ByteBufferWriter.
|
||||
*/
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
writer.putString(this.name);
|
||||
|
||||
writer.putInt(guildTitle);
|
||||
writer.put((byte) 1); // forgot this
|
||||
writer.putInt(this.charterType);
|
||||
writer.putInt(this.unknown02);
|
||||
writer.putInt(this.unknown04);
|
||||
writer.putInt(GameObjectType.Guild.ordinal());
|
||||
writer.putInt(this.guildUUID);
|
||||
|
||||
writer.putString(this.message);
|
||||
writer.putInt(this.unknown05);
|
||||
writer.putInt(this.unknown06);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied ByteBufferReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.name = reader.getString();
|
||||
this.guildTitle = reader.getInt();
|
||||
reader.get(); // forgot this
|
||||
this.unknown02 = reader.getInt();
|
||||
this.charterType = reader.getInt();
|
||||
this.unknown04 = reader.getInt();
|
||||
reader.getInt(); // Object Type Padding
|
||||
this.guildUUID = reader.getInt();
|
||||
this.message = reader.getString();
|
||||
this.unknown05 = reader.getInt();
|
||||
this.unknown06 = reader.getInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the guildTitle
|
||||
*/
|
||||
public int getGuildTitle() {
|
||||
return guildTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param guildTitle
|
||||
* the guildTitle to set
|
||||
*/
|
||||
public void setGuildTitle(int guildTitle) {
|
||||
this.guildTitle = guildTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown02
|
||||
*/
|
||||
@Override
|
||||
public int getUnknown02() {
|
||||
return unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown02
|
||||
* the unknown02 to set
|
||||
*/
|
||||
@Override
|
||||
public void setUnknown02(int unknown02) {
|
||||
this.unknown02 = unknown02;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown03
|
||||
*/
|
||||
public int getCharter() {
|
||||
return charterType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown03
|
||||
* the unknown03 to set
|
||||
*/
|
||||
public void setCharter(int charter) {
|
||||
this.charterType = charter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown04
|
||||
*/
|
||||
public int getUnknown04() {
|
||||
return unknown04;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown04
|
||||
* the unknown04 to set
|
||||
*/
|
||||
public void setUnknown04(int unknown04) {
|
||||
this.unknown04 = unknown04;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the guildUUID
|
||||
*/
|
||||
public int getGuildUUID() {
|
||||
return guildUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param guildUUID
|
||||
* the guildUUID to set
|
||||
*/
|
||||
public void setGuildUUID(int guildUUID) {
|
||||
this.guildUUID = guildUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message to set
|
||||
*/
|
||||
@Override
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unknown05
|
||||
*/
|
||||
public int getUnknown05() {
|
||||
return unknown05;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown05
|
||||
* the unknown05 to set
|
||||
*/
|
||||
public void setUnknown05(int 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user