yesdog / Waterdog

Waterdog, a Yesdog fork of Waterfall/BungeeCord that adds Bedrock support.
MIT License
186 stars 37 forks source link

how to transferservers using the proxy on pmmp #23

Closed AlexPads closed 5 years ago

AlexPads commented 5 years ago

I have it set up with a lobby and when a player clicks the server they want to go to it sends them there but with a proxy how do I do that I have tried making the command run as the player sudoing the player to run the command and all that so how would you do this!

colinrgodsey commented 5 years ago

so, you cant really 'sudo' any of the bungee commands. they only work because they're part of the client packet stream, so you cant force players to run them directly from a plugin. you need to use the script message packet with the key/value messages that bungee normally uses. we're working on setting up some plugins for pmmp, but dont have anything officially published yet.

you should join the discord here: https://discord.gg/MhhWfSW

rgxdev commented 3 years ago
public static function transfer(Player $player, string $server)
{
    $pk = new TransferPacket();
    $pk->address = $server;
    $pk->port = 0;
    $player->directDataPacket($pk);

}
TobiasGrether commented 3 years ago

That won't work with WD1 iirc. You should use the ScriptCustomEventPacket "Connect" tag or some other way to tell the proxy to transfer the player