Skip to content

Commit cb9fd2e

Browse files
committed
match v5 gameDuration 단위 변경에 따른 게임진행시간 계산 로직 수정
1 parent 9931c40 commit cb9fd2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Dto/MatchV5/MatchDetailDto.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class MatchDetailDto extends BaseDto
3434
public $gameCreation;
3535
/** @var \RiotQuest\Dto\DateTime */
3636
public $gameStartTimestamp;
37+
/** @var \RiotQuest\Dto\DateTime */
38+
public $gameEndTimestamp;
3739
/** @var ParticipantDto[] */
3840
public $participants;
3941
/** @var TeamDto[] */
@@ -66,6 +68,10 @@ public function getGameDurationOrigin() {
6668
* @return int|float
6769
*/
6870
public function getGameDurationSecond() {
71+
if ($this->gameStartTimestamp && $this->gameEndTimestamp) {
72+
return (int)($this->gameEndTimestamp->getTimestamp() - $this->gameStartTimestamp->getTimestamp());
73+
}
74+
6975
return (int)($this->gameDuration / 1000);
7076
}
7177

0 commit comments

Comments
 (0)