Separate names with a comma.
Comments in 'Plugin Development' started by EvolSoft, Feb 7, 2015.
I don't know anyone right now, but there should be one that we can use...
What can we do?
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:
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
Is there a way to forward packets directly from PocketMine (with a plugin) or using PHP builtin functions?
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.
How can I forward packets using RakLib?
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.
or wait till @shoghicp is inspired to finish rubberband xD
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)
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)
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())
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)
Then the target server will reject the connection because you didn't send the initial login packets.
And if I send the login packet and then I redirect to the other server?
Are they from the same socket and IP?
How could you do so?
I don't know