Jump to content

dataserver event never fires (from llRequestInventoryData)


May Suki
 Share

You are about to reply to a thread that has been inactive for 1002 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a Doll Key with 11 scripts within it, and one of these scripts calls:

queryLandmarkData = llRequestInventoryData(landmark);

...where landmark equals "Home" in the standard case. queryLandmarkData is verified to not be NULL_KEY, but the dataserver event never fires:

    dataserver(key queryID, string queryData) {

        if (queryID == queryLandmarkData) {                                                                                   
            rlvTeleport(queryData);
            llSetTimerEvent(0.0);
            queryLandmarkData = NULL_KEY;
        }
    }

(The function rlvTeleport takes queryData, generates the appropriate global position setting, and generates an RLV call to teleport.)

Through the use of multiple debug statements it can be determined that the dataserver event never fires for the llRequestInventoryData() call. It does however respond to other dataserver events that happen in other scripts, including processing notecard lines and getting region data and username data.

Is it possible that dataserver events in this script get throttled?

I can find zero reason for llRequestInventoryData to work and then for data server to fail. There's no documentation in the llRequestInventoryData wiki page or in the dataserver wiki page that explains such a scenario.

I'm using Firestorm to compile, along with full usage of all of Firestorm's compile-time enhancements. I also have the code in a git repository.

I searched for the possibility that dataserver events were getting throttled or stopped outright due to too many all at once - but I can't find that documented anywhere if it is the case.

Help?

Edited by May Suki
Link to comment
Share on other sites

What other events are in the script?

What do the 10 other scripts do?

Is your event queue exceeding the maximum limit?

How many other dataserver-related function calls are you making? (If you're using a single variable, you may be replacing the handle before you get the response.)

Edited by Wulfie Reanimator
Link to comment
Share on other sites

Try dropping in something like this where you actually try to read the landmark data, so you know what's actually being called

		if(llGetInventoryType(strLandmark)==INVENTORY_LANDMARK){
			kQueryLandmarkData = llRequestInventoryData(strLandmark);
			if(kQueryLandmarkData){
				llOwnerSay("requested coordinates for \""+strLandmark+"\"\n key is "+(string)kQueryLandmarkData);
			}
			else{
				llOwnerSay("could not read data for strLandmark");
			}
		}
		else{
			llOwnerSay("no landmark called \""+strLandmark+"\"");
		}

 

Link to comment
Share on other sites

5 hours ago, Wulfie Reanimator said:

What other events are in the script?

What do the 10 other scripts do?

Is your event queue exceeding the maximum limit?

How many other dataserver-related function calls are you making? (If you're using a single variable, you may be replacing the handle before you get the response.)

In that script, there are no other dataserver events.

Otherwise, I have these events in that script:

  • state_entry()
  • on_rez(integer start)
  • attach(key id)
  • changed(integer change)
  • link_message(integer lmSource, integer lmInteger, string lmData, key lmID)
  • timer()
  • run_time_permissions(integer perm)

The other scripts perform other functions of the key, as well as generate and respond to menus, handle dressing and undressing the avatar, checking for RLV, handling a chat interface, winding and unwinding the key, and lots more.

I'm not sure how the event queue would be exceeding the maximum limit: I have debug statements everywhere, and the only things that happen during resting operation are two timers, and the tracking of time left on the key in seconds.

The busiest that the dataserver gets is during the reading of the preferences notecard - that had a delay for reading each line, but now it reads the lines as fast as it can go.

In that script, there is only the one dataserver call. I have five other dataserver event blocks:

  • dataserver block in Main.lsl:
    • llRequestSimulatorData() - after teleport
  • dataserver block in Start.lsl:
    • llGetNotecardLine() - at state_entry
    • llRequestDisplayName() - as required
  • dataserver block in Transform.lsl:
    • llGetNotecardLine() - when type phrases are read (doesn't happen often)

None of these happen but a very few times during the lifetime of the key.

As for the overwriting of the queryLandmarkData variable, that was something I considered - but on exit from the set up function, it has the right value - and the dataserver value never fires at all (seen through testing).

Link to comment
Share on other sites

3 hours ago, Innula Zenovka said:

Try dropping in something like this where you actually try to read the landmark data, so you know what's actually being called


		if(llGetInventoryType(strLandmark)==INVENTORY_LANDMARK){
			kQueryLandmarkData = llRequestInventoryData(strLandmark);
			if(kQueryLandmarkData){
				llOwnerSay("requested coordinates for \""+strLandmark+"\"\n key is "+(string)kQueryLandmarkData);
			}
			else{
				llOwnerSay("could not read data for strLandmark");
			}
		}
		else{
			llOwnerSay("no landmark called \""+strLandmark+"\"");
		}

 

I have something like that already... your code is much cleaner. This is the actual code (with Firestorm macros included):

key doTeleport(string tpLandmark) {                                                                                           
    key queryLandmarkData;

    if (!isLandmarkPresent(tpLandmark)) {
        debugSay(6,"DEBUG-LANDMARK","No landmark by the name of \"" + tpLandmark + "\" is present in inventory.");
        return NULL_KEY;
    }

    // This should trigger a dataserver event
    queryLandmarkData = llRequestInventoryData(tpLandmark);

    if (queryLandmarkData == NULL_KEY) {
        llSay(DEBUG_CHANNEL,"Landmark data request failed.");
        return NULL_KEY;
    }

#ifdef DEVELOPER_MODE
    debugSay(6,"DEBUG-LANDMARK","queryLandmarkData set to " + (string)queryLandmarkData);
    debugSay(6,"DEBUG-LANDMARK","Teleporting dolly " + dollName + " to  inventory tpLandmark \"" + tpLandmark + "\".");
#endif
    return queryLandmarkData;
}   

The macro isLandmarkPresent is this:

#define isLandmarkPresent(a) (llGetInventoryType(a) == INVENTORY_LANDMARK)

debugSay is a macro that displays text with llOwnerSay if the debugLevel variable is larger or equal to the parameter. However, if I change a single macro, every last debugSay vanishes.

Link to comment
Share on other sites

When I try to activate the teleport function, this is the resulting debug code:

[08:23:31] Dolly Mei's Key: DEBUG-LINKMONITOR(8):199: Link message #INTERNAL_CMD cmd: teleport [ChatHandler] = Home
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):154: queryLandmarkData set to a28a9842-9269-00d9-1fa4-9a4d9663be37
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):155: Teleporting dolly Lady Mei メイ Mэй Suki to  inventory tpLandmark "Home".
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):567: queryLandmarkData now equals a28a9842-9269-00d9-1fa4-9a4d9663be37

