Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cz.gameteam.dakado.permadapter.packets;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import cz.gameteam.dakado.permadapter.bytestream.Util;
- import io.netty.buffer.ByteBuf;
- import io.netty.buffer.Unpooled;
- public class GetGroupPrefixResponse {
- public static void write(DataOutputStream out, String group, String prefix) {
- ByteBuf buf = Unpooled.buffer();
- Util.writeVarInt(buf, 0x04); //packet id
- Util.writeString(buf, group);
- Util.writeString(buf, prefix);
- //Vytvoří novy packet
- int lenght = buf.readableBytes();
- byte[] packet = new byte[lenght];
- buf.readBytes(packet);
- try {
- Util.writeVarInt(out, lenght);
- out.write(packet);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement