diff --git a/src/api/Factions.tsx b/src/api/Factions.tsx index 5d82acb..0b6f92a 100644 --- a/src/api/Factions.tsx +++ b/src/api/Factions.tsx @@ -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"], +}; diff --git a/src/api/marneApi.tsx b/src/api/marneApi.tsx index 14a4921..5076548 100644 --- a/src/api/marneApi.tsx +++ b/src/api/marneApi.tsx @@ -353,6 +353,7 @@ export class ApiProvider extends JsonClient { smallmode: smallmodes[result?.gameMode], settings: result?.settings, description: result?.description, + map: internalMapName, rotation: result?.rotation === "" ? [] diff --git a/src/components/routes/Servers/Detailed/Main.tsx b/src/components/routes/Servers/Detailed/Main.tsx index 5664117..29e4e0f 100644 --- a/src/components/routes/Servers/Detailed/Main.tsx +++ b/src/components/routes/Servers/Detailed/Main.tsx @@ -428,7 +428,7 @@ export function Results(props: Views): React.ReactElement { ) : ( props.game === "bf1marne" && ( diff --git a/src/components/routes/Servers/Detailed/Players.tsx b/src/components/routes/Servers/Detailed/Players.tsx index 8da025d..28fa9a2 100644 --- a/src/components/routes/Servers/Detailed/Players.tsx +++ b/src/components/routes/Servers/Detailed/Players.tsx @@ -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"; @@ -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); });