Table of Contents

LSL: is_SL()

Detect SL vs OpenSim

This relies on a bug in SL that does not exist in OpenSim, per WaS bug Splitting Strings to Lists. We can detect SL by looking for this bug in llParseString2List():

// Hack to detect Second Life vs OpenSim
// Relies on a bug in llParseString2List() in SL
// http://grimore.org/fuss/lsl/bugs#splitting_strings_to_lists 
integer is_SL() {
    string sa = "12999";
//    list OS = [1,2,9,9,9];
    list SL = [1,2,999];
    list la = llParseString2List(sa, [], ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]);
    return (la == SL);
}