加载时连接ws-app
This commit is contained in:
@@ -1112,7 +1112,6 @@ do
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
function TICK_WS_app()
|
function TICK_WS_app()
|
||||||
local initial=true
|
|
||||||
local retryTime=5
|
local retryTime=5
|
||||||
while true do
|
while true do
|
||||||
YIELD()
|
YIELD()
|
||||||
@@ -1142,10 +1141,7 @@ do
|
|||||||
elseif status=="dead"then
|
elseif status=="dead"then
|
||||||
retryTime=retryTime-1
|
retryTime=retryTime-1
|
||||||
if retryTime==0 then return end
|
if retryTime==0 then return end
|
||||||
if initial then
|
for _=1,120 do YIELD()end
|
||||||
for _=1,120 do YIELD()end
|
|
||||||
initial=false
|
|
||||||
end
|
|
||||||
WS.connect("app","/app")
|
WS.connect("app","/app")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ local loadingThread=coroutine.create(function()
|
|||||||
--Connect to server
|
--Connect to server
|
||||||
TASK.new(TICK_WS_app)
|
TASK.new(TICK_WS_app)
|
||||||
TASK.new(TICK_WS_user)
|
TASK.new(TICK_WS_user)
|
||||||
TASK.new(TICK_WS_chat)
|
WS.connect("app","/app")
|
||||||
if USER.authToken then
|
if USER.authToken then
|
||||||
WS.connect("user","/user",JSON.encode{
|
WS.connect("user","/user",JSON.encode{
|
||||||
id=USER.id,
|
id=USER.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user