set_mods func

This commit is contained in:
Emily 2019-03-13 06:04:29 +01:00
parent 93e26250f8
commit a94baeac62
2 changed files with 3 additions and 4 deletions

View File

@ -7,6 +7,7 @@ from .helpers import osuMods
from .helpers import osuRanks
from .helpers import typeSerializer
from os.path import isfile
from hashlib import md5 as _md5
def md5(str):
@ -80,6 +81,7 @@ class Replay:
def set_mods(self, mods):
if mods < 0 or mods > (1 << 30) - 1:
raise Exception("Mods are out of range")
self.mods = mods
# --------------------------------------------------------------------------
# Update variables ---------------------------------------------------------

View File

@ -6,8 +6,5 @@ replay.write( ReplayFrame(2, 3, 4, 4) )
replay.score_300s = 20
replay.timestamp = 635592412124124124 # Wed Feb 11 2015 09:03:52 GMT+0100 (Central European Standard Time)
replay.timestamp = 635570498982876124 # Invalid timestamp?!
# "2|3|4|4,-12345|0|0|1337,"
# ]\0\0 \0\u0018\0\0\0\0\0\0\0\0\u0019\u001f\u0002g<32>L<EFBFBD>_<EFBFBD>F<EFBFBD><46><EFBFBD>6m<36><6D>\u0003<30>,<2C>7<EFBFBD><37>Í
replay.save("test.osr")
replay.save("test.osr")