Added leveling/roadmap, skillService

This commit is contained in:
Treeku
2013-11-05 05:36:37 +00:00
parent ca5aae4187
commit 90f2eec454
54 changed files with 1567 additions and 97 deletions
+49 -17
View File
@@ -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();
}
}
}