From 0f8721e57ef4e0eb125d301f615d09655ccde217 Mon Sep 17 00:00:00 2001 From: jeroen Date: Tue, 22 Nov 2022 14:41:08 +0100 Subject: [PATCH] ENHANCEMENT: since Swar 5.24 we have multiple FideIDs --- src/Readers/Swar5.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Readers/Swar5.php b/src/Readers/Swar5.php index b6a4e42..21bf5e9 100644 --- a/src/Readers/Swar5.php +++ b/src/Readers/Swar5.php @@ -242,7 +242,19 @@ class Swar5 implements ReaderInterface $this->Tournament->FideHomol = $this->readData('Int', $swshandle); - $this->Tournament->FideId = $this->readData('String', $swshandle); + $location = ftell($swshandle); + if (version_compare($this->Release, '5.24', ">=")) { + $this->Tournament->FideId = $this->readData('Int', $swshandle); + } else { + for ($i = 0; $i <= 15; $i++) { + // First round + $this->readData('Int', $swshandle); + //last round + $this->readData('Int', $swshandle); + //fide ID + $this->readData('Int', $swshandle); + } + } $this->Tournament->FideArbitre1 = $this->readData('String', $swshandle); $this->Tournament->FideArbitre2 = $this->readData('String', $swshandle); $this->Tournament->FideEmail = $this->readData('String', $swshandle);