File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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.
It is sorta covered in the JavaRanch Style Guide.
subject: Java Lobby for Multiplayer game
Similar Threads
How to write a lobby game server
MMOG tutorials?
Eclipse applet vs web applet network performance
J2ME game programming book
Multiplayer Game