You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevents users from attempting to upload packages that aren't zips or
packages without a manifest, icon, and readme in the root of the zip.
Warns the user when uploading packages with > 8 DLL files, an
Assembly-CSharp.dll file, or BepInEx.dll.
Fixes a chromium bug preventing the selection of a file that was
previously selected and canceled.
"You have BepInEx.dll in your .zip file. BepInEx should probably be a dependency in your manifest.json file instead."
245
+
);
246
+
}
247
+
248
+
if(hasAssemblyCSharp){
249
+
errors.fileErrors.push(
250
+
"You have Assembly-CSharp.dll in your .zip file. Your mod may be removed if you do not have permission to distribute this file."
251
+
);
252
+
}
253
+
254
+
if(dllCount>8){
255
+
errors.fileErrors.push(
256
+
"You have "+
257
+
dllCount+
258
+
" .dll files in your .zip file. Some of these files may be unnecessary."
259
+
);
260
+
maybeModpack=true;
261
+
}
262
+
263
+
if(maybeModpack){
264
+
errors.fileErrors.push(
265
+
"If you're making a modpack, do not include the files for each mod in your .zip file. Instead, put the dependency string for each mod inside your manifest.json file."
266
+
);
267
+
}
268
+
269
+
if(
270
+
noRootFiles&&
271
+
hasManifest&&
272
+
hasIcon&&
273
+
hasReadMe&&
274
+
!rootManifest&&
275
+
!rootIcon&&
276
+
!rootReadMe
277
+
){
278
+
blockUpload=true;
279
+
errors.fileErrors.push(
280
+
"Your manifest, icon, and README files should be at the root of the .zip file. You can prevent this by compressing the contents of a folder, rather than the folder itself."
281
+
);
282
+
}else{
283
+
if(!hasManifest){
284
+
blockUpload=true;
285
+
errors.fileErrors.push(
286
+
"Your package is missing a manifest.json file!"
287
+
);
288
+
}elseif(!rootManifest){
289
+
blockUpload=true;
290
+
errors.fileErrors.push(
291
+
"Your manifest.json file is not at the root of the .zip!"
292
+
);
293
+
}
294
+
295
+
if(!hasIcon){
296
+
blockUpload=true;
297
+
errors.fileErrors.push(
298
+
"Your package is missing an icon.png file!"
299
+
);
300
+
}elseif(!rootIcon){
301
+
blockUpload=true;
302
+
errors.fileErrors.push(
303
+
"Your icon.png file is not at the root of the .zip!"
304
+
);
305
+
}
306
+
307
+
if(!hasReadMe){
308
+
blockUpload=true;
309
+
errors.fileErrors.push(
310
+
"Your package is missing a README.md file!"
311
+
);
312
+
}elseif(!rootReadMe){
313
+
blockUpload=true;
314
+
errors.fileErrors.push(
315
+
"Your README.md file is not at the root of the .zip!"
316
+
);
317
+
}
318
+
}
319
+
320
+
awaitzipReader.close();
321
+
}catch(e){
322
+
console.log("Error reading zip: "+e);
323
+
returnfalse;
324
+
}
325
+
}
326
+
327
+
if(errors.fileErrors.length>0){
328
+
setFormErrors(errors);
329
+
330
+
if(blockUpload){
331
+
errors.generalErrors.push(
332
+
"An error with your selected file is preventing submission."
0 commit comments