I started my first javafx GUI game using the MVC pattern and I would like to implement a multiplayer feature where multiple people could join and sort of play a death match mode. I looked up online and for the network part I thought of using a TCP connexion (with java.net.Socket and java.net.ServerSocket). What would be send to the server for each client is their state (number of lives) and the server would notify each client of all players lives.
I'm really unsure on how I could connect the client server part with my javafx MVC. Here are the classes in my main folder :
-> main
---> App.java
: main loader
---> GameController.java
: fetch/modify data from Model and update the View
---> Model.java
: class that only encapsulates data such as lives
I know that each of my Client here would have an associated Thread so what exactly is a "client" in this case and where should I put the server at ?