jubeat: Performance optimizations in get_mdata
This commit is contained in:
parent
ee3b18bfcb
commit
d33a4cb815
@ -1037,6 +1037,17 @@ class JubeatClan(
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
extid = player.child_value('jid')
|
||||
mdata_ver = player.child_value('mdata_ver') # Game requests mdata 3 times per profile for some reason
|
||||
if mdata_ver != 1:
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
root.add_child(datanode)
|
||||
player = Node.void('player')
|
||||
datanode.add_child(player)
|
||||
player.add_child(Node.s32('jid', extid))
|
||||
playdata = Node.void('mdata_list')
|
||||
player.add_child(playdata)
|
||||
return root
|
||||
root = self.get_scores_by_extid(extid)
|
||||
if root is None:
|
||||
root = Node.void('gametop')
|
||||
@ -1092,7 +1103,6 @@ class JubeatClan(
|
||||
return Node.void('gameend')
|
||||
|
||||
def format_scores(self, userid: UserID, profile: ValidatedDict, scores: List[Score]) -> Node:
|
||||
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
|
||||
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
|
@ -533,6 +533,17 @@ class JubeatProp(
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
extid = player.child_value('jid')
|
||||
mdata_ver = player.child_value('mdata_ver') # Game requests mdata 3 times per profile for some reason
|
||||
if mdata_ver != 1:
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
root.add_child(datanode)
|
||||
player = Node.void('player')
|
||||
datanode.add_child(player)
|
||||
player.add_child(Node.s32('jid', extid))
|
||||
playdata = Node.void('mdata_list')
|
||||
player.add_child(playdata)
|
||||
return root
|
||||
root = self.get_scores_by_extid(extid)
|
||||
if root is None:
|
||||
root = Node.void('gametop')
|
||||
@ -1329,7 +1340,6 @@ class JubeatProp(
|
||||
return newprofile
|
||||
|
||||
def format_scores(self, userid: UserID, profile: ValidatedDict, scores: List[Score]) -> Node:
|
||||
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
|
||||
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
|
@ -431,6 +431,17 @@ class JubeatQubell(
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
extid = player.child_value('jid')
|
||||
mdata_ver = player.child_value('mdata_ver') # Game requests mdata 3 times per profile for some reason
|
||||
if mdata_ver != 1:
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
root.add_child(datanode)
|
||||
player = Node.void('player')
|
||||
datanode.add_child(player)
|
||||
player.add_child(Node.s32('jid', extid))
|
||||
playdata = Node.void('mdata_list')
|
||||
player.add_child(playdata)
|
||||
return root
|
||||
root = self.get_scores_by_extid(extid)
|
||||
if root is None:
|
||||
root = Node.void('gametop')
|
||||
@ -831,7 +842,6 @@ class JubeatQubell(
|
||||
return root
|
||||
|
||||
def format_scores(self, userid: UserID, profile: ValidatedDict, scores: List[Score]) -> Node:
|
||||
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
|
||||
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
|
@ -134,6 +134,18 @@ class JubeatSaucer(
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
extid = player.child_value('jid')
|
||||
mdata_ver = player.child_value('mdata_ver') # Game requests mdata 3 times per profile for some reason
|
||||
if mdata_ver != 1:
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
root.add_child(datanode)
|
||||
player = Node.void('player')
|
||||
datanode.add_child(player)
|
||||
player.add_child(Node.s32('jid', extid))
|
||||
playdata = Node.void('playdata')
|
||||
player.add_child(playdata)
|
||||
playdata.set_attribute('count', '0')
|
||||
return root
|
||||
root = self.get_scores_by_extid(extid)
|
||||
if root is None:
|
||||
root = Node.void('gametop')
|
||||
@ -646,7 +658,6 @@ class JubeatSaucer(
|
||||
return newprofile
|
||||
|
||||
def format_scores(self, userid: UserID, profile: ValidatedDict, scores: List[Score]) -> Node:
|
||||
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
|
||||
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
|
@ -265,6 +265,18 @@ class JubeatSaucerFulfill(
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
extid = player.child_value('jid')
|
||||
mdata_ver = player.child_value('mdata_ver') # Game requests mdata 3 times per profile for some reason
|
||||
if mdata_ver != 1:
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
root.add_child(datanode)
|
||||
player = Node.void('player')
|
||||
datanode.add_child(player)
|
||||
player.add_child(Node.s32('jid', extid))
|
||||
playdata = Node.void('playdata')
|
||||
player.add_child(playdata)
|
||||
playdata.set_attribute('count', '0')
|
||||
return root
|
||||
root = self.get_scores_by_extid(extid)
|
||||
if root is None:
|
||||
root = Node.void('gametop')
|
||||
@ -743,7 +755,6 @@ class JubeatSaucerFulfill(
|
||||
return newprofile
|
||||
|
||||
def format_scores(self, userid: UserID, profile: ValidatedDict, scores: List[Score]) -> Node:
|
||||
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
|
||||
|
||||
root = Node.void('gametop')
|
||||
datanode = Node.void('data')
|
||||
|
Loading…
Reference in New Issue
Block a user