提交demoon

This commit is contained in:
Tianpao 2024-09-28 09:14:11 +08:00
commit 7ff0de1445
7 changed files with 435 additions and 0 deletions

132
.gitignore vendored Normal file
View File

@ -0,0 +1,132 @@
# ---> Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

31
PATCH/mainx.js Normal file
View File

@ -0,0 +1,31 @@
; (async () => {
let offset = 0
let max
while (true) {
let re = await fetch(`https://api.modrinth.com/v2/search?limit=100&offset=${offset}&index=relevance&facets=[[%22project_type:mod%22]]`)
let res = await re.json()
if (re.status < 200 || re.status > 299) return (() => {console.log(re.status);console.log(res)})()
max = res.total_hits
console.log(`爬取成功 偏移量 ${offset}, 总量 ${max}`)
offset += 100
// slug: modid, client_side && server_side
for (let ii of Object.keys(res.hits)) {
let i = res.hits[ii]
let t = (() => {
if (i.server_side == 'unsupported')
return 'false'
if (i.client_side == 'unsupported')
return 'true'
return 'trlse'
})()
console.log(`模组 ${i.slug} 类型为 ${t}`)
fetch(`http://154.201.72.75:3009/modid?modid=${i.slug}&client=${t}`).then((r) => {
if (r.status >= 200 && r.status <= 299)
console.log(`模组 ${i.slug} 提交成功为 ${t}`)
else
console.log(`模组 ${i.slug} 提交失败为 ${t}`)
})
}
if (offset > max) break
}
})()

46
main.js Normal file
View File

@ -0,0 +1,46 @@
const fs = require('fs');
const AdmZip = require('adm-zip');
const toml = require('toml');
let re = [];
let ls = fs.readdirSync("mods/");
ls = ls.filter((a) => a.endsWith(".jar"));
ls.forEach((v) => {
try {
let zip = new AdmZip("mods/" + v);
try {
const modsTomlData = zip.getEntry("META-INF/mods.toml").getData().toString();
const modsToml = toml.parse(modsTomlData).mods;
modsToml.forEach((mod) => {
re.push({ modid: mod.modId, modfile: v });
});
} catch (e) {
const fabricModJsonData = zip.getEntry("fabric.mod.json").getData().toString();
const fabricModJson = JSON.parse(fabricModJsonData);
re.push({ modid: fabricModJson.id, modfile: v });
}
} catch (e) {
console.log(e);
}
});
for (let i of re) {
//DeMoon后端服务 StarNet.X所有
fetch(`http://154.201.72.75:3008/${i.modid}`).then(async (r) => {
try {
let body = await r.json();
if (body.client === 'true') {
if (i.modfile) {
fs.renameSync('mods/' + i.modfile, 'clientmod/' + i.modfile);
} else {
throw new Error(`modfile is undefined for mod id ${i.modid}`);
}
}
} catch (error) {
console.error(`Error fetching mod info for ${i.modid}: ${error}`);
}
}).catch((error) => {
console.error(`Error fetching mod info for ${i.modid}: ${error}`);
});
}

84
mods/desktop.ini Normal file
View File

