File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Lobby for Multiplayer game

 
Diane Tuffy
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 815
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Diane Tuff
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 815
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic