限制客户端一般只能开单挑房,电脑用户可以开多人房,特殊电脑用户可以开更大的房
This commit is contained in:
@@ -173,13 +173,13 @@ function NET.fetchRoom()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function NET.createRoom()
|
function NET.createRoom(roomType,name)
|
||||||
if NET.lock("enterRoom",3)then
|
if NET.lock("enterRoom",3)then
|
||||||
WS.send("play",JSON.encode{
|
WS.send("play",JSON.encode{
|
||||||
action=1,
|
action=1,
|
||||||
data={
|
data={
|
||||||
type="classic",
|
type=roomType,
|
||||||
name=(USER.username or"???").."'s room",
|
name=name,
|
||||||
password=nil,
|
password=nil,
|
||||||
config=dumpBasicConfig(),
|
config=dumpBasicConfig(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
|
local kb=love.keyboard
|
||||||
|
|
||||||
local NET=NET
|
local NET=NET
|
||||||
local scrollPos,selected
|
local scrollPos,selected
|
||||||
@@ -29,7 +30,16 @@ function scene.keyDown(k)
|
|||||||
end
|
end
|
||||||
elseif k=="n"then
|
elseif k=="n"then
|
||||||
if TIME()-lastCreateRoomTime>16.2 then
|
if TIME()-lastCreateRoomTime>16.2 then
|
||||||
NET.createRoom()
|
NET.createRoom(
|
||||||
|
kb.isDown("1")and"solo"or
|
||||||
|
kb.isDown("2")and"classic"or
|
||||||
|
tonumber(USER.uid)<100 and(
|
||||||
|
kb.isDown("3")and"r49"or
|
||||||
|
kb.isDown("4")and"r99"or
|
||||||
|
kb.isDown("5")and"unlimited"
|
||||||
|
)or"solo'",
|
||||||
|
(USER.username or"???").."'s room"
|
||||||
|
)
|
||||||
lastCreateRoomTime=TIME()
|
lastCreateRoomTime=TIME()
|
||||||
else
|
else
|
||||||
LOG.print(text.createRoomTooFast,"warn")
|
LOG.print(text.createRoomTooFast,"warn")
|
||||||
|
|||||||
Reference in New Issue
Block a user