Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Java game linking to a perl script

by halley (Prior)
on Jul 14, 2005 at 14:05 UTC ( #474875=note: print w/ replies, xml ) Need Help??


in reply to Java game linking to a perl script

Well, my first choice would be for Java to do the work of saving the results on the server before jumping. It's nothing to do with what language each component is, it's just that it seems to me to be the best "responsible party." Encode a similar call to fetch a certain page but don't actually show the results (or the URL) to the user. Then you can jump to a new vanilla URL which shows the results.

Barring that, learn how Java can POST the solved url information rather than GET the solved url information. The POST method hides the values they're sending, while the GET method encodes them into the URL where anyone can see or muck. I'm guessing Java has a way to do that, too. Methods GET and POST in HTML forms - what's the difference?

Barring that, you should encode the URL parameters in such a way that the user can't recognize or muck them. That might mean that your Java and your perl need to share a key.

If you're really trying to avoid all chance of snooping, you'd use a public key encryption scheme, whereby the Java applet only knows a public key and the perl script can read the encoded form in private key. Of course, since Java is a bytecode, easily decompiled language...

--
[ e d @ h a l l e y . c c ]


Comment on Re: Java game linking to a perl script
Re^2: Java game linking to a perl script
by straywalrus (Friar) on Jul 14, 2005 at 14:56 UTC
    To add one more option, you may want to take a look at Sleep, which is a Perl-ish scripting language for Java. It is easy enough to embed (since that was what it is meant for), has the ability to do what you want hidden from the user, and is seperate from the Java source itself, so you could update it seperately from the java. Just to add to the Pile of Ideas (пoй)
      What would using an embedable language gain that loading the various values, answer keys, questions etc.. that can't be done using something like XML, or just key-value pairs?

      Btw, I prefer Velocity. Yes, it's a template language, but you can write programs in it. Albeit very simple ones that can't do much, "harm."

      ----
      Give me strength for today.. I will not talk it away..
      Just for a moment.. It will burn through the clouds.. and shine down on me.

        I should think that there would be rather little to gain from either method; however, My purpose in recommending Sleep was to firstly offer Yet Another Answer that the poster may not have been aware of and secondly offer something that is rather robust and can be replaced easily. With Sleep, you could simply rewrite the script and use the existing engine. For me, this would be a rather large positive. XML is Yet Another Embedded Language and key-value pairs are fine, but if the poster wishes to change something, then this has to be reworked. Sleep (or any other language, I simply choose the 'hot new thingie') allows for some abstraction, which I find nice in certain situations.
      Oh the joy of sleep, during which $self, $world, @problems and $pain are all undef.
Re^2: Java game linking to a perl script
by kiat (Vicar) on Jul 15, 2005 at 11:49 UTC
    Thanks, halley!

    Ah, java can post the solved url?

    Will go find out more on that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://474875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-07-12 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls