Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (593)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (647)
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 3867 times)
0 Members and 1 Guest are viewing this topic.
Offline markuskidd

Junior Devvie

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 Devvie

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.

Look specifically at the and 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 Devvie

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 Devvie

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 Devvie

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 Devvie

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 Devvie

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 Devvie

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 Devvie


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

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 Devvie

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.

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.

deepthought (37 views)
2015-06-30 15:39:44

deepthought (41 views)
2015-06-30 15:39:09

deepthought (52 views)
2015-06-30 15:36:52

Za\'Anzabar (23 views)
2015-06-29 05:44:54

TritonDreyja (40 views)
2015-06-24 17:10:40

CopyableCougar4 (36 views)
2015-06-23 00:34:45

BurntPizza (42 views)
2015-06-21 20:36:46

cookiecompiler (85 views)
2015-06-11 15:42:53

cookiecompiler (48 views)
2015-06-11 15:41:14

NegativeZero (76 views)
2015-06-11 09:49:18
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 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‑
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!