实现玩家全部准备的时候顶部文字提醒

This commit is contained in:
MrZ_26
2022-10-24 00:26:32 +08:00
parent 43b6ff7697
commit 23f43df737
3 changed files with 8 additions and 13 deletions

View File

@@ -24,7 +24,7 @@ local NET={
spectate=false,-- If player is spectating
seed=false,
roomReadyState=false,
roomAllReady=false,
onlineCount="_",
@@ -44,14 +44,14 @@ function NET.freshRoomState()
if NETPLY.list[j].readyMode=='Ready' then readyCount=readyCount+1 end
end
if playCount-readyCount==1 then
if playCount>1 and playCount-readyCount==1 then
local p=NETPLY.map[USER.uid]
if p.playMode=='Gamer' and p.readyMode~='Ready' then
SFX.play('warn_2',.5)
end
end
NET.roomReadyState=playCount>0 and playCount==readyCount
NET.roomAllReady=playCount>0 and playCount==readyCount
end
--------------------------<NEW HTTP API>
@@ -646,7 +646,8 @@ function NET.wsCallBack.room_leave(body)
end
function NET.wsCallBack.room_fetch(body)
TASK.unlock('fetchRoom')
if body.data then SCN.scenes.net_rooms.widgetList.roomList:setList(body.data) end
if not body.data then body.data={} end
SCN.scenes.net_rooms.widgetList.roomList:setList(body.data)
end
function NET.wsCallBack.room_setPW()
MES.new(text.roomPasswordChanged)