After that, a timer times out and I put an error up with llOwner(DEBUG_CHANNEL, ...)

Edited by May Suki
Added detal
Link to comment
Share on other sites

If it were me, I would write a test script, in another object, and test that the basic reading a landmark functionality works, before trying to figure out why your main script isn't behaving the same way (assuming the test works smoothly)

  • Like 1
Link to comment
Share on other sites

24 minutes ago, May Suki said:

When I try to activate the teleport function, this is the resulting debug code:



[08:23:31] Dolly Mei's Key: DEBUG-LINKMONITOR(8):199: Link message #INTERNAL_CMD cmd: teleport [ChatHandler] = Home
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):154: queryLandmarkData set to a28a9842-9269-00d9-1fa4-9a4d9663be37
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):155: Teleporting dolly Lady Mei メイ Mэй Suki to  inventory tpLandmark "Home".
[08:23:32] Dolly Mei's Key: DEBUG-LANDMARK(6):567: queryLandmarkData now equals a28a9842-9269-00d9-1fa4-9a4d9663be37

After that, a timer times out and I put an error up with llOwner(DEBUG_CHANNEL, ...)

So, from what you're saying, there's a landmark in the object's inventory called "Home" that points to a valid destination, and when a valid request is sent, the dataserver doesn't respond?      (I'm assuming you've tested the  LM, and all the other "is it plugged in?" stuff).

 

Edited by Innula Zenovka
Link to comment
Share on other sites

A debug message in the dataserver event is missing, that shows the queryID and queryLandmarkData so you can make sure that really no event happens.

How many events don't trigger? All? I can't imagine that this is something else than a script bug then.

Do the other scipts handle dataserver events too? In this case you need to remove them to test functionality of your script without possible interventions.

Link to comment
Share on other sites

3 hours ago, Innula Zenovka said:

So, from what you're saying, there's a landmark in the object's inventory called "Home" that points to a valid destination, and when a valid request is sent, the dataserver doesn't respond?      (I'm assuming you've tested the  LM, and all the other "is it plugged in?" stuff).

 

That is correct. I did create a script with just the functions as written, and macros copied, and none of the massive other programming in the original - and it worked (with landmark Home).

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, May Suki said:

