Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bugs #57

Merged
merged 1 commit into from Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions DPS/src/Connectivity/Client.java
Expand Up @@ -273,9 +273,8 @@ private String getHostIP(){

//CALL THIS METHOD FROM GUI WHEN MAP CHANGES
public void handleSendMap(String mapStr) throws IOException {
this.sendMsg(mapStr);
System.out.println(mapStr);
System.out.println("Handlesendmap");
String cmd = mapStr + "\n";
this.serverOut.write(cmd.getBytes());
}

private void handleRecieveMap(String tokens[]) {
Expand Down
3 changes: 0 additions & 3 deletions DPS/src/Connectivity/ServerWorker.java
Expand Up @@ -55,10 +55,8 @@ public void HandleClient() throws IOException {

//loop to constantly grab input
while ((line = reader.readLine()) != null) {
System.out.println(line);
//divide the input byte array by whitespace and get commands accordingly
String[] tokens = line.split(" ");
System.out.println(tokens);

if (tokens != null && tokens.length > 0) {
String cmd = tokens[0];
Expand All @@ -72,7 +70,6 @@ public void HandleClient() throws IOException {
HandleRollDice(tokens);
} else if ("map".equalsIgnoreCase(cmd)){
HandleMap(tokens);
System.out.println("handlingthings");
} else if("tokenmove".equalsIgnoreCase(cmd)){
HandleTokenMove(tokens);
} else if (cmd.startsWith("#")) { //if # is the first character, then it's a direct message.
Expand Down
6 changes: 3 additions & 3 deletions DPS/src/GUI/PlayerSessionController.java
Expand Up @@ -148,7 +148,7 @@ public void initialize(URL url, ResourceBundle rb) {
try {
OpenMap(temp);
} catch (IOException ex) {
Logger.getLogger(PlayerSessionController.class.getName()).log(Level.SEVERE, null, ex);
System.out.println("nope");
}
});
if(mapIds.size() != 0)
Expand All @@ -161,7 +161,7 @@ public void initialize(URL url, ResourceBundle rb) {
@FXML
protected void ChatSend(ActionEvent action) throws IOException{
Player.sendMsg(ChatOut.getText());
ChatIn.setText(ChatIn.getText() + "/n" + username + ": " + ChatOut.getText());
ChatIn.setText(ChatIn.getText() + "\n" + username + ": " + ChatOut.getText());
ChatOut.clear();
}

Expand Down Expand Up @@ -368,6 +368,6 @@ public void mapLoad(String s){
Map map = mapCon.loadMap(s);
mapCon.c = MapCanvas;
mapCon.currMap = map;
mapCon.drawMap(MapCanvas);
mapCon.drawMap2(MapCanvas);
}
}
1 change: 0 additions & 1 deletion DPS/src/dps/Map.java
Expand Up @@ -255,7 +255,6 @@ public final String toString(){
}
}
}
System.out.println(dungeon);
return dungeon;
}

Expand Down
22 changes: 22 additions & 0 deletions DPS/src/dps/mapController.java
Expand Up @@ -84,7 +84,29 @@ public void drawMap(Canvas c){
}

}
public void drawMap2(Canvas c){
gc = c.getGraphicsContext2D();

//iterates across each row
for(int i = 0; i < currMap.sizeX; i++){

//iterates down each column
for(int j = 0; j < currMap.sizeY; j++){

if(this.currMap.getTileAt(i, j).getIsRoom() == true){
gc.setFill(roomColor);
}
else {
gc.setFill(wallColor);
}

gc.strokeRect((i*20), (j*20), 19, 19);
gc.fillRect((i*20), (j*20), 19, 19);

}
}

}

////////////////////////////////////////
/// Section for
Expand Down