Player.transfer

Transfers the player in another node. The target node should be in server.nodes, otherwise the player will be disconnected by the hub with "End of Stream" message.

  1. void transfer(Node node)
    class Player
    void
    transfer
    (
    inout Node node
    )
  2. void transfer(string ip, ushort port)

Parameters

node Node

the name of the node the player will be transferred to

Examples

auto node = server.nodeWithName("main_lobby");
if(node !is null && node.accepts(player))
   player.transfer(node);

If the player should be transferred to another server using Pocket Edition's functionality the other transfer function should be used instead, using ip and port as parameters and not a node name.

Meta