That is correct. I did create a script with just the functions as written, and macros copied, and none of the massive other programming in the original - and it worked (with landmark Home).

In that case there must be something wrong with the original (and "massive other programming" is often a danger sign) but without sight of the code, it's impossible to say much more.

Link to comment
Share on other sites

44 minutes ago, Innula Zenovka said:

In that case there must be something wrong with the original (and "massive other programming" is often a danger sign) but without sight of the code, it's impossible to say much more.

I was afraid of that. As mentioned before, all code is in the github git repo: https://github.com/emmamei/cdkey/

Link to comment
Share on other sites

17 minutes ago, May Suki said:

Yes it is.

https://github.com/emmamei/cdkey/

The problem code is in src/Avatar.lsl.

Grasping at straws and this shouldn't be a problem but try renaming queryLandmarkData within doTeleport to something else, as a simple sanity-check.

Variable name masking should work just fine in LSL, but I'm not seeing anything else suspicious in that script. The system is too complex for me to just pop it into an object inworld and start debugging it, at least right now.

Link to comment
Share on other sites

6 hours ago, Wulfie Reanimator said:

 The system is too complex for me to just pop it into an object inworld and start debugging it, at least right now.

I took all the teleport processing out of Avatar.lsl - one of the more complicated scripts - and moved them to StatusRLV.lsl which is one of the simplest scripts.

The process still fails. Going to look at the Firestorm post-processed script next.

Link to comment
Share on other sites

This may be a silly thought, but since I've made that mistake in my scripting career at least two times and I've been looking for a reason for a few hours each time... make sure that queryLandmarkData global variable is a key, not a string, and that you don't re-declare it or erase by accident in local scope with "key" or "string" at the beginning as well.

Quote

key queryLandmarkData;

default {

    touch_start(integer nd)
    {
        key queryLandmarkData = NULL;
        queryLandmarkData = llRequestInventoryData(landmark);
    }

    dataserver(key queryID, string queryData)
    {
        if (queryID == queryLandmarkData) {
            (...)
        }
    }

}

I'd suggest to check line 138. Personally, I think you can remove it or (better) remove the "key" in front of it. You also should move everything that is under the llRequestInventoryData() call into/inside that call, as dataserver event is asynchronous and that "if (queryLandmarkData == NULL_KEY)" may (will) fire when the dataserver is still processing the data.

It's a good habit to put "g" in front of global vars (gQueryLandmarkData), it's easier to spot re-declarations like this (you can look for "key g", "string g" etc.).

x.jpg

Edited by panterapolnocy
Link to comment
Share on other sites

I moved the code to the StatusRLV script, and it still fails. The dataserver event still gets activated, though never for the llRequestInventoryData() function call.

I tested the data server with an llGetSimulatorData() function; worked perfectly.

I checked the permissions of the landmark, and its full perm. Would permissions of the prims be involved?

I don't know what could be causing this...

Link to comment
Share on other sites

3 hours ago, May Suki said:

Going to look at the Firestorm post-processed script next.

Yes please. I'd guess that—isLandmarkPresent() nothwithstanding—llRequestInventoryData() is somehow being called on something that's not in fact a landmark. [EDIT: But that's unlikely if, as observed above, the call to llRequestInventoryData() returns a non-null key.]

Anyway, the next step for me would be to find the simplest program that exhibits the same problem, and study the actual LSL code, sans preprocessor directives.

Just in passing, another thing about llRequestInventoryData() that's kinda weird is that 1.0 second sleep after the call. I can imagine a complex system of scripts having some kind of heartbeat mechanism that loses patience with a script "sleeping-off" the call (but I don't see that in this particular code).

Edited by Qie Niangao
  • Like 2
Link to comment
Share on other sites

2 hours ago, May Suki said:

I moved the code to the StatusRLV script, and it still fails. The dataserver event still gets activated, though never for the llRequestInventoryData() function call.

If you have a single script that we can compile (with all the required code/macros within that script -- not relying on other scripts/includes), could you post that?

  • Like 2
Link to comment
Share on other sites

12 hours ago, May Suki said:

Yes it is.

https://github.com/emmamei/cdkey/

The problem code is in src/Avatar.lsl.

I'm probably missing something very obvious, but have you not tried writing the script in standard LSL rather than using the Firestorm pre-processor (which seems here to add nothing save unnecessary complication)?    (I'm not familiar with the pre-processor, since I've found the need for it).

