Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cohstats/coh2stats
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.5
Choose a base ref
...
head repository: cohstats/coh2stats
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.6
Choose a head ref
  • 16 commits
  • 22 files changed
  • 3 contributors

Commits on Apr 13, 2022

  1. Copy the full SHA
    5e462c1 View commit details
  2. Merge pull request #210 from cohstats/Fix-Icon-artifacts

    Fix Icon artifacts in app
    petrvecera authored Apr 13, 2022
    Copy the full SHA
    4716ec2 View commit details

Commits on Apr 17, 2022

  1. Copy the full SHA
    e3e3911 View commit details

Commits on Apr 19, 2022

  1. Merge pull request #211 from cohstats/add-links

    Add links to the desktop page
    petrvecera authored Apr 19, 2022
    Copy the full SHA
    d5846c6 View commit details
  2. Add live matches stats

    petrvecera committed Apr 19, 2022
    Copy the full SHA
    8979d5e View commit details

Commits on Apr 20, 2022

  1. Merge pull request #212 from cohstats/live-matches

    Add live matches stats
    petrvecera authored Apr 20, 2022
    Copy the full SHA
    001020d View commit details

Commits on Apr 22, 2022

  1. Live matches table POC

    petrvecera committed Apr 22, 2022
    Copy the full SHA
    f65ddb1 View commit details

Commits on Apr 25, 2022

  1. WIP

    petrvecera committed Apr 25, 2022
    Copy the full SHA
    13fa8f4 View commit details

Commits on Apr 26, 2022

  1. Add the table

    petrvecera committed Apr 26, 2022
    Copy the full SHA
    8c217dc View commit details
  2. Merge pull request #216 from cohstats/live-matches-table

    Add live matches table
    petrvecera authored Apr 26, 2022
    Copy the full SHA
    4c48f07 View commit details

Commits on Apr 28, 2022

  1. Add sorting

    petrvecera committed Apr 28, 2022
    Copy the full SHA
    2610977 View commit details
  2. Merge pull request #217 from cohstats/live-matches-table

    Add sorting to live matches
    petrvecera authored Apr 28, 2022
    Copy the full SHA
    12a7dcc View commit details

Commits on Apr 29, 2022

  1. Copy the full SHA
    3f5aaa7 View commit details
  2. Merge pull request #218 from cohstats/live-matches-table

    Live matches - add styling of the top of the page
    petrvecera authored Apr 29, 2022
    Copy the full SHA
    dd5bc9d View commit details

