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

Solved Detect if the Server is connected to the Internet

Comments in 'Plugin Development' started by Survingo, May 1, 2016.

  1. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Is that possible to detect if the Server is connected to the Internet?

    Because
    Code:
    RuntimeException: "yaml_parse(): end of stream reached without finding document 0" (E_WARNING) in "/plugins/Core/src/Survingo/Core" at line 2809
    doesn't looks good on the Console.
    That's just when the Server isn't connected to the Internet. I just want to make a error message like $this->getLogger()->error("Not connected to the Internet");
    Last edited: May 1, 2016
  2. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Find a pain text site with some text on it, and then check if file_get_contents returns that specific string
    Survingo likes this.
  3. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Thanks :p I'm going to test that, just have to find the line again lol
    and yes my main file has got 3609 lines :eek:
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    It can only mean one thing (No, not hotline bling) you're bad at OOP :p

    Not always number of lines is the indicator of how software good is.
  5. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Not at all, but finding everything and no errors in a 10mb plugin counts xD
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Sorry for off-topic but how does your plugin structure look like?
  7. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Bluefish and the search function. Bluefish does all
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Your whole plugin is in one file?

Share This Page

Advertisement