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

Solved Multiprotocol??

Discussion in 'Development' started by 7awariGamer, Apr 19, 2019.

  1. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    Can I make a plugin that makes the server works in MultiVersions like : 1.6,1.7,.1.8-----1.10...
    ??
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Yes but very hard. The cost of making such a plugin is much bigger than what everyone will earn by supporting old versions.
     
    dktapps likes this.
  3. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    This code won't work?
    PHP:
    <?php
    /*
      _____  __    __      _             
     |___  |/ / /\ \ \  __| |  ___ __   __
        / / \ \/  \/ / / _` | / _ \\ \ / /
       / /   \  /\  / | (_| ||  __/ \ V /
      /_/     \/  \/   \__,_| \___|  \_/ 
                                          
                                          */

    declare(strict_types=1);

    namespace 
    multiprotocol;

    use 
    pocketmine\event\Listener;
    use 
    pocketmine\event\server\DataPacketReceiveEvent;
    use 
    pocketmine\network\mcpe\protocol\LoginPacket;
    use 
    pocketmine\network\mcpe\protocol\ProtocolInfo;
    use 
    pocketmine\plugin\PluginBase;

    /**
     * Class MultiProtocol
     * @package multiprotocol
     * @Edited by 7Wdev
     */
    class MultiProtocol extends PluginBase implements Listener {

        public function 
    onEnable() {
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }

        
    /**
         * @param DataPacketReceiveEvent $event
         */
        
    public function onLogin(DataPacketReceiveEvent $event) {

            
    $pk $event->getPacket();

            if(!
    $pk instanceof LoginPacket) {
                return;
            }

            
    $player $event->getPlayer();
            
    $currentProtocol ProtocolInfo::CURRENT_PROTOCOL;

            if(
    $pk->protocol !== $currentProtocol) {
                
    $pk->protocol $currentProtocol;
                
    $this->getLogger()->alert("§6{$player->getName()}'s protocol changed to {$currentProtocol}!");
            }
        }
    }
     
  4. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Who tf knows, like, try it for F sake.
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Fun fact: in some older versions of the client, even the LIGIN_PACKET constant is something else, so we can't even guess which packet is the LoginPacket, much less modify it.
    Even if editing this constant allows the client to join, you will quickly run into problems because protocol versions are bumped for a reason (We probably can't understand Mojang logic from the common sense though).

    And what if your world has some block types that older versions don't have? They will simply crash and you won't even find out why.
     
    dktapps likes this.
  6. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    I can't d
    I can't download a lower version of minecraft , bcz I am using w10
     
    Levi likes this.
  7. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    Mmmm , but I know a mcpe server using pocketmine and it is working in mcpe 1.8+1.9+1.10
     
  8. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    Ok the code works good
     
    Levi likes this.
  9. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Do many players still join it with 1.8? Are you sure 1.8 clients don't crash on it all the time?
     
    dktapps likes this.
  10. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    1.6 - crashes sometimes but not always
    1.7 - crashes only when flying
    1.8 - doesn't crash
    1.9 - doesn't crash
    1.10 - doesn't crash
     
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Have you tested every single operation you can do and every single block type you can see?
     
  12. 7awariGamer

    7awariGamer Baby Zombie

    Messages:
    120
    GitHub:
    7awariGamer
    There isn't any problem with blocks because they replaced with another blocks that belong to the oldest version , but I can't use the new items because the server crashes
     
  13. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    That's the point. This is only possible for a small subset of servers.
    There are also other issues that you might not have noticed.
     
  14. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Send update blocks.
     
  15. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Do you think that's easy to implement? You have tons of packets to translate because of this.
     
  16. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    This was just the blocks part, of course it's not easy.
     
  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.