Sockets4MC : No more Plugin Messaging Channels! 5.0.4

for Spigot & BungeeCord

  1. Hazae41
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    Source Code:
    https://github.com/RHazDev/Sockets4MC
    [​IMG]


    [​IMG]

    ________________________________________________________________________________________________________________

    Tired of Plugin Messaging Channels?

    This plugin simply allows developers to send any data from a server to another using sockets with RSA and AES encryption

    You can send data from any instance of BungeeCord or Spigot to any instance of BungeeCord or Spigot, just with few lines and without headache ;)

    You're an admin?

    • Just put the file and Kotlin4MC in the plugins folder of your BungeeCord and of your Spigots
    Example of network
    Let's suppose you have one BungeeCord and two Spigots: Factions and HungerGames.

    Each server will have one socket, each on a different port.

    So, let's say:
    • BungeeCord has a socket on port 25590
    • Factions has a socket on port 25591
    • HungerGames has a socket on port 25592
    It is recommended to use only one socket per plugin, with id "default", but if you want you can add multiple sockets with different ids.

    BungeeCord
    Code (YAML):
    default:
      name
    : MyProxy
      port
    : 25590
      password
    : mypassword
      bootstrap
    :
         - <address of Factions>:25591
          - <address of HungerGames>:25592
     
    password is used to prevent third party socket from joining your network, it needs to be the same for all your sockets on the same network.

    Factions
    Code (YAML):
    default:
      name
    : Factions
      port
    : 25591
      password
    : mypassword
      bootstrap
    :
       - <address of BungeeCord>:25590
        - <address of HungerGames>:25592
     
    HungerGames
    Code (YAML):
    default:
      name
    : HungerGames
      port
    : 25592
      password
    : mypassword
      bootstrap
    :
       - <address of BungeeCord>:25590
        - <address of Factions>:25591
     
    If you have problems while connecting your servers on different machines, try setting "discovery: false" in your socket configuration and report it to me ;)

    You're a developer?

    Your plugins can be connected, here is how

    Usage
    Kotlin
    Code (Java):
    // On one side
    onSocketEnable(id = "default"){
        onReady{
            msg(channel = "MyChannel", data = "What is the answer to life?")
        }
       onMessage(channel = "MyChannel"){ msg ->
            val answer = msg["data"] as? String
            logger.info("The answer to life is $answer")
        }
    }

    // On other side
    onSocketEnable(id = "default"){
        onMessage(channel = "MyChannel"){ msg ->
            if(msg["data"] == "What is the answer to life?")
                msg(channel = "MyChannel", data = "42")
        }
    }
    Java
    Code (Java):
    // On one side
    onSocketEnable(/*plugin*/ this, /*id*/ "default", (socket) -> {
        socket.onReady(connection -> {
            connection.msg(/*channel*/ "MyChannel", /*data*/ "What is the answer to life?");
        });
        socket.onMessage(/*channel*/ "MyChannel", (connection, msg) -> {
            String answer = (String) msg.get("data");
            getLogger().info("The answer to life is "+answer);
         });
    });

    // On other side
    onSocketEnable(/*plugin*/ this, /*id*/ "default", (socket) -> {
        socket.onMessage(/*channel*/ "MyChannel", (connection, msg) -> {
            if(msg.get("data").equals("What is the answer to life?"))
            connection.msg(/*channel*/ "MyChannel", /*data*/ "42");
        });
    });
    More examples

    Implementation
    - Kotlin DSL: add this to your build.gradle.kts
    Code (Text):
    repositories {
        maven { url = URI("https://mymavenrepo.com/repo/NIp3fBk55f5oF6VI1Wso/")}
    }

    dependencies {
        compileOnly("fr.rhaz.minecraft:sockets4mc:5.0.4")
    }
    - Gradle: add this to your build.gradle
    Code (Text):
    repositories {
        maven { url 'https://mymavenrepo.com/repo/NIp3fBk55f5oF6VI1Wso/' }
    }

    dependencies {
        compileOnly 'fr.rhaz.minecraft:sockets4mc:5.0.4'
    }
    - Maven: add this to your pom.xml
    Code (Text):
          <repositories>
            <repository>
                <id>rhazdev</id>
                <url>https://mymavenrepo.com/repo/NIp3fBk55f5oF6VI1Wso/</url>
            </repository>
          </repositories>

          <dependencies>
            <dependency>
                <groupId>fr.rhaz.minecraft</groupId>
                <artifactId>sockets4mc</artifactId>
                <version>5.0.4</version>
                <scope>provided</scope>
            </dependency>
          </dependencies>
    Do not forget to add the #sockets4mc to your GitHub repository! ;)

    Additionnal services
    • Help to configure: free
    • Help to develop: free
    • Bug fix: free
    • Small new feature: free
    • Big new feature: paid
    • Port to Sponge, Nukkit, etc: paid
    • Asking me to make a plugin using this plugin: paid

    ________________________________________________________________________________________________________________
    [​IMG]
    [​IMG]
    Getreidemonster, IdkMan, Fxve and 6 others like this.

