Closed mabre closed 10 years ago
startGame? The "Host a game" in the Popup or the "Start"-Button in the lobby? Cause I'm not sure where "Server server; Thread serverThread = new Thread(server = new Server());" and so on belongs.. you already need the server when starting the lobby, right? So it needs to be declared when you click "Host a game"?
You do not have to care about creating server/client(Thread), I’ll do that.
I’m referring to the “Start” button of the Lobby. It has to call public MapWindow(String map, Stage stageToClose, String file, Client client, Thread clientThread, Server server, Thread serverThread)
. Just put in null
for the last 4 parameters (but all the others have to be correct, i.e. pass a correct JSON file etc.); that will result in a crash, I’ll fix that later.
Okay - do we need an extra fromJson there? You cannot load settings into the lobby. The rest is done.
Well, when a new client connects, it has to load the settings from the server. My plan was passing json strings around (like we do for the map window).
needed for properly implementing server/client stuff Just use the same constructor for
startGame
as inGameSettings
, do not care about any crashes, I will fix it.