mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-12 11:07:27 +08:00
[Enhance][Refactor] unranked score & warning log
- Add an option that can be used to forbid some illegal scores - Add brief warning logs for custom exceptions
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from .error import NoData
|
||||
from .config_manager import Config
|
||||
|
||||
|
||||
class Chart:
|
||||
@@ -33,8 +34,10 @@ class Chart:
|
||||
'''select rating_pst, rating_prs, rating_ftr, rating_byn from chart where song_id=:a''', {'a': self.song_id})
|
||||
x = self.c.fetchone()
|
||||
if x is None:
|
||||
self.defnum = -10
|
||||
# raise NoData('The song `%s` does not exist.' % self.song_id)
|
||||
if Config.ALLOW_SCORE_WITH_NO_SONG:
|
||||
self.defnum = -10
|
||||
else:
|
||||
raise NoData(f'The song `{self.song_id}` does not exist.', 120)
|
||||
else:
|
||||
self.defnum = x[self.difficulty]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user