fix(emergency): flag any weapons that arent valid & fix weapon IDs

This commit is contained in:
kittentm 2026-04-26 00:38:18 +02:00
commit 03975c1f5f
No known key found for this signature in database
GPG key ID: 520EDAA0C8CDE295
3 changed files with 101 additions and 107 deletions

View file

@ -1,5 +1,5 @@
{ {
"weapons": [1000, 1001, 1002, 1003, 1100, 1200, 1800, 1801, 2000, 2001, 2002, 2003, 5000], "weapons": [],
"clothes": [26061, 26062, 26063, 26064, 26065, 26066, 26067, 26068, 26069, 26070, 26071, 26072, 26073, 26074, 26075, 26076, 26077, 26078, 26079, 26080, 26081, 26082, 26083, 26084, 26085, 26086, 26087, 26088, 26089, 26090, 26091, 26092, 26093, 26094, 26095, 26096, 26097, 26098, 26099, 26100, 26101, 26102, 26103, 26104, 26105, 26106, 26107, 26108, 26109, 26110, 26111, 26112, 26113, 26114, 26115, 26116, 26117, 26118, 26119, 26120, 26121, 26122, 26123, 26124, 26125, 26126, 26127, 26128, 26129, 26130, 26131, 26132, 26133, 26134, 26135, 26136], "clothes": [26061, 26062, 26063, 26064, 26065, 26066, 26067, 26068, 26069, 26070, 26071, 26072, 26073, 26074, 26075, 26076, 26077, 26078, 26079, 26080, 26081, 26082, 26083, 26084, 26085, 26086, 26087, 26088, 26089, 26090, 26091, 26092, 26093, 26094, 26095, 26096, 26097, 26098, 26099, 26100, 26101, 26102, 26103, 26104, 26105, 26106, 26107, 26108, 26109, 26110, 26111, 26112, 26113, 26114, 26115, 26116, 26117, 26118, 26119, 26120, 26121, 26122, 26123, 26124, 26125, 26126, 26127, 26128, 26129, 26130, 26131, 26132, 26133, 26134, 26135, 26136],
"rules": [-1] "rules": [-1]
} }

View file

