Web Start and Game Server

i have a client-server game and i would like to put it on my site

i've managed to put both the client and the server

the problem is when i run the server, i give it a port and it opens and says waiting for a connection, but when a client joins it doesn't detect it

of course, this problem doesn't exist if i run the server jar file from my computer and then run the clients (webstart or console), it's only loading server through web start that it doesn't work

so, if i run the server through webstart, then run a client through command prompt, what happens is it connects, server doesn't display a connection detected message and then client just drops out, seems like the sockets don't connect properly?

thanx

[762 byte] By [siamakg] at [2007-9-27 14:43:59]
# 1
I think maybe webstart has the same security settings as applets?
shishthemoomin at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 2
seems like you're rightthis is the error i getjava.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.1:1632 accept,resolve)is there a fix for this?i looked in webstart settings, but couldn't find anything
siamakg at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 3
Have you signed your jar files with a digital cert?
zparticle at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 4

i generated a key and signed the jar file, but it still gives the same error

seems like i need a java.policy file in order to allow connection on the ports >1024?

i made a policy file, but in order to use it, i have to give it as a parameter to the jar file

so, java -jar myjar.jar -Djava.security.policy=java.policy

now, the problem is how to make the jnlp file run my class file with the -Djava.security.policy=java.policy parameter?

the policy file contains:

grant {

permission java.net.SocketPermission "*:1024-65535",

"connect,accept";

permission java.net.SocketPermission "*:80", "connect";

};

siamakg at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 5

on another note...anything launched via JWS is only supposed to be able to create a socket connection back to where it was downloaded from...i think if you made you server app a standalone program (that wasn't started via JWS) your problems may go away (server side anyhow):-)

you are able though to do http/s requests from your apps launched via JWS...

Geverson at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 6
also in your cert you need to have the url of where you are downloading your app from, otherwise it will have issues...:-)
Geverson at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 7

thanx for the replies

ya, i guess there's no easy way to run the server through JWS

it requires a policy file to allow listening on sockets and i can't figure it out ...

my server app is a standalone program and it works fine, i just wanted to make it runnable through JWS

the clients work fine through JWS since they're just connecting to a socket, not listening

siamakg at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...
# 8
Aside from signing the jar, you have to add the following to your JNLP file: <security><all-permissions/> </security>You should then get a prompt when you launch the server asking if you want to grant all permissions.
rgeimer at 2007-7-5 22:43:52 > top of Java-index,Other Topics,Java Game Development...