Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Experimental][NewAPI] teleport player to another server on join

Comments in 'Plugin Development' started by EvolSoft, Feb 7, 2015.

  1. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    I don't know anyone right now, but there should be one that we can use...
  2. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    What can we do? :)
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I have this theory, which is purely in programming perspective (but not things like proxies):

    This theory, however, has a disadvantage that you have to design a protocol and block the original server's core from interacting with the player, but without closing the session (you can close the session if you find a way to do so without the client receiving a disconnect packet or without the socket getting closed).
    Therefore, it is easier to do this:

    EvolSoft likes this.
  4. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    I thought a thing like it. The problem is that i don't know how Minecraft PE multiplayer packets work.
    It's a bit difficult to write a PocketMine like software if you don't know packets that the client receive and how they are processed from the client.
    For exmaple I designed a small TCP server for a game. It was easy to make because I had the source code of client multiplayer interface
    Last edited: Feb 10, 2015
  5. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Is there a way to forward packets directly from PocketMine (with a plugin) or using PHP builtin functions?
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Well, PocketMine/RakLib doesn't share the raw RakNet packets received. RakLib processes packets from clients and split them into data packets, and "PocketMine knows nothing about RakNet" as @shoghicp said. You have to recreate the packets. Moreover, you need to make up the forward packets if you use the direct method.
    However, it is possible that you just make up a protocol for communication between the hub server and the sub server.
    EvolSoft likes this.
  7. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    How can I forward packets using RakLib?
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I just said, PocketMine knows nothing about RakNet. RakLib processes all packets that come directly from players. You can't do that, because data packets are different from RakNet packets.
    You should transfer data by yourself instead.
    EvolSoft likes this.
  9. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    or wait till @shoghicp is inspired to finish rubberband xD
    iksaku likes this.
  10. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Ah ok. I didn't understand.
    How can I do this in a easy way? (I don't want to code another C# program to forward UDP packets)
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Make PocketMine ignore do nothing towards a player, then send data to another server that has a plugin to receive data and let PocketMine process it (like Specter)
    EvolSoft likes this.
  12. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Thank you :D
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Making PocketMine ignore it is hard enough though, because if you read carefully what I said, you can't remove the session directly, or the connection will be closed. And if you do otherwise, plugins may do something to that player, thinking that the player is online (as in Server::getOnlinePlayers())
  14. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Yes I know. But I have an idea to fix this. However is there a way to redirect directly the connection? (Something that will do the same thing as IPTables)
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then the target server will reject the connection because you didn't send the initial login packets.
  16. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    And if I send the login packet and then I redirect to the other server?
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Are they from the same socket and IP?
  18. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Yes
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    How could you do so?
  20. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    I don't know

Share This Page

Advertisement