Inform user if Bridge script is using wrong VM (LSO instead of Mono)

There is "std::string isMono" in fslslbridge.cpp set during script creation, but Techwolf had Bridge running in LSL2 mode recently, which was the cause of stack-heap collision.
Northspring 2014-08-01 00:27:14 +02:00
parent 767afbfbe7
commit a2a4bbeeee
4 changed files with 16 additions and 1 deletions

View File

@ -95,6 +95,12 @@
flight_hover(FALSE);
movelock_init(FALSE);
// Check VM version
if (llGetMemoryLimit() <= 16384)
{
llOwnerSay("<bridgeError error=wrongvm>");
}
// Set the channel for the AO OC interface
aoChannelOC = (integer)("0x" + llGetSubString(owner, 30, -1));
if (aoChannelOC > 0)

View File

@ -56,7 +56,7 @@ const U32 FS_BRIDGE_MAJOR_VERSION = 2;
const U32 FS_BRIDGE_MINOR_VERSION = 17;
const U32 FS_MAX_MINOR_VERSION = 99;
//current script version is 2.16
//current script version is 2.17
const std::string UPLOAD_SCRIPT_CURRENT = "EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt";
//
@ -387,6 +387,11 @@ bool FSLSLBridge::lslToViewer(const std::string& message, const LLUUID& fromID,
reportToNearbyChat(LLTrans::getString("fsbridge_error_scriptinfonotfound"));
LL_WARNS("FSLSLBridge") << "ScriptInfo - Object to check is invalid or out of range (warning returned by bridge)" << LL_ENDL;
}
else if (message.substr(valuepos+6, 7) == "wrongvm")
{
reportToNearbyChat(LLTrans::getString("fsbridge_error_wrongvm"));
LL_WARNS("FSLSLBridge") << "Script is using old LSO (16 KB memory limit) instead of new Mono (64 KB memory limit) virtual machine, which creates high probability of stack-heap collision and bridge failure by running out of memory" << LL_ENDL;
}
else
{
LL_WARNS("FSLSLBridge") << "ErrorReporting - Received unknown error type" << LL_ENDL;

View File

@ -2638,6 +2638,7 @@ Try enclosing path to the editor with double quotes.
<string name="fsbridge_error_scriptinfonotfound">Script info: Object to check is invalid or out of range.</string>
<string name="fsbridge_error_scriptinfomalformed">Script info: Received malformed response from bridge. Try again.</string>
<string name="fsbridge_error_injection">NOTICE: One or more scripts have been added to your Firestorm bridge! If you did not expect this message, use the Firestorm 'Avatar/Avatar Health/Recreate Bridge' menu option to re-create your bridge now.</string>
<string name="fsbridge_error_wrongvm">NOTICE: Bridge script is using old LSO (16 KB memory limit) instead of new Mono (64 KB memory limit) virtual machine, which creates high probability of stack-heap collision and bridge failure by running out of memory. Please use the Firestorm 'Avatar/Avatar Health/Recreate Bridge' menu option to recreate the bridge. If you'll see this message again - please try again in a different region.</string>
<!-- <FS:Zi> Quick preferences default options -->
<string name="QP Draw Distance">Draw Distance</string>

View File

@ -5315,6 +5315,9 @@ Spróbuj załączyć ścieżkę do edytora w cytowaniu.
<string name="fsbridge_error_injection">
UWAGA: Jeden lub więcej skryptów zostało dodanych do Twojego Mostu LSL Firestorma! Jeśli ta wiadomość jest niespodziewana, to stwórz teraz Most LSL na nowo ('Naprawa awatara' w menu 'Awatar' na górze).
</string>
<string name="fsbridge_error_wrongvm">
UWAGA: Skrypt Mostu LSL używa starej maszyny wirtualnej LSO (16 KB limitu pamięci) zamiast nowej Mono, co stwarza wysokie prawdopodobieństwo kolizji sterty i stosu oraz awarii Mostu poprzez wyczerpanie się pamięci. Spróbuj stworzyć go na nowo ('Naprawa awatara' w menu 'Awatar' na górze). Jeśli ten komunikat pojawi się ponownie spróbuj jeszcze raz w innym regionie.
</string>
<string name="QP Draw Distance">
Pole widzenia
</string>