调整进房间任务锁机制,修复一个请求参数名写错
This commit is contained in:
@@ -1199,7 +1199,7 @@ do
|
|||||||
SCN.go("net_menu")
|
SCN.go("net_menu")
|
||||||
elseif res.action==0 then--Fetch rooms
|
elseif res.action==0 then--Fetch rooms
|
||||||
NET.roomList=res.roomList
|
NET.roomList=res.roomList
|
||||||
elseif res.action==2 then--Join room
|
elseif res.action==2 then--Join(create) room
|
||||||
loadGame("netBattle",true,true)
|
loadGame("netBattle",true,true)
|
||||||
NET.unlock("enterRoom")
|
NET.unlock("enterRoom")
|
||||||
elseif res.action==3 then--Leave room
|
elseif res.action==3 then--Leave room
|
||||||
|
|||||||
@@ -83,15 +83,17 @@ function NET.freshRoom()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
function NET.createRoom()
|
function NET.createRoom()
|
||||||
WS.send("play",JSON.encode{
|
if NET.lock("enterRoom")then
|
||||||
action=1,
|
WS.send("play",JSON.encode{
|
||||||
data={
|
action=1,
|
||||||
type="classic",
|
data={
|
||||||
name=(USER.name or"???").."'s room",
|
type="classic",
|
||||||
password=nil,
|
name=(USER.name or"???").."'s room",
|
||||||
conf=dumpBasicConfig(),
|
password=nil,
|
||||||
}
|
config=dumpBasicConfig(),
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function NET.enterRoom(roomID,password)
|
function NET.enterRoom(roomID,password)
|
||||||
if NET.lock("enterRoom")then
|
if NET.lock("enterRoom")then
|
||||||
@@ -99,7 +101,7 @@ function NET.enterRoom(roomID,password)
|
|||||||
action=2,
|
action=2,
|
||||||
data={
|
data={
|
||||||
rid=roomID,
|
rid=roomID,
|
||||||
conf=dumpBasicConfig(),
|
config=dumpBasicConfig(),
|
||||||
password=password,
|
password=password,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user