Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessamae23 committed Apr 8, 2024
1 parent 344c020 commit 66343c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Binary file not shown.
3 changes: 2 additions & 1 deletion TowerForge/TowerForge/Networking/RoomNetwork/GameRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class GameRoom {
private func updateRoomState(roomState: RoomState) {
print("Updating room state from player")
let roomStateRef = FirebaseDatabaseReference(.Rooms).child(roomName).child("roomState")
roomStateRef.setValue(roomState) { error, _ in
roomStateRef.setValue(roomState.rawValue) { error, _ in
if let error = error {
print("Error updating room state: \(error.localizedDescription)")
} else {
Expand Down Expand Up @@ -198,6 +198,7 @@ class GameRoom {

let room = GameRoom(roomName: roomName, roomState: roomState)
room.roomId = roomId
completion(room)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ class GameWaitingRoomViewController: UIViewController {
}

@IBAction private func onStartButtonPressed(_ sender: Any) {
gameRoom?.updatePlayerReady { state in
if state == .gameOnGoing {
self.performSegue(withIdentifier: "segueToGame", sender: self)
}
gameRoom?.updatePlayerReady { _ in
self.startButton.isEnabled = false
}
}

Expand All @@ -55,7 +53,6 @@ class GameWaitingRoomViewController: UIViewController {
self.navigationController?.popViewController(animated: true)
}
})
// performSegue(withIdentifier: "segueToGameRoom", sender: self)
}

private func updatePlayerList() {
Expand Down

0 comments on commit 66343c3

Please sign in to comment.