Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (113)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  passing parameter via webstart  (Read 3610 times)
0 Members and 1 Guest are viewing this topic.
Offline misterX

Junior Member




java forever!


« Posted 2004-02-04 09:20:24 »


hi,

is it possible to:
1) give parameters in the link to the jnlp file so that the app will be started with these arguments
or
2) have a jnlp file including parameters in it so that the app will be started with these arguments

The aim would be to make some sort of:
www...game.jnlp?join=12.34.56.789

Possible?
Offline tom
« Reply #1 - Posted 2004-02-04 09:47:23 »

nr 2 is possible. Check out the jnlp file syntax:
http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#application_desc

Quote
<application-desc main-class="Main">
   <argument>arg1</argument>
   <argument>arg2</argument>
 </application-desc>


arg1 and arg2 will be the parameters sent to "public static void main(String args[])"

Offline misterX

Junior Member




java forever!


« Reply #2 - Posted 2004-02-04 16:01:49 »

...then, is it possible to create temporary jnlp files on request (on the server side)?
1. send a request to html, servlet or something else
2. It handles request by sending back a custom made jnlp file.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #3 - Posted 2004-02-04 16:31:31 »

Sure - you can dynamically generate one, just like any normal dynamic page.  Just make sure you set the file type correctly, and if you want to hard-code it, you can just out.println() the XML to the client.

Hellomynameis Charlie Dobbie.
Offline misterX

Junior Member




java forever!


« Reply #4 - Posted 2004-02-04 17:19:28 »

...well... i'm a bit nowhere in this area.
well, do you mean using php? or something similar?
...in that case, could help me out by giving me a small example how to write such a file (non html)?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2004-02-04 17:33:11 »

php, perl, or any other server side code could automagically generate a .jnlp for you. It depends what you know and what you have avalible on your host.

But what exactly are you trying to do?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline misterX

Junior Member




java forever!


« Reply #6 - Posted 2004-02-04 17:46:17 »

i'm doing a nasty, horrible, strange patchwork for a smart aim! (at least, i think so!)

The final aim, is to launch multiplayer games via messenger. yes, messenger.


You'll invite somebody like following:
"Mofu wants to play pong with you! click here to play!"
By clicking, it'll call a link => http://.../game.php?ip=0.0.0.0

which will create a custom jnlp file including the host IP as argument for the program which will try to connect to it when launched!
Tadam! You click accept and you play!

Well, that's the theory!  Lips Sealed
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #7 - Posted 2004-02-05 01:53:42 »

I have a small section in my JWS tutorial about dynamic JWS files:  http://xith.org/tutes/GettingStarted/html/deploying_xith3d_games_with.html#SECTION000140500000000000000

Passing parameters to JWS can sometimes lead to unexpected results so I use Apache mod_rewrite to pretend that they are all actually seperate JNLP files.  In that example essentially you can specify any class to run it:  Eg if the main class is "CubeTest" then your JNLP is "com.xith3d.test.CubeTest.jnlp" but if it is SphereTest then it is "com.xith3d.test.SphereTest.jnlp".  Those two jnlp "files" actually translate to "com.xith3d.test.php?main=CubeTest" and "com.xithed.test.php?main=SphereTest" - but the user (ie. JWS) never knows.

Hope that helps,

Will.

Offline misterX

Junior Member




java forever!


« Reply #8 - Posted 2004-02-05 06:02:24 »

thanks for the infos...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (15 views)
2014-09-12 09:08:26

Norakomi (45 views)
2014-09-10 13:57:51

TehJavaDev (57 views)
2014-09-10 06:39:09

Tekkerue (26 views)
2014-09-09 02:24:56

mitcheeb (49 views)
2014-09-08 06:06:29

BurntPizza (33 views)
2014-09-07 01:13:42

Longarmx (19 views)
2014-09-07 01:12:14

Longarmx (21 views)
2014-09-07 01:11:22

Longarmx (20 views)
2014-09-07 01:10:19

mitcheeb (30 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!