调整进房间任务锁机制,修复一个请求参数名写错

This commit is contained in:
MrZ626
2021-03-30 10:46:23 +08:00
parent 101636a60a
commit 0efdb7dc33
2 changed files with 13 additions and 11 deletions

View File

@@ -1199,7 +1199,7 @@ do
SCN.go("net_menu")
elseif res.action==0 then--Fetch rooms
NET.roomList=res.roomList
elseif res.action==2 then--Join room
elseif res.action==2 then--Join(create) room
loadGame("netBattle",true,true)
NET.unlock("enterRoom")
elseif res.action==3 then--Leave room

View File

@@ -83,15 +83,17 @@ function NET.freshRoom()
})
end
function NET.createRoom()
WS.send("play",JSON.encode{
action=1,
data={
type="classic",
name=(USER.name or"???").."'s room",
password=nil,
conf=dumpBasicConfig(),
}
})
if NET.lock("enterRoom")then
WS.send("play",JSON.encode{
action=1,
data={
type="classic",
name=(USER.name or"???").."'s room",
password=nil,
config=dumpBasicConfig(),
}
})
end
end
function NET.enterRoom(roomID,password)
if NET.lock("enterRoom")then
@@ -99,7 +101,7 @@ function NET.enterRoom(roomID,password)
action=2,
data={
rid=roomID,
conf=dumpBasicConfig(),
config=dumpBasicConfig(),
password=password,
}
})