Added GroupChat, PlanetChat, and basic chat channels

This commit is contained in:
Waverunner
2014-04-16 16:52:11 -04:00
parent 9bed860429
commit ff6c2d7d4c
13 changed files with 258 additions and 65 deletions
+16 -4
View File
@@ -21,9 +21,13 @@
******************************************************************************/
package protocol.swg.chat;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import org.apache.mina.core.buffer.IoBuffer;
import protocol.swg.SWGMessage;
import resources.common.StringUtilities;
public class ChatSendToRoom extends SWGMessage {
@@ -35,10 +39,18 @@ public class ChatSendToRoom extends SWGMessage {
@Override
public void deserialize(IoBuffer data) {
setMessage(getUnicodeString(data));
data.getInt();
setRoomId(data.getInt());
setMsgId(data.getInt());
try {
data.getShort();
data.getInt();
int size = data.getInt();
message = new String(ByteBuffer.allocate(size * 2).put(data.array(), data.position(), size * 2).array(), "UTF-16LE");
data.position(data.position() + size * 2);
data.getInt();
setRoomId(data.getInt());
setMsgId(data.getInt());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
@Override