Ver código fonte

新增战斗房间

neo 1 ano atrás
pai
commit
7d24ee15b1
1 arquivos alterados com 17 adições e 0 exclusões
  1. 17 0
      dev/utils/util_match.lua

+ 17 - 0
dev/utils/util_match.lua

@@ -355,6 +355,23 @@ function root:is_wait_battle_end(roomId)
355 355
     end
356 356
     return true
357 357
 end
358
+-- 房间是否开始战斗
359
+function root:is_room_start_battle(roomId)
360
+    local status = self:get_room_status(roomId)
361
+    if status > 0 then
362
+        return false
363
+    end
364
+    local seatCount = 0
365
+    local key = _get_room_key(roomId)
366
+    local playerList = redisBattleUtil.hget_json(key, "playerList")
367
+    for _, v in ipairs(playerList) do
368
+        if v.seatId and v.seatId > 0 then
369
+            seatCount = seatCount + 1
370
+        end
371
+    end
372
+    local playCount = redisBattleUtil.hget_int(key, "playCount")
373
+    return seatCount >= playCount
374
+end
358 375
 ----------------------------------------
359 376
 -- 接口
360 377
 ----------------------------------------