Class BungeecordDispatcher


  • public abstract class BungeecordDispatcher
    extends Object
    • Field Detail

      • sendToMain

        protected final boolean sendToMain
      • sendToSub

        protected final boolean sendToSub
      • sendToBungeeCord

        protected final boolean sendToBungeeCord
      • registered

        protected boolean registered
    • Constructor Detail

      • BungeecordDispatcher

        public BungeecordDispatcher​(@NotNull
                                    @NotNull ADPPlugin plugin,
                                    boolean sendToMain,
                                    boolean sendToSub,
                                    boolean sendToBungeeCord)
    • Method Detail

      • register

        public void register()
        Register dispatcher
      • unregister

        public void unregister()
        Unregister dispatcher
      • registerChannel

        protected abstract void registerChannel​(@NotNull
                                                @NotNull MessageChannel channel)
        Register a messaging channel
        Parameters:
        channel - the channel to register
      • unregisterChannel

        protected abstract void unregisterChannel​(@NotNull
                                                  @NotNull MessageChannel channel)
        Unregister a messaging channel
        Parameters:
        channel - the channel to unregister
      • sendPacket

        public boolean sendPacket​(@NotNull
                                  @NotNull ADPPacket packet,
                                  @NotNull
                                  @NotNull MessageChannel channel)
        Send a packet
        Parameters:
        packet - the packet to send
        channel - the channel to use
        Returns:
        true if sent successfully
      • sendPacket

        public abstract boolean sendPacket​(@NotNull
                                           @NotNull ADPPacket packet,
                                           @NotNull
                                           @NotNull MessageChannel channel,
                                           boolean log)
        Send a packet
        Parameters:
        packet - the packet to send
        channel - the channel to use
        log - enable debug logs
        Returns:
        true if sent successfully
      • sendPacketToUser

        public boolean sendPacketToUser​(@NotNull
                                        @NotNull ADPPacket packet,
                                        @NotNull
                                        @NotNull User user,
                                        @NotNull
                                        @NotNull MessageChannel channel)
        Send a packet
        Parameters:
        packet - the packet to send
        user - the user where to send the packet
        channel - the channel to use
        Returns:
        true if sent successfully
      • sendPacketToUser

        public abstract boolean sendPacketToUser​(@NotNull
                                                 @NotNull ADPPacket packet,
                                                 @NotNull
                                                 @NotNull User user,
                                                 @NotNull
                                                 @NotNull MessageChannel channel,
                                                 boolean log)
        Send a packet
        Parameters:
        packet - the packet to send
        user - the user where to send the packet
        channel - the channel to use
        log - enable debug logs
        Returns:
        true if sent successfully
      • sendForwardPacket

        public boolean sendForwardPacket​(@NotNull
                                         @NotNull ADPPacket packet)
        Send a forward packet that will be dispatched to every server. This is supported by BungeeCord channel only.
        Parameters:
        packet - the packet to send
        Returns:
        true if sent successfully
      • sendForwardPacket

        public abstract boolean sendForwardPacket​(@NotNull
                                                  @NotNull ADPPacket packet,
                                                  boolean log)
        Send a forward packet that will be dispatched to every server. This is supported by BungeeCord channel only.
        Parameters:
        packet - the packet to send
        log - enable debug logs
        Returns:
        true if sent successfully