Skip to content

Commit

Permalink
add current map to marne
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Nov 19, 2023
1 parent 8d2a0ea commit 3a16673
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
35 changes: 35 additions & 0 deletions src/api/Factions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,38 @@ export const factions = {
name: "Russian Federation",
},
};

export const bf1_factions = {
MP_Tsaritsyn: ["BFFactionId_FactionBOL", "BFFactionId_FactionRUS"],
MP_Amiens: ["BFFactionId_FactionGER", "BFFactionId_FactionUK"],
MP_Desert: ["BFFactionId_FactionUK", "BFFactionId_FactionOTM"],
MP_Forest: ["BFFactionId_FactionGER", "BFFactionId_FactionUSA"],
MP_Chateau: ["BFFactionId_FactionUSA", "BFFactionId_FactionGER"],
MP_MountainFort: ["BFFactionId_FactionITA", "BFFactionId_FactionAHU"],
MP_ShovelTown: ["BFFactionId_FactionGER", "BFFactionId_FactionFRA"],
MP_Giant: ["BFFactionId_FactionGER", "BFFactionId_FactionUK"],
MP_Suez: ["BFFactionId_FactionUK", "BFFactionId_FactionOTM"],
MP_Trench: ["BFFactionId_FactionGER", "BFFactionId_FactionFRA"],
MP_Underworld: ["BFFactionId_FactionGER", "BFFactionId_FactionFRA"],
MP_ItalianCoast: ["BFFactionId_FactionITA", "BFFactionId_FactionAHU"],
MP_Graveyard: ["BFFactionId_FactionFRA", "BFFactionId_FactionGER"],
MP_Scar: ["BFFactionId_FactionUK", "BFFactionId_FactionGER"],
MP_FaoFortress: ["BFFactionId_FactionUK", "BFFactionId_FactionOTM"],
MP_Islands: ["BFFactionId_FactionGER", "BFFactionId_FactionRUS"],
MP_Valley: ["BFFactionId_FactionWA", "BFFactionId_FactionAHU"],
MP_Verdun: ["BFFactionId_FactionGER", "BFFactionId_FactionFRA"],
MP_Hell: ["BFFactionId_FactionUK", "BFFactionId_FactionGER"],
MP_Bridge: ["BFFactionId_FactionWA", "BFFactionId_FactionAHU"],
MP_Ravines: ["BFFactionId_FactionAHU", "BFFactionId_FactionRUS"],
MP_Volga: ["BFFactionId_FactionBOL", "BFFactionId_FactionWA"],
MP_Ridge: ["BFFactionId_FactionUK", "BFFactionId_FactionOTM"],
MP_Fields: ["BFFactionId_FactionFRA", "BFFactionId_FactionGER"],
MP_Alps: ["BFFactionId_FactionGER", "BFFactionId_FactionUK"],
MP_River: ["BFFactionId_FactionAHU", "BFFactionId_FactionITA"],
MP_Offensive: ["BFFactionId_FactionUK", "BFFactionId_FactionGER"],
MP_Naval: ["BFFactionId_FactionUKM", "BFFactionId_FactionGER"],
MP_Harbor: ["BFFactionId_FactionUKM", "BFFactionId_FactionGER"],
MP_Beachhead: ["BFFactionId_FactionUK", "BFFactionId_FactionOTM"],
MP_Blitz: ["BFFactionId_FactionGER", "BFFactionId_FactionUK"],
MP_London: ["BFFactionId_FactionGER", "BFFactionId_FactionUK"],
};
1 change: 1 addition & 0 deletions src/api/marneApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ export class ApiProvider extends JsonClient {
smallmode: smallmodes[result?.gameMode],
settings: result?.settings,
description: result?.description,
map: internalMapName,
rotation:
result?.rotation === ""
? []
Expand Down
2 changes: 1 addition & 1 deletion src/components/routes/Servers/Detailed/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export function Results(props: Views): React.ReactElement {
) : (
props.game === "bf1marne" && (
<MarnePlayerList
players={stats?.players}
stats={stats}
game={props?.game}
gameId={stats?.gameId}
/>
Expand Down
14 changes: 7 additions & 7 deletions src/components/routes/Servers/Detailed/Players.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import {
SelectPrimary,
} from "../../../Materials";
import {
DetailedServerInfo,
ScoreServerPlayer,
seederPlayer,
serverPlayer,
ServerPlayersReturn,
serverTeamList,
} from "../../../../api/ReturnTypes";
import { factions } from "../../../../api/Factions";
import { bf1_factions, factions } from "../../../../api/Factions";
import { Description, Spacing, Title } from "./Servers";
import { DynamicSort } from "../../Stats/Player/Main";
import styled from "styled-components";
Expand Down Expand Up @@ -403,28 +404,27 @@ export function ServerPlayerlist(props: {
}

export function MarnePlayerList(props: {
players: ScoreServerPlayer[];
stats: DetailedServerInfo;
game: string;
gameId: string;
}): React.ReactElement {
const current_factions = bf1_factions[props?.stats?.map] ?? [];
const stats = {
teams: [
{
teamid: "teamOne",
players: [],
image: "",
name: "1",
faction: current_factions[0],
},
{
teamid: "teamTwo",
players: [],
image: "",
name: "",
faction: current_factions[1],
},
],
update_timestamp: Date.now() / 1000,
};
props?.players?.forEach((element) => {
props?.stats?.players?.forEach((element) => {
stats.teams[element.team - 1].players.push(element);
});

Expand Down

0 comments on commit 3a16673

Please sign in to comment.