Author Topic: weidu next generation - forbid special characters for tp2/folder names  (Read 731 times)

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 249
  • Gender: Male
Hi,
upcoming cross-platform mod-distribution format should not allow for creating mods which would not be possible to install because there will be forbidden special characters used for tp2 file/reserved folder names.


My proposition of the only allowed characters:
Code: [Select]
#
_
-
a-z
A-Z
0-9

Additionally, please forbid those Windows reserved folder names for tp2 file and corresponding folder names:
Code: [Select]
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
References:
Linux/Unix forbidden special characters:
Code: [Select]
/    (forward slash)
'\0' (NUL)

Windows forbidden special characters:
Code: [Select]
<
>
:
"
/
\
|
?
*

AD reserved characters:
Code: [Select]
#
.
,
+

Additional forbidden special characters:
Code: [Select]
{
}
[
]
@
%
^
&
$

Those characters are very important to not be allowed for tp2 filenames, because they can be used as bool logic symbols in order to describe mod dependence and conflicts:
Code: [Select]
&
|
:
+
,
<
>
So I strongly suggest to also include them. If there will be questions, I can provide detailed explanation/examples.
« Last Edit: August 02, 2017, 04:18:11 PM by AL|EN »
You cannot have progress without changes...

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 979
I'll try to remember this for when it's time. But I should say I was not envisioning the kind of closed format that could do more than inconvenience someone who wanted to stray outside the reservation.

If I may ask, though, why? Maybe I'm ignorant of these things, but it seems we have gone some 15+ years without having noticeable problems of this kind. [speculation]Additionally, Windows has the most restrictions here, something like 95 % of everyone uses Windows themselves, and the fraction of people who ship verboten characters would face a proportional deluge of players complaining about the broken mod being shipped.[/speculation]

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 249
  • Gender: Male
Programming languages gives you freedom to create what you want but the 'products' which will be used at specific 'systems' will always have limitations. When it comes to weidu mods, creativity lies with the content, not with fancy filenames. Inconvenience in the tp2filename are forced to avoid more trouble, not to annoy modders.

Such problems wasn't popup because there wasn't any people who created their mods using Linux/Mac. Now they can. So when the modder will release mod called ".:<Good|Evil>:."  (even quotas are part of the filename) or "CON", "PRN", "AUX"  etc it would not be possible not only to install such mod but in some cases it's not even possible to create folder/file using such name.

The modder who's primary OS is not Windows, is not aware about such limitations and it's when weidu should step in, to avoid situation when somebody can create a mod which can be installed only using Linux/Mac. It will also avoid blaming modder for non working mod as you pointed.

Does Windows has the most restrictions here? Sure but that's the way it is. It's stupid? Yes. Can it be changed? No unless you invent time machine and go back in time to tell Bill Gates that the valid reason for such limitations will be ridiculed 20 year after.

And if you consider at some point to not care about the past and weidu compatibility, I would also fortbit '!' (cause problems for CMD with filenames which contains it) folder/tp2filename. Letters, numbers, #, -, and _ should be enough for everyone to have a nice unique name for one file and one folder.
You cannot have progress without changes...

Offline Argent77

  • Planewalker
  • *****
  • Posts: 164
I'm against this kind of artificial restriction. It would greatly hurt compatibility with existing mods that already use special characters. Especially mods that have not been coded primarily for the English audience tend to use special characters (such as special umlaut characters, accented characters, or characters of non-latin alphabets). There would also be modder prefixes affected by this restriction. I believe that it should be the modders' responsibility to come up with file/folder names that work on every platform.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 249
  • Gender: Male
Argent77, the problem/case which I'm talking about is limited only to tp2 filename + main top level mod folder name. It has nothing to do with umlaut characters, accented characters, or characters of non-latin alphabets because those are not typical language characters, not special purpose characters as most listed above.

Let me show you some examples:

".:<Good|Evil>:." <-- main folder name, impossible to create/extract a folder with this particular name
".:<Good|Evil>:.".tp2 <-- tp2 folder name, impossible to create/extract file with this particular name

con <-- main folder name, impossible to create/extract a folder with this particular name
con.tp2 <-- tp2 folder name, impossible to create/extract file with this particular name

weidu framework should not allow to create non working mods out-of-the-box. I also take look at Community Filename Prefix Reservation List, ! and # are only widley used character so I left them.
You cannot have progress without changes...

Offline qwertyqwerty

  • Planewalker
  • *****
  • Posts: 64
I'll try to remember this for when it's time. But I should say I was not envisioning the kind of closed format that could do more than inconvenience someone who wanted to stray outside the reservation.

If I may ask, though, why? Maybe I'm ignorant of these things, but it seems we have gone some 15+ years without having noticeable problems of this kind. [speculation]Additionally, Windows has the most restrictions here, something like 95 % of everyone uses Windows themselves, and the fraction of people who ship verboten characters would face a proportional deluge of players complaining about the broken mod being shipped.[/speculation]
I second both points. Don't fix what isn't broken.

I think a better option would be to create some kind of mod unit testing platform/framework (which I'm considering for some time, but the idea is not yet well-formed in my head).

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 249
  • Gender: Male

Quote
Don't fix what isn't broken.
But it's broken already, we just have been lucky that no one created "ClassicOldNight" aka "CON" mod.
You cannot have progress without changes...

Offline Argent77

  • Planewalker
  • *****
  • Posts: 164
I agree that WeiDU could give a warning that names such as CON, PRN or NUL will cause compatibility issues. But prohibiting legal characters such as '!', '&' or '+' is going a bit too far. At the most it should trigger a warning when these characters are used for the first character of a file/folder name. In the worst case the modder has to deal with many bug reports after release.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 249
  • Gender: Male
Using "!" aka exclamation mark will break CMD scripting: more info , Leonardo was going through hell to workaround this. Disallowing  "!" should be out of the question as it sever also another role: as negation

The  '&' character is used for "AND" logic and there is no way to support tp2 names containing such character for logic conditions.

Example:
LiloAndStitch & NSFixpack: "LiloAndStitch" mod and "NSFixpack" mod are always installed together - two mods, correct
Lilo&Stitch & NSFixpack: "Lilo" mod and "Stitch" mod and "NSFixpack" mod are always installed together - three mods, nonsense

It's only for tp2 names, not for other mod files.
« Last Edit: July 28, 2017, 08:32:05 AM by AL|EN »
You cannot have progress without changes...

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 979
Escape or quote special characters and user input and it won't be such a problem. It's best practice stuff.
« Last Edit: July 30, 2017, 12:26:52 PM by Wisp »

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: