Skip to content

Commit

Permalink
add small playerlist to marne
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Oct 27, 2023
1 parent d836c65 commit c41b6e5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/api/marneApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ export class ApiProvider extends JsonClient {
};
},
),
players:
result?.playerList === ""
? []
: result?.playerList?.map((current: PlayerReturn) => {
return {
name: current.name,
team: current.team,
};
}),
};
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/routes/Servers/Detailed/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ export function Results(props: Views): React.ReactElement {
) : (
<>
{props.game === "bf3" ? (
<Bf3ServerPlayerlist players={stats?.players} />
<Bf3ServerPlayerlist
players={stats?.players}
game={props.game}
/>
) : // older titles
stats?.ip && stats?.port ? (
<BfListServerPlayerList
Expand All @@ -390,7 +393,9 @@ export function Results(props: Views): React.ReactElement {
serverPort={stats?.hostport || stats?.port}
/>
) : (
<></>
props.game === "bf1marne" && (
<Bf3ServerPlayerlist players={stats?.players} game="bf1" />
)
)}
</>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/routes/Servers/Detailed/Players.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ export function ServerPlayerlist(props: {

export function Bf3ServerPlayerlist(props: {
players: ScoreServerPlayer[];
game: string;
}): React.ReactElement {
const { t } = useTranslation();

Expand Down Expand Up @@ -445,7 +446,7 @@ export function Bf3ServerPlayerlist(props: {
}}
href={`https://gametools.network/stats/pc/name/${encodeURIComponent(
key.name,
)}?game=bf3`}
)}?game=${props.game}`}
target="_blank"
rel="noreferrer"
>
Expand Down

0 comments on commit c41b6e5

Please sign in to comment.