help out with java programming :)

Java programming topics
Post Reply
PraveenAlexis
Moderator
Moderator
Posts: 78
Joined: Wed Jul 20, 2011 3:06 pm
Location: Sri lanka,Wattala

help out with java programming :)

Post by PraveenAlexis » Tue Feb 25, 2014 6:16 pm

well, im developing a google chrome app for my COD MW3 server to check its online status via ping method, im basically a newbie to java script! can anybody help me out with the coading? it should work like this, if the server response for the ping then it should display the online.png file if else offline.png file! (one of my friend suggested me of updating a XML file something i totally didnt get it, if anyone can explain how that works too?)

if theres any suggestion i would appreciate it :)
than you!
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: help out with java programming :)

Post by SemiconductorCat » Wed Feb 26, 2014 6:21 pm

It is most unfortunate that ping/pong api still does not support in websockets.
It's said that there are extensions going on but they are experimental.

How about another method like readinga image file on your server. If that successful you could assume that it's server is on.

You could use xml to advertise server online status. For a example who are the players currently online , what are the game opening on the server at the current time etc. This is very easy because there are SAX and it's well supported. Since that is a very small XML file sax is more than enough there.

But you COULD definitely do this with javascript. But there's no simple way for this like webscokets. Using AJAX you could do this, but it seems difficult. Since the ping packet is not neither UDP or TCP they are not implemented on API's.
The point is chatzilla IRC client does this. [There should be a ping request to another peer ]. So you may read the chatzilla source code and may be you could harvest a method or codes which perform this operation.

In action script you could do this directly. Or in a java applet.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: help out with java programming :)

Post by Neo » Mon Mar 03, 2014 9:33 pm

As Semi status above, the method I also know is AJAX for this. It could be used to fetch data from server through a client (mostly browser) without refreshing the current page. When it comes to Chrome aps, you would find more easier solutions if they have a separate API as far as I remember. Let us know your findings, so we can continue.

This might be a good application for you.
https://chrome.google.com/webstore/deta ... flimbnkabi
Post Reply

Return to “Java Programming”