Skip to content

Commit

Permalink
fix: Remove gosu approach to send undefined for tourney field, if cli…
Browse files Browse the repository at this point in the history
…ents are not ready
  • Loading branch information
cyperdark committed Nov 21, 2024
1 parent ed6cd11 commit ffa6017
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
27 changes: 26 additions & 1 deletion packages/tosu/src/api/utils/buildResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,32 @@ const buildTourneyData = (
instanceManager.osuInstances
).filter((instance) => instance.isTourneyManager);
if (osuTourneyManager.length < 1) {
return undefined;
return {
manager: {
ipcState: 0,
bestOF: 0,
teamName: {
left: '',
right: ''
},
stars: {
left: 0,
right: 0
},
bools: {
scoreVisible: false,
starsVisible: false
},
chat: [],
gameplay: {
score: {
left: 0,
right: 0
}
}
},
ipcClients: []
};
}

const osuTourneyClients = Object.values(
Expand Down
25 changes: 24 additions & 1 deletion packages/tosu/src/api/utils/buildResultV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,30 @@ const buildTourneyData = (
instanceManager.osuInstances
).filter((instance) => instance.isTourneyManager);
if (osuTourneyManager.length < 1) {
return undefined;
return {
scoreVisible: false,
starsVisible: false,

ipcState: 0,
bestOF: 0,
team: {
left: '',
right: ''
},

points: {
left: 0,
right: 0
},

chat: [],

totalScore: {
left: 0,
right: 0
},
clients: []
};
}

const osuTourneyClients = Object.values(
Expand Down

0 comments on commit ffa6017

Please sign in to comment.