@ -0,0 +1,84 @@
[LocalizedFileNames]
Iceberg-1.20.1-forge-1.1.15.jar=@Iceberg-1.20.1-forge-1.1.15.jar,0
chunksending-1.20.1-2.7.jar=@chunksending-1.20.1-2.7.jar,0
AdvancementPlaques-1.20.1-forge-1.4.10.jar=@AdvancementPlaques-1.20.1-forge-1.4.10.jar,0
invhud.forge.1.20.1-3.4.18.jar=@invhud.forge.1.20.1-3.4.18.jar,0
rubidium-extra-0.5.2+mc1.20.1-build.104.jar=@rubidium-extra-0.5.2+mc1.20.1-build.104.jar,0
textrues_embeddium_options-0.1.2+mc1.20.1.jar=@textrues_embeddium_options-0.1.2+mc1.20.1.jar,0
oculus-mc1.20.1-1.6.9.jar=@oculus-mc1.20.1-1.6.9.jar,0
embeddium-0.2.2+mc1.20.1.jar=@embeddium-0.2.2+mc1.20.1.jar,0
dynamiclightsreforged-1.20.1_v1.6.0.jar=@dynamiclightsreforged-1.20.1_v1.6.0.jar,0
cloth-config-11.1.106-forge.jar=@cloth-config-11.1.106-forge.jar,0
ships-3.0.1.jar=@ships-3.0.1.jar,0
NoChatReports-FORGE-1.20.1-v2.2.2.jar=@NoChatReports-FORGE-1.20.1-v2.2.2.jar,0
modernfix-forge-5.10.0+mc1.20.1.jar=@modernfix-forge-5.10.0+mc1.20.1.jar,0
embeddium-0.2.12+mc1.20.1.jar=@embeddium-0.2.12+mc1.20.1.jar,0
SnowRealMagic-1.20.1-forge-9.1.2.jar=@SnowRealMagic-1.20.1-forge-9.1.2.jar,0
better-end-4.0.10.jar=@better-end-4.0.10.jar,0
minimalmodern-1.2.0-mc1.20.1.jar=@minimalmodern-1.2.0-mc1.20.1.jar,0
soul_like_boss_mod_1.20.1_(v58).jar=@soul_like_boss_mod_1.20.1_(v58).jar,0
EpicFight-20.5.17.jar=@EpicFight-20.5.17.jar,0
lootbeams-1.20.1-1.2.3.jar=@lootbeams-1.20.1-1.2.3.jar,0
soul_like_armors_reworked_1.20.1_(v120).jar=@soul_like_armors_reworked_1.20.1_(v120).jar,0
embeddium-0.2.9+mc1.20.1.jar=@embeddium-0.2.9+mc1.20.1.jar,0
EpicFight.DragonEye.Fix-1.00.jar=@EpicFight.DragonEye.Fix-1.00.jar,0
EpicFight-20.6.3.jar=@EpicFight-20.6.3.jar,0
BOMD-Forge-1.20.1-1.1.0.jar=@BOMD-Forge-1.20.1-1.1.0.jar,0
curios-forge-5.4.7+1.20.1.jar=@curios-forge-5.4.7+1.20.1.jar,0
riverredux-0.3.1.jar=@riverredux-0.3.1.jar,0
fastpaintings-1.20-1.2.1.jar=@fastpaintings-1.20-1.2.1.jar,0
falchionmoveset-20.6.1.jar=@falchionmoveset-20.6.1.jar,0
simply_swords_with_epicfight_mod_1.20.1+(v3).jar=@simply_swords_with_epicfight_mod_1.20.1+(v3).jar,0
dark+spirit+mod+1.20.1+(v12).jar=@dark+spirit+mod+1.20.1+(v12).jar,0
WeaponsOfMiracles-20.1.7.36.3.jar=@WeaponsOfMiracles-20.1.7.36.3.jar,0
qualitysounds-forge-1.5.0-1.20.1.jar=@qualitysounds-forge-1.5.0-1.20.1.jar,0
alexscaves-1.0.9.jar=@alexscaves-1.0.9.jar,0
puffish_skills-0.11.2-1.20-forge.jar=@puffish_skills-0.11.2-1.20-forge.jar,0
fancymenu_forge_2.14.13_MC_1.20.1.jar=@fancymenu_forge_2.14.13_MC_1.20.1.jar,0
rubidium-extra-0.5.3.1+mc1.20.1-build.110.jar=@rubidium-extra-0.5.3.1+mc1.20.1-build.110.jar,0
extrasounds-1.1-1.20.1-forge.jar=@extrasounds-1.1-1.20.1-forge.jar,0
TES-forge-1.20.1-1.4.4.jar=@TES-forge-1.20.1-1.4.4.jar,0
embeddium-0.2.18+mc1.20.1.jar=@embeddium-0.2.18+mc1.20.1.jar,0
XaerosWorldMap_1.37.7_Forge_1.20.jar=@XaerosWorldMap_1.37.7_Forge_1.20.jar,0
Xaeros_Minimap_23.9.7_Forge_1.20.jar=@Xaeros_Minimap_23.9.7_Forge_1.20.jar,0
flywheel-forge-1.20.1-0.6.10-7.jar=@flywheel-forge-1.20.1-0.6.10-7.jar,0
drinkbeer-refill-1.20.1-1.0.4.jar=@drinkbeer-refill-1.20.1-1.0.4.jar,0
harvestwithease-1.20.1-7.0.0.2-forge.jar=@harvestwithease-1.20.1-7.0.0.2-forge.jar,0
entity_texture_features_forge_1.20.1-5.2.3.jar=@entity_texture_features_forge_1.20.1-5.2.3.jar,0
simplyswords-forge-1.51.5-1.20.1.jar=@simplyswords-forge-1.51.5-1.20.1.jar,0
EpicFight-20.6.4.jar=@EpicFight-20.6.4.jar,0
WeaponsOfMiracles-20.1.7.37.jar=@WeaponsOfMiracles-20.1.7.37.jar,0
indestructible-20.6.1.jar=@indestructible-20.6.1.jar,0
embeddium-0.3.1+mc1.20.1.jar=@embeddium-0.3.1+mc1.20.1.jar,0
lazurite-1.0.1+mc1.20.1.jar=@lazurite-1.0.1+mc1.20.1.jar,0
lazurite-1.0.2+mc1.20.1.jar=@lazurite-1.0.2+mc1.20.1.jar,0
textrues_embeddium_options-0.1.3+mc1.20.1.jar=@textrues_embeddium_options-0.1.3+mc1.20.1.jar,0
nyfsspiders-forge-1.20.1-2.1.1.jar=@nyfsspiders-forge-1.20.1-2.1.1.jar,0
healingcampfire-1.20.1-5.3.jar=@healingcampfire-1.20.1-5.3.jar,0
soul_like_armors_reworked_1.20.1_(v140).jar=@soul_like_armors_reworked_1.20.1_(v140).jar,0
chatanimation-1.0.3.jar=@chatanimation-1.0.3.jar,0
chatpatches-201.5.5.jar=@chatpatches-201.5.5.jar,0
flywheel-forge-1.20.1-0.6.10-8.jar=@flywheel-forge-1.20.1-0.6.10-8.jar,0
ColdSweat-2.2.5.1.jar=@ColdSweat-2.2.5.1.jar,0
ConnectorExtras-1.9.2+1.20.1.jar=@ConnectorExtras-1.9.2+1.20.1.jar,0
fabric-api-0.91.0+1.10.8+1.20.1.jar=@fabric-api-0.91.0+1.10.8+1.20.1.jar,0
Connector-1.0.0-beta.36+1.20.1.jar=@Connector-1.0.0-beta.36+1.20.1.jar,0
guardvillagers-1.20.1-1.6.4.jar=@guardvillagers-1.20.1-1.6.4.jar,0
jei-1.20.1-forge-15.3.0.4.jar=@jei-1.20.1-forge-15.3.0.4.jar,0
jeed-1.20-2.1.7.jar=@jeed-1.20-2.1.7.jar,0
JustEnoughResources-1.20.1-1.4.0.238.jar=@JustEnoughResources-1.20.1-1.4.0.238.jar,0
letsdo-beachparty-forge-1.1.3.jar=@letsdo-beachparty-forge-1.1.3.jar,0
doapi-1.2.8-forge.jar=@doapi-1.2.8-forge.jar,0
letsdo-meadow-forge-1.3.4.jar=@letsdo-meadow-forge-1.3.4.jar,0
efrenderfix-1.0.0.jar=@efrenderfix-1.0.0.jar,0
valhelsia_structures-forge-1.20.1-1.1.1.jar=@valhelsia_structures-forge-1.20.1-1.1.1.jar,0
valhelsia_core-forge-1.20.1-1.1.1.jar=@valhelsia_core-forge-1.20.1-1.1.1.jar,0
bettervillage-forge-1.20.1-3.2.0.jar=@bettervillage-forge-1.20.1-3.2.0.jar,0
eidolon_repraised-1.20.1-0.3.8.9.jar=@eidolon_repraised-1.20.1-0.3.8.9.jar,0
IMBlocker_4.0.5+1.20.jar=@IMBlocker_4.0.5+1.20.jar,0
Obscure-Tooltips-2.2.jar=@Obscure-Tooltips-2.2.jar,0
Modifiers-forge-1.20.1-0.1.3.jar=@Modifiers-forge-1.20.1-0.1.3.jar,0
simplyswords-forge-1.55.0-1.20.1.jar=@simplyswords-forge-1.55.0-1.20.1.jar,0
Psimplyswords-1.55.0-1.20.1.jar=@Psimplyswords-1.55.0-1.20.1.jar,0
RegionsUnexploredForge-0.5.5+1.20.1.jar=@RegionsUnexploredForge-0.5.5+1.20.1.jar,0
world_preview-forge-1.20.1-1.3.0.jar=@world_preview-forge-1.20.1-1.3.0.jar,0