As it is, I would debug it by adding at l565

                    string landmark = (string)split[0];
                    llOwnerSay("Trying to read data for "+landmark);  //l565
                    llOwnerSay("queryLandmarkData returns "+(string) (queryLandmarkData = doTeleport(landmark));

just to be absolutely sure of what the script is doing, but on the face of it, the logic seems pretty straightforward -- if the script receives a link message with the string parameter containing the string "home" then find the LM with that name and call llRequestInventoryData -- so I'm not sure why it needs all these bells and whistles.

Link to comment
Share on other sites

All great ideas.

I was able to create a version of StatusRLV.lsl that worked by itself (though with macros included) with the Home landmark in an object. I tested it in the Doll Key on its own with the Home landmark. Both the generic sphere and the Doll Key worked in this way. (I set the teleport to happen on state_entry).

Then moving it into the Key with all its scripts, poses, and other landmarks made the script fail to teleport.

I've now moved the teleport functions to a new script, and am going towards what Innula mentioned: working until the code has less and less dependencies on macros.

The use of debugSay allows me to throw in lots of llOwnerSay and have them all disappear with the resetting of a single macro. It also allows me to have a "level" of debug, so some will be printed and not others.

The isLandmarkPresent() converts a strange test for the inventory item's type into what it really is: a test for existance of the landmark.

The preprocessor provides for macros, switch/case statements, and array indexing (a[i]).

As mentioned, next step is to keep simplifying and removing code until things work: testing all the while in the main fully scripted Key.

(Link message data is split apart, using "|" as the divider.)

Link to comment
Share on other sites

I actually took the Firestorm post-processed (LSL-only) code, cleaned it up, and tried that. It too failed - but at least now the code is LSL-only and self-contained - *and* isolated. Here it is (hope this posting isn't too much):

//========================================
// Teleport.lsl (#2)
//========================================
//
// vim:sw=4 et nowrap:

//========================================
// VARIABLES
//========================================

key keyID                   = NULL_KEY;
list split                  = [];
string dollName;
string script;
string myName;
integer code;
integer optHeader;

integer remoteSeq;
integer rlvOk               = -1;

integer debugLevel = 8;
integer mySeqNum;

key queryLandmarkData = NULL_KEY;
key tpLandmarkQueryID = NULL_KEY;
string tpLandmark;

//========================================
// FUNCTIONS
//========================================

rlvTeleport(string locationData) {

    vector globalLocation = (llGetRegionCorner() + ((vector)locationData));
    string globalPosition = ((string)((integer)globalLocation.x) + "/" + (string)((integer)globalLocation.y) + "/" + (string)((integer)globalLocation.z));

    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)71)+": "+("Dolly should be teleporting now..."));
    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)72)+": "+("Position = " + globalPosition));

    llOwnerSay("Dolly is now teleporting.");



    llOwnerSay("@unsit=y,tploc=y,tpto:" + globalPosition + "=force");
}

memReport(string script, float delay) {
    if (delay != 0.0) llSleep(delay);

    integer usedMemory = llGetUsedMemory();
    integer memoryLimit = llGetMemoryLimit();
    integer freeMemory = memoryLimit - usedMemory;
    integer availMemory = freeMemory + (65536 - memoryLimit);

    llMessageLinked((LINK_THIS), (((++mySeqNum) << 16) | (0 << 10) | 136), myName + "|" +  (string)usedMemory + "|" + (string)memoryLimit + "|" + (string)freeMemory + "|" + (string)availMemory, llGetKey());

}

key doTeleport(string tpLandmark) {

    if (!(llGetInventoryType(tpLandmark) == INVENTORY_LANDMARK)) {
        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)90)+": "+("No landmark by the name of \"" + tpLandmark + "\" is present in inventory."));
        return NULL_KEY;
    }

    tpLandmarkQueryID = llRequestInventoryData(tpLandmark);

    if (tpLandmarkQueryID == NULL_KEY) {
        llSay(0x7FFFFFFF,"Landmark data request failed.");
        return NULL_KEY;
    }

    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)103)+": "+("queryLandmarkData set to " + (string)tpLandmarkQueryID));
    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)104)+": "+("Teleporting dolly " + dollName + " to  inventory tpLandmark \"" + tpLandmark + "\"."));
    return tpLandmarkQueryID;
}

