Skip to content

Commit

Permalink
fix workshop collection loading and add new official maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Taraman17 committed Sep 5, 2024
1 parent ca42316 commit c44832b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
18 changes: 18 additions & 0 deletions OfficialMaps.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[{
"name": "ar_baggage",
"id": 125440026
},{
"name": "ar_poolday",
"id": 3263935964
},{
"name": "ar_shoots",
"id" : 125440261
},{
"name": "cs_assault",
"id": 125432575
},{
"name": "cs_italy",
"id": 125436057
Expand All @@ -16,12 +22,21 @@
},{
"name": "de_anubis",
"id": 1984883124
},{
"name": "de_assembly",
"id": 3071005299
},{
"name": "de_dust2",
"id": 125438255
},{
"name": "de_inferno",
"id": 125438669
},{
"name": "de_memento",
"id": 3165559377
},{
"name": "de_mills",
"id": 3152430710
},{
"name": "de_mirage",
"id": 152508932
Expand All @@ -31,6 +46,9 @@
},{
"name": "de_overpass",
"id": 205240106
},{
"name": "de_thera",
"id": 3121217565
},{
"name": "de_vertigo",
"id": 125439851
Expand Down
30 changes: 17 additions & 13 deletions modules/sharedFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,24 @@ async function reloadMaplist() {
try {
let resJson = JSON.parse(resData);
resJson.response.publishedfiledetails.forEach( details => {
let _mapName = "";
if (details.filename != "") {
let re = /\S+\/(\S+).bsp/;
let matches = details.filename.match(re);
_mapName = matches[1];
if (details.result == 1) {
let _mapName = "";
if (details.filename != "") {
let re = /\S+\/(\S+).bsp/;
let matches = details.filename.match(re);
_mapName = matches[1];
}
returnDetails.push({
"name": _mapName,
"official": official,
"title": details.title,
"workshopID": details.publishedfileid.toString(),
"description": details.description,
"previewLink": details.preview_url,
"tags": details.tags });
} else {
logger.warn(`No details for map ${details.publishedfileid.toString()}. Query Result: ${details.result.toString()}`);
}
returnDetails.push({
"name": _mapName,
"official": official,
"title": details.title,
"workshopID": details.publishedfileid.toString(),
"description": details.description,
"previewLink": details.preview_url,
"tags": details.tags })
});
resolve(returnDetails);
} catch (e) {
Expand Down

0 comments on commit c44832b

Please sign in to comment.