Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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  
  architecture/multiple "worlds" management  (Read 3466 times)
0 Members and 1 Guest are viewing this topic.
Offline markuskidd

Junior Member


Medals: 1



« Posted 2002-11-22 18:53:17 »

My project is built around several "arena" servers that are being run on the same machine and are completely independant game worlds. What I would like to do is have a central arenas server that is always running. When an arena is brought online, it contacts the central server and lets it know its name, port, and perhaps some information about the arena. Then periodically the central server will query all registered arenas to ensure they are still available and update any stats that are pertinent. If the arena closes, it will notify the central server to remove it from the active list and if it does not respond to the central server's periodic request for an update, it will also be removed (and maybe an admin will be sent an email or something).

Could anyone point me to an article or tutorial regarding this sort of communication between applications? I have only the roughest idea of how to proceed..
Offline zparticle

Senior Member




Thick As A Brick


« Reply #1 - Posted 2002-11-22 19:09:23 »

take a look at the source code in the planetation.jar file in this zip.

http://www.scottshaver2000.com/planetation/files/planetation.zip

Look specifically at the UniverseServer.java and WorldServer.java files and the associated config files for them (also in the zip) .

This is exactly what you are trying to do, I'm not saying it is the best way but it is how I did it. These are bare bones implementations so there isn't a load of other code to dig through to see what they are doing.

Offline markuskidd

Junior Member


Medals: 1



« Reply #2 - Posted 2002-11-24 15:31:58 »

I bookmarked planetation on my old PC, but I had forgotten where I found the link originally. Thanks for the example code, it's just the right level of bare-bones-ness to be useful  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zparticle

Senior Member




Thick As A Brick


« Reply #3 - Posted 2002-11-24 17:07:49 »

Cool. Just a side note you will see that the system is set up to allow any data/command to be sent between machines. I am curently having to do a lot of rework because I didn't add a version number to the CommunicationData class. When you implement your stuff make sure to add a version number to any data you are send back and forth. This way you can deal with changes in data formats dynamically.

Offline markuskidd

Junior Member


Medals: 1



« Reply #4 - Posted 2002-11-26 19:40:17 »

I've got something up and running pretty well right now. My next question is whether you have any advice on centralized player registration. What I've just added is a central Universe server, so clients connect first to this server and it sends them a list of all arenas that are currently online and some basic stats about each one. A user then selects a particular arena and opens up a session directly with that arena.
What I'm interested in doing is creating only one session to the Universe server, which would validate a user's credentials or have them create a new account if this is their first time playing. Once they are validated, the Universe server would pass their session to one of the arena servers and they would enter the game. Is there any way to accomplish this and make it transparent to the user? My design is based on arenas running independently, with their own ports open to receive clients. I am hoping this is possible without a major rewrite..
Offline zparticle

Senior Member




Thick As A Brick


« Reply #5 - Posted 2002-11-26 21:23:32 »

I think your fine You give the client the arena server info it needs to connect to it and just have the client automatically do this. No need for the user to interact with this process. You can't trade socket connections from the universe server to the arena server though. This is a totaly separte connection.

Offline markuskidd

Junior Member


Medals: 1



« Reply #6 - Posted 2002-11-26 21:37:52 »

But how would I know that the Universe server authenticated the client?
Offline lefty

Senior Newbie




Java ees kewl, man!


« Reply #7 - Posted 2002-11-26 22:07:16 »

How about generating a key, sending it to the arena, letting it know about an incoming connection.  Once the Arena confirms receipt of the key, send the key to the client.  Client connects to arena, keys match, all is well.  Assuming there is a problem, the arena key times out after, say 1 min.
Offline zparticle

Senior Member




Thick As A Brick


« Reply #8 - Posted 2002-11-26 22:57:44 »

Hey that's a great idea.

It would be cool if the arena could connect to the client but the clients would all have to have static IPs which wouldn't work for most people.

Offline leknor

Junior Member




ROCK!!!


« Reply #9 - Posted 2002-11-27 01:27:42 »

Quote
But how would I know that the Universe server authenticated the client?

Lefty described something very similar to Kerberos which is supported by the 1.4 JVM and can be downloaded as an option package for the 1.3 JVM.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #10 - Posted 2003-01-09 22:32:50 »

I would suggest looking into the Object Replication design pattern as laid out in M. Grands Java Enterprise Design Patterns. Unless you need the worlds absolutely in sync 100% of the time (which will be a HUGE problem), this pattern and a caching strategy will keep all the worlds in sync. I recommend the book - I've talked with the author and took his Design Patterns course... he knows his stuff and it has a direct impact on what you're planning to do.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
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.

atombrot (23 views)
2014-08-19 09:29:53

Tekkerue (22 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (57 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
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!