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

RFC Enhancements to mcpe-protocol in plugin.yml

Discussion in 'Contributing & RFCs' started by yuko fuyutsuki, Mar 15, 2021.

  1. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
    Introduction:
    The current mcpe-protocol directive in the plugin.yml disables the plugin when the protocol is updated. This RFC proposes to improve that feature.

    Subject:
    The current spec uses only the protocol described in mcpe-protocol to determine whether to enable or disable, regardless of the packets used by the plugin, but this is not desirable because developers with low update frequency are rushed to support the latest version by Poggit and others.

    So, I think it would be a good to disable the plugin only when the specific packet used by the plugin is updated by using the following structure for mcpe-protocol and writing the last updated protocol version of the packet.
    Also, I suggests implement this feature on master(API 4.0).

    e.g.
    plugin.yml
    Code:
    mcpe-protocol:
      AddPlayerPacket: 428
      StartGamePacket: 428
    
    Const class that summarizes the last updated version of the protocol
    PHP:
    final class PacketVersion {

        ~~~
        public const 
    ADD_PLAYER_PACKET 291;
        ~~~
        public const 
    START_GAME_PACKET 428;

    }
    Result
    If even one of the versions is less than the tested version of the packet, disable the plugin.

    PacketVersion::{PACKET_NAME} >= mcpe-protocol.{PacketName} = true
    PacketVersion::{PACKET_NAME} < mcpe-protocol.{PacketName} = false

    BCBreak:

    The old mcpe-protocol directive should work as well, and this change will be added. so BCBreak will not occur.
    However, there are only a handful of plugins that use this directive....

    What a maintainer should do with this:
    • When updating packet, you need to update the packet version at the same time.
     
    Last edited: Mar 15, 2021
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    This is actually an interesting idea. But you should post this as a GitHub RFC. It's going to get forgotten here because I don't browse this section very often.
     
    yuko fuyutsuki likes this.
  3. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
    It's okay but if so, I think it would be a good to migrate the forum RFC to GitHub Discussion.
     
  4. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
  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.