Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server Ip

Comments in 'Plugin Development' started by Sensej, Jul 3, 2015.

  1. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    Hey Plugin Developers,

    today im working on a Plugin which needs the Server Adress. I want to know how i could get the ip of my Server. Does anyone know how i could get it?
  2. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    What is the point on doing this?
    DunxandMinecraft likes this.
  3. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    I think you mean:
    $event->getServer()->getIp();
    ???
  4. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    No i dont mean this. I search a PHP function which shows on which ip the server is running.
  5. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
  6. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    go found a ip api website, and .....
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That returns the binding address.
    Utils::getIP()
  8. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    it work?
    http://checkip.dyndns.org
    yeah, that is my idea
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Utils::getIP() uses a list of online API to fetch server external ip. When one doesn't work, fallback to the next one. It is a static API function. It also caches the result.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Utils::getIP() uses a list of online API to fetch server external ip. When one doesn't work, fallback to the next one. It is a static API function. It also caches the result.

Share This Page

Advertisement