case insensitive variable names

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
o11c
Knight
Knight
Posts: 2262
Joined: 20 Feb 2011, 22:09
Location: ^ ^

case insensitive variable names

Post by o11c » 05 Oct 2011, 18:43

The current version of the server uses variable names case insensitively. As this is senseless, I have removed this from the next server.

(Note also that at some point before release, I will force the scripter to explicitly declare all variable to detect typos - we've already had problems with this even with case insensitivity)

Anyway, here's a list of variables that might be used case-insensitively.

Some of them might be accidental - similar variable or label names used by different npcs - but even so, I recommend their case be normalized.

If any permanent variables are found, this may require admin assistance, depending on whether the variable can be set initially from multiple cases.

constants must match db/const.txt

Random note: the files are generated with the following script, then passed through sort -u | sort -f, which is *not* the same as sort -uf. Also there were some slight problems with numbers.

Code: Select all

#!/bin/sh
for ARG
do
cat $ARG |
sed 's/"\([^"]\|\\\"\)*"//g' |
sed 's_//.*__' |
sed -n '/{/,/}/p' |
sed 's/.*{//' |
sed 's/}.*//' |
grep -o '$\?@\?#\{0,2\}[A-Za-z_0-9]\+$\?' \
> out/$(echo $ARG | sed 's|/|_|g' | sed 's/txt$/var/')
done
Attachments
badcase.txt
(7.53 KiB) Downloaded 55 times
Former programmer for the TMWA server.
Post Reply