Skip to content

Commit

Permalink
Update: Admin List Util to Recognize EOSIDs (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisAlienus authored Jul 3, 2024
1 parent 078f722 commit e901403
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions squad-server/utils/admin-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function fetchAdminLists(adminLists) {
}

const groupRgx = /(?<=^Group=)(?<groupID>.*?):(?<groupPerms>.*?)(?=(?:\r\n|\r|\n|\s+\/\/))/gm;
const adminRgx = /(?<=^Admin=)(?<steamID>\d+):(?<groupID>\S+)/gm;
const adminRgx = /(?<=^Admin=)(?<adminID>\d{17}|[a-f0-9]{32}):(?<groupID>\S+)/gm;

for (const m of data.matchAll(groupRgx)) {
groups[`${idx}-${m.groups.groupID}`] = m.groups.groupPerms.split(',');
Expand All @@ -55,20 +55,20 @@ export default async function fetchAdminLists(adminLists) {
const perms = {};
for (const groupPerm of group) perms[groupPerm.toLowerCase()] = true;

const steamID = m.groups.steamID;
if (steamID in admins) {
admins[steamID] = Object.assign(admins[steamID], perms);
const adminID = m.groups.adminID;
if (adminID in admins) {
admins[adminID] = Object.assign(admins[adminID], perms);
Logger.verbose(
'SquadServer',
3,
`Merged duplicate Admin ${steamID} to ${Object.keys(admins[steamID])}`
`Merged duplicate Admin ${adminID} to ${Object.keys(admins[adminID])}`
);
} else {
admins[steamID] = Object.assign(perms);
admins[adminID] = Object.assign(perms);
Logger.verbose(
'SquadServer',
3,
`Added Admin ${steamID} with ${Object.keys(admins[steamID])}`
`Added Admin ${adminID} with ${Object.keys(admins[adminID])}`
);
}
} catch (error) {
Expand Down

0 comments on commit e901403

Please sign in to comment.