Skip to content

Commit

Permalink
Fixed player playtime being set after the check for player playtime
Browse files Browse the repository at this point in the history
  • Loading branch information
scottadkin committed Apr 13, 2024
1 parent 372ff17 commit c912d07
Show file tree
Hide file tree
Showing 4 changed files with 1,955 additions and 4,974 deletions.
15 changes: 7 additions & 8 deletions api/importer/matchmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ class MatchManager{


await this.playerManager.createPlayers(this.gametype.currentMatchGametype, this.mapInfo.mapId);
this.playerManager.totalTeams = this.gameInfo.totalTeams;
this.playerManager.init();

this.playerManager.setPlayerPlaytime(this.gameInfo.hardcore);

const playersWithPlaytime = this.playerManager.getTotalPlayersWithPlaytime();

//const playersWithPlaytime = this.playerManager.getTotalPlayersWithPlaytime();
const playersWithPlaytime = this.playerManager.getTotalPlayers();


if(playersWithPlaytime < this.minPlayers){
new Message(`Total players is less then the minimum specified, skipping.`, "note");
Expand All @@ -143,7 +146,6 @@ class MatchManager{
this.gameInfo.totalTeams = 0;
}

this.playerManager.totalTeams = this.gameInfo.totalTeams;


this.killManager = new KillManager(this.killLines, this.playerManager, this.bIgnoreBots, matchTimings, this.gameInfo.hardcore);
Expand All @@ -155,15 +157,12 @@ class MatchManager{
this.playerManager.setKills(this.killManager.kills);
this.playerManager.matchEnded(this.gameInfo.end);
this.playerManager.setHeadshots(this.killManager.headshots);
this.playerManager.setPlayerPlaytime(this.gameInfo.hardcore);
//this.playerManager.setPlayerPlaytime(this.gameInfo.hardcore);

this.match = new Match();
this.matches = new Matches();
this.maps = new Maps();








Expand Down
3 changes: 2 additions & 1 deletion api/importer/playermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class PlayerManager{
this.masterIdsToNames[masterIds.masterId] = p.name.toLowerCase();


const player = new PlayerInfo(p.id, p.name, masterIds.masterId, masterIds.gametypeId, masterIds.mapId, masterIds.mapGametypeId, p.hwid);
const player = new PlayerInfo(p.id, p.name, masterIds.masterId, masterIds.gametypeId, masterIds.mapId, masterIds.mapGametypeId, p.hwid, p.bSpectator);

this.players.push(player);

Expand Down Expand Up @@ -1757,6 +1757,7 @@ class PlayerManager{
for(let i = 0; i < this.players.length; i++){

const p = this.players[i];


for(const [teamId, playtime] of Object.entries(p.stats.teamPlaytime)){

Expand Down
2 changes: 1 addition & 1 deletion components/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Footer({session}){
<div>
<CookieBanner session={session}/>
<footer>
Node UTStats 2.14.1 &copy; 2021-2024 <a className="yellow" href="https://github.com/scottadkin">Scott Adkin</a><br/>
Node UTStats 2.14.2 &copy; 2021-2024 <a className="yellow" href="https://github.com/scottadkin">Scott Adkin</a><br/>
<span className="yellow">Original UTStats &copy; 2005 azazel, )°DoE°(-AnthraX and toa</span><br/>
<b><a style={{"color": "rgb(0,126,255)"}} href={"https://github.com/OldUnreal/UnrealTournamentPatches"}>Update UT to the Latest Unreal Tournament Patch by OldUnreal</a></b><br/>
Thanks to <span className="yellow">Krull0r</span> for the Monster Icons.<br/>
Expand Down
Loading

0 comments on commit c912d07

Please sign in to comment.