Change the strategy for the U+FFFD separator handling.

Use a global variable instead. In SL, the optimizer does the replacement automatically, therefore no memory penalty is incurred. In OpenSim, the variable is assigned at run time with llUnescapeURL. The OpenSim separator is also changed from U+001F to U+007F, because most control characters under U+0020 cause problems with exporting when present in script memory.

Fixes #41.
This commit is contained in:
Sei Lisa 2017-09-09 10:33:28 +02:00 committed by Sei-Lisa
parent 8bd8b19e2f
commit d23699fbe6
5 changed files with 22 additions and 18 deletions

View file

@ -46,6 +46,7 @@ list chosen_animations;
string cache;
string webkey;
integer webcount;
string SEP = "<22>"; // OSS::string SEP;
string FormatFloat(float f, integer num_decimals)
{
@ -358,6 +359,7 @@ default
{
remove_script("Use only one of this script!");
}
// OSS::SEP = llUnescapeURL("%7F");
llListen(chat_channel, "", llGetOwner(), "");
comm_channel = ((integer)llFrand(99999) + 1) * 1000 * -1;
integer i;
@ -476,7 +478,7 @@ default
}
if (llList2String(data, 7) != "")
{
Readout_Say("ADJUST " + strReplace(llList2String(data, 7), "<22>", "|"));
Readout_Say("ADJUST " + strReplace(llList2String(data, 7), SEP, "|"));
}
if ((integer)llList2String(data, 8))
{
@ -497,7 +499,7 @@ default
string SITTER_TEXT;
if (llList2String(data, 5) != "")
{
SITTER_TEXT = "|" + strReplace(llList2String(data, 5), "<22>", "|");
SITTER_TEXT = "|" + strReplace(llList2String(data, 5), SEP, "|");
}
Readout_Say("SITTER " + (string)id + SITTER_TEXT);
Readout_Say("");
@ -529,13 +531,13 @@ default
else
{
msg = strReplace(msg, "S:B:", "BUTTON ");
if (llSubStringIndex(msg, "<22>") == -1)
if (llSubStringIndex(msg, SEP) == -1)
{
msg = strReplace(msg, "|90200", "");
}
}
msg = strReplace(msg, "S:", "SYNC ");
msg = strReplace(msg, "<22>", "|");
msg = strReplace(msg, SEP, "|");
}
if (llGetSubString(msg, -1, -1) == "*")
{