mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-03 18:13:11 -04:00
Added leveling/roadmap, skillService
This commit is contained in:
@@ -25,16 +25,26 @@ import java.nio.ByteOrder;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
public class ChatSystemMessage extends SWGMessage{
|
||||
import resources.common.Opcodes;
|
||||
|
||||
public class ChatSystemMessage extends SWGMessage{
|
||||
|
||||
private String stfFilename;
|
||||
private String stfName;
|
||||
private int stat;
|
||||
private String message;
|
||||
private byte displayType;
|
||||
|
||||
|
||||
public ChatSystemMessage(String message, byte displayType) {
|
||||
|
||||
this.message = message;
|
||||
this.displayType = displayType;
|
||||
|
||||
}
|
||||
|
||||
public ChatSystemMessage(String stfFilename, String stfName, int stat, byte displayType) {
|
||||
this.stfFilename = stfFilename;
|
||||
this.stfName = stfName;
|
||||
this.stat = stat;
|
||||
this.displayType = displayType;
|
||||
}
|
||||
|
||||
public void deserialize(IoBuffer data) {
|
||||
@@ -42,18 +52,40 @@ public class ChatSystemMessage extends SWGMessage{
|
||||
}
|
||||
|
||||
public IoBuffer serialize() {
|
||||
|
||||
IoBuffer result = IoBuffer.allocate(15 + message.length() * 2).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
result.putShort((short) 2);
|
||||
result.putInt(0x6D2A6413);
|
||||
|
||||
result.put(displayType); // 0x00 = Chat and Screen // 0x02 = Chat only
|
||||
result.put(getUnicodeString(message));
|
||||
result.putInt(0); // unk
|
||||
|
||||
return result.flip();
|
||||
|
||||
if (message != null) {
|
||||
IoBuffer result = IoBuffer.allocate(15 + message.length() * 2).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 2);
|
||||
result.putInt(Opcodes.ChatSystemMessage);
|
||||
result.put(displayType); // 0x00 = Chat and Screen // 0x02 = Chat only
|
||||
result.put(getUnicodeString(message));
|
||||
result.putInt(0);
|
||||
return result.flip();
|
||||
} else {
|
||||
IoBuffer result = IoBuffer.allocate(99 + stfFilename.length() + stfName.length()).order(ByteOrder.LITTLE_ENDIAN);
|
||||
result.putShort((short) 4);
|
||||
result.putInt(Opcodes.ChatSystemMessage);
|
||||
result.put((byte) 0); //result.put((byte) displayType); // 0x00 = Chat and Screen // 0x02 = Chat only
|
||||
result.putInt(0);
|
||||
result.putInt(54);
|
||||
result.putShort((short) 0);
|
||||
result.put((byte) 1);
|
||||
result.putInt(-1);
|
||||
result.put(getAsciiString(stfFilename));
|
||||
result.putInt(0);
|
||||
result.put(getAsciiString(stfName));
|
||||
result.putInt(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putLong(0);
|
||||
result.putInt(stat);
|
||||
result.putInt(0);
|
||||
result.put((byte) 0);
|
||||
return result.flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user