1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Transferring player when client sends login packet

Discussion in 'Development' started by TheGhan, Jun 3, 2017.

  1. TheGhan

    TheGhan Silverfish

    Messages:
    15
    How do I transfer a player if their protocol version is below the current one (113)? I have tried sending it when the server receives the login packet but it says the server has attempted to send TransferPacket too early. Any ideas?
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    @dktapps Allow sending TransferPacket before login?
     
    jojoe77777 likes this.
  3. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    I also have a question with packets. Is there a way to send a packet from Server1 to server2 using sockets?
     
  4. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    Attempt to transfer the player when they are kicked for outdated client or outdated server.
     
  5. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    But then there is the button to close the screen
     
  6. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    PlayerKickEvent is fired before the player is kicked from the sever.
     
  7. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Ou ok. And can I call PlayerKickEvent using $p->close(); ?
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    This is off-topic. Are you sure you understand what packets and sockets are?
     
    0x15f likes this.
  9. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Yes. I already have a socket connection between two servers. And I can send message between them
     
  10. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    Why not just use a TransferPacket? Using sockets to transfer a player when there is already a method is time consuming and complicated.
     
  11. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    The TransferPacket takes so much time
     
  12. TheGhan

    TheGhan Silverfish

    Messages:
    15
    I have tried doing so on my own fork but it simply shows the "Disconnected from Server" message - on the console it says "logged out due to transfer"
    Server uses Player::close() event when it shows the outdated server message - does it still fire kick event?
     
  13. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Have you read the comment on that function? Anyway, you can try sending the packet on PlayerLoginEvent.
    PHP:
    /** @var PlayerLoginEvent $event */
    $event->getPlayer()->transfer("forums.pmmp.io");
     
  14. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Protip: The time you might spend to make a proxy that prevents the use of TransferPacket will be greater than the grand total sum of the time people spend waiting for the several seconds of lag + several tens of seconds of building terrain because they received a TransferPacket on your server.
    Now stop getting off-topic.
     
  15. TheGhan

    TheGhan Silverfish

    Messages:
    15
    If you read above then you would have known I want to transfer an outdated client. The player is already kicked before PlayerLoginEvent is fired.
    @dktapps Any ideas?
     
    Last edited: Jun 4, 2017
  16. TheGhan

    TheGhan Silverfish

    Messages:
    15
    Now PMMP is not handling the BatchPackets from 1.0.7 clients. Any way to handle them and then transfer them to another server?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.