Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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  
  RMIregistry + web ?  (Read 3235 times)
0 Members and 1 Guest are viewing this topic.
Offline misterX

Junior Devvie




java forever!


« Posted 2002-12-06 15:58:20 »

hi,

i'm currently experiencing with RMI and find it's very nice!
After i've written a multiplayer connect 4 game (working well... On one machine at least!)
I was wondering how to make it work on the web...
The issue is that the RMIregistry must be run on the server! Of course, i can't run it on a web hoster!
So what can i do? Is there a possibility to make the app work without running the registry or any other way to make it run?
Offline Themroc

Junior Devvie





« Reply #1 - Posted 2002-12-06 16:25:09 »

Hm ... a simple web hoster won't run any java app for you anyway, regardless of RMI. Most offer only php, perl, python and some offer java servlets. If you want to run a java app you probably have to  rent your own server or at least a server with a virtual linux env that you can configure yourself.
If the hoster is stupid then you can start your own long-running taks through CGI, but most disable that.
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #2 - Posted 2002-12-06 16:42:05 »

You could e.g. start your client via WebStart and let once of the clients be the RMI registry. Of course, this makes matchmaking very hard bc. the InetAdr of the reg. has to be known.


HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nabetse

Senior Newbie




I love YaBB 1G - SP1!


« Reply #3 - Posted 2002-12-06 16:51:06 »

Hi

  if you had a dedicated IP address, your computer could be the server of your game. The problem is that your computer would be running for all the day (and  the night, optional). The game client will connect with your server and you wouldn't depend on strange server.
    But, if you know someone that allows to run your server, please tell me, because I'm in the same situation.
Offline misterX

Junior Devvie




java forever!


« Reply #4 - Posted 2002-12-06 17:08:24 »

hmm... yeah, you're right -damn i forgot my head-, rmi or not, running the server app will be a problem... and i'm not fond on running the server on my machine...

With this simple notice, the situation and the issuechanged.
In case of a "peer-to-peer architecture", how can i do to... before i continue, i prefer to say that i've absolutely no knoweldge about cgi, perl or whatever.
let's go on, when peer-to-peer, running the game should not be a problem since it'll be on locale machines, same with the registry.
The whole problem is to bring the 2 players together out of the web.

I've no idea of the way to start...
Before, in order to start a game, you needed to "invoke" a method like host.join(this) and the game launched...
The 'host' was got via a server, a sort of main portal to lookup wich stores the people logged in.

Without such a main server, how to find, lookup to apparently unknown hosts?

Hmm... I hope i'm clear enough...
PS: i'm going to look at WebStart in a near future, but i'm not knowing it at all yet.
Offline misterX

Junior Devvie




java forever!


« Reply #5 - Posted 2002-12-06 18:01:54 »

PPS:
Quote
Hi
    But, if you know someone that allows to run your server, please tell me, because I'm in the same situation.

Sorry, i dond't know anyone...  Seems to be a common problem.
Offline nabetse

Senior Newbie




I love YaBB 1G - SP1!


« Reply #6 - Posted 2002-12-06 18:02:24 »

You have said the solution. It's possible to make a java application that connects with a web server (servlets) . Then you could create a new game or join to an existing one. But you should have a database connection in server side to store these games. I recommend to look this free web server (http://www.mycgiserver.com).
 
I send you a small piece of code which I used to connect with the server in a java application:

// We connect with the server and send "url" string with the query
try
  {
       URL url_connetion=new URL(url);
       HttpURLConnection hc = (HttpURLConnection)url_connetion.openConnection();
       in = hc.getInputStream();                 // Reading the servelts response

       int contentLength = (int)hc.getContentLength();  
       byte[] raw = new byte[contentLength];
       int length = in.read(raw);

       in.close();

       // Show the response to the user.    
       String sresponse = new String(raw, 0, length);

       return(sresponse);
     }
     catch (IOException ioe) { };

Offline misterX

Junior Devvie




java forever!


« Reply #7 - Posted 2002-12-06 18:40:48 »

...interesting, i'll take a look at it, but it'll take time since i never worked with servlets.
thanks
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.

xFryIx (62 views)
2014-11-13 12:34:49

digdugdiggy (41 views)
2014-11-12 21:11:50

digdugdiggy (36 views)
2014-11-12 21:10:15

digdugdiggy (30 views)
2014-11-12 21:09:33

kovacsa (53 views)
2014-11-07 19:57:14

TehJavaDev (56 views)
2014-11-03 22:04:50

BurntPizza (55 views)
2014-11-03 18:54:52

moogie (70 views)
2014-11-03 06:22:04

CopyableCougar4 (71 views)
2014-11-01 23:36:41

DarkCart (156 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!