Commits on May 16, 2022

  1. Finish - live matches table (#220)

    * WIP move to another file
    
    * Add live matches
    
    * Fix the loop
    petrvecera authored May 16, 2022
    Copy the full SHA
    0b643d8 View commit details

Commits on May 20, 2022

  1. Live matches improvements (#221)

    * wip - fix the pagination
    
    * Finish the live matches components
    
    * Add player names to the url
    petrvecera authored May 20, 2022
    Copy the full SHA
    436b7f2 View commit details
Binary file modified packages/app/assets/icon.ico
Binary file not shown.
7 changes: 7 additions & 0 deletions packages/web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ import CustomStats from "./pages/stats/custom-stats";
import Leaderboards from "./pages/ladders";
import PlayerCard from "./pages/players";
import MapStats from "./pages/map-stats";
import LiveMatches from "./pages/live-matches";

const { Content } = Layout;

@@ -55,6 +56,9 @@ const App: React.FC = () => {
<Route path={routes.statsBase()}>
<CustomStats />
</Route>
<Route path={routes.playerCardWithIdAndName()}>
<PlayerCard />
</Route>
<Route path={routes.playerCardWithId()}>
<PlayerCard />
</Route>
@@ -76,6 +80,9 @@ const App: React.FC = () => {
<Route path={routes.desktopAppBase()}>
<DesktopApp />
</Route>
<Route path={routes.liveMatchesBase()}>
<LiveMatches />
</Route>
<Route path={routes.aboutBase()}>
<About />
</Route>
5 changes: 5 additions & 0 deletions packages/web/src/analytics/firebase.ts
Original file line number Diff line number Diff line change
@@ -66,6 +66,10 @@ const teamCompositionUsed = (faction: string, type: string): void => {
firebase.logEvent("tcmWidgetUsed", { faction, type });
};

const liveMatchesDisplayed = (): void => {
firebase.logEvent("liveMatches");
};

const leaderboardsDisplayed = (): void => {
firebase.logEvent("leaderboards");
};
@@ -104,6 +108,7 @@ const firebaseAnalytics = {
mapStatsDisplayed,
statsDisplayed,
rangeStatsDisplayed,
liveMatchesDisplayed,
teamCompositionUsed,
leaderboardsDisplayed,
playerCardDisplayed,
73 changes: 73 additions & 0 deletions packages/web/src/coh/types.ts
Original file line number Diff line number Diff line change
@@ -102,7 +102,79 @@ interface StatsDataObject {
"4v4": TypeAnalysisObject;
}

interface StatsCurrentLiveGames {
games: {
"1v1": number;
"2v2": number;
"3v3": number;
"4v4": number;
AI: number;
custom: number;
};
players: {
"1v1": number;
"2v2": number;
"3v3": number;
"4v4": number;
AI: number;
custom: number;
};
totalPlayersAutomatch: number;
totalPlayersIngame: number;
timeStamp?: number;
}

type LivePlayerProfile = {
currentID: number;
profile_id: number;
name: string;
unknown3: string;
alias: string;
unknown5: string;
unknown6: number;
xp: number;
level: number;
unknown9: number;
unknown10?: null;
steamid: string;
unknown12: number;
};

type LiveGame = {
id: number;
unknown1: number;
unknown2: string;
creator_profile_id: number;
unknown4: number;
description: string;
unknown6: number;
mapname: string;
options?: string;
unknown9: number;
maxplayers: number;
slotinfo?: string;
unknown12: number;
players?: Array<{
matchid: number;
profile_id: number;
rank: number;
unknown3: number;
race_id: number;
teamid: number;
player_profile?: LivePlayerProfile;
}>;
current_observers: number;
max_observers: number;
unknown16: number;
unknown17: number;
unknown18: number;
unknown19: number;
startgametime: number;
server: string;
};

export type {
StatsCurrentLiveGames,
CommanderData,
CommanderAbility,
IntelBulletinData,
@@ -114,5 +186,6 @@ export type {
StatsDataObject,
TypeAnalysisObject,
statTypesInDbAsType,
LiveGame,
};
export { validRaceNames, validStatsTypes, statsTypesInDB };
19 changes: 18 additions & 1 deletion packages/web/src/components/main-header.tsx
Original file line number Diff line number Diff line change
@@ -11,7 +11,13 @@ import { Badge, Menu, Space, Tooltip } from "antd";
import routes from "../routes";
import { useRouteMatch } from "react-router";
import { PlayerSearchInput } from "./header-search";
import { aboutBase, bulletinsBase, commanderBase, desktopAppBase } from "../titles";
import {
aboutBase,
bulletinsBase,
commanderBase,
desktopAppBase,
liveMatchesAppBase,
} from "../titles";
import SubMenu from "antd/es/menu/SubMenu";
import { useData, useLoading } from "../firebase";
import { Link } from "react-router-dom";
@@ -33,6 +39,9 @@ const pageTitleSwitch = (path: string) => {
case routes.desktopAppBase():
document.title = desktopAppBase;
break;
case routes.liveMatchesBase():
document.title = liveMatchesAppBase;
break;
}
};

@@ -72,13 +81,18 @@ export const MainHeader: React.FC = () => {
path: routes.desktopAppBase(),
});

const liveMatchesMatch = useRouteMatch({
path: routes.liveMatchesBase(),
});

let pathMatch =
commandersMatch ||
statsMatch ||
aboutMatch ||
bulletinsMatch ||
mapStatsMatch ||
desktopAppMatch ||
liveMatchesMatch ||
leaderboardsMatch;
const currentPath = pathMatch?.path || "";
pageTitleSwitch(currentPath);
@@ -161,6 +175,9 @@ export const MainHeader: React.FC = () => {
<Menu.Item key={routes.leaderboardsBase()}>
<Link to={routes.leaderboardsBase()}>Leaderboards</Link>
</Menu.Item>
<Menu.Item key={routes.liveMatchesBase()}>
<Link to={routes.liveMatchesBase()}>Live Games</Link>
</Menu.Item>
<Menu.Item key={routes.commanderBase()}>
<Link to={routes.commanderBase()}>Commanders</Link>
</Menu.Item>
3 changes: 3 additions & 0 deletions packages/web/src/config.tsx
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@ const firebaseFunctions = {
location: "us-east4",
};

const devHostnames = ["localhost", "coh2-ladders-dev.web.app"];

const rrfConfig: Partial<ReactReduxFirebaseConfig> = {
enableLogging: true,
userProfile: "users",
@@ -29,6 +31,7 @@ const config = {
firebase,
rrfConfig,
firebaseFunctions,
devHostnames,
};

// The date when we exported the data for the bulletins and commanders
58 changes: 42 additions & 16 deletions packages/web/src/pages/desktop-app/desktop-app.tsx
Original file line number Diff line number Diff line change
@@ -2,10 +2,26 @@ import { DownloadOutlined } from "@ant-design/icons";
import { Button, Col, Image, Row } from "antd";
import Link from "antd/lib/typography/Link";
import Title from "antd/lib/typography/Title";
import React from "react";
import React, { useEffect, useRef } from "react";
import AppVersionFile from "@coh2stats/web/public/electron-app-version.json";
// eslint-disable-next-line react-hooks/exhaustive-deps
const useMountEffect = (fun: { (): void }) => useEffect(fun, []);

const DesktopApp: React.FC = () => {
const twitchOverlayRef = useRef(null);
const OBSOverlayRef = useRef(null);

useMountEffect(() => {
const hash = window.location.hash;
if (hash === "#twitch-overlay" && twitchOverlayRef) {
// @ts-ignore
twitchOverlayRef.current.scrollIntoView();
} else if (hash === "#obs-overlay" && OBSOverlayRef) {
// @ts-ignore
OBSOverlayRef.current.scrollIntoView();
}
}); // Scroll on mount

return (
<>
<Row justify="center" style={{ paddingTop: "20px" }}>
@@ -113,22 +129,27 @@ const DesktopApp: React.FC = () => {
</p>
</Col>
</Row>

<Row justify="center" style={{ paddingTop: "40px" }}>
<Col xs={24} xl={8} style={{ paddingTop: "70px" }}>
<Title level={2}>Twitch Overlay Extension</Title>
<p style={{ fontSize: "20px" }}>
A expandable Stream Overlay that allows curious viewers to interact with your game
stats on stream. Check out the extension{" "}
<Link
href={
"https://dashboard.twitch.tv/extensions/6x9q2nzzv9wewklo7gt7hz2vypdgg7-0.0.1"
}
target="_blank"
>
here
</Link>
.
</p>
<div ref={twitchOverlayRef}>
<a href={"#twitch-overlay"}>
<Title level={2}>Twitch Overlay Extension</Title>
</a>
<p style={{ fontSize: "20px" }}>
A expandable Stream Overlay that allows curious viewers to interact with your
game stats on stream. Check out the extension{" "}
<Link
href={
"https://dashboard.twitch.tv/extensions/6x9q2nzzv9wewklo7gt7hz2vypdgg7-0.0.1"
}
target="_blank"
>
here
</Link>
.
</p>
</div>
</Col>
<Col xs={24} xl={16}>
<Image
@@ -138,6 +159,7 @@ const DesktopApp: React.FC = () => {
/>
</Col>
</Row>

<Row justify="center" style={{ paddingTop: "40px" }}>
<Col xs={24} xl={16}>
<Image
@@ -147,7 +169,11 @@ const DesktopApp: React.FC = () => {
/>
</Col>
<Col xs={24} xl={8} style={{ paddingTop: "70px" }}>
<Title level={2}>Dynamic overlay for streamers with OBS</Title>
<div ref={OBSOverlayRef}>
<a href={"#obs-overlay"}>
<Title level={2}>Dynamic overlay for streamers with OBS</Title>
</a>
</div>
<p style={{ fontSize: "20px" }}>
An easy to configure overlay for OBS that shows the players and their ranking when
in game. Learn more{" "}
1 change: 1 addition & 0 deletions packages/web/src/pages/ladders/leaderboards.tsx
Original file line number Diff line number Diff line change
@@ -461,6 +461,7 @@ const Leaderboards = () => {
rowKey={(record) => record?.rank}
dataSource={findAndMergeStatGroups(data, dataHistoric)}
loading={isLoadingData || isLoadingDataHistoric}
scroll={{ x: 800 }}
/>
</Col>
</Row>
1 change: 1 addition & 0 deletions packages/web/src/pages/live-matches/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./live-matches";
Loading