mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 15:14:25 -05:00
chore: number parsing in player list and squad list
This commit is contained in:
parent
dc55169e05
commit
b4c42d099f
@ -145,8 +145,10 @@ export default class SquadRcon extends Rcon {
|
|||||||
if (!match) continue;
|
if (!match) continue;
|
||||||
|
|
||||||
const data = match.groups;
|
const data = match.groups;
|
||||||
|
data.playerID = +data.playerID;
|
||||||
data.isLeader = data.isLeader === 'True';
|
data.isLeader = data.isLeader === 'True';
|
||||||
data.squadID = data.squadID !== 'N/A' ? data.squadID : null;
|
data.teamID = data.teamID !== 'N/A' ? +data.teamID : null;
|
||||||
|
data.squadID = data.squadID !== 'N/A' ? +data.squadID : null;
|
||||||
|
|
||||||
players.push(data);
|
players.push(data);
|
||||||
}
|
}
|
||||||
@ -169,10 +171,11 @@ export default class SquadRcon extends Rcon {
|
|||||||
);
|
);
|
||||||
const matchSide = line.match(/Team ID: (\d) \((.+)\)/);
|
const matchSide = line.match(/Team ID: (\d) \((.+)\)/);
|
||||||
if (matchSide) {
|
if (matchSide) {
|
||||||
teamID = matchSide[1];
|
teamID = +matchSide[1];
|
||||||
teamName = matchSide[2];
|
teamName = matchSide[2];
|
||||||
}
|
}
|
||||||
if (!match) continue;
|
if (!match) continue;
|
||||||
|
match.groups.squadID = +match.groups.squadID;
|
||||||
squads.push({
|
squads.push({
|
||||||
...match.groups,
|
...match.groups,
|
||||||
teamID: teamID,
|
teamID: teamID,
|
||||||
|
Loading…
Reference in New Issue
Block a user