Recent Updates

  1. 5.0.4
  2. 5.0.3
  3. 5.0.2

Recent Reviews

  1. DrOreo002
    DrOreo002
    5/5,
    Version: 4.0.4
    This will helps me a lot on developing bungee plugin!. Thanks for this!

    100 Chars
    1. Hazae41
      Author's Response
      You're welcome! Please consider donating if you want to support this plugin :)
  2. Pas02
    Pas02
    5/5,
    Version: 4.0.3
    I like the idea of the plugin and it's easier to understand than PluginMessaging!
    1. Hazae41
      Author's Response
      Thanks! Please consider donating if you want to support this plugin :)
  3. Cisnet
    Cisnet
    5/5,
    Version: 3.2.8
    thanks .
    1. Hazae41
      Author's Response
      You're welcome! Please consider donating if you want to support this plugin :)
  4. Getreidemonster
    Getreidemonster
    5/5,
    Version: Release 3.2.5
    Unfortunately the example-code doesn't works - I'm using Java 8, my plugins (bungeecord- and spigot-side) has no errors.
    The BungeeCord Code doesn't sends any message to my console.

    Any ideas?
    1. Hazae41
      Author's Response
      Send me your code
  5. Getreidemonster
    Getreidemonster
    5/5,
    Version: Release 3.2.4
    Hi, nice releases in the last time - I just got a quick question (i was a long time not using socket4mc xD) how do i get "getSocket()" method? isn't there already in the api itself?

    Spoonfeed me please with the getSocket method xD (seriously)
    1. Hazae41
      Author's Response
      Use Socket4Bukkit#getClient()
      or Socket4Sponge#getClient()
  6. Dawid
    Dawid
    3/5,
    Version: Release 2.1.7
    Good plugin but I have a errors in console and if sockets not be connected CPU usage is very big!
    1. Hazae41
  7. keke142
    keke142
    1/5,
    Version: Beta 2.1.3
    Terrible CPU usage and the author not answering to my private message.
    Otherwise the plugin itself is not bad, pity ....
  8. Getreidemonster
    Getreidemonster
    5/5,
    Version: Beta 2.1.3
    Awesome! I don't like Plugin Messaging Channels... sockets are much easier to understanding :D

    Thanks @Hazae41! :))
    1. Hazae41
  9. JustSanchyro
    JustSanchyro
    4/5,
    Version: Beta 2.1.3
    Hey dude, I like the idea but im trying to figure this out.
    I want it to set in my scoreboard the amount of players in a specific server.
    Please help me
    1. Hazae41
      Author's Response
      You can do it by sending data in JSON
  10. Boss_Aimbot
    Boss_Aimbot
    2/5,
    Version: Beta 2.1.2
    1. Hazae41
      Author's Response
      Please check your ports. And please MP me instead of sending negative review.