1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Reading encapsulated packet from Datagram

Discussion in 'Development' started by Kyd, Aug 24, 2019.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Hello, whenever I try to dump encapsulated packet from datagram sent by mcpe client length of the packet is always 0, but the other info seems decoded OK though..

    PHP:
    $datagram = new Datagram($mcpeDatagram);
    $datagram->decode();

    foreach(
    $datagram->packets as $packet){
              if(
    $packet->hasSplit){
                   echo 
    $packet->length//output = 0
              
    }
    }
    I know this is not question related to PMMP development but RakLib seems to be part of it so that's why I'm asking here
     
  2. YarkaDev

    YarkaDev Spider

    Messages:
    9
    GitHub:
    yarkadev
    Surprisingly, there is no constructor defined in Datagram. This means that it does not contain packets = > length = 0
     
  3. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    He's asikng for length of encapsulated packet, no datagram :facepalm:
     
  4. YarkaDev

    YarkaDev Spider

    Messages:
    9
    GitHub:
    yarkadev
    yeah, but he gets them from Datagram. And as I said above, it is empty
     
  5. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Binary stream has constructor ? Maybe your brain Is empty but not the datagram..
    Sorry i'm joking
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.