[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nhproxy-discuss] Re: slashem proxy interface

From: m m
Subject: [Nhproxy-discuss] Re: slashem proxy interface
Date: Thu, 25 Jan 2007 19:45:43 +0000

Hi Ali,

Thanks for that. To give a bit of background, my initial thought was to develop a javascript rougue-like - I have already written a simple worm game and see no reason that it wouldn't work (speed is possibly an issue, but I think it could be overcome). Then I decided 'why reinvent the wheel', and thought about writting a intermediatary between slashem and the browser - the client side script would be limited to simply sending user input and refreshing the parts of the screen needing it via xml messages, the server side doing all the sending and recieving of the messages and piecing it together. After digging around the source I came across the proxy interface, and it looks like the way to go (my initial thought, and a possible fall back, was just to capture and translate the tty output).

 Something like this -

javascript --- [user input] ---> php --- [user input message] ---> slashem ---[window messages] ---> php ---[display updates] ---> javascript

From what you are saying, and from what I have been piecing together from the proxy docs and tests, a further intermediatory might be needed between slashem and php.

There are quite a few issues that will need addressed, but primarily I'm aiming to get a proof of concept done, to make sure it is technically possible (I see no reason why not atm). Once that is done, the practicalities can be addressed. This is mainly as a learning project for me, so I'm not too worried if it turns out to be unfeasible and needs to be dropped :)

My first set of steps is to get familar with the proxy code, so my tasks are

  [1] compile slashem with the proxy interface - done
  [2] run the proxy interface tests - done
[3] Write a quick C app to show it working (launch slashem and demonstrate it has recieved and sent a message)

[3] is the bit I am stuck at at the minute, though I think by hammering away at the test code for the proxy module I may be able to piece it together. However, any suggestions are very welcome :)


From: "J. Ali Harlow" <address@hidden>
To: m m <address@hidden>
CC: NetHack Proxy mailing list <address@hidden>
Subject: Re: slashem proxy interface
Date: Thu, 25 Jan 2007 18:54:36 +0000

On 2007-01-25 03:18:20 PM, m m wrote:
Hi Ali,

Apologies for circumventing the official slashem dev list, my reasoning is that I'm still very much in the concept stage, and want to get my ideas better formed before making any noise online. If you think it would be more appropriate asked there however, let me know and I can redirect.

I guess the proper place would be nhproxy-discuss, to which I've CCed this. No exactly a high volume list, but it does mean the discussion will be preserved for posterity :)

Basically, what I am considering is a web interface for slashem, using the proxy interface, php and some ajax - the php script starts an instance of slashem and connects to the proxy interface. It then processes the messages, and sends updates to the browser via an xml ajax interface, then returns player input. I'm still researching the viability of it, but nothing I've read so far has lead me to believe it is not feasible (technically anyway, whether it will run at a usable pace or not is another matter, but that can be dealt with if and when it occurs).

To get going, I need to resolve a few queries though, which if you could help me along that would speed things up for me. From what I have managed to gather, the proxy interface works via a shared pipe, this is an area I have pretty much zero knowledge about (beyond some theory). Would you have any example code that shows simply loading up slashem in proxy mode and receiving and sending a few signals? With that, I'm pretty confident I will be able to research/hack/bang my head at it until I get the rest of the stuff I need.

Many thanks,
Martin McCann

To use nhproxy, the PHP script would need to call nhproxy_connect() which would then deal with encoding and decoding the requests between the PHP script and a separate slashem process. I guess that would require writing some PHP bindings for nhproxy (not to mention filling out much of the missing nhproxy documentation). This would probably be the best way forward if you're planning to have an "intelligent" server process.

If, on the other hand, you're planning an "intelligent" client process (in Java/Javascript), you'd probably end up just getting the PHP script to re-encode the requests into XML. I've never heard of any facility for loading libraries and bindings onto client machines so it's probably not practical to try and run nhproxy there (which would be the efficient thing to do). I guess an alternative would be to re-implement the client side of nhproxy in Java/Javascript. No idea how fast it would be.

A final option would be to add XML support to nhproxy. The downside of this is that the existing protocol is designed to be very efficient. XML, for all it's strengths, is distinctly verbose. With the amount of data that flies back and forth in NhProxy, this might be important.

If you can flesh your ideas out a bit more, I can probably think a bit harder about the pros and cons.



Free Alerts : Be smart - let your information find you ! http://alerts.live.com/Alerts/Default.aspx

reply via email to

[Prev in Thread] Current Thread [Next in Thread]