diff --git a/Notifier.lsl b/Notifier.lsl index 7f6ddad..df4f6f1 100644 --- a/Notifier.lsl +++ b/Notifier.lsl @@ -149,9 +149,7 @@ Sends(){ key g_kCurrentReq = NULL_KEY; DoNextRequest(){ if(llGetListLength(g_lReqs)==0)return; - list lTmp = llParseString2List(llList2String(g_lReqs,0),["?"],[]); - if(g_iDEV)llSay(0, "SENDING REQUEST: "+API_SERVER+llList2String(g_lReqs,0)); - g_kCurrentReq = llHTTPRequest(API_SERVER + llList2String(lTmp,0), [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], llDumpList2String(llList2List(lTmp,1,-1),"?")); + g_kCurrentReq = llHTTPRequest(API_SERVER + llList2String(g_lReqs,0), [], ""); } list g_lReqs; @@ -164,6 +162,7 @@ checkUpdate() } requestProductServer() { + } @@ -288,7 +287,7 @@ default } g_iChn = llRound(llFrand(8574833)); g_iLstn = llListen(g_iChn, "", llDetectedKey(0), ""); - llDialog(llDetectedKey(0), "What mode do you want to set?\n\nCurrent mode: "+g_sCurrentMode, g_lModes+["-exit-"], g_iChn); + llDialog(llDetectedKey(0), "What mode do you want to set?\n\nCurrent mode: "+g_sCurrentMode, g_lModes+["-exit-", "chk.update"], g_iChn); } changed(integer c) @@ -301,10 +300,15 @@ default http_response(key r, integer s,list m,string b) { - if(HasDSRequest(r)!=-1) + if(g_kCurrentReq == r) { - DeleteDSReq(r); + if(g_iDEV) + { + llSay(0, "Status Code: "+ (string)s+"\n" + b); + } + + g_lReqs = llDeleteSubList(g_lReqs,0,0); list tmp = llParseString2List(b,[";;",";"],[]); if(llList2String(tmp,0)=="Modify_Product") { @@ -327,6 +331,9 @@ default llRemoveInventory(llGetScriptName()); } + g_kCurrentReq = NULL_KEY; + llSleep(1); + DoNextRequest(); } } @@ -340,7 +347,13 @@ default return; } else if(m == "chk.update") { + if(initial_start) + { + llRegionSayTo(i, 0, "Startup still in progress. Please wait a moment before trying again"); + return; + } checkUpdate(); + return; } llDialog(i, "What mode do you want to set?\n\nCurrent mode: "+m, g_lModes+["-exit-"], c); SetMode(m);