Fixing Client issues?

Discussion in 'Development' started by minijaham, May 26, 2021.

  1. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    Hey! A while ago, I've encountered a client-sided issue that was confirmed by Dylan.
    So the problem was that when I used LevelEventSoundPacket with disableRelativeVolume as true wasn't working at all.
    What disableRelativeVolume was supposed to do is that the sound that is playing should be able to be heard by every player with the same volume, regardless of the position.

    Here's the OS and the PM version I was using:
    PocketMine-MP: 3.19.1
    PHP: 7.4
    Server OS: Windows
    Game version: Win10

    And this is the code
    PHP:
    $packet = new LevelSoundEventPacket();
    $packet->sound 290// ID of the sound
    $packet->disableRelativeVolume true;
    $packet->position $player;
    $player->sendDataPacket($packet);
    Any idea on how to fix these "client issues"?

    And for those who want my discord, please do add me because I made a new account for cleaning up things.
    minijaham#3259
     
  2. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    What I've done is to send a audio packet to all the players with their location, this won't solve the location error though.
     
  3. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    Maybe it's possible to update the packet for the player every time it moves?
     
    minijaham likes this.
  4. Primus

    Primus Zombie Pigman

    Messages:
    647
    I think that it would reset the sound.
     
    minijaham likes this.
  5. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    Hmm,
    We can use the broadcastLevelSoundEvent from Level
    PHP:
    $player->getServer()->getLevelByName("Hub")->broadcastLevelSoundEvent(new \pocketmine\math\Vector3(0,0,0), 290, -1, -1falsetrue);
    Only problem is that the sound will not broadcast to the player if the chunks aren't visible to the player.
    And yes, this works with disableRelativeVolume.
     
  6. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    I also did this but it's the same issue as above, It doesn't work if the player is outside the render distance.
    PHP:
    $packet = new \pocketmine\network\mcpe\protocol\LevelSoundEventPacket();
              
    $packet->sound 290// ID of the sound
              
    $packet->disableRelativeVolume true;
              
    $packet->position = new \pocketmine\math\Vector3(0,0,0);
              
    $player->handleLevelSoundEvent($packet);
    What are your thoughts @Primus xD
     
    Last edited: May 26, 2021
  7. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    Hmm...I might just not be getting what client issues exactly are. Are they caused by the device? The OS?
    I've tried every possible workaround I can think of, but they were either super inefficient or failed.
     
  8. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    It may be from both ?? Not sure, but the two codes I showed does work. Which is a bit weird.
     
  9. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    They do work, except that the disableRelativeVolume isn't functioning the way I want it to. Does it work for you?
     
  10. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    Your code doesn't work, but the code's I posted does work.
     
  11. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    Hmm...my code and your code functions the same for me. What could actually be wrong with my client?
     
  12. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    Bump!
     
    ErikX likes this.
  13. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    It could be outdated protocols?
    Maybe minecraft 1.16 uses different packets?
     
    minijaham likes this.
  14. minijaham

    minijaham Zombie Pigman

    Messages:
    514
    GitHub:
    minijaham
    Hmm...could be. Considering that I purchased minecraft on my IOS device, and the same thing happened....
     

Share This Page

  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.