Valhalla Legends Archive

Programming => General Programming => Topic started by: TangoFour on October 14, 2004, 03:32 AM

Title: Remote UI
Post by: TangoFour on October 14, 2004, 03:32 AM
I'm currently working on a Bot in Java that is to run on a Linux machine without any graphical capabilities (ie. No KDE or GNome or other XFree on it) - my question is neither specific to Java nor to Bots, but feel free to move it.

I want to make a User Interface that runs on a different computer (Windows) that accesses the Bot on the other machine - in other words, a Remote User Interface.

I have been thinking of two approaches, but I can't really seem to pick between the two:

#1 - Miniature Web Server. I create a module to my bot that listens on a specified port, and can be accessed using the HTTP protocol. This way I can access the bot with my browser.

#2 - Observer/Observable. My bot becomes the Observable, and my UI an Observer. I use a Socket to connect the two like so:

Bot Observable --- Bot Observer <--- Socket --> UI Observable --- UI Observer (The actual UI)

Any thoughts on this, or better ideas?
Title: Re: Remote UI
Post by: dxoigmn on October 14, 2004, 09:16 AM
Implement both.  The Web Server one will be useful where the only software on the client computer is a browser.  On other hand, when you want more control of over your interface, you can use the custom client software.
Title: Re: Remote UI
Post by: MyndFyre on October 14, 2004, 10:16 AM
Even expose something binary via port 80 that can be accessed with some kind of special protocol header.  The nice thing about having port 80 open is that it's typically not blocked by firewalls; while B.net connections don't work from my workplace, a Web Service web application used to update my clan's website does.
Title: Re: Remote UI
Post by: iago on October 14, 2004, 12:08 PM
The problem with port 80, however, is that you can't listen on it on Linux unless you're root.

I actually do both of those strategies for my Java bot.  Have a look at http://javaop.clan-e1.net if you're interested.  I have a web server and a telnet server.
Title: Re: Remote UI
Post by: K on October 14, 2004, 03:10 PM
Why not just write a graphical interface for your bot which runs if it detects the X Windows System.

Then you can just pass -X on an ssh command line to get a graphical session on the remote computer.
Title: Re: Remote UI
Post by: Tuberload on October 14, 2004, 03:13 PM
That works for systems the utilize X-Windows, but what about systems that do not?
Title: Re: Remote UI
Post by: Kp on October 14, 2004, 06:54 PM
Quote from: Tuberload on October 14, 2004, 03:13 PMThat works for systems the utilize X-Windows, but what about systems that do not?

Why would you want to use a system that doesn't have an Xserver?
Title: Re: Remote UI
Post by: TangoFour on October 15, 2004, 07:51 AM
Perhaps I should have noted that I'll only be using the Bot myself