ComuCator 1.0.0

P2P Network for Messages which connect everything

  1. geNAZt
    ComuCator

    This API is there to send Messages without any limitations. You can use it even if no Players are online or if you won't use Minecraft Threads to handle much Messages.

    !!! Also works in Bukkit/Spigot !!!
    You will find the BungeeCord Version in this Resource.
    The Bukkit Version is on Jenkins.
    Jenkins: http://jenkins.cube-space.net/job/ComuCator/

    Maven:
    Repository: http://nexus.cube-space.net/content/groups/public/

    Code (Text):
    <dependency>
      <groupId>net.cubespace</groupId>
      <artifactId>ComuCator-Core</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>
    How to use it:

    You need to define Messages which you want to send over the Network. There is a AbstractMessage which need to be implemented. Here is a example of a Message:

    Code (Text):
    @Channel("Test")
    public class TestPacket extends AbstractMessage {
        @Getter
        @Setter
        private String test;

        public TestPacket() {}

        @Override
        public Message write(DataOutputStream outputStream) {
            try {
                DefinedPacket.writeString(test, outputStream);
            } catch (IOException e) {
                Logger.error("Could not write Message :(");
            }

            return this;
        }

        @Override
        public Message read(DataInputStream inputStream) {
            try {
                test = DefinedPacket.readString(inputStream);
            } catch (IOException e) {
                Logger.error("Could not read Message :(");
            }

            return this;
        }
    }
    You need to specify either the @Channel annotation or overwrite the getChannel() method to select in which channel this Packet should send. A Packet can currently on send to one channel. This may change.

    Now you need to register the Packet via the PacketManager:

    Code (Text):
     PacketManager.registerPacket(TestPacket.class);
    After that you are good to go and send of messages.

    Code (Text):
    TestPacket testPacket = new TestPacket();
    testPacket.setTest("test");
    testPacket.send();
    This message will currently not send off since no Client has a Listener for it.

    A listener looks like this:

    Code (Text):
    @Channel("Test")
        public class TestListener extends AbstractPacketListener {
            @PacketHandler
            public void onTestMessage(TestPacket testPacket) {

            }
        }
    Once you registered it via:

    Code (Text):
    PacketManager.registerListener(new TestListener());
    It will start to listen to Messages and other Clients will start to send over Messages if needed.

    Development and Support
    ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬ ▬
    The fastest way to get support is via IRC. Join #geNAZt on Esper.net.

    I will create some Tutorials in the Wiki: http://www.spigotmc.org/wiki/genazt-s-plugins/. If you want to help me go ahead :)

    If you found a Bug please make sure you have a Reportfile about it. It makes lifes easier :D

    In case you found a problem / bug or have a feature request, don't hesitate to let us know! If you are a developer, you can find the source of this plugin on geNAZt's GitHub profile. Development builds can be found on our Jenkins system.

    Current Build Status: [​IMG]

    If you like what i do and want to spend me a Cookie:
    [​IMG]
    Assossa likes this.