Skip to content

Commit

Permalink
feat: pass name to buildResult
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD committed Dec 21, 2023
1 parent 2f0a5cb commit a57365e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/tosu/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export interface TourneyValues {
}

export interface UserProfileAnswer {
name: string;
accuracy: number;
rankedScore: number;
id: number;
Expand Down
1 change: 1 addition & 0 deletions packages/tosu/src/api/utils/buildResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export const buildResult = (
'0': resultsScreenData.HitMiss
},
userProfile: {
name: userProfile.name,
accuracy: userProfile.accuracy,
rankedScore: userProfile.rankedScore,
id: userProfile.id,
Expand Down
4 changes: 4 additions & 0 deletions packages/tosu/src/entities/UserProfile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AbstractEntity } from '../AbstractEntity';
import { DataRepo } from '../DataRepoList';

export class UserProfile extends AbstractEntity {
name: string;
accuracy: number;
rankedScore: number;
id: number;
Expand Down Expand Up @@ -34,6 +35,9 @@ export class UserProfile extends AbstractEntity {
return;
}

this.name = process.readSharpString(
process.readInt(profileBase + 0x30)
);
this.accuracy = process.readDouble(profileBase + 0x4);
this.rankedScore = process.readLong(profileBase + 0xc);
this.id = process.readInt(profileBase + 0x70);
Expand Down

0 comments on commit a57365e

Please sign in to comment.