//========================================
// STATES
//========================================
default {

//========================================
// STATE_ENTRY
//========================================
    state_entry() {
        rlvOk = 1;
        myName = llGetScriptName();
        keyID = llGetKey();

        mySeqNum = llRound(llFrand(1<<15));
    }

//========================================
// ON_REZ
//========================================
    on_rez(integer start) {
        mySeqNum = llRound(llFrand(1<<15));
    }

//========================================
// LINK MESSAGE
//========================================
    link_message(integer lmSource, integer lmInteger, string lmData, key lmID) {

        split     = llParseStringKeepNulls((lmData), [ "|" ], []);         script    = llList2String(split,0);         remoteSeq = (lmInteger & 0xFFFF0000) >> 16;         optHeader = (lmInteger & 0x00000C00) >> 10;         code      =  lmInteger & 0x000003FF;         split     = llDeleteSubList(split, 0, 0 + optHeader);

        if (code == 300) {
            string name = llList2String(split,0);
            string value = llList2String(split,1);
            integer integerValue = (integer)value;

            {if((name) == ("debugLevel"))jump cFq00I;
if((name) == ("rlvOk"))jump cxHZCC;
jump cTgu2x;

                @cxHZCC;
 {
                    rlvOk = integerValue;
                    jump cTgu2x;
                }

                @cFq00I;
 {
                    debugLevel = integerValue;
                    jump cTgu2x;
                }

@cTgu2x;
}
            return;
        }
        else if (code == 305) {
            string cmd = llList2String(split,0);


            {if((cmd) == ("instantMessage"))jump csmNBm;
if((cmd) == ("teleport"))jump ct5mYL;
jump cpzYqz;

                @csmNBm;
 {

                    llInstantMessage(lmID,llList2String(split,0));
                    jump cpzYqz;
                }

                @ct5mYL;
 {

                    tpLandmark = llList2String(split,1);

                    queryLandmarkData = doTeleport(tpLandmark);
                    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)181)+": "+("queryLandmarkData now equals " + (string)queryLandmarkData));
                    llSetTimerEvent(20.0);
                    jump cpzYqz;
                }

@cpzYqz;
}
        }
        else if (code == 350) {
            rlvOk = llList2Integer(split,0);
        }
        else if (code < 200) {
            if (code == 142) {

                llOwnerSay("Teleport" + ": Compiled  by " + "May Suki" + " on " +  "Jun 28 2021" + " at " + "12:08:59" + " Options: " + llList2CSV((["Adult"] + ["Mode=Developer"] + ["RollOver"] + [] + [] + ["PreserveDirectory"] + ["DefaultWind=" + (string)llFloor(1800.0 / 60.0)] )));
            }
            else if (code == 135) {
                float delay = llList2Float(split,0);

                memReport(myName,delay);
            }
        }
    }

//========================================
// TIMER
//========================================
    timer() {

        if (queryLandmarkData) {
            llSay(0x7FFFFFFF,"TP failed to occur; notify developer.");
            llSetTimerEvent(0.0);
        }
    }

//========================================
// DATASERVER
//========================================
    dataserver(key queryID, string queryData) {

        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)224)+": "+("queryLandmarkData is equal to " + (string)queryLandmarkData));
        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)225)+": "+("queryID is equal to " + (string)queryID));

        if (queryID == queryLandmarkData) {
            rlvTeleport(queryData);
            llSetTimerEvent(0.0);
            queryLandmarkData = NULL_KEY;
        }
    }
}

//========== TELEPORT2 ==========

 

Link to comment
Share on other sites

I removed the goto garbage ( I doubt that the "else's" correspond with the "if's" they are meant to (brackets don't match properly) and can imagine a stack obfuscation)
And I placed a touch for testing:

[11:44] Object: DEBUG-LANDMARK(6):103: queryLandmarkData set to d5b4fd44-07ab-0769-8323-e5228cfb3fe3
[11:44] Object: DEBUG-LANDMARK(6):104: Teleporting dolly  to  inventory tpLandmark "test".
[11:44] Object: DEBUG-LANDMARK(6):224: queryLandmarkData is equal to d5b4fd44-07ab-0769-8323-e5228cfb3fe3
[11:44] Object: DEBUG-LANDMARK(6):225: queryID is equal to d5b4fd44-07ab-0769-8323-e5228cfb3fe3
[11:44] Object: DEBUG-LANDMARK(6):71: Dolly should be teleporting now...
[11:44] Object: DEBUG-LANDMARK(6):72: Position = 191953/349654/24
[11:44] Object: Dolly is now teleporting.
[11:44] Object: @unsit=y,tploc=y,tpto:191953/349654/24=force

That seems to work
code:

//========================================
// Teleport.lsl (#2)
//========================================
//
// vim:sw=4 et nowrap:

//========================================
// VARIABLES
//========================================

key keyID                   = NULL_KEY;
list split                  = [];
string dollName;
string script;
string myName;
integer code;
integer optHeader;

integer remoteSeq;
integer rlvOk               = -1;

integer debugLevel = 8;
integer mySeqNum;

key queryLandmarkData = NULL_KEY;
key tpLandmarkQueryID = NULL_KEY;
string tpLandmark;

//========================================
// FUNCTIONS
//========================================

rlvTeleport(string locationData) {

    vector globalLocation = (llGetRegionCorner() + ((vector)locationData));
    string globalPosition = ((string)((integer)globalLocation.x) + "/" + (string)((integer)globalLocation.y) + "/" + (string)((integer)globalLocation.z));

    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)71)+": "+("Dolly should be teleporting now..."));
    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)72)+": "+("Position = " + globalPosition));

    llOwnerSay("Dolly is now teleporting.");



    llOwnerSay("@unsit=y,tploc=y,tpto:" + globalPosition + "=force");
}

