Search Unity

Online Check PRO - Verify Internet reachability

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, May 24, 2017.

  1. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Online Check

    Online Check
    is a simple, configurable tool to reliably check your connection to the Internet (aka "captive portal detection") – in the editor as well as at runtime, where you need it, when you need it.

    Unity’s internal reachability check returns the type of Internet reachability possible on the current device.

    As mentioned in their documentation, this does not check for your actual connectivity – it only determines whether the device can, for example, connect to a hot spot. That’s not very helpful if it the actual route to the network is unavailable.

    Its main purpose is to gain a little bit more comfort by keeping track of your connection state, without consulting your browser or the OS display which both usually cause an unnecessary delay. This tool doesn’t check if you’re connected to a specific network. It checks if you have access to the Internet, which, for example, comes in handy when you’re on the road connected to a public WiFi.

    The asset also provides functions for ping check, speed test and network information like the public IP.


    Features:
    Internet connectivity

    • Reliably check for Internet connectivity:
      • Run on Start: Run the check as soon as the scene loads
      • Manual Mode: Check whenever you need it
      • Endless Mode: Automatically check continuously between intervals
      • Fallback check: Keeps checking in case of connection loss
    • Freely configurable intervals
    • Detect the kind of Internet connection (carrier or local network)
    • Less than 300 KB of data downloaded per hour (at 10 checks per minute)
    • Industry grade captive portal detection methods:
      • Google204
      • GoogleBlank
      • MicrosoftNCSI
      • Apple (HTTPS)
      • Ubuntu
    • Verify a custom URL (e.g. to check if a server is alive)
    • Ping check to determine the round-trip-time
    • Speed test to measure the download and upload speed
    • Network information, like public/local IPs, MACs etc.
    • Specialized checks for each platform:
      • Windows / WSA (UWP)
      • macOS / iOS
      • Linux / Android
      • Generic for all other platforms and devices

    Documentation & control
    • Test all checks in the editor
    • Powerful API for maximum control
    • Proxy manager for Internet connections
    • Detailed demo scenes
    • Comprehensive documentation and support
    • Full C# source code

    2.3.Compatibility
    • Supports all build platforms
    • Works with Windows, Mac and Linux editors
    • Compatible with Unity 2019.4 – 2023
    • C# delegates and Unity events
    • PlayMaker actions


    Some impressions:

    CT_Screenshot_04-01-2021-10-30-04-8.png

    CT_Screenshot_04-01-2021-10-30-58-0.png

    CT_Screenshot_04-01-2021-10-32-06-7.png

    CT_Screenshot_04-01-2021-10-32-37-9.png

    CT_Screenshot_04-01-2021-10-33-06-0.png


    Video:




    AssetStore:
    Online Check PRO
    Essential Tools Bundle
    All Tools Bundle

    Our other assets



    Demos:
    WebGL
    Windows
    Mac
    Linux
    Android


    Changes


    Feel free to download and test it.
    Any constructive comments are very welcome!


    So long,
    Stefan
     
    Last edited: Jan 26, 2023
  2. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    We've created a basic tutorial video:

     
  3. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    Hi there, I just bought the pro version for learning processes mainly. Nice asset works really well :)

    I was hoping you could clarify something for me?

    What is the reason for the IntervalMin and Max values, is there some issue with polling at a regular interval or something?
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi David

    Thank you for buying our asset!

    Those two values are the random range for the polling. The reason is that you don't wanna get banned by one of the verification sites - a random interval helps :)

    I hope this answers your question.


    So long,
    Stefan
     
  5. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    Thanks for the prompt response!

    Right ok that makes sense. And thats why you supply the fallback url? How much of an issue is that? Like how likely is it that you do get banned?
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    It's very unlikely to get any sorts of problems as long as you don't set the interval very low, e.g. all 0.5 seconds.
    This is why we limit the range to a minimum of 3 seconds. With the default settings, you will have an average of 7 seconds for a test. This should be accurate enough :)

    The fallback is only used if, for what ever reason, the main check fails.
     
  7. Weezel

    Weezel

    Joined:
    Apr 20, 2013
    Posts:
    25
    Hi, I have a couple of questions. Does this asset work on WebGL? Can it get the network SSID (also on WebGL)?
     
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    1. Yes it works with WebGL.
    2. No, it can't get the SSID.

    Cheers
    Stefan
     
  9. Weezel

    Weezel

    Joined:
    Apr 20, 2013
    Posts:
    25
    Thanks for the quick response!
     
    Stefan-Laubenberger likes this.
  10. pangsscn

    pangsscn

    Joined:
    Sep 11, 2017
    Posts:
    5
    Hi Stefan,
    I have bought the pro version, Can I check my socket server's status? and How to do?
    I just want to know the internet is connect and my socket server's status.
     
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    OC "only" tests if your app can connect to the Internet.
    It isn't intended to check if a specific server is alive - this is planned for an upcoming asset ;)

    However, if you wanna check the connection status of a socket, you could do it like this:
    Code (CSharp):
    1.  
    2. public bool isSocketConnected(Socket s)
    3. {
    4.    return !(s.Poll(1000, SelectMode.SelectRead) && s.Available == 0);
    5. }
    6.  
    I hope this is useful for you!


    Cheers
    Stefan
     
  12. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Unfortunately, one of our customers was very unhappy about our "update" and "review" reminders.
    We were under the impression that it's easy to postpone or disable those reminders, but I think it's a good idea to explain it once and for all ;)

    Per default, OC (and all our other assets) checks once per day for a new version. If there is a new version available, this window will appear:
    OC_Update.PNG

    • Yes, let's do it!: redirects to the Unity AssetStore to download the new version
    • Not right now: postpone the check for one day and ask again tomorrow
    • Don't check again!: the asset will no longer check for updates (= this window won't appear again)


    Since ratings and reviews are vital for us, we added a "review" reminder. After 13 days of usage (= used at least once per day), OC displays this window:
    OC_Reminder.PNG
    • Yes, let's do it!: redirects to the Unity AssetStore to rate the asset
    • Not right now: postpone the check for another 13 days of usage and ask then again
    • Don't ask again!: the asset will no longer ask for reviews (= this window won't appear again)

    The checks can also be enabled/disabled in the configuration:
    OC_Config.PNG

    I hope this clarifies the situation.


    Cheers
    Stefan
     
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Important notice for all "standard" customers:

    We constantly try to push our assets to the next level by adding new features and deliver the best support for our customers. In the past we've kept updating the asset in a 2-month cycle. However, after careful consideration, we feel like this needs to happen at a faster pace. We've received numerous input from the community that a faster pace would help out a lot. Because Unity is ever evolving and we want to keep our assets relevant we need to be able to keep up the fast pace that is Unity's second nature. Packaging and maintaining a separate DLL-version poses a problem in regards to this goal.

    With this in mind, we decided to phase out the DLL-version by the end of August 2018.
    Besides being able to update the asset more often, we are convinced that phasing out the DLL-version in favor of the PRO version will also bring these improvements for our customers:
    1. More functionalities and supported platforms due the source code (e.g. WSA (UWP), IL2CPP under Android and Linux)
    2. Less frictions with different Unity versions within the same company
    3. Fast hotfixes and high priority support

    We understand that this may impact you negatively. However we hope with the upgrade-path we offer to you - our loyal DLL-customers - can alleviate your concerns and win you over once more:
    PRO edition

    Please rest assured we will continue to support and improve the PRO version over the years to come.

    I hope you understand our decision.


    Cheers
    Stefan
     
    Last edited: May 12, 2019
  14. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Last edited: Aug 21, 2018
  15. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Update regarding the deprecation of the standard package:

    The standard package is planned to be available (but no longer maintained) until December 2018. This will allow the transition to PRO with a 50% reduced upgrade-price for our existing customers.
    Afterwards, the package will vanish from the store and the upgrade path will become inaccessible.


    Edit:
    We managed to create an upgrade path for the standard version which will last forever.
    Therefore, customers of the DLL version can still upgrade to PRO for 50% of the full price.
     
    Last edited: May 12, 2019
  16. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    Hi Stefan,

    Tried your Discord, but couldn't find you amongst the tumbleweeds lol.

    Just wondering where you are supposed to check if the CustomCheck is alive as there is no callback like there is for the other three checks.

    Justin
     
  17. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi Justin

    Sorry, I wasn't online the last few hours, but now I'm available in Discord.
    Would you like to discuss it there?


    Cheers
    Stefan
     
  18. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    Thanks Stefan. I will ... and we did! :)
     
  19. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi,

    Could you please tell me does this asset work with Android 9.0 Pie? It expects apps to use HTTPS by default and HTTP is permitted only as a configured exception.
     
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    It should work without any problems with Android 9.0.
    Do you get an error or warning?
    If so, can you please send it to me? We currently don't have an Android 9.0 device to test it...

    Thx!


    Cheers
    Stefan
     
  21. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi! I'm using another internet verifier asset that is not working on new Android devices. My game is live and some of the customers can't play the game right now. So I'm looking for alternative asset like yours if it works on new Android. I will purchase it. :)
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    As I said, it should work ;)
    If there is a problem, I'm sure we can fix it in no time.

    Cheers
    Stefan
     
    Nadan likes this.
  23. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Hello Stefan,
    I'm interested in the plugin, but when I turn off wifi the webgl demo not shows offline, always shown online. I need it for webgl.
    Thx!
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Yes, you're totally right! We made an error in the deployment of the demo... Please try it again ;)


    Cheers
    Stefan
     
  25. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Last edited: Feb 5, 2019
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
  27. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Purchased! :D
     
    Stefan-Laubenberger likes this.
  28. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Hi Stefan, I have a simple question, how do I get the type of connection? I need to identify when it's mobile data.
    Thank you!
     
  29. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    You can check it with "OnlineCheck.NetworkReachability" and listen to the callback "OnNetworkReachabilityChange".

    I hope this helps you further.


    Cheers
    Stefan
     
  30. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Hi Stefan!

    I have a project that is exported for android and webgl, I have problems to check the connection only in webgl. (works perfectly in editor, exe and apk).
    I have to do something specific for webgl?

    I do not know what I can be doing wrong, considering that in the other platforms it works.

    By the way, I did the test in chrome, edge and mozilla firefox with a simple toggle on screen, whose ".isOn" is set in each frame directly with the value of "OnlineCheck.isInternetAvailable", but it does not change in the damn webgl xD.
    If I do not need to do something specific to work on that platform, could you provide me with the demo project?

    (sry for my english :v)

    Thx!
     
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    You need a "Custom Check" for WebGL. Normally, I recommend to add simple text-file with one line as content (e.g. a unique detection string, like "<mygame> rulez!". Then copy it next to the index html from the WebGL-build on the server. Then create an custom check (right-click in "OnlineCheck" on the field "Custom Check") and set the correct values:
    upload_2019-2-24_8-13-38.png

    upload_2019-2-24_8-10-8.png

    Important: the URL must be https or it wont work!

    I hope this helps you further, please let me know.


    So long,
    Stefan
     
    CDCappa likes this.
  32. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Thank you!

    I'll do it as soon as I have time.
    I promise to pass by here.

    Greetings.
     
  33. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Now that I think about it, if https is a necessity I am in trouble, because in this case it is very important to be able to test locally with "Build And Run" (http). Also, unfortunately I do not have enough knowledge in the area of networks to take the bull by the horns.

    What do you think? Maybe I'm exaggerating the problem out of ignorance. What should I know?
    I think I could learn to use Xampp since it seems simple, but according to what I have read it only serves to mount in http.

    Stefan thank you very much for your time, I hope this annoyance serves you for the type of user like me, that we buy these utilities because we are not able to study networks for lack of time.
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    We have a solution for you.
    Please send me a PM or an email to discuss it further.
     
    CDCappa likes this.
  35. CDCappa

    CDCappa

    Joined:
    Mar 18, 2016
    Posts:
    15
    Thx!
     
  36. Dashtestani

    Dashtestani

    Joined:
    Jan 20, 2015
    Posts:
    1
    Hi I just bought Online Check PRO, after importing into unity 2018.2.0f2 I am getting an error.
    /---------------
    #if UNITY_2018_2_OR_NEWER
    ManagedStrippingLevel level = ManagedStrippingLevel.Disabled;

    if (PlayerSettings.GetScriptingBackend(group) == ScriptingImplementation.Mono2x && PlayerSettings.GetManagedStrippingLevel(group) != level)
    {
    PlayerSettings.SetManagedStrippingLevel(group, level);

    Debug.Log("Android: stripping level changed to '" + level + "'");
    }
    #else
    /---------------
    in this line of code ManagedStrippingLevel and SetManagedStrippingLevel & GetManagedStrippingLevel
    can not be found
    /---------------
     
  37. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Thank you for reporting this!

    There is an bug in "SetAndroid.cs" in line 26 - it must look like this:
    #if UNITY_2018_3_OR_NEWER

    I apologize for the inconvenience!


    Cheers
    Stefan
     
  38. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi! I just want to know in a simple way if the game has internet accessible in a bool. Is it okay this way? Function works, but I would like to be 100% sure that I will have correct information.

    if(OnlineCheck.NetworkReachability == NetworkReachability.NotReachable)
    {
    isConnected = false;
    }
    else
    {
    isConnected = true;
    }
     
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Yes, that will work. Here is an even easier solution:
    Code (CSharp):
    1. isConnected = OnlineCheck.isInternetAvailable;
    Make sure you've enabled "Endless Mode":
    upload_2019-4-19_15-24-45.png

    I hope this answers your question.

    Happy Easter! :)


    Cheers
    Stefan
     
    Last edited: Apr 19, 2019
    gferrari likes this.
  40. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Thank you! :D :D
     
    Stefan-Laubenberger likes this.
  41. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hello! I wanted to ask you, if the time of Last Checked is taken from the internet. If so, I would love to be able to use it in a cheating control so the user don't change the time in the game. I ask curious. The asset is great and works very well!
     
  42. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I also have this warning when running it on Android. I use Unity 2018.12f1, What could be to solve it?
    I apologize for so many post!


    Plugins: Couldn't open c, error: dlopen failed: library "c" not found

    System.Net.WebClient:GetWebRequest(Uri)
    Crosstales.Common.Util.CTWebClient:GetWebRequest(Uri) (at Assets/Plugins/crosstales/Common/Scripts/Util/CTWebClient.cs:45)
    Crosstales.OnlineCheck.Util.CTWebClientNotCached:GetWebRequest(Uri) (at Assets/Plugins/crosstales/OnlineCheck/Scripts/Util/CTWebClientNotCached.cs:20)
    System.Net.WebClient:DownloadString(String)
    Crosstales.OnlineCheck.OnlineCheck:threadCheck(Boolean&, String, String, Boolean, String, Boolean) (at Assets/Plugins/crosstales/OnlineCheck/Scripts/OnlineCheck.cs:688)
    Crosstales.OnlineCheck.<>c__DisplayClass98_0:<startWorker>b__0() (at Assets/Plugins/crosstales/OnlineCheck/Scripts/OnlineCheck.cs:718)
    System.Threading.ThreadHelper:ThreadStart()
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    No problem, we're here to help! It's probably easier and faster if you write us an email.

    Anyway, to answer your questions:
    • "Last Check" is the local time. Online Check can't prevent time cheating, but we're working on such a solution for a seperate asset. If you're interested in a further updates, let me know.
    • About the Android issue: we have to investigate this further. Meanwhile, please change line 99 of "OnlineCheck.cs" to "private const bool forceWWW = true;" Please let me know if this helps to prevent the warning.
     
    gferrari likes this.
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
  45. Kukiri_Komakai

    Kukiri_Komakai

    Joined:
    Jun 4, 2020
    Posts:
    1
    Hi!

    First at all thank you for this plugin, it's perfect!

    Only one doubt, can I somehow get any server date from it? I'm finding a way to check it in unity but the only thing I see is uploading a php script on my server and I don't have any...

    Sorry if that's out-topic and thanks for the help!
     
  46. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Thank you for your kind words!

    What do you like to accomplish exactly?


    So long,
    Stefan
     
  47. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi,
    I have an error with the plugin imported in a blank project. It's something about the HttpUtility.
    I can't press Play.
    See the attached images.
    Unity 2020.1 with android project + google play services plugin http-utiliy error.png
    http-utiliy error 2.png
     
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hi

    Please make sure you're using the latest version 2020.3.0 of Online Check.


    Cheers
    Stefan
     
  49. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi,
    I have updated the plugin to the latest version 2020.3.0 and imported in a new blank project but the problem persists.
    upload_2020-8-3_12-42-6.png
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,980
    Hello again

    It's really strange, it works on our side:
    upload_2020-8-3_13-10-31.png

    Can you please cross-check your player settings with our screenshot?

    If it still doesn't work, please delete the folder "SpeedTestNET".


    Cheers
    Stefan