Idea Javascript interface

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,012
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Well, as asking doesn't hurt, I'd like to be able to read / write some Orbiter vessel variables from Javascript running from a webpage.

As we already have multiplayer implementations, there certainly is a way to get data to and from the simulator.
For example, there's Orb:Connect [ame="http://www.orbithangar.com/searchid.php?ID=4621"]http://www.orbithangar.com/searchid.php?ID=4621[/ame] and is seems to do what I need, but it works with Java, not Javascript/HTML environment.

What would I do with this? Of course nice 2d panels and universal system simulation for any ship does come into mind...


Simple isn't it :thumbup: ?
 
Last edited:
Orb:Connect is open source--why don't you add a websockets mode to it?
 
My skills in programing are limited to Javascript / HTML so I may be able to work with websockets on the browser side. That's half of the problem.
I can't do much about developing Orb:Connect, unfortunately I don't know much of Java development to do it.
 
Last edited:
My skills in programing are limited to Javascript / HTML so I may be able to read/access data from Orbiter, using Orb:Connect as a server...
If I understand things correctly of course....
From what I understand, the WebSockets API requires that both ends of the connection support some overhead protocol, and you can't use it to connect to arbitrary servers.

However, if you're wanting to make your panels as a Win8 app in Javascript, you might be able to use the Windows.Networking.Sockets interface to talk to Orb:Connect. I'm not sure if that allows javascript to access more native styles of socket communication, or if it can talk to Orb:Connect if so.
 
I figured out that a protocol would be needed on both ends (that why I changed my original reply). Actually tried some examples and forced them to access my local IP. Of course no response.

I've seen java applications run in the browser, integrated with HTML buttons, Javascript and all the page layout. Could Orb:Connect be made to run like that?
(sorry if it is a noob question).


Just to state the potential of the browser+ javascript approach:
If I could get the real-time craft coordinates from Orbiter, I could run the GoogleEarth Api in the browser as a 3D engine....
 
Firstly, Orb:Connect is an Orbiter addon, and is written in C++, not Java. The sample client is in Java for the sake of simplicity, I think.

You could write a Java applet that runs in a webpage that connects to an Orb:Connect server.
 
Back
Top