@ -32,110 +32,97 @@
"15": "Mahi-Mahi Resort (ID=15)" "15": "Mahi-Mahi Resort (ID=15)"
}, },
"weapons_main": { "weapons_main": {
"100": "Sploosh-o-matic (ID=100)", "0": "Sploosh-o-matic (ID=0)",
"101": "Neo Sploosh-o-matic (ID=101)", "1": "Neo Sploosh-o-matic (ID=1)",
"102": "Splattershot Jr. (ID=102)", "10": "Splattershot Jr. (ID=10)",
"103": "Custom Splattershot Jr. (ID=103)", "11": "Custom Splattershot Jr. (ID=11)",
"104": "Splash-o-matic (ID=104)", "20": "Splash-o-matic (ID=20)",
"105": "Neo Splash-o-matic (ID=105)", "21": "Neo Splash-o-matic (ID=21)",
"106": "Aerospray MG (ID=106)", "30": "Aerospray MG (ID=30)",
"107": "Aerospray RG (ID=107)", "31": "Aerospray RG (ID=31)",
"108": "Splattershot (ID=108)", "40": "Splattershot (ID=40)",
"109": "Tentatek Splattershot (ID=109)", "41": "Tentatek Splattershot (ID=41)",
"110": "Hero Shot Replica (ID=110)", "45": "Hero Shot Replica (ID=45)",
"111": "Octoshot Replica (ID=111)", "46": "Octoshot Replica (ID=46)",
"112": ".52 Gal (ID=112)", "50": ".52 Gal (ID=50)",
"113": ".52 Gal Deco (ID=113)", "51": ".52 Gal Deco (ID=51)",
"114": "N-ZAP '85 (ID=114)", "60": "N-ZAP '85 (ID=60)",
"115": "N-ZAP '89 (ID=115)", "61": "N-ZAP '89 (ID=61)",
"116": "Splattershot Pro (ID=116)", "90": "Splattershot Pro (ID=90)",
"117": "Forge Splattershot Pro (ID=117)", "91": "Forge Splattershot Pro (ID=91)",
"118": ".96 Gal (ID=118)", "70": ".96 Gal (ID=70)",
"119": ".96 Gal Deco (ID=119)", "71": ".96 Gal Deco (ID=71)",
"120": "Dual Squelcher (ID=120)", "80": "Dual Squelcher (ID=80)",
"121": "Custom Dual Squelcher (ID=121)", "81": "Custom Dual Squelcher (ID=81)",
"122": "Jet Squelcher (ID=122)", "100": "Jet Squelcher (ID=100)",
"123": "Custom Jet Squelcher (ID=123)", "101": "Custom Jet Squelcher (ID=101)",
"124": "Luna Blaster (ID=124)", "200": "Luna Blaster (ID=200)",
"125": "Luna Blaster Neo (ID=125)", "201": "Luna Blaster Neo (ID=201)",
"126": "Blaster (ID=126)", "210": "Blaster (ID=210)",
"127": "Custom Blaster (ID=127)", "211": "Custom Blaster (ID=211)",
"128": "Range Blaster (ID=128)", "220": "Range Blaster (ID=220)",
"129": "Custom Range Blaster (ID=129)", "221": "Custom Range Blaster (ID=221)",
"130": "Rapid Blaster (ID=130)", "230": "Rapid Blaster (ID=230)",
"131": "Rapid Blaster Deco (ID=131)", "231": "Rapid Blaster Deco (ID=231)",
"132": "Rapid Blaster Pro (ID=132)", "240": "Rapid Blaster Pro (ID=240)",
"133": "Rapid Blaster Pro Deco (ID=133)", "241": "Rapid Blaster Pro Deco (ID=241)",
"134": "L-3 Nozzlenose (ID=134)", "300": "L-3 Nozzlenose (ID=300)",
"135": "L-3 Nozzlenose D (ID=135)", "301": "L-3 Nozzlenose D (ID=301)",
"136": "H-3 Nozzlenose (ID=136)", "310": "H-3 Nozzlenose (ID=310)",
"137": "H-3 Nozzlenose D (ID=137)", "311": "H-3 Nozzlenose D (ID=311)",
"138": "Wasabi Splattershot (ID=138)", "42": "Wasabi Splattershot (ID=42)",
"139": "Berry Splattershot Pro (ID=139)", "92": "Berry Splattershot Pro (ID=92)",
"140": "Sploosh-o-matic 7 (ID=140)", "2": "Sploosh-o-matic 7 (ID=2)",
"141": "Aerospray PG (ID=141)", "32": "Aerospray PG (ID=32)",
"142": "N-ZAP '83 (ID=142)", "62": "N-ZAP '83 (ID=62)",
"143": "Grim Range Blaster (ID=143)", "222": "Grim Range Blaster (ID=222)",
"144": "Cherry H-3 Nozzlenose (ID=144)", "312": "Cherry H-3 Nozzlenose (ID=312)",
"200": "Carbon Roller (ID=200)", "1000": "Carbon Roller (ID=1000)",
"201": "Carbon Roller Deco (ID=201)", "1001": "Carbon Roller Deco (ID=1001)",
"202": "Splat Roller (ID=202)", "1010": "Splat Roller (ID=1010)",
"203": "Krak-On Splat Roller (ID=203)", "1011": "Krak-On Splat Roller (ID=1011)",
"204": "Hero Roller Replica (ID=204)", "1013": "Hero Roller Replica (ID=1013)",
"205": "Dynamo Roller (ID=205)", "1020": "Dynamo Roller (ID=1020)",
"206": "Gold Dynamo Roller (ID=206)", "1021": "Gold Dynamo Roller (ID=1021)",
"207": "Inkbrush (ID=207)", "1100": "Inkbrush (ID=1100)",
"208": "Inkbrush Nouveau (ID=208)", "1101": "Inkbrush Nouveau (ID=1101)",
"209": "Octobrush (ID=209)", "1110": "Octobrush (ID=1110)",
"210": "Octobrush Nouveau (ID=210)", "1111": "Octobrush Nouveau (ID=1111)",
"211": "Tempered Dynamo Roller (ID=211)", "1022": "Tempered Dynamo Roller (ID=1022)",
"212": "Permanent Inkbrush (ID=212)", "1102": "Permanent Inkbrush (ID=1102)",
"213": "CoroCoro Splat Roller (ID=213)", "1012": "CoroCoro Splat Roller (ID=1012)",
"300": "Classic Squiffer (ID=300)", "2000": "Classic Squiffer (ID=2000)",
"301": "New Squiffer (ID=301)", "2001": "New Squiffer (ID=2001)",
"302": "Splat Charger (ID=302)", "2010": "Splat Charger (ID=2010)",
"303": "Kelp Splat Charger (ID=303)", "2011": "Kelp Splat Charger (ID=2011)",
"304": "Hero Charger Replica (ID=304)", "2013": "Hero Charger Replica (ID=2013)",
"305": "Splatterscope (ID=305)", "2020": "Splatterscope (ID=2020)",
"306": "Kelp Splatterscope (ID=306)", "2021": "Kelp Splatterscope (ID=2021)",
"307": "E-liter 3K (ID=307)", "2030": "E-liter 3K (ID=2030)",
"308": "Custom E-liter 3K (ID=308)", "2031": "Custom E-liter 3K (ID=2031)",
"309": "E-liter 3K Scope (ID=309)", "2040": "E-liter 3K Scope (ID=2040)",
"310": "Custom E-liter 3K Scope (ID=310)", "2041": "Custom E-liter 3K Scope (ID=2041)",
"311": "Bamboozler 14 Mk I (ID=311)", "2050": "Bamboozler 14 Mk I (ID=2050)",
"312": "Bamboozler 14 Mk II (ID=312)", "2051": "Bamboozler 14 Mk II (ID=2051)",
"313": "Fresh Squiffer (ID=313)", "2002": "Fresh Squiffer (ID=2002)",
"314": "Bamboozler 14 Mk III (ID=314)", "2052": "Bamboozler 14 Mk III (ID=2052)",
"315": "Bento Splat Charger (ID=315)", "2012": "Bento Splat Charger (ID=2012)",
"316": "Bento Splatterscope (ID=316)", "2022": "Bento Splatterscope (ID=2022)",
"400": "Slosher (ID=400)", "3000": "Slosher (ID=3000)",
"401": "Slosher Deco (ID=401)", "3001": "Slosher Deco (ID=3001)",
"402": "Tri-Slosher (ID=402)", "3010": "Tri-Slosher (ID=3010)",
"403": "Tri-Slosher Nouveau (ID=403)", "3011": "Tri-Slosher Nouveau (ID=3011)",
"404": "Sloshing Machine (ID=404)", "3020": "Sloshing Machine (ID=3020)",
"405": "Sloshing Machine Neo (ID=405)", "3021": "Sloshing Machine Neo (ID=3021)",
"406": "Soda Slosher (ID=406)", "3002": "Soda Slosher (ID=3002)",
"500": "Mini Splatling (ID=500)", "4000": "Mini Splatling (ID=4000)",
"501": "Zink Mini Splatling (ID=501)", "4001": "Zink Mini Splatling (ID=4001)",
"502": "Heavy Splatling (ID=502)", "4010": "Heavy Splatling (ID=4010)",
"503": "Heavy Splatling Deco (ID=503)", "4011": "Heavy Splatling Deco (ID=4011)",
"504": "Hydra Splatling (ID=504)", "4020": "Hydra Splatling (ID=4020)",
"505": "Custom Hydra Splatling (ID=505)", "4021": "Custom Hydra Splatling (ID=4021)",
"506": "Refurbished Mini Splatling (ID=506)", "4002": "Refurbished Mini Splatling (ID=4002)",
"507": "Heavy Splatling Remix (ID=507)", "4012": "Heavy Splatling Remix (ID=4012)"
"1000": "?Shot_Msn0Lv0 (ID=1000)",
"1001": "?Shot_Msn0Lv1 (ID=1001)",
"1002": "?Shot_Msn0Lv2 (ID=1002)",
"1003": "?Shot_Msn0Lv3 (ID=1003)",
"1100": "?Roller_Mission (ID=1100)",
"1200": "?Charge_Mission (ID=1200)",
"1800": "?BigBall_SpecAdjust01 (ID=1800)",
"1801": "?BigBall_SpecAdjust02 (ID=1801)",
"2000": "?Shot_Rvl0Lv0 (ID=2000)",
"2001": "?Shot_Rvl0Lv1 (ID=2001)",
"2002": "?Shot_Rvl0Lv2 (ID=2002)",
"2003": "?Shot_Rvl0Lv3 (ID=2003)",
"5000": "?Roller_KingSquid (ID=5000)"
}, },
"sub_weapons": { "sub_weapons": {
"0": "Splat Bomb (ID=0)", "0": "Splat Bomb (ID=0)",

View file

@ -63,17 +63,20 @@ router.post('/post', postLimiter, async (request, response, next) => {
...request.resultData ...request.resultData
}); });
const offenses = []; const offenses = [];
const weaponExists = Object.prototype.hasOwnProperty.call(lookup.weapons_main, String(data.Weapon));
if (!weaponExists && data.Weapon !== undefined) offenses.push("Invalid Weapon ID");
if ((blacklist.weapons || []).includes(Number(data.Weapon))) offenses.push("weapon"); if ((blacklist.weapons || []).includes(Number(data.Weapon))) offenses.push("weapon");
if ((blacklist.clothes || []).includes(Number(data.Gear_Clothes))) offenses.push("clothes"); if ((blacklist.clothes || []).includes(Number(data.Gear_Clothes))) offenses.push("clothes");
if ((blacklist.rules || []).includes(Number(data.Rule))) offenses.push("rule"); if ((blacklist.rules || []).includes(Number(data.Rule))) offenses.push("rule");
if (offenses.length > 0) { if (offenses.length > 0) {
const sWep = offenses.includes("weapon") ? "⭐ " : ""; const sWep = (offenses.includes("weapon") || offenses.includes("Invalid Weapon ID")) ? "⭐ " : "";
const sClt = offenses.includes("clothes") ? "⭐ " : ""; const sClt = offenses.includes("clothes") ? "⭐ " : "";
const sRul = offenses.includes("rule") ? "⭐ " : ""; const sRul = offenses.includes("rule") ? "⭐ " : "";
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(":warning: | Invalid Telemetry received") .setTitle(":warning: | Invalid Telemetry received")
.setDescription(`## Offending information detected in: ${offenses.join(', ')}`) .setDescription(`## Offending information detected in: ${offenses.join(', ')}`)
.setColor(offenses.includes("Invalid Weapon ID") ? 0xFF9900 : 15158332)
.setFields( .setFields(
{ {
name: "User Information:", name: "User Information:",
@ -82,7 +85,11 @@ router.post('/post', postLimiter, async (request, response, next) => {
}, },
{ name: "PID", value: `${data.PId || 'N/A'}`, inline: true }, { name: "PID", value: `${data.PId || 'N/A'}`, inline: true },
{ name: "Mii Name", value: `${data.MiiName || 'N/A'}`, inline: true }, { name: "Mii Name", value: `${data.MiiName || 'N/A'}`, inline: true },
{ name: "Weapon", value: `${sWep}${lookup.weapons_main[data.Weapon] || data.Weapon || 'N/A'}`, inline: true }, {
name: "Weapon",
value: `${sWep}${lookup.weapons_main[data.Weapon] || `UNKNOWN ID: ${data.Weapon}`}`,
inline: true
},
{ name: "Headgear", value: `${lookup.headgear[data.Gear_Head] || data.Gear_Head || 'N/A'}`, inline: true }, { name: "Headgear", value: `${lookup.headgear[data.Gear_Head] || data.Gear_Head || 'N/A'}`, inline: true },
{ name: "Clothes", value: `${sClt}${lookup.clothes[data.Gear_Clothes] || data.Gear_Clothes || 'N/A'}`, inline: true }, { name: "Clothes", value: `${sClt}${lookup.clothes[data.Gear_Clothes] || data.Gear_Clothes || 'N/A'}`, inline: true },
{ name: "Shoes", value: `${lookup.shoes[data.Gear_Shoes] || data.Gear_Shoes || 'N/A'}`, inline: true }, { name: "Shoes", value: `${lookup.shoes[data.Gear_Shoes] || data.Gear_Shoes || 'N/A'}`, inline: true },