[Plugin] Ping

Forum Home Forum Home > Construct 2 Development > Plugins for Construct 2
 Post Reply Post Reply
Author
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Topic: [Plugin] Ping
    Posted: 24 Feb 2012 at 12:58am
Very basic plugins, basically add two events:

Is connected
Is not connected

They return true if the user has internet access or false if not (and the other way around) trough: navigator.onLine

I hope it would be helpful to anyone, it should be helpful for offline app on the chrome web store or mobile.

https://github.com/0plus1/Construct2---Ping
Back to Top

Moderator
28,650 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 24 Feb 2012 at 1:39pm
I guess it is the same as the Browser plugin "Is online", "On went online" and "On went offline" conditions ?

If so, prefer using the browser plugin.
I won't list this plugin on the list for now as it's better to use the built-in plugin in that case.

If the functions provided by your plugin are different than those of the browser object, then I'll list it.

Edited by Kyatric - 24 Feb 2012 at 1:40pm
Back to Top
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 11:21am
Yes, it's the same more or less, the only difference is that I added an isOffline condition, not he went offline, if he started offline which was lacking from the browser plugin and I needed it.
Back to Top

Moderator
28,650 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 12:23pm
Well, "is Offline" is an inverted "Is online" condition.

Not listing the plugin, sorry.
Back to Top
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 1:13pm
No problem Kyatric, no problem at all, that teaches me to read the manual, I didn't know you could invert an action :-(

Sorry for wasting your time
Back to Top

Moderator
28,650 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 2:05pm
Oh you're not wasting my time by no mean.
I feel more like you might have wasted a bit of yours.

On the way though you saw how to put up a custom plugin, and learnt a few others things about C2 so I guess it's not totaly wasted/lost.

The reason I prefer not listing the plugin is to prevent other users of "making the same mistake".
Plugins are cool to help out with a lots of things, but sometime, using a thrid-part plugin you might miss an already built-in feature and "important mechanism" (I think that now that you know you can invert conditions, a lot of new designs and patterns are crossing your mind).

Sorry if I sounded a bit stiff, it wasn't intended and I'm always pleased to see new plugins and new plugins builders in this part of the forum.
It's just in that case that "a better solution" already exists and is an important mechanism of C2 I consider ppl shouldn't be missing.




Edited by Kyatric - 25 Feb 2012 at 2:07pm
Back to Top
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 6:16pm
No don't worry, I learned a lot and I'll be doing plugins, actually I already did other plugins just to invert actions, can you believe it?
:-)

I'm just glad that my current project didn't require that many inversions :-P

Anyway thanks, I hope to post something more useful in the future :-)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down