• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Lobby for Multiplayer game

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could keep a list of all the games, and have a method in the game, addPlayer, I bet.
reply
    Bookmark Topic Watch Topic
  • New Topic