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

Login player by ip or cid

Discussion in 'Development' started by Harviy11, Nov 27, 2016.

  1. Harviy11

    Harviy11 Baby Zombie

    Messages:
    100
    hello, can i login player by ip or cid?
     
    SalmonDE likes this.
  2. Jons

    Jons Spider

    Messages:
    14
    GitHub:
    jonsmc
    yes you can, but i think $ip variable inside a Player object has been marked as private, so you will need to change that to public
     
    SalmonDE likes this.
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you can use get remote address or something to get it
     
    SalmonDE likes this.
  4. Jons

    Jons Spider

    Messages:
    14
    GitHub:
    jonsmc
    Packet?
     
  5. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    no under player object
    not exactly sure doe
     
    SalmonDE likes this.
  6. Jons

    Jons Spider

    Messages:
    14
    GitHub:
    jonsmc
    I think we can get player's ip upon join, which when player sends PlayerLoginPacket or anything similar i dont remember, we can get the ip :p
     
  7. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Just use:
    Code:
    $player->getAddress();
     
    SOFe likes this.
  8. Jons

    Jons Spider

    Messages:
    14
    GitHub:
    jonsmc
    Too lazy, im familier with packet :p
     
  9. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    What?
     
    SalmonDE likes this.
  10. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    so is
    getting the IP itself off packet THEN storing it into an array for future access better then $player->getAddress();?
     
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Have fun. I wonder which method you are using? I hope you aren't starting a Wireshark service to detect identical packets from those you sent.

    How hard is it to call getAddress() upon a player?
     
  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.