Solved Reconnecting or transferring players across servers

Discussion in 'Plugin Development' started by wesley27, May 5, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    wesley27

    Hello all, I've just got a quick question for today! I was wondering if there is a method of some sort, or using an API, or some way to transfer a player from one server to another? We all know how spigot/bungee works, where you type in the server command and you go to that server. Well, with the bukkit API or some API is there a way I can do that? So that when a player types a command, or an event occurs, it takes them to another server?

    Thanks in advance!
     
  2. Probably a mod will say "we don't support ...."

    Code:
    @Override
    public void onEnable() {
        Bukkit.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    }
    
    public void connect(Player player, String server) {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(b);
       
        try {
            out.writeUTF("Connect");
            out.writeUTF(server);
        } catch(IOException e) {
           
        }
       
        player.sendPluginMessage(this, "BungeeCord", b.toByteArray());
    }
     
    wesley27 likes this.
  3. Offline

    mythbusterma

    @wesley27

    No, you can't do this without using software we don't support here.
     
  4. Offline

    eyamaz

    @MaTaMoR_ Yeah, we don't support BungeeCord, but that's not what OP is asking. We've done this in online mod in forge mods, but pretty sure you can't do it in online mode with bukkit. Unless someone can prove me wrong with that, this topic is now locked.

    Edit: @1Rogue just made a good point that you can't prove that wrong if I lock the topic. I think I need more coffee. :p Topic reopened. Keep solutions to not requiring Offline mode.
     
    Last edited: May 5, 2015
    wesley27 likes this.
  5. Offline

    RawCode

    You dont need bungee to proxy network traffic, just resending all packets will work fine.
    Resending raw data will work ever better.
    Resending raw compressed data encrypted with key player want will work with minimal overhead and delay.

    You dont need to perform "login" procedure if specific IP have full trust, all checks can be skipped and player with specific name and uuid simply created and placed into world.

    Since OP ask for complete ready to use solution - answer is no.
     
  6. Offline

    wesley27

    Thanks for the replies, guys, and thanks for keeping it open @eyamaz :p

    This definitely helps, and I will look further into what @RawCode is saying. Thanks @MaTaMoR_ a lot for that! I'll refrain from asking questions here as I know that isn't supported. But thanks, I know where to go from here :)
     
Thread Status:
Not open for further replies.

Share This Page