Skip to content

Commit 680d613

Browse files
authored
Merge pull request #60 from crackhex/rksys_bugfix
.dat unsupported bugfix
2 parents c897e5f + 8a60b76 commit 680d613

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

application/parsers/rksys_parser_strategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
Responsibilities:
1212
- Always support any file that starts with the "RKSD" header
13-
- Produce an RKSysFile with default run_time=0
13+
- Produce an RKSysFile with default run_time=0.0
1414
"""
1515

1616
from domain.entities import RKSysFile
@@ -29,7 +29,7 @@ def supports(self, file_bytes: bytes) -> bool:
2929
"""
3030
Return True if the file_bytes start with the ASCII header "RKSD".
3131
"""
32-
return file_bytes[:4] != b"RKSD"
32+
return file_bytes[:4] == b"RKSD"
3333

3434
def parse(self, file_bytes: bytes, uploaded_at: int) -> RKSysFile:
3535
"""

application/services/submission_services/mkw_submission_service.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
It understands the following file formats:
1313
1414
* .rkg – single-track ghost file (Time Trials).
15-
* .rksys – game file, used for ghosts across multiple tracks.
15+
* .dat – game file, used for ghosts across multiple tracks.
1616
* .zip - sending multiple files, of different type.
1717
1818
The service chooses the proper parser **at run-time**, based on the single
@@ -22,15 +22,11 @@
2222

2323
from __future__ import annotations
2424

25-
from typing import Optional, Dict, Type
25+
from typing import Optional
2626

27-
from application.parsers.parser_strategy import ParserStrategy
2827
from application.parsers.registry import candidates_excluding
29-
from application.parsers.rkg_parser_strategy import RkgParserStrategy
30-
from application.parsers.rksys_parser_strategy import RksysParserStrategy
3128
from application.parsers.file_parser import FileParser
3229
from application.parsers.null_parser_strategy import NullParserStrategy # safety
33-
from application.parsers.zip_parser_strategy import ZipParserStrategy
3430

3531
from application.services.submission_services.base_submission_service import BaseSubmissionService
3632

0 commit comments

Comments
 (0)