Hey everyone, I have gone through many phases of getting into Networking programming and each time I have gone further and further, and have gained a greater and greater understanding (read as “gained a bit more”).
Currently I am trying to make a Multiplayer turn based card game, just a 52 card deck kinda game, and started off with a Multithreaded chat server and am now beginning to implement the card game aspect to it. I so far have made it so that when 2 users connect, the server is able to distribute cards to each client (it actually just gives random numbers as a place holder).
But now since I want multiple games to take place I am thinking of a method to implement this, this is where I get lost a bit because I was thinking I can just create a GameRoom class which will have its own thread and the users will be sent to it and can play the game, however I realize this method is probably not good because it creates a thread per user and game.
I then got stuck on whether I should just implement it that way for a learning experience or to move over to what I believe is the other solution of using NIO and non blocking technique but dont have much information on how to create something with that, anybody have some links or examples, or comments on what I should do?
I do not want to use any libraries although I know KryoNet looks great, I want to make mine from scratch. If i were to use the threaded approach would my solution work of creating a game class and when a user connects to the server, create the user and send it to an open game?