调整进房间任务锁机制,修复一个请求参数名写错
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user