Skip to content

Commit

Permalink
Merge pull request lexogrine#31 from lexogrine/custom_fields
Browse files Browse the repository at this point in the history
Custom fields
  • Loading branch information
osztenkurden authored Feb 4, 2021
2 parents 0d49d2c + 067fb0d commit ae5c596
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 32 deletions.
31 changes: 24 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@types/node": "12.11.1",
"@types/react": "16.9.9",
"@types/react-dom": "16.9.2",
"csgogsi": "^1.2.6",
"csgogsi-socket": "^1.2.8",
"csgogsi": "^1.3.2",
"csgogsi-socket": "^1.3.2",
"node-sass": "^4.14.1",
"query-string": "^6.12.1",
"react": "^16.13.1",
Expand Down
25 changes: 4 additions & 21 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class App extends React.Component<any, { match: Match | null, game: CSGO | null,
realName: `${player.firstName} ${player.lastName}`,
steamid: player.steamid,
country: player.country,
avatar: player.avatar
avatar: player.avatar,
extra: player.extra,
})
);

Expand Down Expand Up @@ -101,24 +102,6 @@ class App extends React.Component<any, { match: Match | null, game: CSGO | null,
window.top.location.reload();
});

/*if (href.indexOf('/huds/')) {
const segment = href.substr(href.indexOf('/huds/') + 6);
const name = segment.substr(0, segment.lastIndexOf('/'));
socket.on("readyToRegister", () => {
socket.emit("register", name);
});
socket.on(`hud_config`, (data: any) => {
configs.save(data);
});
socket.on(`hud_action`, (data: any) => {
actions.execute(data.action, data.data);
});
socket.on('keybindAction', (action: string) => {
actions.execute(action);
});
}*/
socket.on("update_mirv", (data: any) => {
GSI.digestMIRV(data);
})
Expand Down Expand Up @@ -156,15 +139,15 @@ class App extends React.Component<any, { match: Match | null, game: CSGO | null,
}
if (match.left.id) {
api.teams.getOne(match.left.id).then(left => {
const gsiTeamData = { id: left._id, name: left.name, country: left.country, logo: left.logo, map_score: match.left.wins };
const gsiTeamData = { id: left._id, name: left.name, country: left.country, logo: left.logo, map_score: match.left.wins, extra: left.extra };

if (!isReversed) GSI.setTeamOne(gsiTeamData);
else GSI.setTeamTwo(gsiTeamData);
});
}
if (match.right.id) {
api.teams.getOne(match.right.id).then(right => {
const gsiTeamData = { id: right._id, name: right.name, country: right.country, logo: right.logo, map_score: match.right.wins };
const gsiTeamData = { id: right._id, name: right.name, country: right.country, logo: right.logo, map_score: match.right.wins, extra: right.extra };

if (!isReversed) GSI.setTeamTwo(gsiTeamData);
else GSI.setTeamOne(gsiTeamData);
Expand Down
1 change: 0 additions & 1 deletion src/HUD/MatchBar/MatchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export default class TeamBox extends React.Component<IProps, IState> {
else rightTimer = planting;
}
}

return (
<>
<div id={`matchbar`}>
Expand Down
2 changes: 1 addition & 1 deletion src/HUD/Overview/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class Overview extends React.Component<IProps, IState> {
this.state = {
player: {
data: null,
show: false,
show: false
},
match: {
data: null,
Expand Down
2 changes: 2 additions & 0 deletions src/api/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Player {
country: string;
steamid: string;
team: string;
extra: Record<string, string>;
}

export interface Team {
Expand All @@ -15,6 +16,7 @@ export interface Team {
country: string;
shortName: string;
logo: string;
extra: Record<string, string>;
}
/*
export interface HUD {
Expand Down

0 comments on commit ae5c596

Please sign in to comment.