This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Game Development and the fly likes Java Lobby for  Multiplayer game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Java Lobby for  Multiplayer game" Watch "Java Lobby for  Multiplayer game" New topic

Java Lobby for Multiplayer game

Diane Tuffy

Joined: Nov 02, 2005
Posts: 1
I have created a client/server Java Multiplayer Memory Game. One game can have 4 clients. Each player has its own thread which sends/receives game info via a socket. My problem is I would like to add a lobby area that hosts an unlimited number of rooms which contain my memory game. How would I go about making this kind of lobby? Would the lobby just handle the clients connection IDs and spawn a thread for each memory game room. ? Is there any good books about creating multiplayer game lobbies? Or good examples and source??

Any info you can give would be greatly appreciated.
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
I tend to work it as follows:

client connects to lobby.
via whatever means, people decide what game they want.
A new Game object is created and passed the sockets as parameters.

I've heard it takes forever to grow a woman from the ground
Diane Tuff

Joined: Nov 11, 2005
Posts: 1
I had thought about creating a new game object, but how would players join the memory game object??? If you pass the socket connectns to the object how would players join once the object has been creted? Any thoughts..
[ November 11, 2005: Message edited by: Diane Tuff ]
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
you could keep a list of all the games, and have a method in the game, addPlayer, I bet.
I agree. Here's the link:
subject: Java Lobby for Multiplayer game
jQuery in Action, 3rd edition