Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Start Game Packet

Comments in 'Plugin Development' started by Skullex, Feb 10, 2016.

  1. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    I have NEVER messed with packets in my life so I literally have no idea what I'm doing so I have a question. How exactly would a start game packet code look like? I need a example! And what I mean by that is the "Building Terrain" and green status bar. For my intentions with this would be for everytime you transfer to different worlds that packet gets sent to you and then removed.
    HotFireyDeath likes this.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    https://github.com/PocketMine/PocketMine-MP/blob/master/src/pocketmine/Player.php#L1695
    This might crash the client though. Better use a ChangeDimensionPacket (0xdf). It is not in PocketMine source code, but I found this from decompiling MCPE 0.14.0 build 3:

    Code:
    002f0298 <ChangeDimensionPacket::read(RakNet::BitStream*)>:
      2f0298:       b5f0            push    {r4, r5, r6, r7, lr}
      2f029a:       2208            movs    r2, #8
      2f029c:       4604            mov     r4, r0
      2f029e:       b083            sub     sp, #12
      2f02a0:       4608            mov     r0, r1
      2f02a2:       460d            mov     r5, r1
      2f02a4:       2301            movs    r3, #1
      2f02a6:       f104 010d       add.w   r1, r4, #13
      2f02aa:       f303 fd0e       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f02ae:       f104 0710       add.w   r7, r4, #16
      2f02b2:       f304 f915       bl      5f44e0 <RakNet::BitStream::IsNetworkOrderInternal()>
      2f02b6:       2800            cmp     r0, #0
      2f02b8:       d13d            bne.n   2f0336 <ChangeDimensionPacket::read(RakNet::BitStream*)+0x9e>
      2f02ba:       ae01            add     r6, sp, #4
      2f02bc:       4628            mov     r0, r5
      2f02be:       2220            movs    r2, #32
      2f02c0:       2301            movs    r3, #1
      2f02c2:       4631            mov     r1, r6
      2f02c4:       f303 fd01       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f02c8:       2800            cmp     r0, #0
      2f02ca:       d142            bne.n   2f0352 <ChangeDimensionPacket::read(RakNet::BitStream*)+0xba>
      2f02cc:       f104 0714       add.w   r7, r4, #20
      2f02d0:       f304 f906       bl      5f44e0 <RakNet::BitStream::IsNetworkOrderInternal()>
      2f02d4:       bb40            cbnz    r0, 2f0328 <ChangeDimensionPacket::read(RakNet::BitStream*)+0x90>
      2f02d6:       4628            mov     r0, r5
      2f02d8:       4631            mov     r1, r6
      2f02da:       2220            movs    r2, #32
      2f02dc:       2301            movs    r3, #1
      2f02de:       f303 fcf4       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f02e2:       2800            cmp     r0, #0
      2f02e4:       d13b            bne.n   2f035e <ChangeDimensionPacket::read(RakNet::BitStream*)+0xc6>
      2f02e6:       f104 0718       add.w   r7, r4, #24
      2f02ea:       f304 f8f9       bl      5f44e0 <RakNet::BitStream::IsNetworkOrderInternal()>
      2f02ee:       b9a0            cbnz    r0, 2f031a <ChangeDimensionPacket::read(RakNet::BitStream*)+0x82>
      2f02f0:       4628            mov     r0, r5
      2f02f2:       4631            mov     r1, r6
      2f02f4:       2220            movs    r2, #32
      2f02f6:       2301            movs    r3, #1
      2f02f8:       f303 fce7       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f02fc:       bb18            cbnz    r0, 2f0346 <ChangeDimensionPacket::read(RakNet::BitStream*)+0xae>
      2f02fe:       4628            mov     r0, r5
      2f0300:       4631            mov     r1, r6
      2f0302:       2208            movs    r2, #8
      2f0304:       2301            movs    r3, #1
      2f0306:       f303 fce0       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f030a:       f89d 3004       ldrb.w  r3, [sp, #4]
      2f030e:       3300            adds    r3, #0
      2f0310:       bf18            it      ne
      2f0312:       2301            movne   r3, #1
      2f0314:       7723            strb    r3, [r4, #28]
      2f0316:       b003            add     sp, #12
      2f0318:       bdf0            pop     {r4, r5, r6, r7, pc}
      2f031a:       4639            mov     r1, r7
      2f031c:       4628            mov     r0, r5
      2f031e:       2220            movs    r2, #32
      2f0320:       2301            movs    r3, #1
      2f0322:       f303 fcd2       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f0326:       e7ea            b.n     2f02fe <ChangeDimensionPacket::read(RakNet::BitStream*)+0x66>
      2f0328:       4639            mov     r1, r7
      2f032a:       4628            mov     r0, r5
      2f032c:       2220            movs    r2, #32
      2f032e:       2301            movs    r3, #1
      2f0330:       f303 fccb       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f0334:       e7d7            b.n     2f02e6 <ChangeDimensionPacket::read(RakNet::BitStream*)+0x4e>
      2f0336:       4639            mov     r1, r7
      2f0338:       4628            mov     r0, r5
      2f033a:       2220            movs    r2, #32
      2f033c:       2301            movs    r3, #1
      2f033e:       f303 fcc4       bl      5f3cca <RakNet::BitStream::ReadBits(unsigned char*, unsigned int, bool)>
      2f0342:       ae01            add     r6, sp, #4
      2f0344:       e7c2            b.n     2f02cc <ChangeDimensionPacket::read(RakNet::BitStream*)+0x34>
      2f0346:       4639            mov     r1, r7
      2f0348:       4630            mov     r0, r6
      2f034a:       2204            movs    r2, #4
      2f034c:       f304 f8ed       bl      5f452a <RakNet::BitStream::ReverseBytes(unsigned char*, unsigned char*, unsigned int)>
      2f0350:       e7d5            b.n     2f02fe <ChangeDimensionPacket::read(RakNet::BitStream*)+0x66>
      2f0352:       4639            mov     r1, r7
      2f0354:       4630            mov     r0, r6
      2f0356:       2204            movs    r2, #4
      2f0358:       f304 f8e7       bl      5f452a <RakNet::BitStream::ReverseBytes(unsigned char*, unsigned char*, unsigned int)>
      2f035c:       e7b6            b.n     2f02cc <ChangeDimensionPacket::read(RakNet::BitStream*)+0x34>
      2f035e:       4639            mov     r1, r7
      2f0360:       4630            mov     r0, r6
      2f0362:       2204            movs    r2, #4
      2f0364:       f304 f8e1       bl      5f452a <RakNet::BitStream::ReverseBytes(unsigned char*, unsigned char*, unsigned int)>
      2f0368:       e7bd            b.n     2f02e6 <ChangeDimensionPacket::read(RakNet::BitStream*)+0x4e>
      2f036a:       bf00            nop
    
    PocketKiller, Skullex and TheDeibo like this.
  3. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Thank You

Share This Page

Advertisement