state History
{
state_entry()
{
llListen(DIALOG_CHANNEL, "", NULL_KEY, ""
; //LISTEN FOR DIALOG RESPONSESCurrent = 0;
SendHistoryRequest("PREVIOUS"
;}
listen(integer channel, string name, key id, string message)
{
if (message == "<< Prev"

{
SendHistoryRequest("PREVIOUS"
;}
else if (message == "Next >>"

{
SendHistoryRequest("NEXT"
;}
else if (message == "Select"

{
state Idle;
}
}
http_response(key id,integer status, list meta, string body)
{
if (id == HTTPKEY)
{
if (status != 200 && status != 499)
{
llSay(0, "ERROR: There has been a problem communicating with the back end, Resetting. Status: " + (string)status);
state default;
}
else
{
list lbody=llParseString2List(body,["\n"],[]);
string temp = llList2String(lbody, 0);
list VideoInfo = llParseString2List(temp, ["#"],[]);
MediaURL = llList2String(VideoInfo, 0);
MediaName = llList2String(VideoInfo, 1);
MediaLength = llList2Integer(VideoInfo, 2);
Current = llList2Integer(VideoInfo, 3);
llMessageLinked(LINK_THIS, 401, str_replace(MediaName, "&", "&"
, (key)"LCD"
;llDialog(ActiveUser, "\n\t\tUser: " + llKey2Name(ActiveUser) + "\n\n\t\tBalance: " + (string)ActiveBalance + "\n\n\t\tCurrent Video: " + MediaName + "\n", ["<< Prev", "Select", "Next >>"], DIALOG_CHANNEL);
}
}
}
}
I'm assuming the leak occurs somewhere in that final else block but I'm afraid memory management has not been a concern of mine to date. I'm reading up in the wiki but if anyone has pointers I would greatly appreciate it.
Just to help, SendHistoryRequest is just a function with an httprequest within it.
Thanks in advance!