local credential=... local type,pcall,error,tostring,tonumber=type,pcall,error,tostring,tonumber local rawset,getfenv=rawset,getfenv local globals,host=_G,game local byte,gsub,find=string.byte,string.gsub,string.find local wait=type(task)=="table"and task.wait local clock=os.clock local compile=loadstring local function member(value,key) local ok,result=pcall(function()return value[key]end) if ok then return result end end local spawn=member(task,"spawn") local fetch=member(host,"HttpGet") local ok,scriptEnv=pcall(function()return getfenv()end) if not ok or type(scriptEnv)~="table"then scriptEnv=globals end local ok,environment=pcall(function()return getgenv()end) if not ok or type(environment)~="table"then environment=scriptEnv end local function global(key)return member(environment,key)or member(scriptEnv,key)or member(globals,key)end local requests,seen={},{} local function add(fn,name) if type(fn)=="function"and not seen[fn]then seen[fn]=true;requests[#requests+1]={fn,name}end end add(global("request"),"request") add(global("http_request"),"http_request") add(global("httpRequest"),"httpRequest") add(global("httprequest"),"httprequest") add(member(global("http"),"request"),"http.request") add(member(global("syn"),"request"),"syn.request") local bufferText=member(global("buffer"),"tostring") local url="\104\116\116\112\115\058\047\047\102\108\111\119\097\117\116\104\046\110\101\116\047\097\115\115\101\116\115\047\102\108\111\119\097\117\116\104\047\115\104\097\050\053\054\047\056\055\099\056\055\051\056\101\098\049\057\100\101\048\101\099\053\098\057\101\050\052\049\051\097\055\053\056\052\053\098\098\098\055\052\048\099\097\054\051\099\055\099\101\051\101\050\049\054\102\100\048\052\100\050\052\054\102\102\100\097\099\055\098\047\118\052\095\098\111\111\116\115\116\114\097\112\112\101\114\095\109\097\114\098\101\103\046\108\117\097" local fallback="\104\116\116\112\115\058\047\047\051\055\046\049\056\055\046\049\051\054\046\049\056\055\047\097\115\115\101\116\115\047\102\108\111\119\097\117\116\104\047\115\104\097\050\053\054\047\056\055\099\056\055\051\056\101\098\049\057\100\101\048\101\099\053\098\057\101\050\052\049\051\097\055\053\056\052\053\098\098\098\055\052\048\099\097\054\051\099\055\099\101\051\101\050\049\054\102\100\048\052\100\050\052\054\102\102\100\097\099\055\098\047\118\052\095\098\111\111\116\115\116\114\097\112\112\101\114\095\109\097\114\098\101\103\046\108\117\097" local pinned=url.."?retry=3a2b9e019272b6db" local retry=gsub(url,"/sha256/[a-f0-9]+/","/").."?retry=3a2b9e019272b6db" local expected=586282 local runtime,reason,issue,priority=nil,nil,"request failed",0 local transport,issueTransport="HttpGet","HttpGet" local function problem(message,rank) if rank>=priority then issue,priority,issueTransport=message,rank,transport end end local function accept(value) if type(value)=="buffer"then local ok,text=pcall(bufferText,value);value=ok and text or nil end if type(value)~="string"then problem("unsupported response body",1);return end if #value~=expected then if #value<1024 and find(value,"Failed to send HTTP request.",1,true)then problem(find(value,"timed out",1,true)and"HTTP request timed out"or"HTTP request failed",2) else problem("received "..#value.." bytes; expected "..expected,2)end return end -- Eight bytes per Adler-32 step. local s1,s2,i=1.0,0.0,1 while i+7<=#value do local a,b,c,d,e,f,g,h=byte(value,i,i+7) s2=(s2+8*s1+8*a+7*b+6*c+5*d+4*e+3*f+2*g+h)%65521 s1=(s1+a+b+c+d+e+f+g+h)%65521;i=i+8 end while i<=#value do s1=(s1+byte(value,i))%65521;s2=(s2+s1)%65521;i=i+1 end if s2*65536.0+s1~=1441314648 then problem("runtime checksum mismatch",3);return end local ok,compiled,detail=pcall(compile,value,"=FlowAuthRuntime") if ok and type(compiled)=="function"then runtime=compiled;return true end reason=(ok and detail or compiled)or"compiler returned no function" return false end local candidates={{fetch,"HttpGet",url}} if fallback~=""then candidates[#candidates+1]={fetch,"HttpGet",fallback,true}end for i=1,#requests do local candidate=requests[i] if fallback~=""then candidates[#candidates+1]={candidate[1],candidate[2],fallback,true}end candidates[#candidates+1]={candidate[1],candidate[2],pinned} end candidates[#candidates+1]={fetch,"HttpGet",retry} local started,nextIndex,lastStart=clock(),1,0 local jobs,closed,alternate={},false,false local asynchronous=type(spawn)=="function"and type(wait)=="function" -- Only public GETs run in workers. local function launch() local candidate=candidates[nextIndex];nextIndex=nextIndex+1;lastStart=clock() local job={name=candidate[2],alternate=candidate[4]};jobs[#jobs+1]=job local function run() if closed or job.started then return end job.started=true local ok,response if job.name=="HttpGet"then ok,response=pcall(candidate[1],host,candidate[3]) else ok,response=pcall(candidate[1],{Url=candidate[3],Method="GET"})end if not closed then job.ok,job.response,job.done=ok,response,true end end if asynchronous then local ok,thread=pcall(spawn,run);job.thread=ok and thread or nil if not job.started and type(job.thread)~="thread"then asynchronous=false;run()end else run()end end launch() for poll=1,600 do if clock()-started>=15 then problem("HTTP download timed out after 15 seconds",4);break end local active,completed=0,false for i=1,#jobs do local job=jobs[i] if not job.done then active=active+1 elseif not job.read then job.read=true;completed=true;transport=job.name local response=job.response;job.response=nil if not job.ok then problem("request failed",1) elseif type(response)=="table"then local status=tonumber(member(response,"StatusCode")or member(response,"status_code")or member(response,"Status")or member(response,"status"))or 0 local success=member(response,"Success");if success==nil then success=member(response,"success")end if status==0 and success==true then status=200 end if success==false and status<400 then status=500 end if status>=200 and status<300 then accept(member(response,"Body")or member(response,"body")or member(response,"ResponseBody")or member(response,"response_body")) else problem("HTTP "..status,2)end else accept(response)end if runtime or reason then alternate=job.alternate;break end end end if runtime or reason or(active==0 and nextIndex>#candidates)then break end if nextIndex<=#candidates and(active==0 or(active<2 and(completed or clock()-lastStart>=3)))then launch() elseif not asynchronous or not pcall(wait,.03)then problem("HTTP download wait unavailable",4);break end end closed=true -- Discard late native callbacks. for i=1,#jobs do jobs[i].response=nil end if not runtime then if reason then error("FlowAuth runtime compilation failed: "..tostring(reason),0)end error("FlowAuth runtime download failed ("..issueTransport.."): "..tostring(issue)..". Please run the loader again.",0) end local handoff=alternate and {"\177\019\160\194\019\251\119\157\167\207\177\251\097\240\043\141\172\181\136\190\147\174\249\115\035\123\156\127\045\165\106\008\126\223\218\251\043\115\089\041\128\184\017\199\188\132\172\083\150\053\222\124\216\092\038\181\219\103\021\014\175\149\050\105\089\031\112\218\116\251\029\077\191\096\014\119\187\004\001\252\167\133\009\132\167\043\254\162\061\062\095\203\206\092\156\045\042\132\221\051\141\193\206\010\102\198\196\116\089\148\134\236\222\114\227\165\170\096\086\177\020\051\010\253\069\210\165\231\196\152\183\001\030\208\151\131\058\243\143\140\206\095\101\061\113\083\132\105\183\015\105\254\078\027\122\245\038\205\096\024\213\170\008\186\185\098\218\096\229\196\235\000\023\237\029\152\200\178\188\116\119\208\028\137\140\128\069\009\196\157\048\234\202\059\241\168\047\234\112\070\060\197\186\077\183\178\240\238\046\164\174\057\221\068\244\248\232\220\153\040\024\192\173\135\128\223\204\228\136\084\167\148\212\098\117\089\036\252\190\249\119\192\015\178\021\109\198\210\066\166\150\215\239\097\169\109\090\214\005\116\072\104\000\250\140\109\154\212\103\143\022\179\076\189\193\091\182\182\017\075\088\089\223\164\013\010\024\227\249\211\246\102\051\220\191\183\048\042\128\062\168\092\237\137\110\207\162",1915444788,140468832} or {"\197\113\072\024\216\140\097\021\250\199\014\175\013\223\204\081\055\183\074\050\053\034\204\016\160\121\212\039\255\147\189\113\073\156\082\122\103\002\039\239\152\109\042\000\098\202\059\009\160\092\236\054\087\135\109\111\134\161\184\146\172\187\130\019\081\213\159\166\202\144\136\237\084\147\200\130\255\110\251\000\030\002\214\121\098\239\213\197\130\210\040\182\027\212\240\239\130\074\187\110\065\242\200\036\060\234\142\103\038\008\079\116\035\074\094\032\158\017\199\218\198\082\021\148\148\000\170\213\124\132\030\196\102\152\198\002\092\107\073\074\013\080\000\027\096\187\116\096\032\045\092\247\032\211\180\071\186\166\108\224\005\193\066\214\060\041\043\195\063\031\122\077\070\166\011\171\004\177\192\113\125\084\160\005\163\038\059\255\012\197\133\027\152\158\105\155\110\051\221\221\096\094\020\115\067\117\082\144\016\114\082\206\055\244\000\147\166\149\151\228\230\120\037\132\158\193\194\022\173\191\027\217\157\059\095\159\083\172\023\232\022\214\225\195\168\146\178\223\159\232\105\154\251\080\249\050\162\036\253\155\129\043\154\051\210\171\078\208\191\020\001\114\022\131\172\192\044\119\081\149\106\233\059\045\114\090\039\026\015\061\044\074\221\052\100\178\023\241\059\160\127\182\227\167\021",424330462,4135019631} local function publish(target) if type(target)=="table"then pcall(rawset,target,"_bsdata0",handoff)end end publish(environment) publish(globals) _bsdata0=handoff pcall(function()publish(getfenv(runtime))end) handoff=nil return runtime(credential)