120
package-lock.json generated Normal file
View File

@ -0,0 +1,120 @@
{
"name": "demoon",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "demoon",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"adm-zip": "^0.5.14",
"data-uri-to-buffer": "^4.0.1",
"fetch-blob": "^3.2.0",
"formdata-polyfill": "^4.0.10",
"node-domexception": "^1.0.0",
"node-fetch": "^3.3.2",
"toml": "^3.0.0",
"web-streams-polyfill": "^3.3.3"
}
},
"node_modules/adm-zip": {
"version": "0.5.14",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.14.tgz",
"integrity": "sha512-DnyqqifT4Jrcvb8USYjp6FHtBpEIz1mnXu6pTRHZ0RL69LbQYiO+0lDFg5+OKA7U29oWSs3a/i8fhn8ZcceIWg==",
"engines": {
"node": ">=12.0"
}
},
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"engines": {
"node": ">= 12"
}
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/toml": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="
},
"node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"engines": {
"node": ">= 8"
}
}
}
}

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "demoon",
"version": "1.0.0",
"description": "this is a project from starnetx",
"main": "main.js",
"dependencies": {
"adm-zip": "^0.5.14",
"data-uri-to-buffer": "^4.0.1",
"fetch-blob": "^3.2.0",
"formdata-polyfill": "^4.0.10",
"node-domexception": "^1.0.0",
"node-fetch": "^3.3.2",
"toml": "^3.0.0",
"web-streams-polyfill": "^3.3.3"
},
"scripts": {
"test": "node main.js"
},
"author": "",
"license": "ISC"
}

1
start.bat Normal file
View File

@ -0,0 +1 @@
node main.js