Advertisement
Speedyyz

Untitled

Feb 13th, 2020
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class PacketTest implements IMessage {
  2.  
  3.  
  4. private String text;
  5. public PacketTest(){
  6.  
  7. }
  8.  
  9.  
  10. public PacketTest(String text){
  11.  
  12. this.text=text;
  13.  
  14. }
  15. @Override
  16. public void fromBytes(ByteBuf buf) {
  17.  
  18. text= ByteBufUtils.readUTF8String(buf);
  19. }
  20.  
  21. @Override
  22. public void toBytes(ByteBuf buf) {
  23.  
  24. ByteBufUtils.writeUTF8String(buf, this.text);
  25. }
  26.  
  27.  
  28.  
  29. public static class Handler implements IMessageHandler<PacketTest,IMessage>{
  30.  
  31. @Override
  32. public IMessage onMessage(PacketTest message, MessageContext ctx) {
  33. return null;
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement