Default system chat rooms are now created

Added basic joining and room info retrieval functionality for chat rooms and the ability to send messages to the room
This commit is contained in:
Waverunner
2015-06-21 13:35:16 -04:00
parent 6366c0b208
commit e29ee734ce
28 changed files with 1319 additions and 368 deletions
+16 -2
View File
@@ -27,10 +27,13 @@
***********************************************************************************/
package network.packets;
import resources.network.BaselineBuilder;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.List;
public class Packet {
@@ -72,7 +75,14 @@ public class Packet {
public int getOpcode() {
return opcode;
}
public static void addList(ByteBuffer bb, List<? extends BaselineBuilder.Encodable> list) {
addInt(bb, list.size());
for (BaselineBuilder.Encodable encodable : list) {
addData(bb, encodable.encode());
}
}
public static void addBoolean(ByteBuffer bb, boolean b) {
bb.put(b ? (byte)1 : (byte)0);
}
@@ -120,7 +130,11 @@ public class Packet {
public static void addByte(ByteBuffer bb, int b) {
bb.put((byte)b);
}
public static void addData(ByteBuffer bb, byte[] data) {
bb.put(data);
}
public static void addArray(ByteBuffer bb, byte [] b) {
addShort(bb, b.length);
bb.put(b);