Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. package cz.gameteam.dakado.permadapter.packets;
  2.  
  3. import java.io.DataOutputStream;
  4. import java.io.IOException;
  5.  
  6. import cz.gameteam.dakado.permadapter.bytestream.Util;
  7. import io.netty.buffer.ByteBuf;
  8. import io.netty.buffer.Unpooled;
  9.  
  10. public class GetGroupPrefixResponse {
  11.  
  12. public static void write(DataOutputStream out, String group, String prefix) {
  13. ByteBuf buf = Unpooled.buffer();
  14. Util.writeVarInt(buf, 0x04); //packet id
  15. Util.writeString(buf, group);
  16. Util.writeString(buf, prefix);
  17.  
  18. //Vytvoří novy packet
  19. int lenght = buf.readableBytes();
  20. byte[] packet = new byte[lenght];
  21. buf.readBytes(packet);
  22. try {
  23. Util.writeVarInt(out, lenght);
  24. out.write(packet);
  25. } catch (IOException e) {
  26. e.printStackTrace();
  27. }
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement