public void build(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); for (int i = 0; i < this.__flag.Length; i++) { this.__flag[i] = buf.get(); } if (this.hasZjhRoom()) { byte[] bytes = new byte[buf.getInt()]; buf.get(ref bytes, 0, bytes.Length); this.zjh_room = ROOM.decode(bytes); } if (this.hasPlayer()) { int size = buf.getShort(); for (int i = 0; i < size; i++) { byte[] bytes = new byte[buf.getInt()]; buf.get(ref bytes, 0, bytes.Length); this.player.Add(PLAYER.decode(bytes)); } } }
public static ROOM decode(byte[] data) { ROOM proto = newBuilder(); proto.build(data); return(proto); }
public void build(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); for (int i = 0; i < this.__flag.Length; i++) { this.__flag[i] = buf.get(); } if (this.hasZjhRoom()) { byte[] bytes = new byte[buf.getInt()]; buf.get(ref bytes, 0, bytes.Length); this.zjh_room = ROOM.decode(bytes); } if (this.hasNickname()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.nickname = System.Text.Encoding.UTF8.GetString(bytes); } }