trying to get the join button to work
This commit is contained in:
parent
87e465099a
commit
a4a12fc9d2
@ -26,6 +26,7 @@ public class LobbyListItem {
|
||||
private final int MAX_CAPACITY = 6;
|
||||
private SimpleIntegerProperty noOfPlayersInLobby;
|
||||
|
||||
|
||||
public LobbyListItem(SimpleStringProperty lobbyID, SimpleStringProperty adminName,
|
||||
SimpleBooleanProperty ownedByClient, SimpleBooleanProperty isOpen,
|
||||
SimpleIntegerProperty noOfPlayersInLobby) {
|
||||
|
||||
@ -120,6 +120,7 @@ public class LoungeSceneViewController implements Initializable {
|
||||
newGameButton.setOnAction(event -> newGame());
|
||||
LobbyListView.setVisible(true);
|
||||
lListView = LobbyListView;
|
||||
cListView = ClientListView;
|
||||
LOGGER.debug("Lobby in initialize" + LobbyListView);
|
||||
ClientListView.setVisible(true);
|
||||
ClientListView.setItems(clients);
|
||||
@ -216,6 +217,7 @@ public class LoungeSceneViewController implements Initializable {
|
||||
|
||||
{
|
||||
head.setAlignment(Pos.CENTER_LEFT);
|
||||
head.setSpacing(5);
|
||||
playerList.setAlignment(Pos.CENTER_LEFT);
|
||||
headParent.setCollapsible(true);
|
||||
}
|
||||
@ -372,7 +374,6 @@ public class LoungeSceneViewController implements Initializable {
|
||||
SimpleStringProperty id = new SimpleStringProperty(lobbyID);
|
||||
SimpleStringProperty admin = new SimpleStringProperty((adminName));
|
||||
LOGGER.debug("In newLobby()1 LobbyListView" + LobbyListView);
|
||||
Button startOrJoin;
|
||||
boolean ownedByClient = false;
|
||||
if (adminName.equals(client.getUsername())) {
|
||||
LOGGER.debug("Client is admin. Name: " + adminName);
|
||||
@ -423,6 +424,7 @@ public class LoungeSceneViewController implements Initializable {
|
||||
*/
|
||||
public void addClientToList(String s) {
|
||||
ClientListItem cl = new ClientListItem(s);
|
||||
ClientListView = cListView;
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@ -65,7 +65,8 @@ public class JServerProtocolParser {
|
||||
} catch (Exception e) {
|
||||
h.setUsernameOnLogin("U.N. Owen");
|
||||
}
|
||||
h.guiUpdateAll(Protocol.printToGUI+"$"+GuiParameters.newPlayerOnServer+"$"+h.getClientUserName());
|
||||
h.guiUpdateAll(Protocol.printToGUI + "$" + GuiParameters.newPlayerOnServer + "$"
|
||||
+ h.getClientUserName());
|
||||
break;
|
||||
case Protocol.nameChange:
|
||||
h.changeUsername(msg.substring(6));
|
||||
@ -83,6 +84,7 @@ public class JServerProtocolParser {
|
||||
try {
|
||||
int i = Integer.parseInt(msg.substring(6, 7));
|
||||
h.joinLobby(i);
|
||||
//h.guiUpdateAll(Protocol.printToGUI+"$"+GuiParameters.addNewMemberToLobby+"$"+i+":"+h.getClientUserName()); handled in joinLobby()
|
||||
} catch (Exception e) {
|
||||
h.sendMsgToClient(Protocol.printToClientConsole
|
||||
+ "$Invalid input. Please use JOINL$1 to join Lobby 1, for example.");
|
||||
@ -90,11 +92,9 @@ public class JServerProtocolParser {
|
||||
break;
|
||||
case Protocol.createNewLobby:
|
||||
h.createNewLobby();
|
||||
h.sendMsgToClient(
|
||||
h.guiUpdateAll(
|
||||
Protocol.printToGUI + "$" + GuiParameters.newLobbyCreated + "$" + h.getLobby()
|
||||
.getLobbyID() + ":" + h.getClientUserName());
|
||||
h.guiUpdateAll(Protocol.printToGUI + "$" + GuiParameters.newLobbyCreated + "$" + h.getLobby()
|
||||
.getLobbyID() + ":" + h.getClientUserName());
|
||||
LOGGER.info("Here");
|
||||
break;
|
||||
case Protocol.listLobbies:
|
||||
|
||||
Reference in New Issue
Block a user