fix: missing version dot
This commit is contained in:
@@ -160,7 +160,7 @@ impl Display for MusicRating {
|
|||||||
))?;
|
))?;
|
||||||
} else {
|
} else {
|
||||||
f.write_fmt(format_args!(
|
f.write_fmt(format_args!(
|
||||||
"谱面版本: \tSD 1.{:02}{:02}\n",
|
"谱面版本: \tSD 1.{:02}.{:02}\n",
|
||||||
(self.rom_version / 100) % 100,
|
(self.rom_version / 100) % 100,
|
||||||
self.rom_version % 100,
|
self.rom_version % 100,
|
||||||
))?;
|
))?;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
|
from typing import Callable
|
||||||
|
|
||||||
SALT = b"Lt2N5xgjJOqRsT5qVt7wWYw6SqOPZDI7"
|
SALT = b"Lt2N5xgjJOqRsT5qVt7wWYw6SqOPZDI7"
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ def salted_hash_userid(player: dict):
|
|||||||
player["userId"] = hash_uid.hexdigest()[:16]
|
player["userId"] = hash_uid.hexdigest()[:16]
|
||||||
|
|
||||||
|
|
||||||
def remove_useless_fields(player: dict):
|
def clean_player(player: dict):
|
||||||
player.pop("isLogin")
|
player.pop("isLogin")
|
||||||
player.pop("lastLoginDate")
|
player.pop("lastLoginDate")
|
||||||
player.pop("lastPlayDate")
|
player.pop("lastPlayDate")
|
||||||
@@ -33,23 +34,35 @@ def record_time(*, _: list[datetime] = []):
|
|||||||
return diff
|
return diff
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def process(
|
||||||
|
clean_fields: Callable[[dict], None],
|
||||||
|
input_file: str,
|
||||||
|
output_file: str,
|
||||||
|
):
|
||||||
record_time()
|
record_time()
|
||||||
with open("players.json", "r", encoding="utf-8") as f:
|
with open(input_file, "r", encoding="utf-8") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
print(f"loaded, cost {record_time():.2f}s")
|
print(f"loaded, cost {record_time():.2f}s")
|
||||||
|
|
||||||
record_time()
|
record_time()
|
||||||
for entry in data:
|
for entry in data:
|
||||||
salted_hash_userid(entry)
|
salted_hash_userid(entry)
|
||||||
remove_useless_fields(entry)
|
clean_fields(entry)
|
||||||
print(f"processed, cost {record_time():.2f}s")
|
print(f"processed, cost {record_time():.2f}s")
|
||||||
|
|
||||||
record_time()
|
record_time()
|
||||||
with open("players_pub.json", "w", encoding="utf-8") as f:
|
with open(output_file, "w", encoding="utf-8") as f:
|
||||||
json.dump(data, f, ensure_ascii=False)
|
json.dump(data, f, ensure_ascii=False)
|
||||||
print(f"written out, cost {record_time():.2f}s")
|
print(f"written out, cost {record_time():.2f}s")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
process(
|
||||||
|
clean_player,
|
||||||
|
"players.json",
|
||||||
|
"players_pub.json",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user