diff --git a/Zframework/websocket_thread.lua b/Zframework/websocket_thread.lua index e2fda4c4..7860f161 100644 --- a/Zframework/websocket_thread.lua +++ b/Zframework/websocket_thread.lua @@ -40,21 +40,25 @@ do-- Connect repeat res,err=SOCK:receive('*l') assert(res,err) - if not ctLen and res:find('length') then - ctLen=tonumber(res:match('%d+')) + if not ctLen and res:find('content-length') then + ctLen=tonumber(res:match('%d+')) or 0 end until res=='' -- Result + if code=='101' then + CHN_push(readCHN,'success') + end + + -- Content(?) if ctLen then - if code=='101' then - CHN_push(readCHN,'success') - else - res,err=SOCK:receive(ctLen) + res,err=SOCK:receive(ctLen) + if code~='101' then res=JSON.decode(assert(res,err)) error((code or "XXX")..":"..(res and res.reason or "Server Error")) end end + SOCK:settimeout(0) end diff --git a/main.lua b/main.lua index e1be36d3..ef4b0ed4 100644 --- a/main.lua +++ b/main.lua @@ -591,10 +591,10 @@ for _,fileName in next,fs.getDirectoryItems('replay') do end table.sort(REPLAY,function(a,b) return a.fileName>b.fileName end) -AUTHURL="https://studio26f.org/oauth?product=techmino" -AUTHHOST="cafuuchino1.3322.org:8081" -WS.switchHost('cafuuchino1.3322.org','10026','/techmino/ws/v1') -HTTP.setHost("cafuuchino1.3322.org:10026") +AUTHURL="https://www.studio26f.org/oauth?product=techmino" +AUTHHOST="www.studio26f.org" +WS.switchHost('www.studio26f.org','80','/techmino/ws/v1') +HTTP.setHost("www.studio26f.org") HTTP.setThreadCount(1) table.insert(_LOADTIMELIST_,("Load Resources: %.3fs"):format(TIME()-_LOADTIME_)) diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index bec291ac..2f692ccb 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -212,7 +212,7 @@ end scene.widgetList={ WIDGET.newButton{name='offline',x=-1200,y=210,w=800,h=100,color='lR',font=45,align='R',edge=30,code=pressKey'1'}, WIDGET.newButton{name='qplay', x=-1200,y=330,w=800,h=100,color='lM',font=40,align='R',edge=30,code=pressKey'q'}, - WIDGET.newButton{name='online', x=-1200,y=450,w=800,h=100,color='D',font=45,align='R',edge=30,code=pressKey'a'}, + WIDGET.newButton{name='online', x=-1200,y=450,w=800,h=100,color='lV',font=45,align='R',edge=30,code=pressKey'a'}, WIDGET.newButton{name='custom', x=-1200,y=570,w=800,h=100,color='lS',font=45,align='R',edge=30,code=pressKey'z'}, WIDGET.newButton{name='setting',x=2480,y=210,w=800,h=100, color='lO',font=40,align='L',edge=30,code=pressKey'-'},