1

Description:

I'm making a version of the campfire story game where each person adds to the story, ends with a transition statement for the next player, and passes the turn to the next camper around the fire.

This goes in a circle indefinitely.

I want to be able to create multiple sessions, have each session accept an indefinite number of players, and to be able to have new players join a session while it's running.

Problem:

When I google, almost everything comes up with servlets and other things that aren't taught in my introduction to java programming book.

I want to stick to that using sockets, data streams, and threads. I think the main thing I need to know is how to lay it out? I noticed I got a downvote but I sincerely want to know how I can ask questions like this properly, so if there is an issue I would appreciate anyone letting me know in a comment so I can amend this.

It's hard to ask questions when I know little of what I'm talking about :/

Themelis
  • 4,048
  • 2
  • 21
  • 45
  • Please see https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question – GhostCat Dec 16 '18 at 20:44
  • I would start by learning how to do a simple server that talks to one client. Then enhance that for multiple clients. When you search for "java server multiple clients threads", you can find a ton of non servlet answers, like: https://stackoverflow.com/questions/10131377/socket-programming-multiple-client-to-one-server or https://stackoverflow.com/questions/33584373/how-can-i-use-multi-threading-to-allow-multiple-clients-on-to-a-server – GhostCat Dec 16 '18 at 20:46
  • I have some examples that show how to have a server accept two clients, then run a session by passing in the two clients into a HandleASession class constructor, but I want to make it so it'll accept any number of clients. I don't see how I can create indefinite sockets to pass into the equivalent of the HandleASession class in the example. Or is that not necessary? – Justin Dupre' Dec 16 '18 at 20:52
  • It sounds wrong. The server accepts incoming clients, and maybe keeps a list of currently connected clients. Each client has its OWN session, there is no need to somehow handle sessions for all clients from one "handler". But as said: this is way too broad. We help with specific questions here, this community is not a replacement for a learning group or the many hours of work required to turn such a project into reality. this is also not a tutor service where somebody sits down with you and guides you through all the necessary steps. – GhostCat Dec 16 '18 at 20:59
  • That makes perfect sense. I was hoping there would be a simple kind of layout answer or set of steps I could take, rather than needing to go into an in-depth thing. I'll look deeper into the things I have available to me and hopefully be able to come back with a better question – Justin Dupre' Dec 16 '18 at 22:44
  • Thanks a lot Skemelio. I knew it could be better but that's SO much clearer that I feel silly for making it so bad initially. I'll do better in future posts – Justin Dupre' Dec 17 '18 at 02:14
  • Unfortunately, in programming there are no detours. Learning to program includes those many hours of first identifying good ways to solve problems, and then many hours more to get code to do what it is supposed to do. – GhostCat Dec 17 '18 at 05:15

0 Answers0