Allow searching for users by raw and ciphered card ID as well as game extid.

This commit is contained in:
Jennifer Taylor 2026-07-18 19:50:53 +00:00
parent bb07a1e0bc
commit 552f64af0a
28 changed files with 138 additions and 110 deletions

View File

@ -198,7 +198,7 @@ class DDRGameTraceHandler(DDRBase):
game = Node.void("game")
# Rival trace loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
# Nothing to load
return game
@ -254,7 +254,7 @@ class DDRGameLoadDailyHandler(DDRBase):
if extid is not None:
# Rival daily loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self daily loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
@ -329,7 +329,7 @@ class DDRGameFriendHandler(DDRBase):
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
friend = self.get_profile(userid)
play_stats = self.get_play_statistics(userid)
@ -394,7 +394,7 @@ class DDRGameLoadCourseHandler(DDRBase):
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self score loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)

View File

@ -185,7 +185,7 @@ class DDR2013(
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self score loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
@ -670,7 +670,7 @@ class DDR2013(
newfriends[pos] = None
else:
# Try looking up the userid
newfriends[pos] = self.data.remote.user.from_extid(self.game, self.version, code)
newfriends[pos] = self.data.remote.user.from_extid(self.game, code)
# Diff the set of links to determine updates
for i in range(10):

View File

@ -196,7 +196,7 @@ class DDR2014(
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self score loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
@ -300,7 +300,7 @@ class DDR2014(
game = Node.void("game")
# Rival trace loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
# Nothing to load
return game
@ -731,7 +731,7 @@ class DDR2014(
newfriends[pos] = None
else:
# Try looking up the userid
newfriends[pos] = self.data.remote.user.from_extid(self.game, self.version, code)
newfriends[pos] = self.data.remote.user.from_extid(self.game, code)
# Diff the set of links to determine updates
for i in range(10):

View File

@ -574,7 +574,7 @@ class DDRAce(
]:
# Load up this user's highscores, format the way the below code expects it
extid = requestdata.child_value("ddrcode")
otherid = self.data.remote.user.from_extid(self.game, self.version, extid)
otherid = self.data.remote.user.from_extid(self.game, extid)
userscores = self.data.remote.music.get_scores(self.game, self.music_version, otherid)
scores = [(otherid, score) for score in userscores]
else:
@ -665,7 +665,7 @@ class DDRAce(
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
if userid is None:
# Possibly look up by extid instead
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if mode == "userload":
self.__handle_userload(userid, request.child("data"), playerdata)

View File

@ -213,7 +213,7 @@ class DDRX2(
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self score loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
@ -729,7 +729,7 @@ class DDRX2(
newfriends[pos] = None
else:
# Try looking up the userid
newfriends[pos] = self.data.remote.user.from_extid(self.game, self.version, code)
newfriends[pos] = self.data.remote.user.from_extid(self.game, code)
# Diff the set of links to determine updates
for i in range(10):

View File

@ -179,7 +179,7 @@ class DDRX3(
if extid is not None:
# Rival score loading
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
else:
# Self score loading
userid = self.data.remote.user.from_refid(self.game, self.version, refid)
@ -746,7 +746,7 @@ class DDRX3(
newfriends[pos] = None
else:
# Try looking up the userid
newfriends[pos] = self.data.remote.user.from_extid(self.game, self.version, code)
newfriends[pos] = self.data.remote.user.from_extid(self.game, code)
# Diff the set of links to determine updates
for i in range(10):

View File

@ -182,7 +182,7 @@ class IIDXBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
"""
Given an ExtID and a request node, unformat the profile and save it.
"""
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
return
@ -672,7 +672,7 @@ class IIDXBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
if ghost_type == self.GHOST_TYPE_RIVAL:
rival_extid = int(parameter)
rival_userid = self.data.remote.user.from_extid(self.game, self.version, rival_extid)
rival_userid = self.data.remote.user.from_extid(self.game, rival_extid)
if rival_userid is not None:
rival_profile = self.get_profile(rival_userid)
rival_score = self.data.remote.music.get_score(
@ -827,9 +827,7 @@ class IIDXBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
if ghost_type == self.GHOST_TYPE_RIVAL_TOP or ghost_type == self.GHOST_TYPE_RIVAL_AVERAGE:
rival_extids = [int(e[1:-1]) for e in parameter.split(",")]
rival_userids = [
self.data.remote.user.from_extid(self.game, self.version, rival_extid) for rival_extid in rival_extids
]
rival_userids = [self.data.remote.user.from_extid(self.game, rival_extid) for rival_extid in rival_extids]
all_scores = sorted(
[

View File

@ -506,7 +506,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
else:
raise Exception("Unknown registration type for course entry!")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -534,7 +534,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
pgreats = int(request.attribute("pgnum"))
greats = int(request.attribute("gnum"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -595,7 +595,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -631,7 +631,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX25music")
@ -679,7 +679,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
def handle_IIDX25music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -705,7 +705,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -966,7 +966,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cstage"))

View File

@ -481,7 +481,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
else:
raise Exception("Unknown registration type for course entry!")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -547,7 +547,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -582,7 +582,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -765,7 +765,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
def handle_IIDX23music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -829,7 +829,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX23music")
@ -878,7 +878,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cstage"))
@ -1388,7 +1388,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
extid = int(request.child_value("iidx_id"))
location = ID.parse_machine_id(request.child_value("location_id"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
if profile is None:

View File

@ -362,7 +362,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
else:
raise Exception("Unknown registration type for course entry!")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -550,7 +550,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -585,7 +585,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -768,7 +768,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
def handle_IIDX22music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -832,7 +832,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX22music")
@ -882,7 +882,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cflg"))
@ -1352,7 +1352,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
extid = int(request.child_value("iidx_id"))
location = ID.parse_machine_id(request.child_value("location_id"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
if profile is None:

View File

@ -451,7 +451,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -487,7 +487,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX26music")
@ -535,7 +535,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
def handle_IIDX26music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -561,7 +561,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -822,7 +822,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cstage"))

View File

@ -505,7 +505,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
else:
raise Exception("Unknown registration type for course entry!")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -533,7 +533,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
pgreats = int(request.attribute("pgnum"))
greats = int(request.attribute("gnum"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
# Update achievement to track course statistics
self.update_course(
@ -594,7 +594,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -630,7 +630,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX24music")
@ -678,7 +678,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
def handle_IIDX24music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -704,7 +704,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -925,7 +925,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cstage"))
@ -1324,7 +1324,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
extid = int(request.child_value("iidx_id"))
location = ID.parse_machine_id(request.child_value("location_id"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
if profile is None:

View File

@ -494,7 +494,7 @@ class IIDXSpada(IIDXBase):
except Exception:
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -529,7 +529,7 @@ class IIDXSpada(IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -712,7 +712,7 @@ class IIDXSpada(IIDXBase):
def handle_IIDX21music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -776,7 +776,7 @@ class IIDXSpada(IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("IIDX21music")
@ -984,7 +984,7 @@ class IIDXSpada(IIDXBase):
extid = int(request.child_value("iidx_id"))
location = ID.parse_machine_id(request.child_value("location_id"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
if profile is None:
@ -1000,7 +1000,7 @@ class IIDXSpada(IIDXBase):
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cflg"))

View File

@ -474,7 +474,7 @@ class IIDXTricoro(IIDXBase):
# Invalid extid
continue
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
@ -509,7 +509,7 @@ class IIDXTricoro(IIDXBase):
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
chart = self.game_to_db_chart(int(request.attribute("clid")))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
# See if we need to report global or shop scores
if self.machine_joined_arcade():
@ -690,7 +690,7 @@ class IIDXTricoro(IIDXBase):
def handle_music_breg_request(self, request: Node) -> Node:
extid = int(request.attribute("iidxid"))
musicid = int(request.attribute("mid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
clear_status = self.game_to_db_status(int(request.attribute("cflg")))
@ -754,7 +754,7 @@ class IIDXTricoro(IIDXBase):
chart = self.game_to_db_chart(int(request.attribute("clid")))
ghost_type = int(request.attribute("ctype"))
extid = int(request.attribute("iidxid"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("music")
@ -940,7 +940,7 @@ class IIDXTricoro(IIDXBase):
extid = int(request.child_value("iidx_id"))
location = ID.parse_machine_id(request.child_value("location_id"))
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
if profile is None:
@ -955,7 +955,7 @@ class IIDXTricoro(IIDXBase):
extid = int(request.attribute("iidxid"))
cltype = int(request.attribute("gtype"))
rank = self.game_to_db_rank(int(request.attribute("gid")), cltype)
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
percent = int(request.attribute("achi"))
stages_cleared = int(request.attribute("cflg"))

View File

@ -160,7 +160,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
if extid is None:
return None
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
profile = self.get_profile(userid)
if profile is None:
return None

View File

@ -744,7 +744,7 @@ class JubeatProp(
music_index = music_index + 1
# Look up profile so we can load the last course played
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
profile = self.get_profile(userid)
if profile is None:
profile = Profile(self.game, self.version, "", extid)
@ -788,7 +788,7 @@ class JubeatProp(
extid = player.child_value("jid")
# Look up profile so we can load the last course played
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
profile = self.get_profile(userid)
if profile is None:
profile = Profile(self.game, self.version, "", extid)

View File

@ -245,7 +245,7 @@ class JubeatSaucerFulfill(
music_index = music_index + 1
# Look up profile so we can load the last course played
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
profile = self.get_profile(userid)
if profile is None:
profile = Profile(self.game, self.version, "", extid)

View File

@ -200,7 +200,7 @@ class ReflecBeatColette(ReflecBeatBase):
extid = request.child_value("uid")
teamid = request.child_value("tid")
limit = request.child_value("limit")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
comments = [
achievement
@ -262,7 +262,7 @@ class ReflecBeatColette(ReflecBeatBase):
def handle_info_pzlcmt_write_request(self, request: Node) -> Node:
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
# Anonymous comment
userid = UserID(0)
@ -348,7 +348,7 @@ class ReflecBeatColette(ReflecBeatBase):
# Create a lobby entry for this user
extid = request.child_value("e/uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
self.data.local.lobby.put_lobby(
@ -416,7 +416,7 @@ class ReflecBeatColette(ReflecBeatBase):
mg = request.child_value("m_grade") # noqa: F841
extid = request.child_value("uid")
limit = request.child_value("max")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for user, lobby in lobbies:

View File

@ -127,7 +127,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
# Create a lobby entry for this user
extid = request.child_value("e/uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
info = self.data.local.lobby.get_play_session_info(self.game, self.version, userid)
@ -196,7 +196,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
mg = request.child_value("m_grade") # noqa: F841
extid = request.child_value("uid")
limit = request.child_value("max")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for user, lobby in lobbies:
@ -471,7 +471,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
extid = request.child_value("uid")
locid = ID.parse_machine_id(request.child_value("lid"))
limit = request.child_value("limit")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
comments = [
achievement
@ -532,7 +532,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
def handle_info_rb4pzlcmt_write_request(self, request: Node) -> Node:
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
# Anonymous comment
userid = UserID(0)
@ -619,7 +619,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
def handle_player_rb4readepisode_request(self, request: Node) -> Node:
extid = request.child_value("user_id")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
achievements = self.data.local.user.get_achievements(self.game, self.version, userid)
else:
@ -691,7 +691,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
extid = request.child_value("uid")
songid = request.child_value("music_id")
chart = request.child_value("note_grade")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
score = None
profile = None
@ -1456,7 +1456,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
continue
extid = child.child_value("id")
other_userid = self.data.remote.user.from_extid(self.game, self.version, extid)
other_userid = self.data.remote.user.from_extid(self.game, extid)
if other_userid is None:
continue

View File

@ -260,7 +260,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
def handle_event_w_add_comment_request(self, request: Node) -> Node:
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
# Anonymous comment
userid = UserID(0)
@ -296,7 +296,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
def handle_event_w_update_status_request(self, request: Node) -> Node:
# Update user status so puzzle comments can show it
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
customize = request.child_value("customize")
status = request.child_value("status")
@ -329,7 +329,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
# Create a lobby entry for this user
extid = request.child_value("e/uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
self.data.local.lobby.put_lobby(
@ -394,7 +394,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
mg = request.child_value("m_grade") # noqa: F841
extid = request.child_value("uid")
limit = request.child_value("max")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for user, lobby in lobbies:

View File

@ -152,7 +152,7 @@ class ReflecBeat(ReflecBeatBase):
# Create a lobby entry for this user
extid = request.child_value("e/uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
self.data.local.lobby.put_lobby(
@ -203,7 +203,7 @@ class ReflecBeat(ReflecBeatBase):
mg = request.child_value("m_grade") # noqa: F841
extid = request.child_value("uid")
limit = request.child_value("max")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for user, lobby in lobbies:

View File

@ -99,7 +99,7 @@ class ReflecBeatVolzza(ReflecBeatVolzzaBase):
extid = request.child_value("uid")
songid = request.child_value("music_id")
chart = request.child_value("note_grade")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
score = None
profile = None
@ -121,7 +121,7 @@ class ReflecBeatVolzza(ReflecBeatVolzzaBase):
def handle_player_rb5_player_read_rival_ranking_data_request(self, request: Node) -> Node:
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("player")
rival_data = Node.void("rival_data")
@ -783,7 +783,7 @@ class ReflecBeatVolzza(ReflecBeatVolzzaBase):
continue
extid = child.child_value("id")
other_userid = self.data.remote.user.from_extid(self.game, self.version, extid)
other_userid = self.data.remote.user.from_extid(self.game, extid)
if other_userid is None:
continue

View File

@ -118,7 +118,7 @@ class ReflecBeatVolzza2(ReflecBeatVolzzaBase):
extid = request.child_value("uid")
songid = request.child_value("music_id")
chart = request.child_value("note_grade")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is None:
score = None
profile = None
@ -140,7 +140,7 @@ class ReflecBeatVolzza2(ReflecBeatVolzzaBase):
def handle_player_rb5_player_read_rival_ranking_data_5_request(self, request: Node) -> Node:
extid = request.child_value("uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
root = Node.void("player")
rival_data = Node.void("rival_data")
@ -890,7 +890,7 @@ class ReflecBeatVolzza2(ReflecBeatVolzzaBase):
continue
extid = child.child_value("id")
other_userid = self.data.remote.user.from_extid(self.game, self.version, extid)
other_userid = self.data.remote.user.from_extid(self.game, extid)
if other_userid is None:
continue

View File

@ -258,7 +258,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
# Create a lobby entry for this user
extid = request.child_value("e/uid")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
profile = self.get_profile(userid)
info = self.data.local.lobby.get_play_session_info(self.game, self.version, userid)
@ -325,7 +325,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
mg = request.child_value("m_grade") # noqa: F841
extid = request.child_value("uid")
limit = request.child_value("max")
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
userid = self.data.remote.user.from_extid(self.game, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for user, lobby in lobbies:

View File

@ -142,8 +142,8 @@ class GlobalUserData(BaseGlobalData):
def from_refid(self, game: GameConstants, version: int, refid: str) -> Optional[UserID]:
return self.user.from_refid(game, version, refid)
def from_extid(self, game: GameConstants, version: int, extid: int) -> Optional[UserID]:
return self.user.from_extid(game, version, extid)
def from_extid(self, game: GameConstants, extid: int) -> Optional[UserID]:
return self.user.from_extid(game, extid)
def get_profile(self, game: GameConstants, version: int, userid: UserID) -> Optional[Profile]:
if RemoteUser.is_remote(userid):

View File

@ -240,7 +240,7 @@ class UserData(BaseData):
result = cursor.mappings().fetchone() # type: ignore
return UserID(result["userid"])
def from_extid(self, game: GameConstants, version: int, extid: int) -> Optional[UserID]:
def from_extid(self, game: GameConstants, extid: int) -> Optional[UserID]:
"""
Given a generated ExtID, look up a user ID.
@ -249,7 +249,6 @@ class UserData(BaseData):
Parameters:
game - Enum value identifier of the game looking up the user.
version - Integer version of the game looking up the user.
extid - ExtID in question, most likely previously generated by this class.
Returns:

View File

@ -1,5 +1,5 @@
import random
from typing import Dict, Tuple, Any, Optional
from typing import Dict, List, Tuple, Any, Optional
from flask import Blueprint, request, Response, render_template, url_for
from bemani.backend.base import Base
@ -853,21 +853,52 @@ def addcard() -> Dict[str, Any]:
def searchusers() -> Dict[str, Any]:
# Grab card, convert it
searchdetails = request.get_json()["user_search"]
actual_users: Optional[List[UserID]] = None
if len(searchdetails["card"]) > 0:
card = searchdetails["card"]
if " " in card:
card = card.replace(" ", "")
if "-" in card:
card = card.replace("-", "")
# First, try by ciphered card ID.
try:
cardid = CardCipher.decode(searchdetails["card"])
cardid = CardCipher.decode(card)
actual_userid = g.data.local.user.from_cardid(cardid)
if actual_userid is None:
# Force a non-match below
actual_userid = UserID(-1)
if actual_userid is not None:
actual_users = [actual_userid]
except CardCipherException:
actual_userid = UserID(-1)
else:
actual_userid = None
pass
# Now try by raw card ID.
if actual_users is None:
actual_userid = g.data.local.user.from_cardid(card)
if actual_userid is not None:
actual_users = [actual_userid]
# Now try by extid.
if actual_users is None:
try:
extid = int(card)
actual_users = []
for game in GameConstants:
actual_userid = g.data.local.user.from_extid(game, extid)
if actual_userid is not None:
actual_users.append(actual_userid)
except ValueError:
pass
# Finally, give up and return no results.
if actual_users is None:
actual_users = []
def match(user: User) -> bool:
if actual_userid is not None:
return user.id == actual_userid
if actual_users is not None:
return user.id in actual_users
else:
return True

View File

@ -75,7 +75,7 @@ var card_management = createReactClass({
<div className="section">
<h3>User Search</h3>
<form onSubmit={this.searchUsers}>
<label htmlFor="card">Card Number:</label>
<label htmlFor="card">Card Number or Game ID:</label>
<br />
<input
type="text"