Debugging NewLobby()
This commit is contained in:
parent
70c553d608
commit
fdc7ba6668
@ -415,11 +415,14 @@ public class Client {
|
|||||||
private void makeNewLobby(String data) {
|
private void makeNewLobby(String data) {
|
||||||
String[] params = data.split(":");
|
String[] params = data.split(":");
|
||||||
loungeSceneViewController.newLobby(params[0], params[1]);
|
loungeSceneViewController.newLobby(params[0], params[1]);
|
||||||
|
LOGGER.debug("makeNewLobby() seems to have finnished");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPlayerToLobby(String data) {
|
private void addPlayerToLobby(String data) {
|
||||||
String[] params = data.split(":");
|
String[] params = data.split(":");
|
||||||
loungeSceneViewController.addPlayerToLobby(params[0], params[1]);
|
loungeSceneViewController.addPlayerToLobby(params[0], params[1]);
|
||||||
|
LOGGER.debug("addPlayerToLobby() seems to have finnished");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLobbyMembers(String data) {
|
private void updateLobbyMembers(String data) {
|
||||||
|
|||||||
@ -42,4 +42,5 @@ public class ClientListItem {
|
|||||||
public int clientID() {
|
public int clientID() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,4 +110,17 @@ public class LobbyListItem {
|
|||||||
public void setNoOfPlayersInLobby(int noOfPlayersInLobby) {
|
public void setNoOfPlayersInLobby(int noOfPlayersInLobby) {
|
||||||
this.noOfPlayersInLobby.set(noOfPlayersInLobby);
|
this.noOfPlayersInLobby.set(noOfPlayersInLobby);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LobbyListItem{" +
|
||||||
|
"lobbyID=" + lobbyID +
|
||||||
|
", adminName=" + adminName +
|
||||||
|
", clientsInLobby=" + clientsInLobby +
|
||||||
|
", ownedByClient=" + ownedByClient +
|
||||||
|
", isOpen=" + isOpen +
|
||||||
|
", MAX_CAPACITY=" + MAX_CAPACITY +
|
||||||
|
", noOfPlayersInLobby=" + noOfPlayersInLobby +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,13 +32,14 @@ import javafx.scene.layout.AnchorPane;
|
|||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.text.Text;
|
import javafx.scene.text.Text;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
public class LoungeSceneViewController implements Initializable {
|
public class LoungeSceneViewController implements Initializable {
|
||||||
|
|
||||||
public static final Logger LOGGER = LogManager.getLogger(JServerProtocolParser.class);
|
public static final Logger LOGGER = LogManager.getLogger(LoungeSceneViewController.class);
|
||||||
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
|
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -170,7 +171,9 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
} else {
|
} else {
|
||||||
LOGGER.debug("In updateItem(item, empty) Method. Else branch -> nonnull item");
|
LOGGER.debug("In updateItem(item, empty) Method. Else branch -> nonnull item");
|
||||||
name.setText(item.getName());
|
name.setText(item.getName());
|
||||||
|
name.setTextFill(Color.BLACK);
|
||||||
id.setText(String.valueOf(item.getId()));
|
id.setText(String.valueOf(item.getId()));
|
||||||
|
id.setTextFill(Color.BLACK);
|
||||||
setGraphic(nameAndId);
|
setGraphic(nameAndId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,7 +264,10 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
startOrJoin.setText(item.isOwnedByClient() ? "Start" : "Join");
|
startOrJoin.setText(item.isOwnedByClient() ? "Start" : "Join");
|
||||||
setGraphic(headParent);
|
lobbyID.setTextFill(Color.BLACK);
|
||||||
|
adminName.setTextFill(Color.BLACK);
|
||||||
|
startOrJoin.setTextFill(Color.BLACK);
|
||||||
|
setGraphic(head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -269,6 +275,7 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
});
|
});
|
||||||
|
|
||||||
LobbyListView.setPlaceholder(new Text("No open lobbies!"));
|
LobbyListView.setPlaceholder(new Text("No open lobbies!"));
|
||||||
|
LobbyListView.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addGameView(){
|
public void addGameView(){
|
||||||
@ -336,7 +343,16 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
}
|
}
|
||||||
LobbyListItem item = new LobbyListItem(id, admin, new SimpleBooleanProperty(ownedByClient),
|
LobbyListItem item = new LobbyListItem(id, admin, new SimpleBooleanProperty(ownedByClient),
|
||||||
new SimpleBooleanProperty(true), new SimpleIntegerProperty(0));
|
new SimpleBooleanProperty(true), new SimpleIntegerProperty(0));
|
||||||
|
Platform.runLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
lobbies.add(item);
|
lobbies.add(item);
|
||||||
|
LOGGER.debug("within newLobby() run() thread");
|
||||||
|
LOGGER.debug(item.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
LOGGER.debug("newLobby() in LoungeSceneViewController seems to have reached end.");
|
||||||
|
LOGGER.debug(lobbies.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void joinGame(String lobbyID) {
|
public void joinGame(String lobbyID) {
|
||||||
@ -362,7 +378,16 @@ public class LoungeSceneViewController implements Initializable {
|
|||||||
* @param s
|
* @param s
|
||||||
*/
|
*/
|
||||||
public void addClientToList(String s) {
|
public void addClientToList(String s) {
|
||||||
clients.add(new ClientListItem(s));
|
ClientListItem cl = new ClientListItem(s);
|
||||||
|
Platform.runLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
clients.add(cl);
|
||||||
|
LOGGER.debug("in addClientToList() in run()");
|
||||||
|
LOGGER.debug(cl.toString() + " in run()");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void newGame() {
|
public void newGame() {
|
||||||
|
|||||||
Reference in New Issue
Block a user