neo 1 vuosi sitten
vanhempi
commit
7a561b9bc7
2 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 2 2
      dev/utils/util_global.lua
  2. 4 4
      dev/utils/util_match.lua

+ 2 - 2
dev/utils/util_global.lua

@@ -38,7 +38,7 @@ end
38
 function root:gen_share_code()
38
 function root:gen_share_code()
39
     local function _gen_code()
39
     local function _gen_code()
40
         local r = {}
40
         local r = {}
41
-        for i = 1, 5 do
41
+        for i = 1, 6 do
42
             table.insert(r, string.char(math.random(65, 90)))
42
             table.insert(r, string.char(math.random(65, 90)))
43
         end
43
         end
44
         return table.concat(r)
44
         return table.concat(r)
@@ -58,7 +58,7 @@ function root:is_sharecode_active(sharecode)
58
     if is_empty(sharecode) then
58
     if is_empty(sharecode) then
59
         return false
59
         return false
60
     end
60
     end
61
-    local ret = lib_game_redis:sismerber("sharecode", sharecode)
61
+    local ret = lib_game_redis:sismember("sharecode", sharecode)
62
     return ret == 1
62
     return ret == 1
63
 end
63
 end
64
 -- 删除邀请码
64
 -- 删除邀请码

+ 4 - 4
dev/utils/util_match.lua

@@ -329,7 +329,7 @@ function root:destroy_room(roomId)
329
     local isExist = lib_battle_redis:exists(key)
329
     local isExist = lib_battle_redis:exists(key)
330
     if not isExist then
330
     if not isExist then
331
         -- 从活跃房间集合删除
331
         -- 从活跃房间集合删除
332
-        lib_battle_redis:sismerber(_get_active_room_id_key(), roomId)
332
+        lib_battle_redis:sismember(_get_active_room_id_key(), roomId)
333
         return false
333
         return false
334
     end
334
     end
335
     local status = redisBattleUtil.hget_int(key, "status")
335
     local status = redisBattleUtil.hget_int(key, "status")
@@ -340,7 +340,7 @@ function root:destroy_room(roomId)
340
     -- 删除房间信息
340
     -- 删除房间信息
341
     lib_battle_redis:del(key)
341
     lib_battle_redis:del(key)
342
     -- 从活跃房间集合删除
342
     -- 从活跃房间集合删除
343
-    lib_battle_redis:sismerber(_get_active_room_id_key(), roomId)
343
+    lib_battle_redis:sismember(_get_active_room_id_key(), roomId)
344
     return true
344
     return true
345
 end
345
 end
346
 -- 是否等待开战结束
346
 -- 是否等待开战结束
@@ -397,7 +397,7 @@ function root:start_battle(roomId)
397
     local isExist = lib_battle_redis:exists(key)
397
     local isExist = lib_battle_redis:exists(key)
398
     if not isExist then
398
     if not isExist then
399
         -- 从活跃房间集合删除
399
         -- 从活跃房间集合删除
400
-        lib_battle_redis:sismerber(_get_active_room_id_key(), roomId)
400
+        lib_battle_redis:sismember(_get_active_room_id_key(), roomId)
401
         return false
401
         return false
402
     end
402
     end
403
     -- 更新状态
403
     -- 更新状态
@@ -493,7 +493,7 @@ function root:start_battle(roomId)
493
     -- 删除房间信息
493
     -- 删除房间信息
494
     lib_battle_redis:del(key)
494
     lib_battle_redis:del(key)
495
     -- 从活跃房间集合删除
495
     -- 从活跃房间集合删除
496
-    lib_battle_redis:sismerber(_get_active_room_id_key(), roomId)
496
+    lib_battle_redis:sismember(_get_active_room_id_key(), roomId)
497
     -- 通知在线玩家 - 销毁房间
497
     -- 通知在线玩家 - 销毁房间
498
     nodeMgr.broadcast_proto_notify("on_room_destroy", {roomId = roomId})
498
     nodeMgr.broadcast_proto_notify("on_room_destroy", {roomId = roomId})
499
 end
499
 end