@@ -55,7 +55,8 @@ export default async function({login, q, imports, data, account}, {enabled = fal
5555 //Read fetched data
5656 const exported = await Promise . all (
5757 ( await imports . fs . readdir ( `${ imports . __module ( import . meta. url ) } /s3si/export` ) )
58- . map ( async file => JSON . parse ( await imports . fs . readFile ( `${ imports . __module ( import . meta. url ) } /s3si/export/${ file } ` ) ) ) )
58+ . map ( async file => JSON . parse ( await imports . fs . readFile ( `${ imports . __module ( import . meta. url ) } /s3si/export/${ file } ` ) ) ) ,
59+ )
5960 const summary = exported . filter ( ( { type} ) => type === "SUMMARY" ) . at ( 0 )
6061 if ( ! summary )
6162 throw new Error ( "Failed to fetch player summary!" )
@@ -64,66 +65,68 @@ export default async function({login, q, imports, data, account}, {enabled = fal
6465
6566 //Player summary
6667 const player = {
67- level :summary . data . HistoryRecordQuery . playHistory . rank ,
68- rank :{
69- current :summary . data . HistoryRecordQuery . playHistory . udemae ,
70- max :summary . data . HistoryRecordQuery . playHistory . udemaeMax ,
68+ level : summary . data . HistoryRecordQuery . playHistory . rank ,
69+ rank : {
70+ current : summary . data . HistoryRecordQuery . playHistory . udemae ,
71+ max : summary . data . HistoryRecordQuery . playHistory . udemaeMax ,
7172 } ,
72- painted :summary . data . HistoryRecordQuery . playHistory . paintPointTotal ,
73- battles :{
74- wins :summary . data . HistoryRecordQuery . playHistory . winCountTotal ,
75- count :summary . data . ConfigureAnalyticsQuery . playHistory . battleNumTotal ,
73+ painted : summary . data . HistoryRecordQuery . playHistory . paintPointTotal ,
74+ battles : {
75+ wins : summary . data . HistoryRecordQuery . playHistory . winCountTotal ,
76+ count : summary . data . ConfigureAnalyticsQuery . playHistory . battleNumTotal ,
7677 } ,
77- started :new Date ( summary . data . HistoryRecordQuery . playHistory . gameStartTime ) ,
78- name :summary . data . HistoryRecordQuery . currentPlayer . name ,
79- byname :summary . data . HistoryRecordQuery . currentPlayer . byname ,
80- badges :await Promise . all ( summary . data . HistoryRecordQuery . currentPlayer . nameplate . badges . map ( badge => badge ? imports . imgb64 ( badge . image . url ) : null ) ) ,
81- plate :{
82- color :`#${ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . r ) . toString ( 16 ) . padStart ( 2 , 0 ) } ${ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . g ) . toString ( 16 ) . padStart ( 2 , 0 ) } ${ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . b ) . toString ( 16 ) . padStart ( 2 , 0 ) } ` ,
83- icon :await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . image . url ) ,
78+ started : new Date ( summary . data . HistoryRecordQuery . playHistory . gameStartTime ) ,
79+ name : summary . data . HistoryRecordQuery . currentPlayer . name ,
80+ byname : summary . data . HistoryRecordQuery . currentPlayer . byname ,
81+ badges : await Promise . all ( summary . data . HistoryRecordQuery . currentPlayer . nameplate . badges . map ( badge => badge ? imports . imgb64 ( badge . image . url ) : null ) ) ,
82+ plate : {
83+ color : `#${ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . r ) . toString ( 16 ) . padStart ( 2 , 0 ) } ${ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . g ) . toString ( 16 ) . padStart ( 2 , 0 ) } ${
84+ Math . round ( 255 * summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . textColor . b ) . toString ( 16 ) . padStart ( 2 , 0 )
85+ } `,
86+ icon : await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . nameplate . background . image . url ) ,
8487 } ,
85- equipment :{
86- weapon :{
87- name :summary . data . HistoryRecordQuery . currentPlayer . weapon . name ,
88- icon :await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . image . url ) ,
88+ equipment : {
89+ weapon : {
90+ name : summary . data . HistoryRecordQuery . currentPlayer . weapon . name ,
91+ icon : await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . image . url ) ,
8992 } ,
90- special :{
91- name :summary . data . HistoryRecordQuery . currentPlayer . weapon . specialWeapon . name ,
92- icon :await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . specialWeapon . image . url ) ,
93+ special : {
94+ name : summary . data . HistoryRecordQuery . currentPlayer . weapon . specialWeapon . name ,
95+ icon : await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . specialWeapon . image . url ) ,
9396 } ,
94- sub :{
95- name :summary . data . HistoryRecordQuery . currentPlayer . weapon . subWeapon . name ,
96- icon :await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . subWeapon . image . url ) ,
97+ sub : {
98+ name : summary . data . HistoryRecordQuery . currentPlayer . weapon . subWeapon . name ,
99+ icon : await imports . imgb64 ( summary . data . HistoryRecordQuery . currentPlayer . weapon . subWeapon . image . url ) ,
97100 } ,
98- gears :await Promise . all ( [ "headGear" , "clothingGear" , "shoesGear" ] . map ( async type => {
101+ gears : await Promise . all ( [ "headGear" , "clothingGear" , "shoesGear" ] . map ( async type => {
99102 const gear = summary . data . HistoryRecordQuery . currentPlayer [ type ]
100103 return {
101- name :gear . name ,
102- icon :await imports . imgb64 ( gear . image . url ) ,
103- abilities :await Promise . all ( [
104+ name : gear . name ,
105+ icon : await imports . imgb64 ( gear . image . url ) ,
106+ abilities : await Promise . all ( [
104107 {
105- name :gear . primaryGearPower . name ,
106- icon :await imports . imgb64 ( gear . primaryGearPower . image . url ) ,
108+ name : gear . primaryGearPower . name ,
109+ icon : await imports . imgb64 ( gear . primaryGearPower . image . url ) ,
107110 } ,
108- ...gear . additionalGearPowers . map ( async ability => ( { name :ability . name , icon :await imports . imgb64 ( ability . image . url ) } ) )
109- ] )
111+ ...gear . additionalGearPowers . map ( async ability => ( { name : ability . name , icon : await imports . imgb64 ( ability . image . url ) } ) ) ,
112+ ] ) ,
110113 }
111- } ) )
114+ } ) ) ,
112115 } ,
113- salmon :{
114- grade :{
115- name :summary . data . CoopHistoryQuery . coopResult . regularGrade . name ,
116- points :summary . data . CoopHistoryQuery . coopResult . regularGradePoint ,
116+ salmon : {
117+ grade : {
118+ name : summary . data . CoopHistoryQuery . coopResult . regularGrade . name ,
119+ points : summary . data . CoopHistoryQuery . coopResult . regularGradePoint ,
117120 } ,
118- played :summary . data . CoopHistoryQuery . coopResult . pointCard . playCount ,
119- rescues :summary . data . CoopHistoryQuery . coopResult . pointCard . rescueCount ,
121+ played : summary . data . CoopHistoryQuery . coopResult . pointCard . playCount ,
122+ rescues : summary . data . CoopHistoryQuery . coopResult . pointCard . rescueCount ,
120123 eggs : {
121124 golden : summary . data . CoopHistoryQuery . coopResult . pointCard . goldenDeliverCount ,
122125 regular : summary . data . CoopHistoryQuery . coopResult . pointCard . deliverCount ,
123126 } ,
124- points :summary . data . CoopHistoryQuery . coopResult . pointCard . totalPoint ,
125- kings :summary . data . CoopHistoryQuery . coopResult . pointCard . defeatBossCount ,
126- }
127+ points : summary . data . CoopHistoryQuery . coopResult . pointCard . totalPoint ,
128+ kings : summary . data . CoopHistoryQuery . coopResult . pointCard . defeatBossCount ,
129+ } ,
127130 }
128131
129132 //Versus mode
0 commit comments