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

Pocketmine Sending Command Format

Discussion in 'Development' started by yungtechboy1, Dec 4, 2016.

  1. yungtechboy1

    yungtechboy1 Creeper

    Messages:
    1
    GitHub:
    yungtechboy1
    Is there any way to have it say
    Code:
    /login <password>
    On the screen instead of
    Code:
    /login [args: string]
    [​IMG]
     
  2. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    No, blame the devs who added commands in 0.16.0
     
  3. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    There is no API for this YET, it was not added in 0.16 since the changes needed to implement a new commands format like this would have broken almost every plugin anywhere.
     
  4. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    I meant MCPE devs, not PM
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    I don't know why you want to blame someone who created something... MCPE added command lists properly. It is the server that doesn't send the command list properly.

    Of course, with the exception that :shoghi: is to be blamed for everything.
     
    Muqsit and XShockinFireX like this.
  6. Primus

    Primus Zombie Pigman

    Messages:
    749
    They definitely write a packet documentation, but what are the reasons they don't want to share them?
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    We have so far no problem understanding the packets sent while command data are sent. What's troublesome is how the plugin API backwards compatibility can be maintained while supporting new features.
     
  8. Primus

    Primus Zombie Pigman

    Messages:
    749
    This leans towards to core rewrite.
     
  9. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    @Primus exactly, which is why I just added this hack for 0.16... back in the early days I didn't want to alienate people by breaking the whole API so soon, especially since damn near every PocketMine plugin in the world uses commands and would have broken as a result

    You do realize that the reason it displays like that is nothing to do with MCPE... it's to do with server-side fast hacks added to fix commands while at the same time maintaining backwards compatibility with older plugins.
     
  10. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    This might be a bit off topic but I was messing with UN-sending command data last week until I had ran into an \stdClass error that I have now fixed. This was my code to unregister all commands that would be listed when player types in '/':
    PHP:
        public function unsendCommandData($player){
            
    $pk = new \pocketmine\network\protocol\AvailableCommandsPacket();
            
    $pk->commands "";
            
    $player->dataPacket($pk);
        }
    Now, it obviously worked but...
    After executing that function, when the $player typed in a vanilla command on the server, it would actually give out a vanilla output.
    Example, typing...
    /give muqsit b
    ...in the chat would give out a list of item names starting with 'b' alongwith the item icon to the name's left, just like vanilla. The crash would occur only when the $player had executed a vanilla command.
     
    yungtechboy1 likes this.
  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.