|
@@ 119-122 (lines=4) @@
|
| 116 |
|
$playerCount = count($this->playerStorage->getOnline()); |
| 117 |
|
|
| 118 |
|
// Check if vote passes when we suppose that all palyers that didn't vote would vote NO. |
| 119 |
|
if ($playerCount > 0 && ($this->currentVote->getYes() / $playerCount) > $this->ratio) { |
| 120 |
|
$this->votePassed(); |
| 121 |
|
return; |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
// If the vote is still not decided wait for the end to decide. |
| 125 |
|
if (($time - $this->currentVote->getStartTime()) > $this->duration) { |
|
@@ 128-132 (lines=5) @@
|
| 125 |
|
if (($time - $this->currentVote->getStartTime()) > $this->duration) { |
| 126 |
|
$totalVotes = $this->currentVote->getYes() + $this->currentVote->getNo() * 1.0; |
| 127 |
|
|
| 128 |
|
if ($totalVotes >= 1 && ($this->currentVote->getYes()/$totalVotes) > $this->ratio) { |
| 129 |
|
$this->votePassed(); |
| 130 |
|
} else { |
| 131 |
|
$this->voteFailed(); |
| 132 |
|
} |
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
|