memReport(string script, float delay) {
    if (delay != 0.0) llSleep(delay);

    integer usedMemory = llGetUsedMemory();
    integer memoryLimit = llGetMemoryLimit();
    integer freeMemory = memoryLimit - usedMemory;
    integer availMemory = freeMemory + (65536 - memoryLimit);

    llMessageLinked((LINK_THIS), (((++mySeqNum) << 16) | (0 << 10) | 136), myName + "|" +  (string)usedMemory + "|" + (string)memoryLimit + "|" + (string)freeMemory + "|" + (string)availMemory, llGetKey());

}

key doTeleport(string tpLandmark) {

    if (!(llGetInventoryType(tpLandmark) == INVENTORY_LANDMARK)) {
        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)90)+": "+("No landmark by the name of \"" + tpLandmark + "\" is present in inventory."));
        return NULL_KEY;
    }

    tpLandmarkQueryID = llRequestInventoryData(tpLandmark);

    if (tpLandmarkQueryID == NULL_KEY) {
        llSay(0x7FFFFFFF,"Landmark data request failed.");
        return NULL_KEY;
    }

    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)103)+": "+("queryLandmarkData set to " + (string)tpLandmarkQueryID));
    if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)104)+": "+("Teleporting dolly " + dollName + " to  inventory tpLandmark \"" + tpLandmark + "\"."));
    return tpLandmarkQueryID;
}

//========================================
// STATES
//========================================
default {

//========================================
// STATE_ENTRY
//========================================
    state_entry() {
        rlvOk = 1;
        myName = llGetScriptName();
        keyID = llGetKey();

        mySeqNum = llRound(llFrand(1<<15));
    }

//========================================
// ON_REZ
//========================================
    on_rez(integer start) {
        mySeqNum = llRound(llFrand(1<<15));
    }

//========================================
// LINK MESSAGE
//========================================
    touch_start(integer num) {

		tpLandmark = "test";
		queryLandmarkData = doTeleport(tpLandmark);
        llSetTimerEvent(20.0);
    }

//========================================
// TIMER
//========================================
    timer() {

        if (queryLandmarkData) {
            llSay(0x7FFFFFFF,"TP failed to occur; notify developer.");
            llSetTimerEvent(0.0);
        }
    }

//========================================
// DATASERVER
//========================================
    dataserver(key queryID, string queryData) {

        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)224)+": "+("queryLandmarkData is equal to " + (string)queryLandmarkData));
        if (debugLevel >= 6) llOwnerSay(     "DEBUG-LANDMARK"+"("+((string)6)+"):"+((string)225)+": "+("queryID is equal to " + (string)queryID));

        if (queryID == queryLandmarkData) {
            rlvTeleport(queryData);
            llSetTimerEvent(0.0);
            queryLandmarkData = NULL_KEY;
        }
    }
}

 

Link to comment
Share on other sites

20 minutes ago, Nova Convair said:

I removed the goto garbage ( I doubt that the "else's" correspond with the "if's" they are meant to (brackets don't match properly) and can imagine a stack obfuscation)

The if/jump blocks are the LSL implementation of the Firestorm switch/case statements. The if statements were all just:

if (condition) jump (location);

The location being each case, then the case (normally) ends with a jump to the end of the switch statement.

Your testing shows what I've been suspicious of, too - that something in the link message processing is killing the teleport.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1002 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...