恢复刷新在线玩家人数并且降低请求频率
This commit is contained in:
@@ -369,8 +369,10 @@ end
|
|||||||
function NET.freshPlayerCount()
|
function NET.freshPlayerCount()
|
||||||
while WS.status('app')=='running'do
|
while WS.status('app')=='running'do
|
||||||
for _=1,260 do yield()end
|
for _=1,260 do yield()end
|
||||||
|
if NET.lock('freshPlayerCount',10)then
|
||||||
WS.send('app',JSON.encode{action=3})
|
WS.send('app',JSON.encode{action=3})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function NET.updateWS_app()
|
function NET.updateWS_app()
|
||||||
while WS.status('app')~='dead'do
|
while WS.status('app')~='dead'do
|
||||||
@@ -399,7 +401,7 @@ function NET.updateWS_app()
|
|||||||
end
|
end
|
||||||
MES.new('broadcast',res.notice,5)
|
MES.new('broadcast',res.notice,5)
|
||||||
NET.tryLogin(true)
|
NET.tryLogin(true)
|
||||||
-- TASK.new(NET.freshPlayerCount)
|
TASK.new(NET.freshPlayerCount)
|
||||||
elseif res.action==0 then--Broadcast
|
elseif res.action==0 then--Broadcast
|
||||||
MES.new('broadcast',res.data.message,5)
|
MES.new('broadcast',res.data.message,5)
|
||||||
elseif res.action==1 then--Get notice
|
elseif res.action==1 then--Get notice
|
||||||
@@ -419,6 +421,7 @@ function NET.updateWS_app()
|
|||||||
NET.PlayCount=res.data.Play
|
NET.PlayCount=res.data.Play
|
||||||
NET.StreamCount=res.data.Stream
|
NET.StreamCount=res.data.Stream
|
||||||
--res.data.Chat
|
--res.data.Chat
|
||||||
|
NET.unlock('freshPlayerCount')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
WS.alert('app')
|
WS.alert('app')
|
||||||
|
|||||||
Reference in New Issue
Block a user