Skip to content
Snippets Groups Projects
Commit f62ab2de authored by lukasWoyke's avatar lukasWoyke
Browse files

More comments.

parent d1734cac
No related branches found
No related tags found
2 merge requests!62Fix master,!60Code cleanup lukas fix
......@@ -239,14 +239,15 @@ class GameViewController: UIViewController, LocalTeamPlayDelegate {
}
// MARK: - Set up Progress server side
var maxValue = 0
var maxValueOfSetps = 0
private var progressCounter = 0
/// 1. For Server: Show the waiting view for server
func showServerSpinner() {
if let _maxValue = LocalTeamPlayManager.sharedInstance.allPlayersPeerIDs?.count {
maxValue = _maxValue * 5
spinnerView.start(maxProgress: maxValue)
maxValueOfSetps = _maxValue * 5
// For each character there have to be 5 messages to be exchanged (customization, level, levelResponse, index, indexConfirmation)
spinnerView.start(maxProgress: maxValueOfSetps)
// Update the progress if server already received configurations.
progressCounter = CharacterManager.sharedInstance.allPlayersConfiguration.count
......@@ -280,7 +281,7 @@ class GameViewController: UIViewController, LocalTeamPlayDelegate {
LocalTeamPlayManager.sharedInstance.sendToAll(sessionAction: SessionAction.setup(SetupAction.selectedLevel(selectedLevel)), isReliable: true)
// Update the progress Counter
spinnerView.currentState = .sendingLevels
progressCounter = LocalTeamPlayManager.sharedInstance.allPlayersPeerIDs!.count * 2
progressCounter = LocalTeamPlayManager.sharedInstance.allPlayersPeerIDs!.count * 2 // Two number of messages exchanged in the setup process
spinnerView.updateProgress(progressCount: progressCounter)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment