给一些网络操作加5秒超时
This commit is contained in:
@@ -70,7 +70,7 @@ function NET.wsconn_app()
|
|||||||
WS.connect("app","/app")
|
WS.connect("app","/app")
|
||||||
end
|
end
|
||||||
function NET.wsconn_user_pswd(email,password)
|
function NET.wsconn_user_pswd(email,password)
|
||||||
if _lock("wsc_user")then
|
if _lock("wsc_user",5)then
|
||||||
WS.connect("user","/user",JSON.encode{
|
WS.connect("user","/user",JSON.encode{
|
||||||
email=email,
|
email=email,
|
||||||
password=password,
|
password=password,
|
||||||
@@ -78,7 +78,7 @@ function NET.wsconn_user_pswd(email,password)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function NET.wsconn_user_token(uid,authToken)
|
function NET.wsconn_user_token(uid,authToken)
|
||||||
if _lock("wsc_user")then
|
if _lock("wsc_user",5)then
|
||||||
WS.connect("user","/user",JSON.encode{
|
WS.connect("user","/user",JSON.encode{
|
||||||
uid=uid,
|
uid=uid,
|
||||||
authToken=authToken,
|
authToken=authToken,
|
||||||
@@ -166,7 +166,7 @@ function NET.fetchRoom()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function NET.createRoom()
|
function NET.createRoom()
|
||||||
if _lock("enterRoom")then
|
if _lock("enterRoom",5)then
|
||||||
WS.send("play",JSON.encode{
|
WS.send("play",JSON.encode{
|
||||||
action=1,
|
action=1,
|
||||||
data={
|
data={
|
||||||
@@ -179,7 +179,7 @@ function NET.createRoom()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function NET.enterRoom(roomID,password)
|
function NET.enterRoom(roomID,password)
|
||||||
if _lock("enterRoom")then
|
if _lock("enterRoom",5)then
|
||||||
NET.rid=roomID
|
NET.rid=roomID
|
||||||
WS.send("play",JSON.encode{
|
WS.send("play",JSON.encode{
|
||||||
action=2,
|
action=2,
|
||||||
|
|||||||
Reference in New Issue
Block a user