Skip to content

Commit 8fe76f1

Browse files
authored
Merge pull request #454 from CnCNet/bugfix/logging-for-color-prefs
Added logging to find color preference bug.
2 parents b4f6aa8 + 6db1bef commit 8fe76f1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cncnet-api/app/Http/Services/QuickMatchService.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,15 +1017,23 @@ private function set1v1QmSpawns($otherQmQueueEntries, $qmMatch, $qmPlayer, $expe
10171017
$p2OppColors = $p1Colors;
10181018
}
10191019

1020+
Log::debug('QuickMatchService ** Colors prefs', [
1021+
'player' => $qmPlayer->player->username,
1022+
'p1Colors' => $p1Colors,
1023+
'p1OppColors' => $p1OppColors,
1024+
'p2Colors' => $p2Colors,
1025+
'p2OppColors' => $p2OppColors,
1026+
]);
10201027
$bothHaveColorPrefs = is_array($p1Colors) && is_array($p2Colors) && is_array($p1OppColors) && is_array($p2OppColors);
1028+
Log::debug("QuickMatchService ** Both have colors prefs: " . $bothHaveColorPrefs . " Match has observer: " . $matchHasObserver . " qmPlayer is observer: " . $qmPlayer->isObserver());
10211029
}
10221030

10231031
if (!$matchHasObserver && $bothHaveColorPrefs)
10241032
{
10251033
// Determine best matching colors.
10261034
[$p1Color, $p2Color] = $this->setColors($p1Colors, $p1OppColors, $p2Colors, $p2OppColors);
10271035
$colorsArr = [$p1Color, $p2Color];
1028-
if ($qmPlayer->isObserver() == false)
1036+
if (!$qmPlayer->isObserver())
10291037
{
10301038
$qmPlayer->color = $colorsArr[$i];
10311039
$qmPlayer->location = $spawnOrder[$i] - 1;

0 commit comments

Comments
 (0)